diff options
author | Fabian Frederick <fabf@skynet.be> | 2017-01-24 21:48:34 +0100 |
---|---|---|
committer | Jan Kara <jack@suse.cz> | 2017-02-03 16:19:54 +0100 |
commit | 782deb2eecc018bfa278f7453f367e01f5479ccb (patch) | |
tree | b4887a5da794933bf397b1ce3ab8411d76556337 /fs/udf/file.c | |
parent | 70f16cef06b5bf72d50b8016e1188995eddc073a (diff) | |
download | linux-rpi-782deb2eecc018bfa278f7453f367e01f5479ccb.tar.gz linux-rpi-782deb2eecc018bfa278f7453f367e01f5479ccb.tar.bz2 linux-rpi-782deb2eecc018bfa278f7453f367e01f5479ccb.zip |
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: Fabian Frederick <fabf@skynet.be>
Signed-off-by: Jan Kara <jack@suse.cz>
Diffstat (limited to 'fs/udf/file.c')
-rw-r--r-- | fs/udf/file.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/fs/udf/file.c b/fs/udf/file.c index dbcb3a4a0cb9..87551b77933a 100644 --- a/fs/udf/file.c +++ b/fs/udf/file.c @@ -184,7 +184,8 @@ long udf_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) 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"); result = -EINVAL; goto out; @@ -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_lenEAttr) ? -EFAULT : 0; goto out; + default: + return -ENOIOCTLCMD; } out: |