Whamcloud - gitweb
LU-5223 lmv: build master LMV EA dynamically build via readdir 51/10751/17
authorFan Yong <fan.yong@intel.com>
Sun, 25 May 2014 16:34:27 +0000 (00:34 +0800)
committerOleg Drokin <oleg.drokin@intel.com>
Tue, 8 Jul 2014 15:40:01 +0000 (15:40 +0000)
commitde2d5808bd2987f76d2486272e1a9c192ba277d4
tree370195652a84989be926f65319f16afb2f213172
parent35b3a429d1915ec147f01a42c4ec0526b887d1c7
LU-5223 lmv: build master LMV EA dynamically build via readdir

When creating a striped directory, the master object saves the slave
objects (or shards) as internal sub-directories. The sub-directory's
name is composed of ${shard_FID}:${shard_idx}. With the name, we can
easily to know what the shard is and where it should be.

On the other hand, we need to store some information related with the
striped directory, such as magic, hash type, shards count, and so on.
That is the LMV EA (header). We do NOT store the FID of each shard in
the LMV EA. Instead, when we need the shards' FIDs (such as readdir()
on client-side), we can build the entrie LMV EA on the MDT (in RAM) by
iterating the sub-directory entries that are contained in the master
object of the striped directroy.

Above mechanism can simplify the striped directory create operation.
For very large striped directory, logging the FIDs array in the LMV
EA will be trouble. It also simplify the LFSCK for verifying striped
directory, because it reduces the inconsistency sources.

Another fixing is about the lmv_master_fid in master LMV EA header,
it is redundant information, and may become one of the inconsistency
sources. So replace it with two __u64 padding fields.

Signed-off-by: Fan Yong <fan.yong@intel.com>
Change-Id: If7ddec892b75ff8f6e14d9f3f7a3ae0fa065239e
Reviewed-on: http://review.whamcloud.com/10751
Tested-by: Jenkins
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: Alex Zhuravlev <alexey.zhuravlev@intel.com>
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
18 files changed:
lustre/include/lustre/lustre_idl.h
lustre/include/lustre_lmv.h
lustre/lfsck/lfsck_engine.c
lustre/lfsck/lfsck_internal.h
lustre/llite/llite_lib.c
lustre/lmv/lmv_obd.c
lustre/lod/lod_internal.h
lustre/lod/lod_lov.c
lustre/lod/lod_object.c
lustre/lod/lproc_lod.c
lustre/mdd/mdd_dir.c
lustre/mdt/mdt_handler.c
lustre/osp/osp_md_object.c
lustre/ptlrpc/wiretest.c
lustre/tests/sanity.sh
lustre/utils/liblustreapi.c
lustre/utils/wirecheck.c
lustre/utils/wiretest.c