From: Alex Zhuravlev Date: Fri, 15 Mar 2019 12:39:10 +0000 (+0300) Subject: LU-12075 mdt: commit migrate transaction with locks held X-Git-Tag: 2.12.58~33 X-Git-Url: https://git.whamcloud.com/gitweb?a=commitdiff_plain;h=refs%2Fchanges%2F31%2F34431%2F9;p=fs%2Flustre-release.git 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 --- 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; }