From e5c0c9f2cb45c4c98060c5dceb6556f098674cbd Mon Sep 17 00:00:00 2001 From: Alex Zhuravlev Date: Fri, 15 Mar 2019 15:39:10 +0300 Subject: [PATCH] LU-12075 mdt: commit migrate transaction with locks held in normal conditions migration (being a distributed transaction) saves LDLM locks in the reply to implement CoS semantics, but if migrate process has got too many LDLM locks and we can't save them in the reply, then we should commit the transaction and then we can release the locks. Change-Id: I5e5f0516bdca973a72e43d63ecde79c792558abd Signed-off-by: Alex Zhuravlev Reviewed-on: https://review.whamcloud.com/34431 Reviewed-by: Lai Siyao Tested-by: jenkins Tested-by: Maloo Reviewed-by: Andreas Dilger Reviewed-by: Oleg Drokin --- lustre/mdt/mdt_reint.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lustre/mdt/mdt_reint.c b/lustre/mdt/mdt_reint.c index c9bb061..099b34e 100644 --- a/lustre/mdt/mdt_reint.c +++ b/lustre/mdt/mdt_reint.c @@ -2177,6 +2177,10 @@ unlock_open_sem: if (open_sem_locked) up_write(&sobj->mot_open_sem); unlock_links: + /* if we've got too many locks to save into RPC, + * then just commit before the locks are released */ + if (!rc && do_sync) + mdt_device_sync(env, mdt); mdt_unlock_list(info, &link_locks, do_sync ? 1 : rc); put_source: mdt_object_put(env, sobj); @@ -2190,9 +2194,6 @@ unlock_rename: if (lustre_handle_is_used(&rename_lh)) mdt_rename_unlock(&rename_lh); - if (!rc && do_sync) - mdt_device_sync(env, mdt); - return rc; } -- 1.8.3.1