linux-block.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Bart Van Assche <bvanassche@acm.org>
To: Weiping Zhang <zwp10758@gmail.com>, hch@infradead.org
Cc: Jens Axboe <axboe@kernel.dk>, linux-block@vger.kernel.org
Subject: Re: [PATCH v3] block: add documentation for io_timeout
Date: Thu, 06 Dec 2018 08:06:16 -0800	[thread overview]
Message-ID: <1544112376.185366.230.camel@acm.org> (raw)
In-Reply-To: <CAA70yB7rD_vqMXUvHrQ8SwH-jAyDZeL58TkqABqJ0Y=-p_pjyg@mail.gmail.com>

On Wed, 2018-12-05 at 22:59 +0800, Weiping Zhang wrote:
> Weiping Zhang <zwp10758@gmail.com> 于2018年12月5日周三 下午10:49写道:
> > Christoph Hellwig <hch@infradead.org> 于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?

> 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.

Bart.

  reply	other threads:[~2018-12-06 16:06 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-05 14:17 [PATCH v3] block: add documentation for io_timeout Weiping Zhang
2018-12-05 14:40 ` Christoph Hellwig
2018-12-05 14:49   ` Weiping Zhang
2018-12-05 14:59     ` Weiping Zhang
2018-12-06 16:06       ` Bart Van Assche [this message]
2018-12-06 16:19         ` Christoph Hellwig
2018-12-06 16:19 ` Bart Van Assche
2018-12-26  1:51   ` Weiping Zhang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1544112376.185366.230.camel@acm.org \
    --to=bvanassche@acm.org \
    --cc=axboe@kernel.dk \
    --cc=hch@infradead.org \
    --cc=linux-block@vger.kernel.org \
    --cc=zwp10758@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).