mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 19:21:31 -04:00
block/ioctl.c and fs/partition/check.c: check value returned by add_partition()
Now that add_partition() has been aught to propagate errors, let's check them. [[email protected]: coding-style fixes] Signed-off-by: Abdel Benamrouche <[email protected]> Cc: Jens Axboe <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
This commit is contained in:
parent
d805dda412
commit
04ebd4aee5
2 changed files with 11 additions and 4 deletions
|
|
@ -499,10 +499,16 @@ int rescan_partitions(struct gendisk *disk, struct block_device *bdev)
|
|||
if (!size)
|
||||
continue;
|
||||
if (from + size > get_capacity(disk)) {
|
||||
printk(" %s: p%d exceeds device capacity\n",
|
||||
printk(KERN_ERR " %s: p%d exceeds device capacity\n",
|
||||
disk->disk_name, p);
|
||||
continue;
|
||||
}
|
||||
res = add_partition(disk, p, from, size, state->parts[p].flags);
|
||||
if (res) {
|
||||
printk(KERN_ERR " %s: p%d could not be added: %d\n",
|
||||
disk->disk_name, p, -res);
|
||||
continue;
|
||||
}
|
||||
add_partition(disk, p, from, size, state->parts[p].flags);
|
||||
#ifdef CONFIG_BLK_DEV_MD
|
||||
if (state->parts[p].flags & ADDPART_FLAG_RAID)
|
||||
md_autodetect_dev(bdev->bd_dev+p);
|
||||
|
|
|
|||
Loading…
Reference in a new issue