Whamcloud - gitweb
LU-5517 lfsck: repair invalid nlink count 16/11516/29
authorFan Yong <fan.yong@intel.com>
Wed, 27 Aug 2014 15:12:44 +0000 (23:12 +0800)
committerOleg Drokin <oleg.drokin@intel.com>
Thu, 30 Oct 2014 02:13:32 +0000 (02:13 +0000)
commit9ff2d957982160103b5d885c9a532ad45bdf8d4d
tree6f97bae4744752542c74f694ff745db3627d940b
parente8812867e8c6c9eb62174b370cb818985e3d2180
LU-5517 lfsck: repair invalid nlink count

If the namespace LFSCK has verified all the known name entries during
the first-stage scanning, then the MDT-object's linkEA is trustable.
So if the non-directory MDT-object's nlink attribute does not match
the MDT-object linkEA entries count, then the LFSCK will repair the
MDT-object's nlink attribute according to its linkEA entries count.

One exception is that: the linkEA space is limited, if there are too
much hard links on the MDT-object and exceeds the object's linkEA
space limitation, then some name entries cannot be recorded in the
linkEA. Under such case, we will add some flags (LLF_SKIP_NLINK)
in the LFSCK tracing file for related MDT-objects. Then the LFSCK
can skip the nlink attribute verification for the marked MDT-objects
during the second-stage scanning.

This patch also cleanup the LFSCK environment when current LFSCK
scanning exits (completed/stopped/failed) to avoid some stale to
misguide the next LFSCK scanning.

This patch also makes some code adjustment for the former landed
LFSCK patches according to the inspection feedback.

Signed-off-by: Fan Yong <fan.yong@intel.com>
Change-Id: Iedc676e8cc06a52f55e82372e6dc8b30008e20f4
Reviewed-on: http://review.whamcloud.com/11516
Tested-by: Jenkins
Reviewed-by: Alex Zhuravlev <alexey.zhuravlev@intel.com>
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Lai Siyao <lai.siyao@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
25 files changed:
lustre/include/lu_target.h
lustre/include/lustre/lustre_idl.h
lustre/include/lustre_lfsck.h
lustre/include/obd_support.h
lustre/lfsck/lfsck_internal.h
lustre/lfsck/lfsck_layout.c
lustre/lfsck/lfsck_lib.c
lustre/lfsck/lfsck_namespace.c
lustre/mdd/mdd_compat.c
lustre/mdd/mdd_dir.c
lustre/mdd/mdd_internal.h
lustre/ofd/ofd_io.c
lustre/ofd/ofd_objects.c
lustre/osd-ldiskfs/osd_handler.c
lustre/osd-zfs/osd_xattr.c
lustre/osp/osp_internal.h
lustre/osp/osp_md_object.c
lustre/osp/osp_object.c
lustre/ptlrpc/wiretest.c
lustre/target/out_handler.c
lustre/target/tgt_handler.c
lustre/target/tgt_internal.h
lustre/tests/sanity-lfsck.sh
lustre/utils/wirecheck.c
lustre/utils/wiretest.c