Re: [v4 11/11] buffer_io_error: Use durable_name_printk_ratelimited

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Jul 24, 2020 at 8:19 PM Tony Asleson <tasleson@xxxxxxxxxx> wrote:
>
> Replace printk_ratelimited with one that adds the key/value
> durable name to log entry.

>  static void buffer_io_error(struct buffer_head *bh, char *msg)
>  {
> -       if (!test_bit(BH_Quiet, &bh->b_state))
> -               printk_ratelimited(KERN_ERR
> +       if (!test_bit(BH_Quiet, &bh->b_state)) {
> +               struct device *gendev;
> +
> +               gendev = (bh->b_bdev->bd_disk) ?
> +                       disk_to_dev(bh->b_bdev->bd_disk) : NULL;

Besides unneeded parentheses as Sergey noticed...

> +
> +               durable_name_printk_ratelimited(KERN_ERR, gendev,
>                         "Buffer I/O error on dev %pg, logical block %llu%s\n",
>                         bh->b_bdev, (unsigned long long)bh->b_blocknr, msg);
> +       }

...can we drop indentation level?

  if (test_bit(...))
   return;
  ...

>  }

-- 
With Best Regards,
Andy Shevchenko



[Index of Archives]     [Linux Filesystems]     [Linux SCSI]     [Linux RAID]     [Git]     [Kernel Newbies]     [Linux Newbie]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Samba]     [Device Mapper]

  Powered by Linux