linux-raid.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Yu Kuai <yukuai1@huaweicloud.com>
To: chen cheng <chenchneg33@gmail.com>,
	linux-raid@vger.kernel.org, "yukuai (C)" <yukuai3@huawei.com>
Subject: Re: md: Does the thread entering the wait queue violate the semantics of REQ_NOWAIT in raid5_make_request() ?
Date: Thu, 7 Aug 2025 09:35:43 +0800	[thread overview]
Message-ID: <d1c7de09-7be0-362c-5429-ed09866c8834@huaweicloud.com> (raw)
In-Reply-To: <CAD8sxFLS7A3HLL3diYRU5fHxCUb_y-QJS666k5cPOgQ8wGFDjw@mail.gmail.com>

Hi,

在 2025/08/06 21:34, chen cheng 写道:
> static bool raid5_make_request(struct mddev *mddev, struct bio * bi)
> {
>          ...
> 
>          if ((bi->bi_opf & REQ_NOWAIT) &&
>              (conf->reshape_progress != MaxSector) &&
>              get_reshape_loc(mddev, conf, logical_sector) ==
> LOC_INSIDE_RESHAPE) {
>                  bio_wouldblock_error(bi);
>                  if (rw == WRITE)
>                          md_write_end(mddev);
>                  return true;
>          }
> 
>          if (likely(conf->reshape_progress == MaxSector)) {
>                  ...
>          } else {
>                  add_wait_queue(&conf->wait_for_reshape, &wait);
>                  on_wq = true;
>          }
> 
>          ...
> }
> 
> 
> In raid5_make_request(), if a reshape is progressing and the current
> IO request is not within the reshape range and has the REQ_NOWAIT
> flag, does the thread entering the wait queue violate the semantics of
> REQ_NOWAIT?

The mdraid really doesn't support REQ_NOWAIT, for now the flag is just
ignored and I think BLK_FEAT_NOWAIT should be cleared for raid1/10/456.

BTW, support it will require a lot of work, because IO error handling is
too complicated, we don't want to record badblocks for nowait IO
failure, however, if write disk a succeed while write disk b failed,
whatever we do will violate the semantics of nowait.

Thanks,
Kuai

>  
> .
> 


      reply	other threads:[~2025-08-07  1:35 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-08-06 13:34 md: Does the thread entering the wait queue violate the semantics of REQ_NOWAIT in raid5_make_request() ? chen cheng
2025-08-07  1:35 ` Yu Kuai [this message]

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=d1c7de09-7be0-362c-5429-ed09866c8834@huaweicloud.com \
    --to=yukuai1@huaweicloud.com \
    --cc=chenchneg33@gmail.com \
    --cc=linux-raid@vger.kernel.org \
    --cc=yukuai3@huawei.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).