linux-stable/drivers/block
Guo Chao 541c742a75 loopdev: update block device size in loop_set_status()
Loop device driver sometimes fails to impose the size limit on the
device. Keep issuing following two commands:

losetup --offset 7517244416 --sizelimit 3224971264 /dev/loop0 backed_file
blockdev --getsize64 /dev/loop0

blockdev reports file size instead of sizelimit several out of 100 times.

The problems are:

	- losetup set up the device in two ioctl:
		  LOOP_SET_FD and LOOP_SET_STATUS64.

	- LOOP_SET_STATUS64 only update size of gendisk.

Block device size will be updated lazily when device comes to use. If udev
rushes in between the two ioctl, it will bring in a block device whose
size is backing file size. If the device is not released after
LOOP_SET_STATUS64 ioctl, blockdev will not see the updated size.

Update block size in LOOP_SET_STATUS64 ioctl.

Signed-off-by: Guo Chao <yan@linux.vnet.ibm.com>
Reported-by: M. Hindess <hindessm@uk.ibm.com>
Cc: Alexander Viro <viro@zeniv.linux.org.uk>
Cc: Guo Chao <yan@linux.vnet.ibm.com>
Cc: Nikanth Karthikesan <knikanth@suse.de>
Cc: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2013-02-22 10:43:22 +01:00
..
aoe aoe: fix use after free in aoedev_by_aoeaddr() 2012-12-17 17:15:26 -08:00
drbd drbd: fix potential protocol error and resulting disconnect/reconnect 2013-01-21 22:58:36 +01:00
mtip32xx Merge branch 'stable/for-jens-3.9' of git://git.kernel.org/pub/scm/linux/kernel/git/konrad/xen into for-3.9/drivers 2013-02-20 08:26:06 +01:00
paride paride/pcd: fix bool verbose module parameter. 2012-01-13 09:32:26 +10:30
rsxx block: IBM RamSan 70/80 driver fixes 2013-02-18 21:35:59 +01:00
xen-blkback xen-blkback: use balloon pages for persistent grants 2013-02-19 15:17:21 -05:00
DAC960.c dac960: return success instead of -ENOTTY 2013-01-11 14:42:36 +01:00
DAC960.h
Kconfig Merge branch 'delete-xt-disk' of git://git.kernel.org/pub/scm/linux/kernel/git/paulg/linux into for-3.9/drivers 2013-02-14 16:29:34 +01:00
Makefile Merge branch 'delete-xt-disk' of git://git.kernel.org/pub/scm/linux/kernel/git/paulg/linux into for-3.9/drivers 2013-02-14 16:29:34 +01:00
amiflop.c fs: move code out of buffer.c 2012-01-03 22:54:07 -05:00
ataflop.c block: unexport DISK_EVENT_MEDIA_CHANGE for legacy/fringe drivers 2011-04-21 21:33:05 +02:00
brd.c block: remove the second argument of k[un]map_atomic() 2012-03-20 21:48:16 +08:00
cciss.c Drivers: block: remove __dev* attributes. 2013-01-03 15:57:15 -08:00
cciss.h cciss: Adds simple mode functionality 2011-08-08 11:40:15 +02:00
cciss_cmd.h cciss: use new doorbell-bit-5 reset method 2011-05-06 08:23:55 -06:00
cciss_scsi.c cciss: fix handling of protocol error 2012-09-18 11:57:08 +02:00
cciss_scsi.h cciss: add cciss_tape_cmds module paramter 2011-05-06 08:23:59 -06:00
cpqarray.c Drivers: block: remove __dev* attributes. 2013-01-03 15:57:15 -08:00
cpqarray.h
cryptoloop.c
floppy.c floppy: destroy floppy workqueue before cleaning up the queue 2012-11-23 14:32:54 +01:00
hd.c Remove all #inclusions of asm/system.h 2012-03-28 18:30:03 +01:00
ida_cmd.h
ida_ioctl.h
loop.c loopdev: update block device size in loop_set_status() 2013-02-22 10:43:22 +01:00
mg_disk.c mg_disk: Use struct dev_pm_ops for power management 2012-07-06 19:07:00 +02:00
nbd.c nbd: handle discard requests 2012-10-06 03:05:24 +09:00
nvme.c Drivers: block: remove __dev* attributes. 2013-01-03 15:57:15 -08:00
osdblk.c block: Add bio_clone_bioset(), bio_clone_kmalloc() 2012-09-09 10:35:39 +02:00
pktcdvd.c pktcdvd: Switch to bio_kmalloc() 2012-09-09 10:35:39 +02:00
ps3disk.c Drivers: block: remove __dev* attributes. 2013-01-03 15:57:15 -08:00
ps3vram.c Drivers: block: remove __dev* attributes. 2013-01-03 15:57:15 -08:00
rbd.c rbd: get rid of rbd_{get,put}_dev() 2012-12-20 10:56:44 -06:00
rbd_types.h rbd: get rid of RBD_MAX_SEG_NAME_LEN 2012-12-17 08:37:29 -06:00
smart1,2.h fix typos 'comamnd' -> 'command' in comments 2011-02-02 11:31:21 +01:00
sunvdc.c Drivers: block: remove __dev* attributes. 2013-01-03 15:57:15 -08:00
swim.c Drivers: block: remove __dev* attributes. 2013-01-03 15:57:15 -08:00
swim3.c Drivers: block: remove __dev* attributes. 2013-01-03 15:57:15 -08:00
swim_asm.S
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 Various minor fixes, but a slightly more complex one to fix the per-cpu overload 2013-01-20 16:44:28 -08:00
xen-blkfront.c xen-blkfront: drop the use of llist_for_each_entry_safe 2013-02-19 15:17:08 -05:00
xsysace.c Drivers: block: remove __dev* attributes. 2013-01-03 15:57:15 -08:00
z2ram.c drivers/block/z2ram.c: correct printing of sector_t 2010-10-28 06:15:26 -06:00