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

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
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -2010,14 +2010,14 @@ int nfs_atomic_open(struct inode *dir, struct dentry *dentry,
	if (!res) {
		inode = d_inode(dentry);
		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);
		else if (inode && S_ISREG(inode->i_mode))
			res = ERR_PTR(-EOPENSTALE);
	} else if (!IS_ERR(res)) {
		inode = d_inode(res);
		if ((lookup_flags & LOOKUP_DIRECTORY) && inode &&
		    !S_ISDIR(inode->i_mode)) {
		    !(S_ISDIR(inode->i_mode) || S_ISLNK(inode->i_mode))) {
			dput(res);
			res = ERR_PTR(-ENOTDIR);
		} else if (inode && S_ISREG(inode->i_mode)) {
+3 −6
Original line number Diff line number Diff line
@@ -854,11 +854,8 @@ 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;
	}
	    S_ISREG(inode->i_mode))
		filemap_write_and_wait(inode->i_mapping);

	/*
	 * We may force a getattr if the user cares about atime.
+1 −2
Original line number Diff line number Diff line
@@ -1229,8 +1229,7 @@ nfs4_update_changeattr_locked(struct inode *inode,
				NFS_INO_INVALID_ACCESS | NFS_INO_INVALID_ACL |
				NFS_INO_INVALID_SIZE | NFS_INO_INVALID_OTHER |
				NFS_INO_INVALID_BLOCKS | NFS_INO_INVALID_NLINK |
				NFS_INO_INVALID_MODE | NFS_INO_INVALID_XATTR |
				NFS_INO_REVAL_PAGECACHE;
				NFS_INO_INVALID_MODE | NFS_INO_INVALID_XATTR;
		nfsi->attrtimeo = NFS_MINATTRTIMEO(inode);
	}
	nfsi->attrtimeo_timestamp = jiffies;