]> git.ipfire.org Git - thirdparty/linux.git/commit
xfs: zero i_nlink before repair puts inode on unlinked list
authorDarrick J. Wong <djwong@kernel.org>
Tue, 21 Jul 2026 03:24:33 +0000 (20:24 -0700)
committerCarlos Maiolino <cem@kernel.org>
Wed, 22 Jul 2026 13:06:25 +0000 (15:06 +0200)
commit49933254ba8d421ed706cbe6ed0fbc264e572cab
tree8e078ff23bdb43ea159c84611314005f32848925
parent8ed78104722b57df69478b0b1608a408c1036085
xfs: zero i_nlink before repair puts inode on unlinked list

LOLLM observes that we don't reset i_nlink if we encounter a file with
no parent that isn't on the unlinked list.  This causes unnecessary
assertion trips on debugging kernels and an inconsistent file, so let's
fix that.

Cc: stable@vger.kernel.org # v6.10
Fixes: 669dfe883c8e20 ("xfs: update the unlinked list when repairing link counts")
Signed-off-by: "Darrick J. Wong" <djwong@kernel.org>
Assisted-by: LOLLM # finding obvious bugs
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Carlos Maiolino <cem@kernel.org>
fs/xfs/scrub/nlinks_repair.c