Whamcloud - gitweb
LU-12075 mdt: commit migrate transaction with locks held 31/34431/9
authorAlex Zhuravlev <bzzz@whamcloud.com>
Fri, 15 Mar 2019 12:39:10 +0000 (15:39 +0300)
committerOleg Drokin <green@whamcloud.com>
Tue, 3 Sep 2019 05:09:49 +0000 (05:09 +0000)
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 <bzzz@whamcloud.com>
Reviewed-on: https://review.whamcloud.com/34431
Reviewed-by: Lai Siyao <lai.siyao@whamcloud.com>
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/mdt/mdt_reint.c

index c9bb061..099b34e 100644 (file)
@@ -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;
 }