diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2009-01-08 17:03:34 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-01-08 17:03:34 -0500 |
commit | 894bcdfb1a40a7c5032242c380b956aab106e05d (patch) | |
tree | cb5d34da6a7f524bb3188be539422896f2427405 /fs/block_dev.c | |
parent | a419df8a0ff01b6694cebc8885778f854165d17d (diff) | |
parent | 4044ba58dd15cb01797c4fd034f39ef4a75f7cc3 (diff) |
Merge branch 'for-linus' of git://neil.brown.name/md
* 'for-linus' of git://neil.brown.name/md:
md: don't retry recovery of raid1 that fails due to error on source drive.
md: Allow md devices to be created by name.
md: make devices disappear when they are no longer needed.
md: centralise all freeing of an 'mddev' in 'md_free'
md: move allocation of ->queue from mddev_find to md_probe
md: need another print_sb for mdp_superblock_1
md: use list_for_each_entry macro directly
md: raid0: make hash_spacing and preshift sector-based.
md: raid0: Represent the size of strip zones in sectors.
md: raid0 create_strip_zones(): Add KERN_INFO/KERN_ERR to printk's.
md: raid0 create_strip_zones(): Make two local variables sector-based.
md: raid0: Represent zone->zone_offset in sectors.
md: raid0: Represent device offset in sectors.
md: raid0_make_request(): Replace local variable block by sector.
md: raid0_make_request(): Remove local variable chunk_size.
md: raid0_make_request(): Replace chunksize_bits by chunksect_bits.
md: use sysfs_notify_dirent to notify changes to md/sync_action.
md: fix bitmap-on-external-file bug.
Diffstat (limited to 'fs/block_dev.c')
-rw-r--r-- | fs/block_dev.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/fs/block_dev.c b/fs/block_dev.c index b957717e25ab..8ebbfdf708c2 100644 --- a/fs/block_dev.c +++ b/fs/block_dev.c | |||
@@ -1005,6 +1005,7 @@ static int __blkdev_get(struct block_device *bdev, fmode_t mode, int for_part) | |||
1005 | } | 1005 | } |
1006 | 1006 | ||
1007 | lock_kernel(); | 1007 | lock_kernel(); |
1008 | restart: | ||
1008 | 1009 | ||
1009 | ret = -ENXIO; | 1010 | ret = -ENXIO; |
1010 | disk = get_gendisk(bdev->bd_dev, &partno); | 1011 | disk = get_gendisk(bdev->bd_dev, &partno); |
@@ -1025,6 +1026,19 @@ static int __blkdev_get(struct block_device *bdev, fmode_t mode, int for_part) | |||
1025 | 1026 | ||
1026 | if (disk->fops->open) { | 1027 | if (disk->fops->open) { |
1027 | ret = disk->fops->open(bdev, mode); | 1028 | ret = disk->fops->open(bdev, mode); |
1029 | if (ret == -ERESTARTSYS) { | ||
1030 | /* Lost a race with 'disk' being | ||
1031 | * deleted, try again. | ||
1032 | * See md.c | ||
1033 | */ | ||
1034 | disk_put_part(bdev->bd_part); | ||
1035 | bdev->bd_part = NULL; | ||
1036 | module_put(disk->fops->owner); | ||
1037 | put_disk(disk); | ||
1038 | bdev->bd_disk = NULL; | ||
1039 | mutex_unlock(&bdev->bd_mutex); | ||
1040 | goto restart; | ||
1041 | } | ||
1028 | if (ret) | 1042 | if (ret) |
1029 | goto out_clear; | 1043 | goto out_clear; |
1030 | } | 1044 | } |