Re: [PATCH v3] block: add documentation for io_timeout

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

 



On Thu, Dec 06, 2018 at 08:06:16AM -0800, Bart Van Assche wrote:
> On Wed, 2018-12-05 at 22:59 +0800, Weiping Zhang wrote:
> > Weiping Zhang <zwp10758@xxxxxxxxx> 于2018年12月5日周三 下午10:49写道:
> > > Christoph Hellwig <hch@xxxxxxxxxxxxx> 于2018年12月5日周三 下午10:40写道:
> > > > Can you please also send a patch to not show this attribute for
> > > > drivers without a timeout handler?  Thanks!
> > 
> > Is there a simple way do that ?
> 
> How about checking the timeout member of struct blk_mq_ops for blk-mq and
> checking the rq_timed_out_fn member in struct request_queue for the legacy
> block layer?

Just the former given that the legacy code is gone in for-next.

> > Shall we return -ENOTSUPP when user read/write this attribute when
> > driver has no timeout handler ?
> 
> A much more elegant solution is to introduce a sysfs attribute group for the
> io_timeout attribute and to make that group visible only if a timeout handler
> has been defined. See e.g. disk_attr_group in block/genhd.c for an example.

Agreed, that is the way to go.



[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