Re: [PATCH] block: improve the error message from bio_check_eod

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

 



On 2022/05/04 23:33, Christoph Hellwig wrote:
> Print the start sector and length separately instead of the combined
> value to help with debugging.
> 
> Signed-off-by: Christoph Hellwig <hch@xxxxxx>
> ---
>  block/blk-core.c | 7 +++----
>  1 file changed, 3 insertions(+), 4 deletions(-)
> 
> diff --git a/block/blk-core.c b/block/blk-core.c
> index 937bb6b863317..10b32a1cc42b7 100644
> --- a/block/blk-core.c
> +++ b/block/blk-core.c
> @@ -592,10 +592,9 @@ static inline int bio_check_eod(struct bio *bio)
>  	    (nr_sectors > maxsector ||
>  	     bio->bi_iter.bi_sector > maxsector - nr_sectors)) {
>  		pr_info_ratelimited("%s: attempt to access beyond end of device\n"
> -				    "%pg: rw=%d, want=%llu, limit=%llu\n",
> -				    current->comm,
> -				    bio->bi_bdev, bio->bi_opf,
> -				    bio_end_sector(bio), maxsector);
> +				    "%pg: rw=%d, sector=%llu, nr_sectors = %u limit=%llu\n",
> +				    current->comm, bio->bi_bdev, bio->bi_opf,
> +				    bio->bi_iter.bi_sector, nr_sectors, maxsector);
>  		return -EIO;
>  	}
>  	return 0;

Looks good.

Reviewed-by: Damien Le Moal <damien.lemoal@xxxxxxxxxxxxxxxxxx>

-- 
Damien Le Moal
Western Digital Research



[Index of Archives]     [Linux RAID]     [Linux SCSI]     [Linux ATA RAID]     [IDE]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Device Mapper]

  Powered by Linux