From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796238597; b=UdG+orEWJ3GdulgRFP3Wnu7aCFwMy3FUUcTG3frGhAIS4MbOolZ3brg4AwI3tDdKORG7 uhxS8M2XJXQB9/ak1XzNkzy2enWuVNFrXj+laSlUsm8a8iPbbvOoKQ4Byz0nqRtQXCUt7 h8WIS5yJgTi4qDXVs0eb/dEgIWWap/r+g3p4UMTlSrUzNoa3mzp3wQaJWVcD/oEOf/2XB /yNLihoDf2CK5pCVZlqiGrCiLTt6W/7vl/BopOu+AotnF5sCfk6gYJQbr4xJYEnJfgajU 6+34PNfyHg8cfede5k9MtqPxkrizyRIOpOE1Y+YxAggMdhcdQtcqDq5qwfoVHHtKABg== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796238597; h=Received:DKIM-Signature:Date:From:To:Cc:Subject:Message-ID: References:MIME-Version:Content-Type:Content-Disposition:In-Reply-To; bh=xIH7JEm1pnlYAxlposxxqZqq5qPpezuytaiAUtjwipk=; b=w4cLA2lqPEu0wUlkAB9zD3VMWJ9MM/MxnUghM3FcnpTsf0zNz9VcG3KnKGXzJEDdWpmX yhbtfnxV0oN6lEHxec5XMiEZlQyEEsEvcKWqoXUkaDNitjtV7Y0Y5bWfDE8Oev9+gfmxI Q+UB7TzlP0RhpkQIRmghXJHjKFbhIf39EoC7VFzyfw2L6QDsnl37yrT0g+HrmCHvbIoKB nB1EIoIgvOCRObSml4HpGcVhUC1lccCzZ+aQg9990bqSyzDX5juP+j2WgWVR2yf4oJR5+ FNSfBl+jtMWOvmtSV5pYu+DxdEmMOe9ssWr7wNFIXLMhlbOB7NoRD4AOHMcJptK+xTA== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=lXtR+HdL; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 68BE4606A322; Wed, 2 Dec 2026 19:09:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=lXtR+HdL Received: by smtp.kernel.org (Postfix) with ESMTPSA id CE9491F000C1; Wed, 2 Dec 2026 19:09:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796238597; bh=xIH7JEm1pnlYAxlposxxqZqq5qPpezuytaiAUtjwipk=; h=Date:From:To:Cc:Subject:References:In-Reply-To; b=lXtR+HdLmG3aMU6/TtYn9eMbvTXLeXRbJxKBQD7NsLt8ntxD26rx3EYS/lijSHs71 iMmRRnFtDMQAIOcgew96P62aq/oTeugTW4sqLh16FtShNGIlsmbVo8q9diebzc5uwv iRyO8FLZyOqfDHj1SXZG+H+1KCIT07eLPxkLIvif2L7tj8E9Hp7FZZunEGzy+iHYfQ aTnqEjoPHdc2tHXaUr+i+RwXmqgbmUBfyErHKCX/tKLCkpBdkf1WkxYzi0aKOP6WMV hbVU4Auqfbf+Ko+7Ew6OqsdU3wgZBoIG2p5nLz+TLL1Y2jBIsjD8KRwLZkV43oHAIR upDYnQ5eQle9Q== Date: Wed, 2 Dec 2026 19:09:54 +0000 From: Eric Biggers To: Fengnan Chang Cc: Jens Axboe , linux-block@vger.kernel.org, stable@vger.kernel.org Subject: Re: [PATCH v2] blk-crypto: clear REQ_POLLED on software-encrypted write bios Message-ID: <20261202190954.GD338490@google.com> References: <20261202080930.1338801-1-changfengnan@bytedance.com> X-Mailing-List: linux-block@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20261202080930.1338801-1-changfengnan@bytedance.com> On Wed, Dec 02, 2026 at 08:09:30AM +0000, Fengnan Chang wrote: > blk-crypto-fallback encrypts a write into new bios and completes the > source bio from their endio callback. The submitter only polls the > source bio, which is never queued to hardware and never gets a cookie. > If the encrypted bios inherit REQ_POLLED and land on a poll queue, > nothing polls them, and the write stalls until the request times out. > > Let the encrypted bios use interrupt completion. Reads are not > affected: the source bio itself is submitted and decrypted after it > completes. > > Reproduced with io_uring IOPOLL O_DIRECT writes to an fscrypt-encrypted > ext4 file (mounted with -o inlinecrypt) on a null_blk device with poll > queues: every write failed with -ETIMEDOUT after the request timeout. > With this change the writes complete and read back correctly. > > Fixes: 3e08773c3841 ("block: switch polling to be bio based") > Cc: stable@vger.kernel.org > Signed-off-by: Fengnan Chang > --- > block/blk-crypto-fallback.c | 6 ++++-- > 1 file changed, 4 insertions(+), 2 deletions(-) > > diff --git a/block/blk-crypto-fallback.c b/block/blk-crypto-fallback.c > index 12e0b487e23ab..be6aee3d1e9d0 100644 > --- a/block/blk-crypto-fallback.c > +++ b/block/blk-crypto-fallback.c > @@ -177,8 +177,10 @@ static struct bio *blk_crypto_alloc_enc_bio(struct bio *bio_src, > struct page **pages; > struct bio *bio; > > - bio = bio_alloc_bioset(bio_src->bi_bdev, nr_segs, bio_src->bi_opf, > - GFP_NOIO, &enc_bio_set); > + /* The submitter can only poll the source bio. */ > + bio = bio_alloc_bioset(bio_src->bi_bdev, nr_segs, > + bio_src->bi_opf & ~REQ_POLLED, GFP_NOIO, > + &enc_bio_set); > if (bio_flagged(bio_src, BIO_REMAPPED)) > bio_set_flag(bio, BIO_REMAPPED); > bio->bi_private = bio_src; Reviewed-by: Eric Biggers - Eric