mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-04 10:12:16 +09:00
VFS: fix recent breakage of FS_REVAL_DOT
commit176306f59aupstream. Commit1f36f774b2broke FS_REVAL_DOT semantics. In particular, before this patch, the command ls -l in an NFS mounted directory would always check if the directory on the server had changed and if so would flush and refill the pagecache for the dir. After this patch, the same "ls -l" will repeatedly return stale date until the cached attributes for the directory time out. The following patch fixes this by ensuring the d_revalidate is called by do_last when "." is being looked-up. link_path_walk has already called d_revalidate, but in that case LOOKUP_OPEN is not set so nfs_lookup_verify_inode chooses not to do any validation. The following patch restores the original behaviour. Signed-off-by: NeilBrown <neilb@suse.de> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
9521ba4ae1
commit
b55e34571e
@@ -1620,6 +1620,7 @@ static struct file *do_last(struct nameidata *nd, struct path *path,
|
||||
case LAST_DOTDOT:
|
||||
follow_dotdot(nd);
|
||||
dir = nd->path.dentry;
|
||||
case LAST_DOT:
|
||||
if (nd->path.mnt->mnt_sb->s_type->fs_flags & FS_REVAL_DOT) {
|
||||
if (!dir->d_op->d_revalidate(dir, nd)) {
|
||||
error = -ESTALE;
|
||||
@@ -1627,7 +1628,6 @@ static struct file *do_last(struct nameidata *nd, struct path *path,
|
||||
}
|
||||
}
|
||||
/* fallthrough */
|
||||
case LAST_DOT:
|
||||
case LAST_ROOT:
|
||||
if (open_flag & O_CREAT)
|
||||
goto exit;
|
||||
|
||||
Reference in New Issue
Block a user