Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 248113
b: refs/heads/master
c: ff2a994
h: refs/heads/master
i:
  248111: 2301f61
v: v3
  • Loading branch information
Tejun Heo authored and Linus Torvalds committed May 23, 2011
1 parent e7f09d1 commit 2d81d7b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: f4b10bc60a310916bab5413f821b99ef845cac17
refs/heads/master: ff2a9941ca27ab18169d17b3803aca68b154951c
17 changes: 9 additions & 8 deletions trunk/fs/block_dev.c
Original file line number Diff line number Diff line change
Expand Up @@ -1120,6 +1120,15 @@ static int __blkdev_get(struct block_device *bdev, fmode_t mode, int for_part)
goto restart;
}
}

if (!ret && !bdev->bd_openers) {
bd_set_size(bdev,(loff_t)get_capacity(disk)<<9);
bdi = blk_get_backing_dev_info(bdev);
if (bdi == NULL)
bdi = &default_backing_dev_info;
bdev_inode_switch_bdi(bdev->bd_inode, bdi);
}

/*
* If the device is invalidated, rescan partition
* if open succeeded or failed with -ENOMEDIUM.
Expand All @@ -1130,14 +1139,6 @@ static int __blkdev_get(struct block_device *bdev, fmode_t mode, int for_part)
rescan_partitions(disk, bdev);
if (ret)
goto out_clear;

if (!bdev->bd_openers) {
bd_set_size(bdev,(loff_t)get_capacity(disk)<<9);
bdi = blk_get_backing_dev_info(bdev);
if (bdi == NULL)
bdi = &default_backing_dev_info;
bdev_inode_switch_bdi(bdev->bd_inode, bdi);
}
} else {
struct block_device *whole;
whole = bdget_disk(disk, 0);
Expand Down

0 comments on commit 2d81d7b

Please sign in to comment.