Skip to content

Commit 4469e95

Browse files
fdmananakdave
authored andcommitted
btrfs: log error codes during failures when writing super blocks
When writing super blocks, at write_dev_supers(), we log an error message when we get some error but we don't show which error we got and we have that information. So enhance the error messages with the error codes. Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com> Reviewed-by: Qu Wenruo <wqu@suse.com> Signed-off-by: Filipe Manana <fdmanana@suse.com> Reviewed-by: David Sterba <dsterba@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
1 parent 0f2bc22 commit 4469e95

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

fs/btrfs/disk-io.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3752,8 +3752,8 @@ static int write_dev_supers(struct btrfs_device *device,
37523752
continue;
37533753
} else if (ret < 0) {
37543754
btrfs_err(device->fs_info,
3755-
"couldn't get super block location for mirror %d",
3756-
i);
3755+
"couldn't get super block location for mirror %d error %d",
3756+
i, ret);
37573757
atomic_inc(&device->sb_write_errors);
37583758
continue;
37593759
}
@@ -3772,8 +3772,8 @@ static int write_dev_supers(struct btrfs_device *device,
37723772
GFP_NOFS);
37733773
if (IS_ERR(folio)) {
37743774
btrfs_err(device->fs_info,
3775-
"couldn't get super block page for bytenr %llu",
3776-
bytenr);
3775+
"couldn't get super block page for bytenr %llu error %ld",
3776+
bytenr, PTR_ERR(folio));
37773777
atomic_inc(&device->sb_write_errors);
37783778
continue;
37793779
}

0 commit comments

Comments
 (0)