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

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

 



On Wed, 2018-12-05 at 22:59 +-0800, Weiping Zhang wrote:
+AD4 Weiping Zhang +ADw-zwp10758+AEA-gmail.com+AD4 +To4-2018+XnQ-12+Zwg-5+ZeVUaE4J +TgtTSA-10:49+UZmQU/8a
+AD4 +AD4 Christoph Hellwig +ADw-hch+AEA-infradead.org+AD4 +To4-2018+XnQ-12+Zwg-5+ZeVUaE4J +TgtTSA-10:40+UZmQU/8a
+AD4 +AD4 +AD4 Can you please also send a patch to not show this attribute for
+AD4 +AD4 +AD4 drivers without a timeout handler?  Thanks+ACE
+AD4 
+AD4 Is there a simple way do that ?

How about checking the timeout member of struct blk+AF8-mq+AF8-ops for blk-mq and
checking the rq+AF8-timed+AF8-out+AF8-fn member in struct request+AF8-queue for the legacy
block layer?

+AD4 Shall we return -ENOTSUPP when user read/write this attribute when
+AD4 driver has no timeout handler ?

A much more elegant solution is to introduce a sysfs attribute group for the
io+AF8-timeout attribute and to make that group visible only if a timeout handler
has been defined. See e.g. disk+AF8-attr+AF8-group in block/genhd.c for an example.

Bart.



[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