From 9fb963b7442ff028907f53350407f5580cb733b0 Mon Sep 17 00:00:00 2001 From: "J. R. Okajima" Date: Tue, 5 Nov 2024 12:05:19 +0900 Subject: [PATCH] aufs: possible bugfix, warning about sb->s_remove_count #2 By the commit in linux-v3.3-rc1 7ada4db88634 2012-01-06 vfs: count unlinked inodes vfs:__destroy_inode() became available to produce a warning about sb->s_remove_count. In aufs, calling vfs:set_nlink() may confuse s_remove_count, espcially when the link count is unchaged. Artur Piechocki reported on github the warning is issued while I cannot reproduce by myself. This commit may not be able to disappear the warning, but it keeps the correct link count. See-also: https://github.com/sfjro/aufs-standalone/issues/44 Signed-off-by: J. R. Okajima --- fs/aufs/cpup.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/fs/aufs/cpup.c b/fs/aufs/cpup.c index 19a7cfa5213f37..8a249b070f43c7 100644 --- a/fs/aufs/cpup.c +++ b/fs/aufs/cpup.c @@ -100,8 +100,7 @@ void au_cpup_attr_all(struct inode *inode, int force) h_inode = au_h_iptr(inode, au_ibtop(inode)); au_cpup_attr_changeable(inode); - if (inode->i_nlink > 0) - au_cpup_attr_nlink(inode, force); + au_cpup_attr_nlink(inode, force); inode->i_rdev = h_inode->i_rdev; inode->i_blkbits = h_inode->i_blkbits; au_cpup_igen(inode, h_inode);