Commit 782deb2e authored by Fabian Frederick's avatar Fabian Frederick Committed by Jan Kara

udf: fix ioctl errors

Currently, lsattr for instance in udf directory gives
"udf: Invalid argument While reading flags on ..."

This patch returns -ENOIOCTLCMD
when command is unknown to have more accurate message like this:
"Inappropriate ioctl for device While reading flags on ..."
Signed-off-by: default avatarFabian Frederick <fabf@skynet.be>
Signed-off-by: default avatarJan Kara <jack@suse.cz>
parent 70f16cef
...@@ -184,7 +184,8 @@ long udf_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) ...@@ -184,7 +184,8 @@ long udf_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
goto out; goto out;
} }
if (!arg) { if (!arg && ((cmd == UDF_GETVOLIDENT) || (cmd == UDF_GETEASIZE) ||
(cmd == UDF_RELOCATE_BLOCKS) || (cmd == UDF_GETEABLOCK))) {
udf_debug("invalid argument to udf_ioctl\n"); udf_debug("invalid argument to udf_ioctl\n");
result = -EINVAL; result = -EINVAL;
goto out; goto out;
...@@ -220,6 +221,8 @@ long udf_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) ...@@ -220,6 +221,8 @@ long udf_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
UDF_I(inode)->i_ext.i_data, UDF_I(inode)->i_ext.i_data,
UDF_I(inode)->i_lenEAttr) ? -EFAULT : 0; UDF_I(inode)->i_lenEAttr) ? -EFAULT : 0;
goto out; goto out;
default:
return -ENOIOCTLCMD;
} }
out: out:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment