Skip to content

Commit 4f12b74

Browse files
committed
Merge tag 'nfs-for-5.17-3' of git://git.linux-nfs.org/projects/anna/linux-nfs
Pull NFS client bugfixes from Anna Schumaker: - Fix unnecessary changeattr revalidations - Fix resolving symlinks during directory lookups - Don't report writeback errors in nfs_getattr() * tag 'nfs-for-5.17-3' of git://git.linux-nfs.org/projects/anna/linux-nfs: NFS: Do not report writeback errors in nfs_getattr() NFS: LOOKUP_DIRECTORY is also ok with symlinks NFS: Remove an incorrect revalidation in nfs4_update_changeattr_locked()
2 parents 1c2a33d + d19e018 commit 4f12b74

3 files changed

Lines changed: 6 additions & 10 deletions

File tree

fs/nfs/dir.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2010,14 +2010,14 @@ int nfs_atomic_open(struct inode *dir, struct dentry *dentry,
20102010
if (!res) {
20112011
inode = d_inode(dentry);
20122012
if ((lookup_flags & LOOKUP_DIRECTORY) && inode &&
2013-
!S_ISDIR(inode->i_mode))
2013+
!(S_ISDIR(inode->i_mode) || S_ISLNK(inode->i_mode)))
20142014
res = ERR_PTR(-ENOTDIR);
20152015
else if (inode && S_ISREG(inode->i_mode))
20162016
res = ERR_PTR(-EOPENSTALE);
20172017
} else if (!IS_ERR(res)) {
20182018
inode = d_inode(res);
20192019
if ((lookup_flags & LOOKUP_DIRECTORY) && inode &&
2020-
!S_ISDIR(inode->i_mode)) {
2020+
!(S_ISDIR(inode->i_mode) || S_ISLNK(inode->i_mode))) {
20212021
dput(res);
20222022
res = ERR_PTR(-ENOTDIR);
20232023
} else if (inode && S_ISREG(inode->i_mode)) {

fs/nfs/inode.c

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -853,12 +853,9 @@ int nfs_getattr(struct user_namespace *mnt_userns, const struct path *path,
853853
}
854854

855855
/* Flush out writes to the server in order to update c/mtime. */
856-
if ((request_mask & (STATX_CTIME|STATX_MTIME)) &&
857-
S_ISREG(inode->i_mode)) {
858-
err = filemap_write_and_wait(inode->i_mapping);
859-
if (err)
860-
goto out;
861-
}
856+
if ((request_mask & (STATX_CTIME | STATX_MTIME)) &&
857+
S_ISREG(inode->i_mode))
858+
filemap_write_and_wait(inode->i_mapping);
862859

863860
/*
864861
* We may force a getattr if the user cares about atime.

fs/nfs/nfs4proc.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1229,8 +1229,7 @@ nfs4_update_changeattr_locked(struct inode *inode,
12291229
NFS_INO_INVALID_ACCESS | NFS_INO_INVALID_ACL |
12301230
NFS_INO_INVALID_SIZE | NFS_INO_INVALID_OTHER |
12311231
NFS_INO_INVALID_BLOCKS | NFS_INO_INVALID_NLINK |
1232-
NFS_INO_INVALID_MODE | NFS_INO_INVALID_XATTR |
1233-
NFS_INO_REVAL_PAGECACHE;
1232+
NFS_INO_INVALID_MODE | NFS_INO_INVALID_XATTR;
12341233
nfsi->attrtimeo = NFS_MINATTRTIMEO(inode);
12351234
}
12361235
nfsi->attrtimeo_timestamp = jiffies;

0 commit comments

Comments
 (0)