Whamcloud - gitweb
LU-4840 lfs: Use file lease to implement migration 13/10013/41
authorHenri Doreau <henri.doreau@cea.fr>
Fri, 18 Apr 2014 14:17:01 +0000 (16:17 +0200)
committerOleg Drokin <oleg.drokin@intel.com>
Thu, 28 May 2015 19:00:20 +0000 (19:00 +0000)
commit85bd36cc69563d7a79e3ed34f8fadb4ed1a72b7c
treee894cc652a0f8c23bede63dfd20443f2e5473f25
parent1cf0952fc28b061932cec40022486a7f78573414
LU-4840 lfs: Use file lease to implement migration

Implement non-blocking migration based on exclusive open instead of
group lock. Implemented exclusive close operation to atomically put
a lease, swap two layouts and close a file. This allows race-free
migrations.

Make the caller responsible for retrying on failure (EBUSY, EAGAIN)
in non-blocking mode.

In blocking mode, allow applications to trigger layout swaps using a
grouplock they already own, to prevent race conditions between the
actual data copy and the layout swap. Updated lfs accordingly. File
leases are also taken in blocking mode, so that lfs migrate can issue
a warning if an application attempts to open a file that is being
migrated and gets blocked.

Timestamps (atime/mtime) are set from userland, after the layout swap
is performed, to prevent conflicts with the grouplock.

lli_trunc_sem is taken/released in the vvp_io layer, under the DLM
lock. This re-ordering fixes the original issue between truncate and
migrate.

Signed-off-by: Henri Doreau <henri.doreau@cea.fr>
Signed-off-by: Jinshan Xiong <jinshan.xiong@intel.com>
Change-Id: Ie420e1998cae03928ae24834070c16642e8cd3b9
Reviewed-on: http://review.whamcloud.com/10013
Tested-by: Jenkins
Reviewed-by: John L. Hammond <john.hammond@intel.com>
Reviewed-by: frank zago <fzago@cray.com>
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
14 files changed:
lustre/include/lustre/lustre_idl.h
lustre/include/lustre/lustre_user.h
lustre/include/lustre/lustreapi.h
lustre/include/lustre_req_layout.h
lustre/llite/file.c
lustre/llite/llite_lib.c
lustre/llite/vvp_io.c
lustre/mdc/mdc_lib.c
lustre/mdc/mdc_request.c
lustre/mdt/mdt_lib.c
lustre/mdt/mdt_open.c
lustre/ptlrpc/layout.c
lustre/utils/lfs.c
lustre/utils/liblustreapi.c