Whamcloud - gitweb
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.
If the inode is not linked into the namespace, link it into
lost+found before checking trusted.link for the DNE link count.
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.
Signed-off-by: Li Dongyang <dongyangli@ddn.com>
Change-Id: I213d816a92043c348eb55374aaa98e98957ccf23
Reviewed-on: https://review.whamcloud.com/43169
Reviewed-by: Artem Blagodarenko <artem.blagodarenko@hpe.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>