From patchwork Tue Feb 9 00:54:19 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Simmons X-Patchwork-Id: 12076925 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id BAC90C433E6 for ; Tue, 9 Feb 2021 00:54:36 +0000 (UTC) Received: from pdx1-mailman02.dreamhost.com (pdx1-mailman02.dreamhost.com [64.90.62.194]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 5818964E77 for ; Tue, 9 Feb 2021 00:54:36 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 5818964E77 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lustre-devel-bounces@lists.lustre.org Received: from pdx1-mailman02.dreamhost.com (localhost [IPv6:::1]) by pdx1-mailman02.dreamhost.com (Postfix) with ESMTP id 327DC30F9D6; Mon, 8 Feb 2021 16:54:35 -0800 (PST) Received: from smtp4.ccs.ornl.gov (smtp4.ccs.ornl.gov [160.91.203.40]) by pdx1-mailman02.dreamhost.com (Postfix) with ESMTP id A87EA30F758 for ; Mon, 8 Feb 2021 16:54:30 -0800 (PST) Received: from star.ccs.ornl.gov (star.ccs.ornl.gov [160.91.202.134]) by smtp4.ccs.ornl.gov (Postfix) with ESMTP id E9EB71006EB8; Mon, 8 Feb 2021 19:54:28 -0500 (EST) Received: by star.ccs.ornl.gov (Postfix, from userid 2004) id E2A384CC22; Mon, 8 Feb 2021 19:54:28 -0500 (EST) From: James Simmons To: Andreas Dilger , Oleg Drokin , NeilBrown Date: Mon, 8 Feb 2021 19:54:19 -0500 Message-Id: <1612832067-1449-2-git-send-email-jsimmons@infradead.org> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1612832067-1449-1-git-send-email-jsimmons@infradead.org> References: <1612832067-1449-1-git-send-email-jsimmons@infradead.org> Subject: [lustre-devel] [PATCH 1/9] lustre: llite: send file mode with rename RPC X-BeenThere: lustre-devel@lists.lustre.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "For discussing Lustre software development." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Lustre Development List MIME-Version: 1.0 Errors-To: lustre-devel-bounces@lists.lustre.org Sender: "lustre-devel" From: Andreas Dilger In preparation for parallel rename operations, send renamed file mode to the MDS in order to allow the rename locking to be more efficient. WC-bug-id: https://jira.whamcloud.com/browse/LU-12125 Lustre-commit: 47576dc68cd9006 ("LU-12125 llite: send file mode with rename RPC") Signed-off-by: Andreas Dilger Reviewed-on: https://review.whamcloud.com/41184 Reviewed-by: Lai Siyao Reviewed-by: Yingjin Qian Reviewed-by: Oleg Drokin Signed-off-by: James Simmons --- fs/lustre/llite/namei.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/fs/lustre/llite/namei.c b/fs/lustre/llite/namei.c index b24f097..1095fa9 100644 --- a/fs/lustre/llite/namei.c +++ b/fs/lustre/llite/namei.c @@ -1745,6 +1745,7 @@ static int ll_rename(struct inode *src, struct dentry *src_dchild, struct ll_sb_info *sbi = ll_i2sbi(src); struct md_op_data *op_data; ktime_t kstart = ktime_get(); + umode_t mode = 0; int err; if (flags) @@ -1762,7 +1763,13 @@ static int ll_rename(struct inode *src, struct dentry *src_dchild, if (err) return err; - op_data = ll_prep_md_op_data(NULL, src, tgt, NULL, 0, 0, + if (src_dchild->d_inode) + mode = src_dchild->d_inode->i_mode; + + if (tgt_dchild->d_inode) + mode = tgt_dchild->d_inode->i_mode; + + op_data = ll_prep_md_op_data(NULL, src, tgt, NULL, 0, mode, LUSTRE_OPC_ANY, NULL); if (IS_ERR(op_data)) return PTR_ERR(op_data);