linux-block.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Christoph Hellwig <hch@lst.de>, Jens Axboe <axboe@kernel.dk>,
	Eric Biggers <ebiggers@kernel.org>
Cc: oe-kbuild-all@lists.linux.dev, linux-block@vger.kernel.org,
	linux-fsdevel@vger.kernel.org, linux-fscrypt@vger.kernel.org
Subject: Re: [PATCH 8/9] blk-crypto: optimize data unit alignment checking
Date: Tue, 16 Dec 2025 04:16:05 +0100	[thread overview]
Message-ID: <202512160419.nTnYWVyJ-lkp@intel.com> (raw)
In-Reply-To: <20251210152343.3666103-9-hch@lst.de>

Hi Christoph,

kernel test robot noticed the following build errors:

[auto build test ERROR on axboe/for-next]
[also build test ERROR on jaegeuk-f2fs/dev-test jaegeuk-f2fs/dev brauner-vfs/vfs.all next-20251216]
[cannot apply to tytso-ext4/dev linus/master v6.16-rc1]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Christoph-Hellwig/fscrypt-keep-multiple-bios-in-flight-in-fscrypt_zeroout_range_inline_crypt/20251211-002354
base:   https://git.kernel.org/pub/scm/linux/kernel/git/axboe/linux.git for-next
patch link:    https://lore.kernel.org/r/20251210152343.3666103-9-hch%40lst.de
patch subject: [PATCH 8/9] blk-crypto: optimize data unit alignment checking
config: x86_64-rhel-9.4-ltp (https://download.01.org/0day-ci/archive/20251216/202512160419.nTnYWVyJ-lkp@intel.com/config)
compiler: gcc-14 (Debian 14.2.0-19) 14.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20251216/202512160419.nTnYWVyJ-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202512160419.nTnYWVyJ-lkp@intel.com/

All errors (new ones prefixed by >>):

   block/blk-merge.c: In function 'bio_split_io_at':
>> block/blk-merge.c:332:47: error: 'struct bio' has no member named 'bi_crypt_context'
     332 |                 struct bio_crypt_ctx *bc = bio->bi_crypt_context;
         |                                               ^~


vim +332 block/blk-merge.c

   310	
   311	/**
   312	 * bio_split_io_at - check if and where to split a bio
   313	 * @bio:  [in] bio to be split
   314	 * @lim:  [in] queue limits to split based on
   315	 * @segs: [out] number of segments in the bio with the first half of the sectors
   316	 * @max_bytes: [in] maximum number of bytes per bio
   317	 *
   318	 * Find out if @bio needs to be split to fit the queue limits in @lim and a
   319	 * maximum size of @max_bytes.  Returns a negative error number if @bio can't be
   320	 * split, 0 if the bio doesn't have to be split, or a positive sector offset if
   321	 * @bio needs to be split.
   322	 */
   323	int bio_split_io_at(struct bio *bio, const struct queue_limits *lim,
   324			unsigned *segs, unsigned max_bytes)
   325	{
   326		struct bio_vec bv, bvprv, *bvprvp = NULL;
   327		unsigned nsegs = 0, bytes = 0, gaps = 0;
   328		struct bvec_iter iter;
   329		unsigned len_align_mask = lim->dma_alignment;
   330	
   331		if (bio_has_crypt_ctx(bio)) {
 > 332			struct bio_crypt_ctx *bc = bio->bi_crypt_context;
   333	
   334			len_align_mask |= (bc->bc_key->crypto_cfg.data_unit_size - 1);
   335		}
   336	
   337		bio_for_each_bvec(bv, bio, iter) {
   338			if (bv.bv_offset & len_align_mask)
   339				return -EINVAL;
   340	
   341			/*
   342			 * If the queue doesn't support SG gaps and adding this
   343			 * offset would create a gap, disallow it.
   344			 */
   345			if (bvprvp) {
   346				if (bvec_gap_to_prev(lim, bvprvp, bv.bv_offset))
   347					goto split;
   348				gaps |= bvec_seg_gap(bvprvp, &bv);
   349			}
   350	
   351			if (nsegs < lim->max_segments &&
   352			    bytes + bv.bv_len <= max_bytes &&
   353			    bv.bv_offset + bv.bv_len <= lim->max_fast_segment_size) {
   354				nsegs++;
   355				bytes += bv.bv_len;
   356			} else {
   357				if (bvec_split_segs(lim, &bv, &nsegs, &bytes,
   358						lim->max_segments, max_bytes))
   359					goto split;
   360			}
   361	
   362			bvprv = bv;
   363			bvprvp = &bvprv;
   364		}
   365	
   366		*segs = nsegs;
   367		bio->bi_bvec_gap_bit = ffs(gaps);
   368		return 0;
   369	split:
   370		if (bio->bi_opf & REQ_ATOMIC)
   371			return -EINVAL;
   372	
   373		/*
   374		 * We can't sanely support splitting for a REQ_NOWAIT bio. End it
   375		 * with EAGAIN if splitting is required and return an error pointer.
   376		 */
   377		if (bio->bi_opf & REQ_NOWAIT)
   378			return -EAGAIN;
   379	
   380		*segs = nsegs;
   381	
   382		/*
   383		 * Individual bvecs might not be logical block aligned. Round down the
   384		 * split size so that each bio is properly block size aligned, even if
   385		 * we do not use the full hardware limits.
   386		 *
   387		 * It is possible to submit a bio that can't be split into a valid io:
   388		 * there may either be too many discontiguous vectors for the max
   389		 * segments limit, or contain virtual boundary gaps without having a
   390		 * valid block sized split. A zero byte result means one of those
   391		 * conditions occured.
   392		 */
   393		bytes = ALIGN_DOWN(bytes, bio_split_alignment(bio, lim));
   394		if (!bytes)
   395			return -EINVAL;
   396	
   397		/*
   398		 * Bio splitting may cause subtle trouble such as hang when doing sync
   399		 * iopoll in direct IO routine. Given performance gain of iopoll for
   400		 * big IO can be trival, disable iopoll when split needed.
   401		 */
   402		bio_clear_polled(bio);
   403		bio->bi_bvec_gap_bit = ffs(gaps);
   404		return bytes >> SECTOR_SHIFT;
   405	}
   406	EXPORT_SYMBOL_GPL(bio_split_io_at);
   407	

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

  parent reply	other threads:[~2025-12-16  3:16 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-12-10 15:23 move blk-crypto-fallback to sit above the block layer v2 Christoph Hellwig
2025-12-10 15:23 ` [PATCH 1/9] fscrypt: pass a real sector_t to fscrypt_zeroout_range_inline_crypt Christoph Hellwig
2025-12-10 15:23 ` [PATCH 2/9] fscrypt: keep multiple bios in flight in fscrypt_zeroout_range_inline_crypt Christoph Hellwig
2025-12-10 15:23 ` [PATCH 3/9] block: merge bio_split_rw_at into bio_split_io_at Christoph Hellwig
2025-12-13  0:31   ` Eric Biggers
2025-12-15  6:00     ` Christoph Hellwig
2025-12-10 15:23 ` [PATCH 4/9] blk-crypto: submit the encrypted bio in blk_crypto_fallback_bio_prep Christoph Hellwig
2025-12-13  0:48   ` Eric Biggers
2025-12-10 15:23 ` [PATCH 5/9] blk-crypto: optimize bio splitting in blk_crypto_fallback_encrypt_bio Christoph Hellwig
2025-12-13  0:56   ` Eric Biggers
2025-12-10 15:23 ` [PATCH 6/9] blk-crypto: use on-stack skcipher requests for fallback en/decryption Christoph Hellwig
2025-12-13  1:00   ` Eric Biggers
2025-12-10 15:23 ` [PATCH 7/9] blk-crypto: use mempool_alloc_bulk for encrypted bio page allocation Christoph Hellwig
2025-12-13  1:21   ` Eric Biggers
2025-12-15  6:01     ` Christoph Hellwig
2025-12-10 15:23 ` [PATCH 8/9] blk-crypto: optimize data unit alignment checking Christoph Hellwig
2025-12-11  8:28   ` kernel test robot
2025-12-11 11:43   ` kernel test robot
2025-12-13  1:30   ` Eric Biggers
2025-12-15  6:02     ` Christoph Hellwig
2025-12-16  3:16   ` kernel test robot [this message]
2025-12-10 15:23 ` [PATCH 9/9] blk-crypto: handle the fallback above the block layer Christoph Hellwig
2025-12-13  1:46   ` Eric Biggers
  -- strict thread matches above, loose matches on Subject: below --
2025-12-17  6:06 move blk-crypto-fallback to sit above the block layer v3 Christoph Hellwig
2025-12-17  6:06 ` [PATCH 8/9] blk-crypto: optimize data unit alignment checking Christoph Hellwig
2025-12-19 20:14   ` Eric Biggers
2026-01-06  7:36 move blk-crypto-fallback to sit above the block layer v4 Christoph Hellwig
2026-01-06  7:36 ` [PATCH 8/9] blk-crypto: optimize data unit alignment checking 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=202512160419.nTnYWVyJ-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=axboe@kernel.dk \
    --cc=ebiggers@kernel.org \
    --cc=hch@lst.de \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-fscrypt@vger.kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=oe-kbuild-all@lists.linux.dev \
    /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).