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.