Linux-Next discussions
 help / color / mirror / Atom feed
From: Mark Brown <broonie@kernel.org>
To: Jens Axboe <axboe@kernel.dk>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	David Hildenbrand <david@kernel.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Linux Next Mailing List <linux-next@vger.kernel.org>,
	Mike Rapoport <rppt@kernel.org>,
	Tal Zussman <tz2294@columbia.edu>,
	Vlastimil Babka <vbabka@kernel.org>
Subject: linux-next: manual merge of the block tree with the mm tree
Date: Tue, 20 Oct 2026 13:27:19 +0100	[thread overview]
Message-ID: <atdeJ-91RQrqLke6@sirena.co.uk> (raw)

[-- Attachment #1: Type: text/plain, Size: 2429 bytes --]

Hi all,

Today's linux-next merge of the block tree got a conflict in:

  block/bio.c

between commit:

  d4ee6948bcabb ("block: restore the iterator when rejecting a misaligned bio")

from the mm tree and commit:

  73a0ff6030afc ("block: fail a short atomic pin in bio_iov_iter_get_pages()")

from the block tree.

I fixed it up (see below) and can carry the fix as necessary. This
is now fixed as far as linux-next is concerned, but any non trivial
conflicts should be mentioned to your upstream maintainer when your tree
is submitted for merging.  You may also want to consider cooperating
with the maintainer of the conflicting tree to minimise any particularly
complex conflicts.

diff --cc block/bio.c
index f5f866bfd89e4,8b3f6dc075275..0000000000000
--- a/block/bio.c
+++ b/block/bio.c
@@@ -1308,7 -1345,7 +1345,8 @@@ int bio_iov_iter_get_pages(struct bio *
  			   unsigned len_align_mask)
  {
  	iov_iter_extraction_t flags = 0;
 +	struct iov_iter saved_iter;
+ 	int ret;
  
  	if (WARN_ON_ONCE(bio_flagged(bio, BIO_CLONED)))
  		return -EIO;
@@@ -1329,11 -1366,10 +1367,11 @@@
  	if (bio->bi_bdev && blk_queue_pci_p2pdma(bio->bi_bdev->bd_disk->queue))
  		flags |= ITER_ALLOW_P2PDMA;
  
 +	saved_iter = *iter;
  	do {
- 		ssize_t ret;
+ 		ssize_t size;
  
- 		ret = iov_iter_extract_bvecs(iter, bio->bi_io_vec,
+ 		size = iov_iter_extract_bvecs(iter, bio->bi_io_vec,
  				maxlen - bio->bi_iter.bi_size,
  				&bio->bi_vcnt, bio->bi_max_vecs,
  				mem_align_mask, flags);
@@@ -1358,7 -1386,27 +1388,28 @@@
  
  	if (is_pci_p2pdma_page(bio->bi_io_vec->bv_page))
  		bio->bi_opf |= REQ_NOMERGE;
- 	return bio_iov_iter_align_down(bio, iter, len_align_mask);
+ 	ret = bio_iov_iter_align_down(bio, iter, len_align_mask);
+ 	if (ret)
+ 		return ret;
+ 
+ 	/*
+ 	 * An atomic write is submitted as a single bio, so it has to cover
+ 	 * the whole iterator or it would be torn.
+ 	 */
+ 	if ((bio->bi_opf & REQ_ATOMIC) && iov_iter_count(iter))
+ 		goto out_release_pages;
+ 	return 0;
+ 
+ out_release_pages:
+ 	/*
+ 	 * Release the pages pinned so far before failing, since this bio won't
+ 	 * be submitted to release them.
+ 	 */
+ 	bio_release_pages(bio, false);
+ 	bio_clear_flag(bio, BIO_PAGE_PINNED);
+ 	bio->bi_vcnt = 0;
++	*iter = saved_iter;
+ 	return -EINVAL;
  }
  
  static struct folio *folio_alloc_greedy(gfp_t gfp, size_t *size,

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

             reply	other threads:[~2026-10-20 12:27 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-20 12:27 Mark Brown [this message]
2026-10-20 12:45 ` linux-next: manual merge of the block tree with the mm tree Jens Axboe
2026-10-20 17:00   ` Andrew Morton
2026-10-20 17:13     ` Jens Axboe
2026-10-20 18:43       ` Andrew Morton
  -- strict thread matches above, loose matches on Subject: below --
2024-04-02  0:27 Stephen Rothwell
2024-05-13 23:41 ` Stephen Rothwell
2024-05-13 23:43   ` Edgecombe, Rick P
2024-02-14  0:25 Stephen Rothwell
2024-03-11 21:54 ` Stephen Rothwell
2023-06-16  1:58 Stephen Rothwell
2023-06-16  3:50 ` Andrew Morton
2023-06-16  9:56   ` David Howells
2023-06-16 16:07     ` Jens Axboe
2023-06-16 19:44 ` Vishal Moola
2023-06-16  1:50 Stephen Rothwell
2023-03-22 23:02 Stephen Rothwell
2023-03-22 23:13 ` David Howells
2023-03-22 23:15   ` Jens Axboe
2023-03-22 23:26     ` Andrew Morton
2023-03-23  0:03       ` Stephen Rothwell
2023-03-23  0:04       ` David Howells
2023-03-23  0:49       ` Jens Axboe

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=atdeJ-91RQrqLke6@sirena.co.uk \
    --to=broonie@kernel.org \
    --cc=akpm@linux-foundation.org \
    --cc=axboe@kernel.dk \
    --cc=david@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-next@vger.kernel.org \
    --cc=rppt@kernel.org \
    --cc=tz2294@columbia.edu \
    --cc=vbabka@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