Whamcloud - gitweb
LU-13124 scrub: check for multiple linked file 94/37194/31
authorHongchao Zhang <hongchao@whamcloud.com>
Tue, 8 Jun 2021 21:50:34 +0000 (05:50 +0800)
committerOleg Drokin <green@whamcloud.com>
Mon, 21 Jun 2021 22:16:01 +0000 (22:16 +0000)
commit0c1ae1cb9c19f8a4f6c5a7ff6a1fd54807430795
treec48711d56201cf844ab51c0996b711132eefb26b
parent2ce6957b69370b0ce75725d1d91866bf55c07fa8
LU-13124 scrub: check for multiple linked file

The files on OSTs should have only one link, but it could
have more than one link when there are some disk failures
"multiply claimed block(s)" and fixed by e2fsck to clone
these conflicted blocks. This patch adds the check of these
multiple linked files in Scrub on OST.

The name of the objects in "O" depends on the object's FID,
the directory pattern is O/[FID_SEQ]/[SUB_DIR]/[FID_OID],
the inodes of these multiple linked files are normal, but
there is only one directroy entry compatible with the object,
this patch scans all files under "O" to check whether its name
is matched with its FID.

Change-Id: I280a725939b037006935d47e9ef426a4a6a7b317
Signed-off-by: Hongchao Zhang <hongchao@whamcloud.com>
Reviewed-on: https://review.whamcloud.com/37194
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Yang Sheng <ys@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
13 files changed:
lustre/include/lustre_scrub.h
lustre/lfsck/lfsck_internal.h
lustre/lfsck/lfsck_layout.c
lustre/lfsck/lfsck_lib.c
lustre/lfsck/lfsck_namespace.c
lustre/lfsck/lfsck_striped_dir.c
lustre/osd-ldiskfs/osd_compat.c
lustre/osd-ldiskfs/osd_handler.c
lustre/osd-ldiskfs/osd_internal.h
lustre/osd-ldiskfs/osd_scrub.c
lustre/osd-zfs/osd_internal.h
lustre/osd-zfs/osd_scrub.c
lustre/tests/sanity-scrub.sh