FAILED: patch "[PATCH] CIFS: Force revalidate inode when dentry is stale" failed to apply to 4.4-stable tree
[email protected]
maintainerThe patch below does not apply to the 4.4-stable tree.
If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to <[email protected]>.
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
From c82e5ac7fe3570a269c0929bf7899f62048e7dbc Mon Sep 17 00:00:00 2001
From: Pavel Shilovsky <[email protected]>
Date: Mon, 30 Sep 2019 10:06:19 -0700
Subject: [PATCH] CIFS: Force revalidate inode when dentry is stale
Currently the client indicates that a dentry is stale when inode numbers or type types between a local inode and a remote file don't match. If this is the case attributes is not being copied from remote to local, so, it is already known that the local copy has stale metadata. That's why the inode needs to be marked for revalidation in order to tell the VFS to lookup the dentry again before openning a file. This prevents unexpected stale errors to be returned to the user space when openning a file.
fs/cifs/inode.c +4 -0
@@ -414,6 +414,7 @@ int cifs_get_inode_info_unix(struct inode **pinode,/* if uniqueid is different, return error */ if (unlikely (cifs_sb->mnt_cifs_flags &CIFS_MOUNT_SERVER_INUM &&CIFS_I (*pinode)->uniqueid != fattr.cf_uniqueid)) { +CIFS_I (*pinode)->time =0 ;/* force reval */ rc = -ESTALE ; goto cgiiu_exit; }
@@ -421,6 +422,7 @@ int cifs_get_inode_info_unix(struct inode **pinode,/* if filetype is different, return error */ if (unlikely (((*pinode)->i_mode &S_IFMT ) != (fattr.cf_mode &S_IFMT ))) { +CIFS_I (*pinode)->time =0 ;/* force reval */ rc = -ESTALE ; goto cgiiu_exit; }
@@ -933,6 +935,7 @@ cifs_get_inode_info(struct inode **inode, const char *full_path,/* if uniqueid is different, return error */ if (unlikely (cifs_sb->mnt_cifs_flags &CIFS_MOUNT_SERVER_INUM &&CIFS_I (*inode)->uniqueid != fattr.cf_uniqueid)) { +CIFS_I (*inode)->time =0 ;/* force reval */ rc = -ESTALE ; goto cgii_exit; }
@@ -940,6 +943,7 @@ cifs_get_inode_info(struct inode **inode, const char *full_path,/* if filetype is different, return error */ if (unlikely (((*inode)->i_mode &S_IFMT ) != (fattr.cf_mode &S_IFMT ))) { +CIFS_I (*inode)->time =0 ;/* force reval */ rc = -ESTALE ; goto cgii_exit; }
Sasha Levin
maintainerQuoted 26 lines · On Mon, Oct 14, 2019 at 06:17:29PM +0200, [email protected] wrote:
The patch below does not apply to the 4.4-stable tree.
If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to <[email protected]>.thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
From
c82e5ac7fe3570a269c0929bf7899f62048e7dbcMon Sep 17 00:00:00 2001
From: Pavel Shilovsky <[email protected]>
Date: Mon, 30 Sep 2019 10:06:19 -0700
Subject: [PATCH] CIFS: Force revalidate inode when dentry is staleCurrently the client indicates that a dentry is stale when inode numbers or type types between a local inode and a remote file don't match. If this is the case attributes is not being copied from remote to local, so, it is already known that the local copy has stale metadata. That's why the inode needs to be marked for revalidation in order to tell the VFS to lookup the dentry again before openning a file. This prevents unexpected stale errors to be returned to the user space when openning a file.
Quoted 3 lines
Cc <[email protected]>Signed-off-by Pavel Shilovsky <[email protected]>Signed-off-by Steve French <[email protected]>
I also took a108471b5730b ("cifs: Check uniqueid for SMB2+ and return -ESTALE if necessary") and queued both for 4.4.
Signature · 2 lines
Thanks, Sasha