summaryrefslogtreecommitdiffstats
path: root/cmd/zvol_id
diff options
context:
space:
mode:
authorFajar A. Nugraha <[email protected]>2011-03-24 15:22:52 +0700
committerBrian Behlendorf <[email protected]>2011-03-24 11:48:18 -0700
commita5729f7b22e14aed657bd716f3ee98b02f7e7c41 (patch)
treee4c9a38f6bfd3f93816e60ed444eef723c7a746a /cmd/zvol_id
parent7a1cdc0775aa4405501e64ebf0bfd998e723f2d7 (diff)
Fixes to enable zvol symlink creation
This commit fixes issue on https://github.com/behlendorf/zfs/issues/#issue/172 Changes: - update BLKZNAME to use _IOR instead of _IO. Kernel 2.6.32 allows read parameters (copy_to_user) with _IO, while newer kernels (tested Archlinux's 2.6.37 kernel) enforces _IOR (which is correct) - fix return code and message on error Signed-off-by: Brian Behlendorf <[email protected]>
Diffstat (limited to 'cmd/zvol_id')
-rw-r--r--cmd/zvol_id/zvol_id_main.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/cmd/zvol_id/zvol_id_main.c b/cmd/zvol_id/zvol_id_main.c
index 2aa8abbdc..018bb6672 100644
--- a/cmd/zvol_id/zvol_id_main.c
+++ b/cmd/zvol_id/zvol_id_main.c
@@ -40,7 +40,6 @@ int ioctl_get_msg(char *var, int fd)
error = ioctl(fd, BLKZNAME, msg);
if (error < 0) {
- printf("ioctl_get_msg failed:%d\n", error);
return (error);
}
@@ -77,7 +76,11 @@ int main(int argc, char **argv)
return (errno);
}
- ioctl_get_msg(zvol_name, fd);
+ error = ioctl_get_msg(zvol_name, fd);
+ if (error < 0) {
+ printf("ioctl_get_msg failed:%s\n", strerror(errno));
+ return (errno);
+ }
if (dev_part > 0)
snprintf(zvol_name_part, ZFS_MAXNAMELEN, "%s-part%d", zvol_name,
dev_part);