Whamcloud - gitweb
LU-11446 e2fsck: check trusted.link when fixing nlink 69/43169/5
authorLi Dongyang <dongyangli@ddn.com>
Tue, 30 Mar 2021 11:22:40 +0000 (22:22 +1100)
committerAndreas Dilger <adilger@whamcloud.com>
Wed, 7 Apr 2021 22:02:37 +0000 (22:02 +0000)
commit6528bce00beaa69d1d140452b1a8b84cc7e1f253
tree991a92e5b23001fb32bdd652056fa73b5275bd4d
parentc0f60f896182d26711c7d8d064dc95471b0d9829
LU-11446 e2fsck: check trusted.link when fixing nlink

The inode link count could be higher than what is stored in the
local MDT inode because of remote file links from DNE MDTs.
If we find a mismatched link count, look up the "trusted.link"
xattr.  If it exists, do a sanity check on it, and use the
leh_reccount stored there if larger than the local link count.

If leh_overflow_time is set, then the "trusted.link" xattr may
not hold all of the links, so assume the maximum of available
link counts is valid until LFSCK clears leh_overflow_time.

Signed-off-by: Li Dongyang <dongyangli@ddn.com>
Change-Id: I213d816a92043c348eb55374aaa98e98957ccf23
Reviewed-on: https://review.whamcloud.com/43169
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Artem Blagodarenko <artem.blagodarenko@hpe.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
e2fsck/pass4.c
lib/ext2fs/ext2fs.h
lib/ext2fs/ext_attr.c
lib/ext2fs/lfsck.h
tests/f_trusted_link/expect.1 [new file with mode: 0644]
tests/f_trusted_link/expect.2 [new file with mode: 0644]
tests/f_trusted_link/image.gz [new file with mode: 0644]
tests/f_trusted_link/name [new file with mode: 0644]