Re: [PATCH 2/2] block: change blk_mq_add_to_batch() third argument type to blk_status_t

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

 



On Mar 11, 2025 / 01:13, Christoph Hellwig wrote:
> On Tue, Mar 11, 2025 at 11:41:44AM +0900, Shin'ichiro Kawasaki wrote:
> > However, blk_mq_add_to_batch() callers do not pass negative error
> > values. Instead, they pass status codes defined in various ways:
> > 
> > - NVMe PCI and Apple drivers pass NVMe status code
> > - virtio_blk driver passes the virtblk request header status byte
> > - null_blk driver passes blk_status_t
> 
> The __force cast in null_blk should have been a big fat warning..
> 
> > To correct the ioerror check within blk_mq_add_to_batch(), make all
> > callers to uniformly pass the argument as blk_status_t. Modify the
> > callers to translate their specific status codes into blk_status_t. For
> > this translation, export the helper function nvme_error_status(). Adjust
> > blk_mq_add_to_batch() to translate blk_status_t back into the error
> > number for the appropriate check.
> 
> This still looks a bit ugly because of all the conversions to a
> blk_status_t just to convert it back to a errno just to check for
> a non-zero value (blk_status_to_errno can't return a positive value).
> 
> I suspect simply passing a "bool is_error" might actually be cleaner
> than that,

Thanks. Hannes made same comment. Wiil do so in v2.

> combined with a proper kerneldoc comment for
> blk_mq_add_to_batch explaining how to set it?

Will add it in v2.

I Will send out v2 soon for furhter review.




[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