Commit 4f12b742 authored by Linus Torvalds's avatar Linus Torvalds

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()
parents 1c2a33d0 d19e0183
...@@ -2010,14 +2010,14 @@ int nfs_atomic_open(struct inode *dir, struct dentry *dentry, ...@@ -2010,14 +2010,14 @@ int nfs_atomic_open(struct inode *dir, struct dentry *dentry,
if (!res) { if (!res) {
inode = d_inode(dentry); inode = d_inode(dentry);
if ((lookup_flags & LOOKUP_DIRECTORY) && inode && if ((lookup_flags & LOOKUP_DIRECTORY) && inode &&
!S_ISDIR(inode->i_mode)) !(S_ISDIR(inode->i_mode) || S_ISLNK(inode->i_mode)))
res = ERR_PTR(-ENOTDIR); res = ERR_PTR(-ENOTDIR);
else if (inode && S_ISREG(inode->i_mode)) else if (inode && S_ISREG(inode->i_mode))
res = ERR_PTR(-EOPENSTALE); res = ERR_PTR(-EOPENSTALE);
} else if (!IS_ERR(res)) { } else if (!IS_ERR(res)) {
inode = d_inode(res); inode = d_inode(res);
if ((lookup_flags & LOOKUP_DIRECTORY) && inode && if ((lookup_flags & LOOKUP_DIRECTORY) && inode &&
!S_ISDIR(inode->i_mode)) { !(S_ISDIR(inode->i_mode) || S_ISLNK(inode->i_mode))) {
dput(res); dput(res);
res = ERR_PTR(-ENOTDIR); res = ERR_PTR(-ENOTDIR);
} else if (inode && S_ISREG(inode->i_mode)) { } else if (inode && S_ISREG(inode->i_mode)) {
......
...@@ -853,12 +853,9 @@ int nfs_getattr(struct user_namespace *mnt_userns, const struct path *path, ...@@ -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. */ /* Flush out writes to the server in order to update c/mtime. */
if ((request_mask & (STATX_CTIME|STATX_MTIME)) && if ((request_mask & (STATX_CTIME | STATX_MTIME)) &&
S_ISREG(inode->i_mode)) { S_ISREG(inode->i_mode))
err = filemap_write_and_wait(inode->i_mapping); filemap_write_and_wait(inode->i_mapping);
if (err)
goto out;
}
/* /*
* We may force a getattr if the user cares about atime. * We may force a getattr if the user cares about atime.
......
...@@ -1229,8 +1229,7 @@ nfs4_update_changeattr_locked(struct inode *inode, ...@@ -1229,8 +1229,7 @@ nfs4_update_changeattr_locked(struct inode *inode,
NFS_INO_INVALID_ACCESS | NFS_INO_INVALID_ACL | NFS_INO_INVALID_ACCESS | NFS_INO_INVALID_ACL |
NFS_INO_INVALID_SIZE | NFS_INO_INVALID_OTHER | NFS_INO_INVALID_SIZE | NFS_INO_INVALID_OTHER |
NFS_INO_INVALID_BLOCKS | NFS_INO_INVALID_NLINK | NFS_INO_INVALID_BLOCKS | NFS_INO_INVALID_NLINK |
NFS_INO_INVALID_MODE | NFS_INO_INVALID_XATTR | NFS_INO_INVALID_MODE | NFS_INO_INVALID_XATTR;
NFS_INO_REVAL_PAGECACHE;
nfsi->attrtimeo = NFS_MINATTRTIMEO(inode); nfsi->attrtimeo = NFS_MINATTRTIMEO(inode);
} }
nfsi->attrtimeo_timestamp = jiffies; nfsi->attrtimeo_timestamp = jiffies;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment