]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit
CIFS: Gracefully handle QueryInfo errors during open
authorPavel Shilovsky <piastryyy@gmail.com>
Mon, 30 Sep 2019 17:06:18 +0000 (10:06 -0700)
committerStefan Bader <stefan.bader@canonical.com>
Tue, 12 Nov 2019 18:04:36 +0000 (19:04 +0100)
commitd3498bc11fce8bfda0e9297f11d07621b93330fd
tree22a5dacc0f473b2c705ab312090b9c60182aa557
parentc4ab4c967945c65ee72bd177cbef456425a707cc
CIFS: Gracefully handle QueryInfo errors during open

BugLink: https://bugs.launchpad.net/bugs/1850541
commit 30573a82fb179420b8aac30a3a3595aa96a93156 upstream.

Currently if the client identifies problems when processing
metadata returned in CREATE response, the open handle is being
leaked. This causes multiple problems like a file missing a lease
break by that client which causes high latencies to other clients
accessing the file. Another side-effect of this is that the file
can't be deleted.

Fix this by closing the file after the client hits an error after
the file was opened and the open descriptor wasn't returned to
the user space. Also convert -ESTALE to -EOPENSTALE to allow
the VFS to revalidate a dentry and retry the open.

Cc: <stable@vger.kernel.org>
Signed-off-by: Pavel Shilovsky <pshilov@microsoft.com>
Signed-off-by: Steve French <stfrench@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
fs/cifs/file.c