Whamcloud - gitweb
LU-3811 hsm: handle file ownership and timestamps 61/7461/5
authorJohn L. Hammond <john.hammond@intel.com>
Thu, 29 Aug 2013 19:41:49 +0000 (14:41 -0500)
committerOleg Drokin <oleg.drokin@intel.com>
Wed, 4 Sep 2013 04:39:07 +0000 (04:39 +0000)
commit23c197908902183d5f88d3f431da6cde9c290e07
treec19329e344082306d70a6f25447015d54095a03e
parent325ce4b25e94fc0fbf4441487713fae53637f40e
LU-3811 hsm: handle file ownership and timestamps

In hsm_init_ucred() set the capability mask to CFS_CAP_FS_MASK thereby
allowing the coordinator to swap layouts of files not owned by
root. In mdt_orphan_open() raise CFS_CAP_DAC_OVERRIDE before creating
the orphan filee in the MDT's local root. In mdt_hsm_release() set
inode size and timestamps before getting the LOV xattr and ensure that
the orphan file is created with the same UID and GID of the original.
In lhsmtool_posix.c similalrly ensure that the volatile file used for
restore has the same ownership, access and modification timestamps as
the original.

Strengthen sanity-hsm test 24 to check that none of archive, release,
or restore will change the access or modified timestamps. Add 24b to
check that root can archive, release, and restore an ordinary user's
files and that the user will be able to read a released file even if
the parent directory is unwritable.

Signed-off-by: John L. Hammond <john.hammond@intel.com>
Change-Id: Id08429cbfed1bbab719f52ed101e61d5e629ccd2
Reviewed-on: http://review.whamcloud.com/7461
Reviewed-by: Aurelien Degremont <aurelien.degremont@cea.fr>
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: jacques-Charles Lafoucriere <jacques-charles.lafoucriere@cea.fr>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
lustre/include/lustre/lustreapi.h
lustre/mdt/mdt_coordinator.c
lustre/mdt/mdt_open.c
lustre/tests/sanity-hsm.sh
lustre/utils/lhsmtool_posix.c
lustre/utils/liblustreapi_hsm.c