mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-27 22:51:31 +00:00
[PATCH] fix rescan_partitions to return errors properly
The only error code which comes from the partition checkers is -1, when they finds an EIO. As per the discussion, ENOMEM values were ignored, as they might scare the users. So, with the current code, we end up returning -1 and not EIO for the ioctl() calls. Which doesn't give any clue to the user of what went wrong. Signed-off-by: Suzuki K P <suzuki@in.ibm.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
parent
b257bc051f
commit
b74a2f0913
1 changed files with 1 additions and 1 deletions
|
@ -541,7 +541,7 @@ int rescan_partitions(struct gendisk *disk, struct block_device *bdev)
|
||||||
if (!get_capacity(disk) || !(state = check_partition(disk, bdev)))
|
if (!get_capacity(disk) || !(state = check_partition(disk, bdev)))
|
||||||
return 0;
|
return 0;
|
||||||
if (IS_ERR(state)) /* I/O error reading the partition table */
|
if (IS_ERR(state)) /* I/O error reading the partition table */
|
||||||
return PTR_ERR(state);
|
return -EIO;
|
||||||
for (p = 1; p < state->limit; p++) {
|
for (p = 1; p < state->limit; p++) {
|
||||||
sector_t size = state->parts[p].size;
|
sector_t size = state->parts[p].size;
|
||||||
sector_t from = state->parts[p].from;
|
sector_t from = state->parts[p].from;
|
||||||
|
|
Loading…
Reference in a new issue