Whamcloud - gitweb
LU-11376 lmv: new foreign LMV format 87/34087/40
authorBruno Faccini <bruno.faccini@intel.com>
Tue, 22 Jan 2019 15:10:26 +0000 (16:10 +0100)
committerOleg Drokin <green@whamcloud.com>
Wed, 8 May 2019 05:50:43 +0000 (05:50 +0000)
commitfdad38781cccb05c4cf3f1458c2d2d7c8b2b5bec
tree1c568d70b7045c049d382b022757daeec49ee2d2
parent6a20bdcc608bc2b933774b9f34ec25395e920a54
LU-11376 lmv: new foreign LMV format

This patch introduces a new striping/LMV format in order to
allow to specify an arbitrary external reference for a dir
in Lustre namespace.
The new LMV format is made of {newmagic, length, type, flags,
string[length]} to be as flexible as possible.
Foreign dir can be created by using the ioctl(LL_IOC_LMV_SETDIRSTRIPE)
operation and it can only be and remain an empty dir until removed.
A new API method llapi_dir_create_foreign() has been introduced
and "lfs {get,set}dirstripe" and "lfs find" modified to understand
new format.
The idea behind this is to provide Lustre namespace support and
striping prefetch/caching under lock protection, for user/external
usage.

This patch is the LMV/dirs complement of LOV/files previous change
(Change-Id: I5d9c0642fe8e7009c30918bfa946cac7c00c9af8) and has
been rebased on top of the latter along with some with obvious
mutualizations and simplifications.

Code has been added for lfsck to handle foreign dirs, and
a new sub-test has been added in sanity-lfsck in order to verify
if does not break foreign dir and that reverse is also true.

Also fixes a bug causing SEGVs during
"lfs find [--mdt-count=[+,-]<count>, --mdt-hash=<hashtype>]" when
handling a file (ie, "DIR *dir" is NULLL) in cb_find_init().

Signed-off-by: Bruno Faccini <bruno.faccini@intel.com>
Change-Id: I3721b8f14578bf926a92da76375dae92dc8d764d
Reviewed-on: https://review.whamcloud.com/34087
Tested-by: Jenkins
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Patrick Farrell <pfarrell@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
29 files changed:
lustre/doc/lfs-find.1
lustre/doc/lfs-setdirstripe.1
lustre/include/lustre/lustreapi.h
lustre/include/lustre_lmv.h
lustre/include/obd.h
lustre/include/uapi/linux/lustre/lustre_idl.h
lustre/include/uapi/linux/lustre/lustre_user.h
lustre/lfsck/lfsck_striped_dir.c
lustre/llite/dir.c
lustre/llite/file.c
lustre/llite/llite_lib.c
lustre/lmv/lmv_intent.c
lustre/lmv/lmv_obd.c
lustre/lod/lod_internal.h
lustre/lod/lod_lov.c
lustre/lod/lod_object.c
lustre/mdc/mdc_request.c
lustre/mdd/mdd_dir.c
lustre/mdt/mdt_lib.c
lustre/ptlrpc/pack_generic.c
lustre/tests/Makefile.am
lustre/tests/create_foreign_dir.c [new file with mode: 0644]
lustre/tests/create_foreign_file.c
lustre/tests/parse_foreign_dir.c [new file with mode: 0644]
lustre/tests/sanity-lfsck.sh
lustre/tests/sanity.sh
lustre/utils/lfs.c
lustre/utils/liblustreapi.c
lustre/utils/liblustreapi.map