Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 196873
b: refs/heads/master
c: 56bca01
h: refs/heads/master
i:
  196871: b29eed4
v: v3
  • Loading branch information
Tejun Heo authored and Jens Axboe committed May 21, 2010
1 parent b5b1f0d commit d033e49
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 11 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: fa4b9074cd8428958c2adf9dc0c831f46e27c193
refs/heads/master: 56bca01738733709bef076e2e97bbd01e5659f24
16 changes: 6 additions & 10 deletions trunk/fs/partitions/check.c
Original file line number Diff line number Diff line change
Expand Up @@ -544,7 +544,7 @@ int rescan_partitions(struct gendisk *disk, struct block_device *bdev)
struct hd_struct *part;
struct parsed_partitions *state;
int p, highest, res;

rescan:
if (bdev->bd_part_count)
return -EBUSY;
res = invalidate_partition(disk, 0);
Expand Down Expand Up @@ -581,7 +581,7 @@ int rescan_partitions(struct gendisk *disk, struct block_device *bdev)
/* add partitions */
for (p = 1; p < state->limit; p++) {
sector_t size, from;
try_scan:

size = state->parts[p].size;
if (!size)
continue;
Expand All @@ -596,7 +596,6 @@ int rescan_partitions(struct gendisk *disk, struct block_device *bdev)

if (from + size > get_capacity(disk)) {
const struct block_device_operations *bdops = disk->fops;
unsigned long long capacity;

printk(KERN_WARNING
"%s: p%d size %llu exceeds device capacity, ",
Expand All @@ -605,14 +604,11 @@ int rescan_partitions(struct gendisk *disk, struct block_device *bdev)
if (bdops->set_capacity &&
(disk->flags & GENHD_FL_NATIVE_CAPACITY) == 0) {
printk(KERN_CONT "enabling native capacity\n");
capacity = bdops->set_capacity(disk, ~0ULL);
bdops->set_capacity(disk, ~0ULL);
disk->flags |= GENHD_FL_NATIVE_CAPACITY;
if (capacity > get_capacity(disk)) {
set_capacity(disk, capacity);
check_disk_size_change(disk, bdev);
bdev->bd_invalidated = 0;
}
goto try_scan;
/* free state and restart */
kfree(state);
goto rescan;
} else {
/*
* we can not ignore partitions of broken tables
Expand Down

0 comments on commit d033e49

Please sign in to comment.