summaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2011-06-24 08:42:35 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2011-06-24 08:42:35 -0700
commit5220cc9382e11ca955ce946ee6a5bac577bb14ff (patch)
tree7949f52a5ca0c7fa74ec8e49ba89a00d0e4114a9 /fs
parent726ce0656b99ac6436b590d83613fe8447b4769e (diff)
parent155d109b5f52ffd749219b27702462dcd9cf4f8d (diff)
downloadtalos-obmc-linux-5220cc9382e11ca955ce946ee6a5bac577bb14ff.tar.gz
talos-obmc-linux-5220cc9382e11ca955ce946ee6a5bac577bb14ff.zip
Merge branch 'for-linus' of git://git.kernel.dk/linux-block
* 'for-linus' of git://git.kernel.dk/linux-block: block: add REQ_SECURE to REQ_COMMON_MASK block: use the passed in @bdev when claiming if partno is zero block: Add __attribute__((format(printf...) and fix fallout block: make disk_block_events() properly wait for work cancellation block: remove non-syncing __disk_block_events() and fold it into disk_block_events() block: don't use non-syncing event blocking in disk_check_events() cfq-iosched: fix locking around ioc->ioc_data assignment
Diffstat (limited to 'fs')
-rw-r--r--fs/block_dev.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/fs/block_dev.c b/fs/block_dev.c
index 1a2421f908f0..610e8e0b04b8 100644
--- a/fs/block_dev.c
+++ b/fs/block_dev.c
@@ -762,7 +762,19 @@ static struct block_device *bd_start_claiming(struct block_device *bdev,
if (!disk)
return ERR_PTR(-ENXIO);
- whole = bdget_disk(disk, 0);
+ /*
+ * Normally, @bdev should equal what's returned from bdget_disk()
+ * if partno is 0; however, some drivers (floppy) use multiple
+ * bdev's for the same physical device and @bdev may be one of the
+ * aliases. Keep @bdev if partno is 0. This means claimer
+ * tracking is broken for those devices but it has always been that
+ * way.
+ */
+ if (partno)
+ whole = bdget_disk(disk, 0);
+ else
+ whole = bdgrab(bdev);
+
module_put(disk->fops->owner);
put_disk(disk);
if (!whole)
OpenPOWER on IntegriCloud