summaryrefslogtreecommitdiffstats
path: root/drivers/staging/lustre/lustre/mdc/mdc_request.c
diff options
context:
space:
mode:
authorHenri Doreau <henri.doreau@cea.fr>2016-11-10 12:30:31 -0500
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2016-11-14 16:16:57 +0100
commit0ffaa9c8eb2faab0cb2dbbe46a83ec5f96df0310 (patch)
tree4f621177649d7a7daab95a3c76ba5709010b8d61 /drivers/staging/lustre/lustre/mdc/mdc_request.c
parentb73d803b656e58a0bba69eff9cedd6f4e52aaba1 (diff)
downloadop-kernel-dev-0ffaa9c8eb2faab0cb2dbbe46a83ec5f96df0310.zip
op-kernel-dev-0ffaa9c8eb2faab0cb2dbbe46a83ec5f96df0310.tar.gz
staging: lustre: hsm: 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> Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-4840 Reviewed-on: http://review.whamcloud.com/10013 Reviewed-by: John L. Hammond <john.hammond@intel.com> Reviewed-by: frank zago <fzago@cray.com> Reviewed-by: Oleg Drokin <oleg.drokin@intel.com> Signed-off-by: James Simmons <jsimmons@infradead.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/lustre/lustre/mdc/mdc_request.c')
-rw-r--r--drivers/staging/lustre/lustre/mdc/mdc_request.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/staging/lustre/lustre/mdc/mdc_request.c b/drivers/staging/lustre/lustre/mdc/mdc_request.c
index a021704..6bed5ec 100644
--- a/drivers/staging/lustre/lustre/mdc/mdc_request.c
+++ b/drivers/staging/lustre/lustre/mdc/mdc_request.c
@@ -704,9 +704,8 @@ static int mdc_close(struct obd_export *exp, struct md_op_data *op_data,
int rc;
int saved_rc = 0;
- req_fmt = &RQF_MDS_CLOSE;
if (op_data->op_bias & MDS_HSM_RELEASE) {
- req_fmt = &RQF_MDS_RELEASE_CLOSE;
+ req_fmt = &RQF_MDS_INTENT_CLOSE;
/* allocate a FID for volatile file */
rc = mdc_fid_alloc(NULL, exp, &op_data->op_fid2, op_data);
@@ -716,6 +715,10 @@ static int mdc_close(struct obd_export *exp, struct md_op_data *op_data,
/* save the errcode and proceed to close */
saved_rc = rc;
}
+ } else if (op_data->op_bias & MDS_CLOSE_LAYOUT_SWAP) {
+ req_fmt = &RQF_MDS_INTENT_CLOSE;
+ } else {
+ req_fmt = &RQF_MDS_CLOSE;
}
*request = NULL;
OpenPOWER on IntegriCloud