Whamcloud - gitweb
LU-14312 ldlm: don't change GROUP lock GID on client 68/41268/5
authorMikhail Pershin <mpershin@whamcloud.com>
Tue, 19 Jan 2021 14:21:57 +0000 (17:21 +0300)
committerOleg Drokin <green@whamcloud.com>
Sat, 23 Jan 2021 08:09:56 +0000 (08:09 +0000)
GROUP lock GID is part of inodebits policy and is passed
to the server from client in policy li_gid field.
Meanwhile the ldlm_ibits_policy_wire_to_local() is used on
client also when server reply or completion AST is processed,
so client original GID can be overwritten by server value.
This is not problem if both server and client have the same
Lustre version but if server is older then it can have garbage
in li_gid field and client lock policy is updated with it.

Considering that GROUP lock GID is never changed and server should
not do that, the solution is to ignore returned li_gid from server
and never update original GID of GROUP lock on client from server

Test-Parameters: testlist=sanity serverversion=2.12.6 env=ONLY=272b
Test-Parameters: testlist=sanity serverversion=2.13.0 serverdistro=el7.7 env=ONLY=272b

Signed-off-by: Mikhail Pershin <mpershin@whamcloud.com>
Change-Id: I9a82f4b3513fd93d63b92a9527cb7b89c635e61b
Reviewed-on: https://review.whamcloud.com/41268
Tested-by: jenkins <devops@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>

index a338c4d..fad8fc6 100644 (file)
@@ -449,10 +449,9 @@ void ldlm_ibits_policy_wire_to_local(const union ldlm_wire_policy_data *wpolicy,
                                     union ldlm_policy_data *lpolicy)
        lpolicy->l_inodebits.bits = wpolicy->l_inodebits.bits;
-       lpolicy->l_inodebits.li_gid = wpolicy->l_inodebits.li_gid;
-        * try_bits are to be handled outside of generic write_to_local due
-        * to different behavior on a server and client.
+        * try_bits and li_gid are to be handled outside of generic
+        * write_to_local due to different behavior on a server and client.
index 0315364..cbf9479 100644 (file)
@@ -1361,11 +1361,14 @@ int ldlm_handle_enqueue0(struct ldlm_namespace *ns,
-       if (dlm_req->lock_desc.l_resource.lr_type == LDLM_EXTENT)
+       if (dlm_req->lock_desc.l_resource.lr_type == LDLM_EXTENT) {
                lock->l_req_extent = lock->l_policy_data.l_extent;
-       else if (dlm_req->lock_desc.l_resource.lr_type == LDLM_IBITS)
+       } else if (dlm_req->lock_desc.l_resource.lr_type == LDLM_IBITS) {
                lock->l_policy_data.l_inodebits.try_bits =
+               lock->l_policy_data.l_inodebits.li_gid =
+                       dlm_req->lock_desc.l_policy_data.l_inodebits.li_gid;
+       }
        cookie = req;