Skip to content

Commit

Permalink
Fix probing cache device in casadm
Browse files Browse the repository at this point in the history
Signed-off-by: Adam Rutkowski <[email protected]>
  • Loading branch information
Adam Rutkowski committed Jan 21, 2021
1 parent 1fb5fd9 commit 1fcb175
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion casadm/cas_lib.c
Original file line number Diff line number Diff line change
Expand Up @@ -2849,6 +2849,11 @@ int _check_cache_device(const char *device_path,
{
int result, fd;

if (strncpy_s(cmd_info->path_name, sizeof(cmd_info->path_name),
device_path, MAX_STR_LEN)) {
return FAILURE;
}

fd = open_ctrl_device();
if (fd == -1)
return FAILURE;
Expand All @@ -2857,7 +2862,7 @@ int _check_cache_device(const char *device_path,

close(fd);

return result;
return result ? FAILURE : SUCCESS;
}

int check_cache_device(const char *device_path)
Expand Down

0 comments on commit 1fcb175

Please sign in to comment.