diff options
author | Finn Thain <fthain@telegraphics.com.au> | 2018-04-12 02:50:14 +0200 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2018-04-17 05:49:35 +0200 |
commit | 8e2ab5a4efaac77fb93e5b5b109d0b3976fdd3a0 (patch) | |
tree | b3efe23492206f9afab06a54a6c75ab562ca1d7f /drivers/block/swim.c | |
parent | block/swim: Remove extra put_disk() call from error path (diff) | |
download | linux-8e2ab5a4efaac77fb93e5b5b109d0b3976fdd3a0.tar.xz linux-8e2ab5a4efaac77fb93e5b5b109d0b3976fdd3a0.zip |
block/swim: Don't log an error message for an invalid ioctl
The 'eject' shell command may send various different ioctl commands.
This leads to error messages on the console even though the FDEJECT
ioctl succeeds.
~# eject floppy
SWIM floppy_ioctl: unknown cmd 21257
SWIM floppy_ioctl: unknown cmd 1
Don't log an error message for an invalid ioctl, just do as the
swim3 driver does and return -ENOTTY.
Cc: Laurent Vivier <lvivier@redhat.com>
Cc: Jens Axboe <axboe@kernel.dk>
Cc: stable@vger.kernel.org # v4.14+
Tested-by: Stan Johnson <userm57@yahoo.com>
Signed-off-by: Finn Thain <fthain@telegraphics.com.au>
Acked-by: Laurent Vivier <lvivier@redhat.com>
Reviewed-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'drivers/block/swim.c')
-rw-r--r-- | drivers/block/swim.c | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/drivers/block/swim.c b/drivers/block/swim.c index 0258a96e0c46..7b847170cf71 100644 --- a/drivers/block/swim.c +++ b/drivers/block/swim.c @@ -727,14 +727,9 @@ static int floppy_ioctl(struct block_device *bdev, fmode_t mode, if (copy_to_user((void __user *) param, (void *) &floppy_type, sizeof(struct floppy_struct))) return -EFAULT; - break; - - default: - printk(KERN_DEBUG "SWIM floppy_ioctl: unknown cmd %d\n", - cmd); - return -ENOSYS; + return 0; } - return 0; + return -ENOTTY; } static int floppy_getgeo(struct block_device *bdev, struct hd_geometry *geo) |