diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2012-03-14 20:16:45 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-03-14 20:16:45 -0400 |
commit | f1cbd03f5eabb75ea8ace23b47d2209f10871c16 (patch) | |
tree | 2ac398bd1a50ce135461fae5b5e91ba05831af84 /fs | |
parent | ff398c45b03d9d64135d928c0146d8c38a70fd3b (diff) | |
parent | ff8c1474cc2f5e11414c71ec4d739c18e6e669c0 (diff) |
Merge branch 'for-linus' of git://git.kernel.dk/linux-block
Pull block fixes from Jens Axboe:
"Been sitting on this for a while, but lets get this out the door.
This fixes various important bugs for 3.3 final, along with a few more
trivial ones. Please pull!"
* 'for-linus' of git://git.kernel.dk/linux-block:
block: fix ioc leak in put_io_context
block, sx8: fix pointer math issue getting fw version
Block: use a freezable workqueue for disk-event polling
drivers/block/DAC960: fix -Wuninitialized warning
drivers/block/DAC960: fix DAC960_V2_IOCTL_Opcode_T -Wenum-compare warning
block: fix __blkdev_get and add_disk race condition
block: Fix setting bio flags in drivers (sd_dif/floppy)
block: Fix NULL pointer dereference in sd_revalidate_disk
block: exit_io_context() should call elevator_exit_icq_fn()
block: simplify ioc_release_fn()
block: replace icq->changed with icq->flags
Diffstat (limited to 'fs')
-rw-r--r-- | fs/block_dev.c | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/fs/block_dev.c b/fs/block_dev.c index 0e575d1304b4..5e9f198f7712 100644 --- a/fs/block_dev.c +++ b/fs/block_dev.c | |||
@@ -1183,8 +1183,12 @@ static int __blkdev_get(struct block_device *bdev, fmode_t mode, int for_part) | |||
1183 | * The latter is necessary to prevent ghost | 1183 | * The latter is necessary to prevent ghost |
1184 | * partitions on a removed medium. | 1184 | * partitions on a removed medium. |
1185 | */ | 1185 | */ |
1186 | if (bdev->bd_invalidated && (!ret || ret == -ENOMEDIUM)) | 1186 | if (bdev->bd_invalidated) { |
1187 | rescan_partitions(disk, bdev); | 1187 | if (!ret) |
1188 | rescan_partitions(disk, bdev); | ||
1189 | else if (ret == -ENOMEDIUM) | ||
1190 | invalidate_partitions(disk, bdev); | ||
1191 | } | ||
1188 | if (ret) | 1192 | if (ret) |
1189 | goto out_clear; | 1193 | goto out_clear; |
1190 | } else { | 1194 | } else { |
@@ -1214,8 +1218,12 @@ static int __blkdev_get(struct block_device *bdev, fmode_t mode, int for_part) | |||
1214 | if (bdev->bd_disk->fops->open) | 1218 | if (bdev->bd_disk->fops->open) |
1215 | ret = bdev->bd_disk->fops->open(bdev, mode); | 1219 | ret = bdev->bd_disk->fops->open(bdev, mode); |
1216 | /* the same as first opener case, read comment there */ | 1220 | /* the same as first opener case, read comment there */ |
1217 | if (bdev->bd_invalidated && (!ret || ret == -ENOMEDIUM)) | 1221 | if (bdev->bd_invalidated) { |
1218 | rescan_partitions(bdev->bd_disk, bdev); | 1222 | if (!ret) |
1223 | rescan_partitions(bdev->bd_disk, bdev); | ||
1224 | else if (ret == -ENOMEDIUM) | ||
1225 | invalidate_partitions(bdev->bd_disk, bdev); | ||
1226 | } | ||
1219 | if (ret) | 1227 | if (ret) |
1220 | goto out_unlock_bdev; | 1228 | goto out_unlock_bdev; |
1221 | } | 1229 | } |