public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Damien Le Moal <dlemoal@kernel.org>
To: Christoph Hellwig <hch@lst.de>, Jens Axboe <axboe@kernel.dk>
Cc: Carlos Maiolino <cem@kernel.org>,
	Bart Van Assche <bvanassche@acm.org>,
	linux-block@vger.kernel.org, linux-xfs@vger.kernel.org
Subject: Re: [PATCH 3/4] block: add a bio_submit_or_kill helper
Date: Mon, 6 Apr 2026 09:08:16 +0200	[thread overview]
Message-ID: <2b2998f6-260d-426d-9ea5-1019bdb8c77d@kernel.org> (raw)
In-Reply-To: <20260406055728.472919-4-hch@lst.de>

On 2026/04/06 7:57, Christoph Hellwig wrote:
> Factor the common logic for the ioctl helpers to either submit a bio or
> end if the process is being killed.  As this is now the only user of
> bio_await_chain, open code that.
> 
> Signed-off-by: Christoph Hellwig <hch@lst.de>

Looks good to me. Just one comment below.

Reviewed-by: Damien Le Moal <dlemoal@kernel.org>

> ---
>  block/bio.c     | 23 ++++++++++++++---------
>  block/blk-lib.c | 16 ++--------------
>  block/blk.h     |  2 +-
>  block/ioctl.c   | 11 ++---------
>  4 files changed, 19 insertions(+), 33 deletions(-)
> 
> diff --git a/block/bio.c b/block/bio.c
> index c7e75d532666..994db354439f 100644
> --- a/block/bio.c
> +++ b/block/bio.c
> @@ -1520,6 +1520,20 @@ static void bio_endio_cb(struct bio *bio, void *priv)
>  	bio_endio(bio);
>  }
>  
> +/*
> + * Submit @bio synchronously, or call bio_endio on it if the current process
> + * is being killed.
> + */
> +int bio_submit_or_kill(struct bio *bio, unsigned int flags)
> +{
> +	if ((flags & BLKDEV_ZERO_KILLABLE) && fatal_signal_pending(current)) {
> +		bio_await(bio, NULL, bio_endio_cb);
> +		return -EINTR;

This was like this in the previous code, so not big deal, but should we perhaps
return the bio error if there was one ? And return -EINTR if there was no error.


-- 
Damien Le Moal
Western Digital Research

  reply	other threads:[~2026-04-06  7:08 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-06  5:57 refactor submit_bio_wait and bio await helpers v2 Christoph Hellwig
2026-04-06  5:57 ` [PATCH 1/4] block: unify the synchronous bi_end_io callbacks Christoph Hellwig
2026-04-06  6:59   ` Damien Le Moal
2026-04-06  5:57 ` [PATCH 2/4] block: factor out a bio_await helper Christoph Hellwig
2026-04-06  7:05   ` Damien Le Moal
2026-04-06  5:57 ` [PATCH 3/4] block: add a bio_submit_or_kill helper Christoph Hellwig
2026-04-06  7:08   ` Damien Le Moal [this message]
2026-04-06  5:57 ` [PATCH 4/4] xfs: use bio_await in xfs_zone_gc_reset_sync Christoph Hellwig
2026-04-06  7:09   ` Damien Le Moal
  -- strict thread matches above, loose matches on Subject: below --
2026-04-01 14:03 refactor submit_bio_wait and bio await helpers Christoph Hellwig
2026-04-01 14:03 ` [PATCH 3/4] block: add a bio_submit_or_kill helper Christoph Hellwig
2026-04-01 15:42   ` Bart Van Assche
2026-04-06  5:51     ` Christoph Hellwig

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=2b2998f6-260d-426d-9ea5-1019bdb8c77d@kernel.org \
    --to=dlemoal@kernel.org \
    --cc=axboe@kernel.dk \
    --cc=bvanassche@acm.org \
    --cc=cem@kernel.org \
    --cc=hch@lst.de \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-xfs@vger.kernel.org \
    /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