All of lore.kernel.org
 help / color / mirror / Atom feed
* FAILED: patch "[PATCH] CIFS: Force revalidate inode when dentry is stale" failed to apply to 4.4-stable tree
@ 2019-10-14 16:17 gregkh
  2019-10-15  3:14 ` Sasha Levin
  0 siblings, 1 reply; 2+ messages in thread
From: gregkh @ 2019-10-14 16:17 UTC (permalink / raw)
  To: piastryyy, pshilov, stable, stfrench; +Cc: stable


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 <stable@vger.kernel.org>.

thanks,

greg k-h

------------------ original commit in Linus's tree ------------------

From c82e5ac7fe3570a269c0929bf7899f62048e7dbc Mon Sep 17 00:00:00 2001
From: Pavel Shilovsky <piastryyy@gmail.com>
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.

Cc: <stable@vger.kernel.org>
Signed-off-by: Pavel Shilovsky <pshilov@microsoft.com>
Signed-off-by: Steve French <stfrench@microsoft.com>

diff --git a/fs/cifs/inode.c b/fs/cifs/inode.c
index 3bae2e53f0b8..5dcc95b38310 100644
--- a/fs/cifs/inode.c
+++ b/fs/cifs/inode.c
@@ -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;
 		}


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: FAILED: patch "[PATCH] CIFS: Force revalidate inode when dentry is stale" failed to apply to 4.4-stable tree
  2019-10-14 16:17 FAILED: patch "[PATCH] CIFS: Force revalidate inode when dentry is stale" failed to apply to 4.4-stable tree gregkh
@ 2019-10-15  3:14 ` Sasha Levin
  0 siblings, 0 replies; 2+ messages in thread
From: Sasha Levin @ 2019-10-15  3:14 UTC (permalink / raw)
  To: gregkh; +Cc: piastryyy, pshilov, stable, stfrench

On Mon, Oct 14, 2019 at 06:17:29PM +0200, gregkh@linuxfoundation.org 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 <stable@vger.kernel.org>.
>
>thanks,
>
>greg k-h
>
>------------------ original commit in Linus's tree ------------------
>
>From c82e5ac7fe3570a269c0929bf7899f62048e7dbc Mon Sep 17 00:00:00 2001
>From: Pavel Shilovsky <piastryyy@gmail.com>
>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.
>
>Cc: <stable@vger.kernel.org>
>Signed-off-by: Pavel Shilovsky <pshilov@microsoft.com>
>Signed-off-by: Steve French <stfrench@microsoft.com>

I also took a108471b5730b ("cifs: Check uniqueid for SMB2+ and return
-ESTALE if necessary") and queued both for 4.4.

-- 
Thanks,
Sasha

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-10-15  3:14 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-10-14 16:17 FAILED: patch "[PATCH] CIFS: Force revalidate inode when dentry is stale" failed to apply to 4.4-stable tree gregkh
2019-10-15  3:14 ` Sasha Levin

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.