]> git.proxmox.com Git - mirror_ubuntu-focal-kernel.git/commit
cifs: don't leak -EAGAIN for stat() during reconnect
authorRonnie Sahlberg <lsahlber@redhat.com>
Tue, 18 Feb 2020 20:01:03 +0000 (06:01 +1000)
committerPaolo Pisati <paolo.pisati@canonical.com>
Fri, 13 Mar 2020 12:26:55 +0000 (13:26 +0100)
commit38f528de4a17607161f692bfa4c714ce59fb9736
tree3792b1d6a624da1a1d329206734c2c4a99704de5
parent09d703cb725fb836ba237f0b069f80108fe18858
cifs: don't leak -EAGAIN for stat() during reconnect

BugLink: https://bugs.launchpad.net/bugs/1867178
commit fc513fac56e1b626ae48a74d7551d9c35c50129e upstream.

If from cifs_revalidate_dentry_attr() the SMB2/QUERY_INFO call fails with an
error, such as STATUS_SESSION_EXPIRED, causing the session to be reconnected
it is possible we will leak -EAGAIN back to the application even for
system calls such as stat() where this is not a valid error.

Fix this by re-trying the operation from within cifs_revalidate_dentry_attr()
if cifs_get_inode_info*() returns -EAGAIN.

This fixes stat() and possibly also other system calls that uses
cifs_revalidate_dentry*().

Signed-off-by: Ronnie Sahlberg <lsahlber@redhat.com>
Signed-off-by: Steve French <stfrench@microsoft.com>
Reviewed-by: Pavel Shilovsky <pshilov@microsoft.com>
Reviewed-by: Aurelien Aptel <aaptel@suse.com>
CC: Stable <stable@vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
fs/cifs/inode.c