summaryrefslogtreecommitdiff
path: root/drivers/md/raid5.c
diff options
context:
space:
mode:
authorNicolas Schichan <nschichan@freebox.fr>2014-01-15 19:58:52 +0400
committerNeilBrown <neilb@suse.de>2014-01-16 01:55:00 +0400
commitcb335f88eb35af712d1f4171642d0487f7bb2e7e (patch)
treefba070397b84f40067bf5d12aded18672eea3ebf /drivers/md/raid5.c
parent830778a180f268ac106f072b8aad793a79088c87 (diff)
downloadlinux-cb335f88eb35af712d1f4171642d0487f7bb2e7e.tar.xz
md: check command validity early in md_ioctl().
Verify that the cmd parameter passed to md_ioctl() is valid before doing anything. This fixes mddev->hold_active being set to 0 when an invalid ioctl command is passed to md_ioctl() before the array has been configured. Clearing mddev->hold_active in that case can lead to a livelock situation when an invalid ioctl number is given to md_ioctl() by a process when the mddev is currently being opened by another process: Process 1 Process 2 --------- --------- md_alloc() mddev_find() -> returns a new mddev with hold_active == UNTIL_IOCTL add_disk() -> sends KOBJ_ADD uevent (sees KOBJ_ADD uevent for device) md_open() md_ioctl(INVALID_IOCTL) -> returns ENODEV and clears mddev->hold_active md_release() md_put() -> deletes the mddev as hold_active is 0 md_open() mddev_find() -> returns a newly allocated mddev with mddev->gendisk == NULL -> returns with ERESTARTSYS (kernel restarts the open syscall) Signed-off-by: Nicolas Schichan <nschichan@freebox.fr> Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to 'drivers/md/raid5.c')
0 files changed, 0 insertions, 0 deletions