Skip to content

Commit 28e0947

Browse files
committed
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: 8e843bf ("cifs: return a single-use cfid if we did not get a lease") Cc: [email protected] Acked-by: Bharath SM <[email protected]> Signed-off-by: Steve French <[email protected]>
1 parent ec4535b commit 28e0947

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

fs/smb/client/cached_dir.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -433,8 +433,8 @@ smb2_close_cached_fid(struct kref *ref)
433433
if (cfid->is_open) {
434434
rc = SMB2_close(0, cfid->tcon, cfid->fid.persistent_fid,
435435
cfid->fid.volatile_fid);
436-
if (rc != -EBUSY && rc != -EAGAIN)
437-
atomic_dec(&cfid->tcon->num_remote_opens);
436+
if (rc) /* should we retry on -EBUSY or -EAGAIN? */
437+
cifs_dbg(VFS, "close cached dir rc %d\n", rc);
438438
}
439439

440440
free_cached_dir(cfid);

0 commit comments

Comments
 (0)