[lustre-devel] [PATCH 5/9] lustre: ldlm: don't change GROUP lock GID on client

James Simmons jsimmons at infradead.org
Mon Feb 8 16:54:23 PST 2021


From: Mikhail Pershin <mpershin at whamcloud.com>

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
response.

WC-bug-id: https://jira.whamcloud.com/browse/LU-14312
Lustre-commit: da18ad5628556cb ("LU-14312 ldlm: don't change GROUP lock GID on client")
Signed-off-by: Mikhail Pershin <mpershin at whamcloud.com>
Reviewed-on: https://review.whamcloud.com/41268
Reviewed-by: Andreas Dilger <adilger at whamcloud.com>
Reviewed-by: Oleg Drokin <green at whamcloud.com>
Signed-off-by: James Simmons <jsimmons at infradead.org>
---
 fs/lustre/ldlm/ldlm_inodebits.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/fs/lustre/ldlm/ldlm_inodebits.c b/fs/lustre/ldlm/ldlm_inodebits.c
index a367ff1..32de9b9 100644
--- a/fs/lustre/ldlm/ldlm_inodebits.c
+++ b/fs/lustre/ldlm/ldlm_inodebits.c
@@ -59,7 +59,10 @@ 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 and li_gid are to be handled outside of generic
+	 * write_to_local due to different behavior on a server and client.
+	 */
 }
 
 void ldlm_ibits_policy_local_to_wire(const union ldlm_policy_data *lpolicy,
-- 
1.8.3.1



More information about the lustre-devel mailing list