From patchwork Tue Feb 15 23:05:18 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Trond Myklebust X-Patchwork-Id: 12747708 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id E189CC433F5 for ; Tue, 15 Feb 2022 23:11:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229729AbiBOXL6 (ORCPT ); Tue, 15 Feb 2022 18:11:58 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:46776 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238786AbiBOXL5 (ORCPT ); Tue, 15 Feb 2022 18:11:57 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DC2D013CF6 for ; Tue, 15 Feb 2022 15:11:46 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 6641161502 for ; Tue, 15 Feb 2022 23:11:46 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9AA7FC340F0 for ; Tue, 15 Feb 2022 23:11:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1644966705; bh=UCn/QnjNhOcTDfq8uqDXDR/GNHqDfhklFjWfMyBMeV8=; h=From:To:Subject:Date:In-Reply-To:References:From; b=lrOcH27EOdlPgor7/m8dqXGmS2FbjDbdQAUL4RLGDwS4hSDBtiMsz2DES0+lFhaz+ s/WEA105TMeFjIyhbA2vFtiNkFV9lMCIqjigyb4iNHcNecgH9q9fchLo+mx52EY8ZU 2TPL3bHHSY0pBA7YvEl7mny0CmJm05HiZd05Ro6ZfykT7nMfopiabVxxRjNPM6BbTO CWViNlX/EhXNsWp6wVBGbCxyY0QXpkzLyPKboJy8XAdp7dxx4ZYvE7/WjsFqFP3jye UDO4KvVisrEareG4bOKyhYj3huKFdAne7KXiadStYBBIl6Z6kCfeyjwrQmCQcCv5t2 rZoCX6ezrtSdg== From: trondmy@kernel.org To: linux-nfs@vger.kernel.org Subject: [PATCH 2/2] NFS: Do not report writeback errors in nfs_getattr() Date: Tue, 15 Feb 2022 18:05:18 -0500 Message-Id: <20220215230518.24923-2-trondmy@kernel.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220215230518.24923-1-trondmy@kernel.org> References: <20220215230518.24923-1-trondmy@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org From: Trond Myklebust The result of the writeback, whether it is an ENOSPC or an EIO, or anything else, does not inhibit the NFS client from reporting the correct file timestamps. Fixes: 79566ef018f5 ("NFS: Getattr doesn't require data sync semantics") Signed-off-by: Trond Myklebust --- fs/nfs/inode.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/fs/nfs/inode.c b/fs/nfs/inode.c index 90432fc389a0..f9fc506ebb29 100644 --- a/fs/nfs/inode.c +++ b/fs/nfs/inode.c @@ -850,12 +850,9 @@ int nfs_getattr(struct user_namespace *mnt_userns, const struct path *path, } /* Flush out writes to the server in order to update c/mtime. */ - if ((request_mask & (STATX_CTIME|STATX_MTIME)) && - S_ISREG(inode->i_mode)) { - err = filemap_write_and_wait(inode->i_mapping); - if (err) - goto out; - } + if ((request_mask & (STATX_CTIME | STATX_MTIME)) && + S_ISREG(inode->i_mode)) + filemap_write_and_wait(inode->i_mapping); /* * We may force a getattr if the user cares about atime.