From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 07ED1279DA2 for ; Tue, 24 Feb 2026 17:19:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.140.110.172 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771953568; cv=none; b=u7Q7WaBnRai6JJuYXsvtuk/0kb7IyVR3vS2yzFZ4VERGULwpH0YVBg+p2DMeLC2O9laKFK/3pojUzHPXaixaeJ+7ALOOv4j+n6xvDufC6H+Ne3EqqwbSUaax3la+HcFmmfKZk3KmQKvJgkGREhGg0duQ1wouJStnS6P8PMMTtUA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771953568; c=relaxed/simple; bh=1pTrYdstuR09ZgqyYSNh9IcB7d9VLVwjaZ6RTQN0V9M=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=gt8rblX6nZiAF2lnP/Pw9XU/Q9sII5eU7M1a4ltk3DvFdRKS2Kq3dPnsPT4CxoNgRZx2/R+w8cNOoccFUs8WT4eLGdI4yBWEXnyLoGGZSZVCJfaCCRHZ9+Cq811ZeYy0waEaiTe6vstNJU6+nEEbsim+h0347h+vNdNr4QSw0HQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com; spf=pass smtp.mailfrom=arm.com; arc=none smtp.client-ip=217.140.110.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=arm.com Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 09693339; Tue, 24 Feb 2026 09:19:20 -0800 (PST) Received: from arm.com (arrakis.cambridge.arm.com [10.1.197.46]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id ECBA43F59E; Tue, 24 Feb 2026 09:19:24 -0800 (PST) Date: Tue, 24 Feb 2026 17:19:22 +0000 From: Catalin Marinas To: Christoph Hellwig Cc: kernel test robot , linux-kernel@vger.kernel.org, Jens Axboe , Eric Biggers , Will Deacon , linux-arm-kernel@lists.infradead.org Subject: Re: fs/crypto/bio.c:67:17: sparse: sparse: cast to restricted blk_status_t Message-ID: References: <202602230947.uNRsPyBn-lkp@intel.com> <20260224145528.GA13793@lst.de> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20260224145528.GA13793@lst.de> On Tue, Feb 24, 2026 at 03:55:28PM +0100, Christoph Hellwig wrote: > On Mon, Feb 23, 2026 at 09:23:07AM +0800, kernel test robot wrote: > > tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master > > head: 6de23f81a5e08be8fbf5e8d7e9febc72a5b5f27f > > commit: bc26e2efa2c5bb9289fa894834446840dea0bc31 fscrypt: keep multiple bios in flight in fscrypt_zeroout_range_inline_crypt > > date: 6 weeks ago > > config: arm64-randconfig-r134-20260223 (https://download.01.org/0day-ci/archive/20260223/202602230947.uNRsPyBn-lkp@intel.com/config) > > compiler: clang version 23.0.0git (https://github.com/llvm/llvm-project d8f778935a5bf8a173a3c1d886fd736a4ef6cf05) > > reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260223/202602230947.uNRsPyBn-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 > > | Closes: https://lore.kernel.org/oe-kbuild-all/202602230947.uNRsPyBn-lkp@intel.com/ > > > > sparse warnings: (new ones prefixed by >>) > > fs/crypto/bio.c:67:17: sparse: sparse: cast from restricted blk_status_t > > >> fs/crypto/bio.c:67:17: sparse: sparse: cast to restricted blk_status_t > > > > vim +67 fs/crypto/bio.c > > > > 61 > > 62 static void fscrypt_zeroout_range_end_io(struct bio *bio) > > 63 { > > 64 struct fscrypt_zero_done *done = bio->bi_private; > > 65 > > 66 if (bio->bi_status) > > > 67 cmpxchg(&done->status, 0, bio->bi_status); > > 68 fscrypt_zeroout_range_done(done); > > 69 bio_put(bio); > > 70 } > > 71 > > It looks like some arm64 configs generate sparse warnings when using > cmpxchg on __bitwise types. Any chance I could prod the arm64 maintainers > into looking into this? It looks like sparse doesn't like the __bitwise cast to unsigned long in the arm64 cmxchg code. We could force the type cast, not sure whether it hides any real issues. Another option is to do the force cast in bio.c but I don't think that code is doing anything wrong: diff --git a/arch/arm64/include/asm/cmpxchg.h b/arch/arm64/include/asm/cmpxchg.h index d7a540736741..6cf3cd6873f5 100644 --- a/arch/arm64/include/asm/cmpxchg.h +++ b/arch/arm64/include/asm/cmpxchg.h @@ -91,8 +91,9 @@ __XCHG_GEN(_mb) #define __xchg_wrapper(sfx, ptr, x) \ ({ \ __typeof__(*(ptr)) __ret; \ - __ret = (__typeof__(*(ptr))) \ - __arch_xchg##sfx((unsigned long)(x), (ptr), sizeof(*(ptr))); \ + __ret = (__force __typeof__(*(ptr))) \ + __arch_xchg##sfx((__force unsigned long)(x), (ptr), \ + sizeof(*(ptr))); \ __ret; \ }) @@ -175,9 +176,10 @@ __CMPXCHG_GEN(_mb) #define __cmpxchg_wrapper(sfx, ptr, o, n) \ ({ \ __typeof__(*(ptr)) __ret; \ - __ret = (__typeof__(*(ptr))) \ - __cmpxchg##sfx((ptr), (unsigned long)(o), \ - (unsigned long)(n), sizeof(*(ptr))); \ + __ret = (__force __typeof__(*(ptr))) \ + __cmpxchg##sfx((ptr), (__force unsigned long)(o), \ + (__force unsigned long)(n), \ + sizeof(*(ptr))); \ __ret; \ }) -- Catalin