Skip to content

Commit 9234851

Browse files
Christoph Hellwigliu-song-6
authored andcommitted
md-bitmap: use %pD to print the file name in md_bitmap_file_kick
Don't bother allocating an extra buffer in the I/O failure handler and instead use the printk built-in format to print the last 4 path name components. Signed-off-by: Christoph Hellwig <[email protected]> Reviewed-by: Hannes Reinecke <[email protected]> Reviewed-by: Johannes Thumshirn <[email protected]> Reviewed-by: Himanshu Madhani <[email protected]> Signed-off-by: Song Liu <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 546ac0b commit 9234851

File tree

1 file changed

+2
-10
lines changed

1 file changed

+2
-10
lines changed

drivers/md/md-bitmap.c

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -870,21 +870,13 @@ static void md_bitmap_file_unmap(struct bitmap_storage *store)
870870
*/
871871
static void md_bitmap_file_kick(struct bitmap *bitmap)
872872
{
873-
char *path, *ptr = NULL;
874-
875873
if (!test_and_set_bit(BITMAP_STALE, &bitmap->flags)) {
876874
md_bitmap_update_sb(bitmap);
877875

878876
if (bitmap->storage.file) {
879-
path = kmalloc(PAGE_SIZE, GFP_KERNEL);
880-
if (path)
881-
ptr = file_path(bitmap->storage.file,
882-
path, PAGE_SIZE);
883-
884-
pr_warn("%s: kicking failed bitmap file %s from array!\n",
885-
bmname(bitmap), IS_ERR(ptr) ? "" : ptr);
877+
pr_warn("%s: kicking failed bitmap file %pD4 from array!\n",
878+
bmname(bitmap), bitmap->storage.file);
886879

887-
kfree(path);
888880
} else
889881
pr_warn("%s: disabling internal bitmap due to errors\n",
890882
bmname(bitmap));

0 commit comments

Comments
 (0)