]> git.baikalelectronics.ru Git - kernel.git/commitdiff
NFS: Do not report writeback errors in nfs_getattr()
authorTrond Myklebust <trond.myklebust@hammerspace.com>
Tue, 15 Feb 2022 23:05:18 +0000 (18:05 -0500)
committerAnna Schumaker <Anna.Schumaker@Netapp.com>
Wed, 16 Feb 2022 20:15:22 +0000 (15:15 -0500)
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: fcfc2c4f0b9c ("NFS: Getattr doesn't require data sync semantics")
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
fs/nfs/inode.c

index a918c3a834b6b7a72bee8ef3d151497e6ea7d752..d96baa4450e3953d689e8f59cc93aae0585393a4 100644 (file)
@@ -853,12 +853,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.