diff options
author | Steve French <stfrench@microsoft.com> | 2024-04-07 06:16:08 +0200 |
---|---|---|
committer | Steve French <stfrench@microsoft.com> | 2024-04-11 23:02:02 +0200 |
commit | 28e0947651ce6a2200b9a7eceb93282e97d7e51a (patch) | |
tree | 4431f896b80d8f2eca5695574f680b4d0cd6989f /fs | |
parent | smb: client: fix NULL ptr deref in cifs_mark_open_handles_for_deleted_file() (diff) | |
download | linux-28e0947651ce6a2200b9a7eceb93282e97d7e51a.tar.xz linux-28e0947651ce6a2200b9a7eceb93282e97d7e51a.zip |
smb3: fix Open files on server counter going negative
We were decrementing the count of open files on server twice
for the case where we were closing cached directories.
Fixes: 8e843bf38f7b ("cifs: return a single-use cfid if we did not get a lease")
Cc: stable@vger.kernel.org
Acked-by: Bharath SM <bharathsm@microsoft.com>
Signed-off-by: Steve French <stfrench@microsoft.com>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/smb/client/cached_dir.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/smb/client/cached_dir.c b/fs/smb/client/cached_dir.c index 13a9d7acf8f8..0ff2491c311d 100644 --- a/fs/smb/client/cached_dir.c +++ b/fs/smb/client/cached_dir.c @@ -433,8 +433,8 @@ smb2_close_cached_fid(struct kref *ref) if (cfid->is_open) { rc = SMB2_close(0, cfid->tcon, cfid->fid.persistent_fid, cfid->fid.volatile_fid); - if (rc != -EBUSY && rc != -EAGAIN) - atomic_dec(&cfid->tcon->num_remote_opens); + if (rc) /* should we retry on -EBUSY or -EAGAIN? */ + cifs_dbg(VFS, "close cached dir rc %d\n", rc); } free_cached_dir(cfid); |