Whamcloud - gitweb
LU-16835 target: server_ioctl() should return ENOTTY 72/51072/3
authorLi Dongyang <dongyangli@ddn.com>
Sat, 20 May 2023 07:41:56 +0000 (17:41 +1000)
committerAndreas Dilger <adilger@whamcloud.com>
Mon, 22 May 2023 08:40:26 +0000 (08:40 +0000)
server_ioctl() returns EOPNOTSUPP when ioctl cmd
is not supported. This will confuse e2fsprogs >= 1.47
as it's trying to get/set fs label using
FS_IOC_GETFSLABEL and FS_IOC_SETFSLABEL ioctl.

If the cmd is not supported we really should return
ENOTTY which means "Inappropriate ioctl for device".

Change-Id: Ibca0e6ad9a5c19cc7bd55ebd96cf32af05cf0fb6
Test-Parameters: trivial
Fixes: d5be104cc9 ("LU-11355 lustre: enable fstrim on lustre device")
Signed-off-by: Li Dongyang <dongyangli@ddn.com>
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/51072
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
lustre/target/tgt_mount.c

index bf559e2..753e9dc 100644 (file)
@@ -1939,7 +1939,7 @@ static long server_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
        struct vfsmount *root_mnt;
        struct file *root_filp;
        struct inode *root_inode;
-       int err = -EOPNOTSUPP;
+       int err = -ENOTTY;
 
        if (!is_cmd_supported(cmd))
                return err;