Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 105995
b: refs/heads/master
c: 04ebd4a
h: refs/heads/master
i:
  105993: 1717edf
  105991: 640f5bb
v: v3
  • Loading branch information
Abdel Benamrouche authored and Linus Torvalds committed Jul 25, 2008
1 parent b6775d7 commit 6345626
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 5 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: d805dda412346225a50af2d399d958a4bc676c38
refs/heads/master: 04ebd4aee52b06a2c38127d9208546e5b96f3a19
5 changes: 3 additions & 2 deletions trunk/block/ioctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ static int blkpg_ioctl(struct block_device *bdev, struct blkpg_ioctl_arg __user
long long start, length;
int part;
int i;
int err;

if (!capable(CAP_SYS_ADMIN))
return -EACCES;
Expand Down Expand Up @@ -61,9 +62,9 @@ static int blkpg_ioctl(struct block_device *bdev, struct blkpg_ioctl_arg __user
}
}
/* all seems OK */
add_partition(disk, part, start, length, ADDPART_FLAG_NONE);
err = add_partition(disk, part, start, length, ADDPART_FLAG_NONE);
mutex_unlock(&bdev->bd_mutex);
return 0;
return err;
case BLKPG_DEL_PARTITION:
if (!disk->part[part-1])
return -ENXIO;
Expand Down
10 changes: 8 additions & 2 deletions trunk/fs/partitions/check.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 6345626

Please sign in to comment.