Whamcloud - gitweb
LU-13124 scrub: check for multiple linked file
authorHongchao Zhang <hongchao@whamcloud.com>
Wed, 21 Jul 2021 08:44:07 +0000 (16:44 +0800)
committerAndreas Dilger <adilger@whamcloud.com>
Thu, 22 Jul 2021 01:59:50 +0000 (01:59 +0000)
commit55948e1dbe73562720c998a1e09a162d0d69236d
treefcd7953891c8d814f0c994310e7c02d35bea43c8
parentf7a5fc548d5debf5f1e4e56ea58155b439e83285
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.

Lustre-change: https://review.whamcloud.com/37194
Lustre-commit: 0c1ae1cb9c19f8a4f6c5a7ff6a1fd54807430795
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Yang Sheng <ys@whamcloud.com>
Change-Id: I280a725939b037006935d47e9ef426a4a6a7b317
Signed-off-by: Hongchao Zhang <hongchao@whamcloud.com>
Reviewed-on: https://review.whamcloud.com/44299
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@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