summaryrefslogtreecommitdiffstats
path: root/fs/smb/client/smb2ops.c
diff options
context:
space:
mode:
authorRitvik Budhiraja <rbudhiraja@microsoft.com>2024-04-02 14:01:28 -0500
committerSteve French <stfrench@microsoft.com>2024-04-03 14:43:24 -0500
commit173217bd73365867378b5e75a86f0049e1069ee8 (patch)
tree4357a373f7c39bbd02b98fa3f20aec7089f1cd0b /fs/smb/client/smb2ops.c
parent93cee45ccfebc62a3bb4cd622b89e00c8c7d8493 (diff)
downloadlinux-stable-173217bd73365867378b5e75a86f0049e1069ee8.tar.gz
linux-stable-173217bd73365867378b5e75a86f0049e1069ee8.tar.bz2
linux-stable-173217bd73365867378b5e75a86f0049e1069ee8.zip
smb3: retrying on failed server close
In the current implementation, CIFS close sends a close to the server and does not check for the success of the server close. This patch adds functionality to check for server close return status and retries in case of an EBUSY or EAGAIN error. This can help avoid handle leaks Cc: stable@vger.kernel.org Signed-off-by: Ritvik Budhiraja <rbudhiraja@microsoft.com> Signed-off-by: Steve French <stfrench@microsoft.com>
Diffstat (limited to 'fs/smb/client/smb2ops.c')
-rw-r--r--fs/smb/client/smb2ops.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/fs/smb/client/smb2ops.c b/fs/smb/client/smb2ops.c
index 35bf7eb315cd..87b63f6ad2e2 100644
--- a/fs/smb/client/smb2ops.c
+++ b/fs/smb/client/smb2ops.c
@@ -1412,14 +1412,14 @@ smb2_set_fid(struct cifsFileInfo *cfile, struct cifs_fid *fid, __u32 oplock)
memcpy(cfile->fid.create_guid, fid->create_guid, 16);
}
-static void
+static int
smb2_close_file(const unsigned int xid, struct cifs_tcon *tcon,
struct cifs_fid *fid)
{
- SMB2_close(xid, tcon, fid->persistent_fid, fid->volatile_fid);
+ return SMB2_close(xid, tcon, fid->persistent_fid, fid->volatile_fid);
}
-static void
+static int
smb2_close_getattr(const unsigned int xid, struct cifs_tcon *tcon,
struct cifsFileInfo *cfile)
{
@@ -1430,7 +1430,7 @@ smb2_close_getattr(const unsigned int xid, struct cifs_tcon *tcon,
rc = __SMB2_close(xid, tcon, cfile->fid.persistent_fid,
cfile->fid.volatile_fid, &file_inf);
if (rc)
- return;
+ return rc;
inode = d_inode(cfile->dentry);
@@ -1459,6 +1459,7 @@ smb2_close_getattr(const unsigned int xid, struct cifs_tcon *tcon,
/* End of file and Attributes should not have to be updated on close */
spin_unlock(&inode->i_lock);
+ return rc;
}
static int