From mboxrd@z Thu Jan 1 00:00:00 1970 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=-9.2 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, 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 C01C1C282DD for ; Thu, 18 Apr 2019 18:42:50 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 9273121872 for ; Thu, 18 Apr 2019 18:42:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1555612970; bh=fW6/gSecN9rL9T6eaX9s2wiLHRJ7o1d/JZYNU9JEKBM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=EJ79io6exTAeSfx4F5TuClfG+y7wbSkypiVRvA9nkNtxw2QGGqB4QnnAl7EbO2Wr4 DdspL/7GZbb1Sx0nT01UZXd0lx5vHt3B4LCq9SI/AfhTCYoGtDSnJNBEiSREL/jEtA q6MgJoU0tNEosprQiRbhtyL9q3fvQgn+7KobF/E0= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389969AbfDRSmt (ORCPT ); Thu, 18 Apr 2019 14:42:49 -0400 Received: from mail.kernel.org ([198.145.29.99]:60632 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389900AbfDRSmt (ORCPT ); Thu, 18 Apr 2019 14:42:49 -0400 Received: from localhost.localdomain (unknown [24.213.116.99]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 14A882064A; Thu, 18 Apr 2019 18:42:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1555612968; bh=fW6/gSecN9rL9T6eaX9s2wiLHRJ7o1d/JZYNU9JEKBM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=GSjAxcvHmB8DuG6aGtbe8FmpiIJWsJx3OjFja6vYD1vQ3twlSnTsVWfZ/e4IE+UDe gVj8CgyAEhAyGs0JLIZZPTozJElp09FBts5mwUzQsR+MJyCxVtOXKh51c9wBRpcuSO NgGmSL8Jw+ILS+YSuvVQ2Cm1/2wKo8U+zlCcnkyE= From: hubcap@kernel.org To: linux-fsdevel@vger.kernel.org, christoph@lameter.com Cc: Martin Brandenburg , Mike Marshall Subject: [PATCH 04/22] orangefs: update attributes rather than relying on server Date: Thu, 18 Apr 2019 14:40:56 -0400 Message-Id: <20190418184113.9152-5-hubcap@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190418184113.9152-1-hubcap@kernel.org> References: <20190418184113.9152-1-hubcap@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org From: Martin Brandenburg This should be a no-op now, but once inode writeback works, it'll be necessary to have the correct attribute in the dirty inode. Previously the attribute fetch timeout was marked invalid and the server provided the updated attribute. When the inode is dirty, the server cannot be consulted since it does not yet know the pending setattr. Signed-off-by: Martin Brandenburg Signed-off-by: Mike Marshall --- fs/orangefs/file.c | 10 ++-------- fs/orangefs/namei.c | 7 ++++++- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/fs/orangefs/file.c b/fs/orangefs/file.c index b0688ea894a4..a9e69c56d2fb 100644 --- a/fs/orangefs/file.c +++ b/fs/orangefs/file.c @@ -327,14 +327,8 @@ static ssize_t do_readv_writev(enum ORANGEFS_io_type type, struct file *file, file_accessed(file); } else { file_update_time(file); - /* - * Must invalidate to ensure write loop doesn't - * prevent kernel from reading updated - * attribute. Size probably changed because of - * the write, and other clients could update - * any other attribute. - */ - orangefs_inode->getattr_time = jiffies - 1; + if (*offset > i_size_read(inode)) + i_size_write(inode, *offset); } } diff --git a/fs/orangefs/namei.c b/fs/orangefs/namei.c index 87584d79ca7a..140314b76e10 100644 --- a/fs/orangefs/namei.c +++ b/fs/orangefs/namei.c @@ -383,6 +383,7 @@ static int orangefs_rename(struct inode *old_dir, unsigned int flags) { struct orangefs_kernel_op_s *new_op; + struct iattr iattr; int ret; if (flags) @@ -392,7 +393,11 @@ static int orangefs_rename(struct inode *old_dir, "orangefs_rename: called (%pd2 => %pd2) ct=%d\n", old_dentry, new_dentry, d_count(new_dentry)); - ORANGEFS_I(new_dentry->d_parent->d_inode)->getattr_time = jiffies - 1; + new_dir->i_mtime = new_dir->i_ctime = current_time(new_dir); + memset(&iattr, 0, sizeof iattr); + iattr.ia_valid |= ATTR_MTIME; + orangefs_inode_setattr(new_dir, &iattr); + mark_inode_dirty_sync(new_dir); new_op = op_alloc(ORANGEFS_VFS_OP_RENAME); if (!new_op) -- 2.20.1