From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8D0283AFB1A for ; Tue, 12 May 2026 14:22:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778595743; cv=none; b=D2UxJxCFDGjnukG83GywqsooIXMrA28PeuoJTs0DChGNQREtOc10M2D7lV9Hx2VJ7q2KmJ+7o8hev/Gk4H6mmGy++m+irsi29oMuz8mTOdXi1EzR9zaXL4Io9gQYCy39Go81+fP16jIq6OvoRqF0xWvAU8e8EjUeRt6rkqqVWm0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778595743; c=relaxed/simple; bh=gTin/ebsZTdGb+CSJS/mdW19TkTR4EVTbaxMQiMe5kY=; h=Subject:To:Cc:From:Date:Message-ID:MIME-Version:Content-Type; b=ONMi83w97EuXUEFWSCi2fbZ3CBerJoTym0Dbv+mY08VqBBnuQ2S+vy9Nrb/pC7cznhDBdY976S+0gJkwzgOf7K2el1OXm2Zb1I5vOxAIuIUa9f/lwhAM8Q9dYIRun5Y5Zero1S/NxCID7SS5FXd4Q1tAZ+SLi7zcR9//On4uVZs= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=wCpVc7Wf; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="wCpVc7Wf" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 23397C2BCB0; Tue, 12 May 2026 14:22:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1778595743; bh=gTin/ebsZTdGb+CSJS/mdW19TkTR4EVTbaxMQiMe5kY=; h=Subject:To:Cc:From:Date:From; b=wCpVc7WfQ9Z8SaVe3yZzVQuWS5Pwz1MTf6Sw9r0nbOMrIMv5zNKdDfv2IYawvv3H1 RqAN67XId8XxDYQLIJWL5sZKzOuTJkAi1rVlXSd0uwGjB42d+V15YDLZ9aCMfkU3VU C3VeQZi+Fm1mLmQUGW72WfZ5tQJe0G5HMmh27H6U= Subject: FAILED: patch "[PATCH] f2fs: add READ_ONCE() for i_blocks in f2fs_update_inode()" failed to apply to 5.15-stable tree To: zzzccc427@gmail.com,chao@kernel.org,jaegeuk@kernel.org Cc: From: Date: Tue, 12 May 2026 16:22:28 +0200 Message-ID: <2026051228-echo-earshot-7ef7@gregkh> Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=ANSI_X3.4-1968 Content-Transfer-Encoding: 8bit The patch below does not apply to the 5.15-stable tree. If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to . To reproduce the conflict and resubmit, you may use the following commands: git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-5.15.y git checkout FETCH_HEAD git cherry-pick -x 5471834a96fb697874be2ca0b052e74bcf3c23d1 # git commit -s git send-email --to '' --in-reply-to '2026051228-echo-earshot-7ef7@gregkh' --subject-prefix 'PATCH 5.15.y' HEAD^.. Possible dependencies: thanks, greg k-h ------------------ original commit in Linus's tree ------------------ >From 5471834a96fb697874be2ca0b052e74bcf3c23d1 Mon Sep 17 00:00:00 2001 From: Cen Zhang Date: Wed, 18 Mar 2026 15:32:53 +0800 Subject: [PATCH] f2fs: add READ_ONCE() for i_blocks in f2fs_update_inode() f2fs_update_inode() reads inode->i_blocks without holding i_lock to serialize it to the on-disk inode, while concurrent truncate or allocation paths may modify i_blocks under i_lock. Since blkcnt_t is u64, this risks torn reads on 32-bit architectures. Following the approach in ext4_inode_blocks_set(), add READ_ONCE() to prevent potential compiler-induced tearing. Fixes: 19f99cee206c ("f2fs: add core inode operations") Cc: stable@vger.kernel.org Signed-off-by: Cen Zhang Reviewed-by: Chao Yu Signed-off-by: Jaegeuk Kim diff --git a/fs/f2fs/inode.c b/fs/f2fs/inode.c index e0f850b3f0c3..89240be8cc59 100644 --- a/fs/f2fs/inode.c +++ b/fs/f2fs/inode.c @@ -687,7 +687,7 @@ void f2fs_update_inode(struct inode *inode, struct folio *node_folio) ri->i_uid = cpu_to_le32(i_uid_read(inode)); ri->i_gid = cpu_to_le32(i_gid_read(inode)); ri->i_links = cpu_to_le32(inode->i_nlink); - ri->i_blocks = cpu_to_le64(SECTOR_TO_BLOCK(inode->i_blocks) + 1); + ri->i_blocks = cpu_to_le64(SECTOR_TO_BLOCK(READ_ONCE(inode->i_blocks)) + 1); if (!f2fs_is_atomic_file(inode) || is_inode_flag_set(inode, FI_ATOMIC_COMMITTED))