From aadc6de18ed9af8f26cc829faa5643f8b4f0bba7 Mon Sep 17 00:00:00 2001 From: Li Dongyang Date: Sat, 20 May 2023 17:41:56 +1000 Subject: [PATCH] LU-16835 target: server_ioctl() should return ENOTTY 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 Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/51072 Reviewed-by: Andreas Dilger Tested-by: jenkins Tested-by: Maloo --- lustre/target/tgt_mount.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lustre/target/tgt_mount.c b/lustre/target/tgt_mount.c index bf559e2..753e9dc 100644 --- a/lustre/target/tgt_mount.c +++ b/lustre/target/tgt_mount.c @@ -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; -- 1.8.3.1