Message ID | 9c33e49522e2910e2c6735a32592080325ed395d.1710409033.git.wqu@suse.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | btrfs: scrub: refine the error messages | expand |
On Thu, Mar 14, 2024 at 9:50 AM Qu Wenruo <wqu@suse.com> wrote: > > Since commit 2a2dc22f7e9d ("btrfs: scrub: use dedicated super block > verification function to scrub one super block"), the super block > scrubbing is handled in a dedicated helper, thus > scrub_print_common_warning() no longer needs to print warning for super > block errors. > > Just remove the parameter. > > Signed-off-by: Qu Wenruo <wqu@suse.com> Reviewed-by: Filipe Manana <fdmanana@suse.com> Looks good, thanks. > --- > fs/btrfs/scrub.c | 14 ++++---------- > 1 file changed, 4 insertions(+), 10 deletions(-) > > diff --git a/fs/btrfs/scrub.c b/fs/btrfs/scrub.c > index 119e98797b21..5e371ffdb37b 100644 > --- a/fs/btrfs/scrub.c > +++ b/fs/btrfs/scrub.c > @@ -476,7 +476,7 @@ static int scrub_print_warning_inode(u64 inum, u64 offset, u64 num_bytes, > } > > static void scrub_print_common_warning(const char *errstr, struct btrfs_device *dev, > - bool is_super, u64 logical, u64 physical) > + u64 logical, u64 physical) > { > struct btrfs_fs_info *fs_info = dev->fs_info; > struct btrfs_path *path; > @@ -488,12 +488,6 @@ static void scrub_print_common_warning(const char *errstr, struct btrfs_device * > u32 item_size; > int ret; > > - /* Super block error, no need to search extent tree. */ > - if (is_super) { > - btrfs_warn_in_rcu(fs_info, "%s on device %s, physical %llu", > - errstr, btrfs_dev_name(dev), physical); > - return; > - } > path = btrfs_alloc_path(); > if (!path) > return; > @@ -966,15 +960,15 @@ static void scrub_stripe_report_errors(struct scrub_ctx *sctx, > > if (test_bit(sector_nr, &stripe->io_error_bitmap)) > if (__ratelimit(&rs) && dev) > - scrub_print_common_warning("i/o error", dev, false, > + scrub_print_common_warning("i/o error", dev, > logical, physical); > if (test_bit(sector_nr, &stripe->csum_error_bitmap)) > if (__ratelimit(&rs) && dev) > - scrub_print_common_warning("checksum error", dev, false, > + scrub_print_common_warning("checksum error", dev, > logical, physical); > if (test_bit(sector_nr, &stripe->meta_error_bitmap)) > if (__ratelimit(&rs) && dev) > - scrub_print_common_warning("header error", dev, false, > + scrub_print_common_warning("header error", dev, > logical, physical); > } > > -- > 2.44.0 > >
diff --git a/fs/btrfs/scrub.c b/fs/btrfs/scrub.c index 119e98797b21..5e371ffdb37b 100644 --- a/fs/btrfs/scrub.c +++ b/fs/btrfs/scrub.c @@ -476,7 +476,7 @@ static int scrub_print_warning_inode(u64 inum, u64 offset, u64 num_bytes, } static void scrub_print_common_warning(const char *errstr, struct btrfs_device *dev, - bool is_super, u64 logical, u64 physical) + u64 logical, u64 physical) { struct btrfs_fs_info *fs_info = dev->fs_info; struct btrfs_path *path; @@ -488,12 +488,6 @@ static void scrub_print_common_warning(const char *errstr, struct btrfs_device * u32 item_size; int ret; - /* Super block error, no need to search extent tree. */ - if (is_super) { - btrfs_warn_in_rcu(fs_info, "%s on device %s, physical %llu", - errstr, btrfs_dev_name(dev), physical); - return; - } path = btrfs_alloc_path(); if (!path) return; @@ -966,15 +960,15 @@ static void scrub_stripe_report_errors(struct scrub_ctx *sctx, if (test_bit(sector_nr, &stripe->io_error_bitmap)) if (__ratelimit(&rs) && dev) - scrub_print_common_warning("i/o error", dev, false, + scrub_print_common_warning("i/o error", dev, logical, physical); if (test_bit(sector_nr, &stripe->csum_error_bitmap)) if (__ratelimit(&rs) && dev) - scrub_print_common_warning("checksum error", dev, false, + scrub_print_common_warning("checksum error", dev, logical, physical); if (test_bit(sector_nr, &stripe->meta_error_bitmap)) if (__ratelimit(&rs) && dev) - scrub_print_common_warning("header error", dev, false, + scrub_print_common_warning("header error", dev, logical, physical); }
Since commit 2a2dc22f7e9d ("btrfs: scrub: use dedicated super block verification function to scrub one super block"), the super block scrubbing is handled in a dedicated helper, thus scrub_print_common_warning() no longer needs to print warning for super block errors. Just remove the parameter. Signed-off-by: Qu Wenruo <wqu@suse.com> --- fs/btrfs/scrub.c | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-)