From 2b8b57b4f353c6cb58a654eda518c9b418457371 Mon Sep 17 00:00:00 2001 From: Aurelien Degremont Date: Tue, 20 Feb 2024 12:46:03 +0100 Subject: [PATCH] LU-17566 mdt: remove duplicate call to mdt_init_ucred_reint() Remove duplicate call to mdt_init_ucred_reint() from mdt_reint_setxattr(). mdt_init_ucred_reint() is called in mdt_reint_internal() which is covering all actual reinters. However, SETXATTR was converted to reinters framework in fd908da and this call was not removed. So mdt_init_ucred_reint() is called first in mdt_reint_internal() then again in the specific mdt_reint_setxattr() handler, without anything special being done on the ucred between them. Also merge __mdt_init_ucred() and mdt_init_cred() which was called only once, and with the same prototype. Lustre-change: https://review.whamcloud.com/54111 Lustre-commit: 65e0802f2ada98f802d01b5672bb9349ad0dde8c Signed-off-by: Aurelien Degremont Change-Id: I90fed1d2709edf7337a27dd9c3cb0f75f7625135 Reviewed-on: https://review.whamcloud.com/c/ex/lustre-release/+/54368 Reviewed-by: Sebastien Buisson Reviewed-by: Andreas Dilger Tested-by: jenkins Tested-by: Maloo --- lustre/mdt/mdt_lib.c | 8 +------- lustre/mdt/mdt_xattr.c | 4 ---- 2 files changed, 1 insertion(+), 11 deletions(-) diff --git a/lustre/mdt/mdt_lib.c b/lustre/mdt/mdt_lib.c index 2e04115..2ad11c8 100644 --- a/lustre/mdt/mdt_lib.c +++ b/lustre/mdt/mdt_lib.c @@ -624,8 +624,7 @@ static int old_init_ucred_reint(struct mdt_thread_info *info) RETURN(rc); } -static inline int __mdt_init_ucred(struct mdt_thread_info *info, - struct mdt_body *body) +int mdt_init_ucred(struct mdt_thread_info *info, struct mdt_body *body) { struct ptlrpc_request *req = mdt_info_req(info); struct lu_ucred *uc = mdt_ucred(info); @@ -642,11 +641,6 @@ static inline int __mdt_init_ucred(struct mdt_thread_info *info, return new_init_ucred(info, BODY_INIT, body); } -int mdt_init_ucred(struct mdt_thread_info *info, struct mdt_body *body) -{ - return __mdt_init_ucred(info, body); -} - int mdt_init_ucred_reint(struct mdt_thread_info *info) { struct ptlrpc_request *req = mdt_info_req(info); diff --git a/lustre/mdt/mdt_xattr.c b/lustre/mdt/mdt_xattr.c index 2a6ffa1..f1b2d98 100644 --- a/lustre/mdt/mdt_xattr.c +++ b/lustre/mdt/mdt_xattr.c @@ -561,10 +561,6 @@ int mdt_reint_setxattr(struct mdt_thread_info *info, if (OBD_FAIL_CHECK(OBD_FAIL_MDS_SETXATTR)) RETURN(err_serious(-ENOMEM)); - rc = mdt_init_ucred_reint(info); - if (rc != 0) - RETURN(rc); - if (strncmp(xattr_name, XATTR_USER_PREFIX, sizeof(XATTR_USER_PREFIX) - 1) == 0) { if (!(exp_connect_flags(req->rq_export) & OBD_CONNECT_XATTR)) -- 1.8.3.1