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.
LU-14600 e2fsck: check trusted.link after linking inode
If the inode is not linked into the namespace, link it into
lost+found before checking the trusted.link xattr to get the
DNE link count.
Fixes:
6528bce00bea ("LU-11446 e2fsck: check trusted.link when fixing nlink")
Test-Parameters: testlist=sanity-lfsck
Signed-off-by: Andreas Dilger <adilger@whamcloud.com>
Change-Id: I447c1ce32f965311bfed1c08381928737dd9b02c
Reviewed-on: https://review.whamcloud.com/43324
Tested-by: jenkins <devops@whamcloud.com>
Reviewed-by: Li Dongyang <dongyangli@ddn.com>
LU-14600 e2fsck: trusted.link unref inode test case
Update the f_trusted_link test case to include a locally
unreferenced inode that has a trusted.link xattr. The
inode should be linked into lost+found because of the xattr,
even if it has no blocks/data, and the link cound should be
extracted from the trusted.link xattr.
Change-Id: Ifad410d0bc1ceb140216dbed48e54ea3825abe3b
Signed-off-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-on: https://review.whamcloud.com/43335
Tested-by: jenkins <devops@whamcloud.com>
Reviewed-by: Li Dongyang <dongyangli@ddn.com>
Tested-by: Maloo <maloo@whamcloud.com>
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>