diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2011-06-24 08:42:35 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-06-24 08:42:35 -0700 |
commit | 5220cc9382e11ca955ce946ee6a5bac577bb14ff (patch) | |
tree | 7949f52a5ca0c7fa74ec8e49ba89a00d0e4114a9 /fs | |
parent | 726ce0656b99ac6436b590d83613fe8447b4769e (diff) | |
parent | 155d109b5f52ffd749219b27702462dcd9cf4f8d (diff) | |
download | kernel_goldelico_gta04-5220cc9382e11ca955ce946ee6a5bac577bb14ff.zip kernel_goldelico_gta04-5220cc9382e11ca955ce946ee6a5bac577bb14ff.tar.gz kernel_goldelico_gta04-5220cc9382e11ca955ce946ee6a5bac577bb14ff.tar.bz2 |
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.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/fs/block_dev.c b/fs/block_dev.c index 1a2421f..610e8e0 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) |