linux/drivers/block
Stephen M. Cameron 03f47e888d cciss: fix broken mutex usage in ioctl
If a new logical drive is added and the CCISS_REGNEWD ioctl is invoked
(as is normal with the Array Configuration Utility) the process will
hang as below.  It attempts to acquire the same mutex twice, once in
do_ioctl() and once in cciss_unlocked_open().  The BKL was recursive,
the mutex isn't.

  Linux version 3.10.0-rc2 (scameron@localhost.localdomain) (gcc version 4.4.7 20120313 (Red Hat 4.4.7-3) (GCC) ) #1 SMP Fri May 24 14:32:12 CDT 2013
  [...]
  acu             D 0000000000000001     0  3246   3191 0x00000080
  Call Trace:
    schedule+0x29/0x70
    schedule_preempt_disabled+0xe/0x10
    __mutex_lock_slowpath+0x17b/0x220
    mutex_lock+0x2b/0x50
    cciss_unlocked_open+0x2f/0x110 [cciss]
    __blkdev_get+0xd3/0x470
    blkdev_get+0x5c/0x1e0
    register_disk+0x182/0x1a0
    add_disk+0x17c/0x310
    cciss_add_disk+0x13a/0x170 [cciss]
    cciss_update_drive_info+0x39b/0x480 [cciss]
    rebuild_lun_table+0x258/0x370 [cciss]
    cciss_ioctl+0x34f/0x470 [cciss]
    do_ioctl+0x49/0x70 [cciss]
    __blkdev_driver_ioctl+0x28/0x30
    blkdev_ioctl+0x200/0x7b0
    block_ioctl+0x3c/0x40
    do_vfs_ioctl+0x89/0x350
    SyS_ioctl+0xa1/0xb0
    system_call_fastpath+0x16/0x1b

This mutex usage was added into the ioctl path when the big kernel lock
was removed.  As it turns out, these paths are all thread safe anyway
(or can easily be made so) and we don't want ioctl() to be single
threaded in any case.

Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com>
Cc: Jens Axboe <axboe@kernel.dk>
Cc: Mike Miller <mike.miller@hp.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2013-06-12 16:29:45 -07:00
..
aoe Merge branch 'for-3.10/drivers' of git://git.kernel.dk/linux-block 2013-05-08 11:51:05 -07:00
drbd Merge branch 'for-3.10/drivers' of git://git.kernel.dk/linux-block 2013-05-08 11:51:05 -07:00
mtip32xx Merge branch 'for-3.10/drivers' of git://git.kernel.dk/linux-block 2013-05-08 11:51:05 -07:00
paride block_device_operations->release() should return void 2013-05-07 02:16:21 -04:00
rsxx rsxx: remove unused variable 2013-03-26 14:48:12 -06:00
xen-blkback xen-blkback: don't store dev_bus_addr 2013-03-19 12:50:00 -04:00
amiflop.c block_device_operations->release() should return void 2013-05-07 02:16:21 -04:00
ataflop.c block_device_operations->release() should return void 2013-05-07 02:16:21 -04:00
brd.c drivers/block/brd.c: fix brd_lookup_page() race 2013-05-24 16:22:52 -07:00
cciss_cmd.h cciss: use new doorbell-bit-5 reset method 2011-05-06 08:23:55 -06:00
cciss_scsi.c cciss: switch to ->show_info() 2013-04-09 14:13:19 -04:00
cciss_scsi.h cciss: add cciss_tape_cmds module paramter 2011-05-06 08:23:59 -06:00
cciss.c cciss: fix broken mutex usage in ioctl 2013-06-12 16:29:45 -07:00
cciss.h cciss: Adds simple mode functionality 2011-08-08 11:40:15 +02:00
cpqarray.c block_device_operations->release() should return void 2013-05-07 02:16:21 -04:00
cpqarray.h
cryptoloop.c
DAC960.c procfs: new helper - PDE_DATA(inode) 2013-04-09 14:13:32 -04:00
DAC960.h
floppy.c Merge branch 'for-3.10/core' of git://git.kernel.dk/linux-block 2013-05-08 10:13:35 -07:00
hd.c Remove all #inclusions of asm/system.h 2012-03-28 18:30:03 +01:00
ida_cmd.h
ida_ioctl.h
Kconfig block: IBM RamSan 70/80 branding changes. 2013-03-11 19:53:55 +01:00
loop.c block_device_operations->release() should return void 2013-05-07 02:16:21 -04:00
Makefile NVMe: Add nvme-scsi.c 2013-03-28 14:50:49 -04:00
mg_disk.c Merge branch 'for-3.10/drivers' of git://git.kernel.dk/linux-block 2013-05-08 11:51:05 -07:00
nbd.c nbd: increase default and max request sizes 2013-04-30 17:04:07 -07:00
nvme-core.c NVMe: Add MSI support 2013-05-31 11:45:52 -04:00
nvme-scsi.c NVMe: Fix a signedness bug in nvme_trans_modesel_get_mp 2013-05-17 09:10:38 -04:00
osdblk.c block: Add bio_clone_bioset(), bio_clone_kmalloc() 2012-09-09 10:35:39 +02:00
pktcdvd.c Merge branch 'for-3.10/core' of git://git.kernel.dk/linux-block 2013-05-08 10:13:35 -07:00
ps3disk.c Drivers: block: remove __dev* attributes. 2013-01-03 15:57:15 -08:00
ps3vram.c procfs: new helper - PDE_DATA(inode) 2013-04-09 14:13:32 -04:00
rbd_types.h rbd: get rid of RBD_MAX_SEG_NAME_LEN 2012-12-17 08:37:29 -06:00
rbd.c Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/sage/ceph-client 2013-05-15 13:36:19 -07:00
smart1,2.h fix typos 'comamnd' -> 'command' in comments 2011-02-02 11:31:21 +01:00
sunvdc.c sunvdc: Fix off-by-one in generic_request(). 2013-02-14 11:49:01 -08:00
swim3.c block_device_operations->release() should return void 2013-05-07 02:16:21 -04:00
swim_asm.S
swim.c block_device_operations->release() should return void 2013-05-07 02:16:21 -04:00
sx8.c block, sx8: fix pointer math issue getting fw version 2012-03-03 19:44:39 +01:00
umem.c Drivers: block: remove __dev* attributes. 2013-01-03 15:57:15 -08:00
umem.h
virtio_blk.c virtio_blk: remove nents member. 2013-03-20 15:44:58 +10:30
xen-blkfront.c block_device_operations->release() should return void 2013-05-07 02:16:21 -04:00
xsysace.c drivers/block/xsysace.c: fix id with missing port-number 2013-05-24 16:22:50 -07:00
z2ram.c block_device_operations->release() should return void 2013-05-07 02:16:21 -04:00