Skip to content
This repository was archived by the owner on Oct 31, 2024. It is now read-only.

Commit 0d7ddfc

Browse files
christian-heuselgregkh
authored andcommitted
block: print symbolic error name instead of error code
[ Upstream commit 25c1772 ] Utilize the %pe print specifier to get the symbolic error name as a string (i.e "-ENOMEM") in the log message instead of the error code to increase its readablility. This change was suggested in https://lore.kernel.org/all/92972476-0b1f-4d0a-9951-af3fc8bc6e65@suswa.mountain/ Signed-off-by: Christian Heusel <christian@heusel.eu> Reviewed-by: Chaitanya Kulkarni <kch@nvidia.com> Link: https://lore.kernel.org/r/20240111231521.1596838-1-christian@heusel.eu Signed-off-by: Jens Axboe <axboe@kernel.dk> Stable-dep-of: 26e197b ("block: fix potential invalid pointer dereference in blk_add_partition") Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent 5740c0f commit 0d7ddfc

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

block/partitions/core.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -575,8 +575,8 @@ static bool blk_add_partition(struct gendisk *disk,
575575
part = add_partition(disk, p, from, size, state->parts[p].flags,
576576
&state->parts[p].info);
577577
if (IS_ERR(part) && PTR_ERR(part) != -ENXIO) {
578-
printk(KERN_ERR " %s: p%d could not be added: %ld\n",
579-
disk->disk_name, p, -PTR_ERR(part));
578+
printk(KERN_ERR " %s: p%d could not be added: %pe\n",
579+
disk->disk_name, p, part);
580580
return true;
581581
}
582582

0 commit comments

Comments
 (0)