diff --git a/fs/cifs/cifsglob.h b/fs/cifs/cifsglob.h index d78bfcc19156..10cb4d4fb122 100644 --- a/fs/cifs/cifsglob.h +++ b/fs/cifs/cifsglob.h @@ -1548,6 +1548,7 @@ struct mid_q_entry { }; struct close_cancelled_open { + __u64 mid; struct cifs_fid fid; struct cifs_tcon *tcon; struct work_struct work; diff --git a/fs/cifs/smb2misc.c b/fs/cifs/smb2misc.c index e311f58dc1c8..6120c307d88e 100644 --- a/fs/cifs/smb2misc.c +++ b/fs/cifs/smb2misc.c @@ -735,12 +735,19 @@ smb2_cancelled_close_fid(struct work_struct *work) { struct close_cancelled_open *cancelled = container_of(work, struct close_cancelled_open, work); + struct cifs_tcon *tcon = cancelled->tcon; + int rc; - cifs_dbg(VFS, "Close unmatched open\n"); + cifs_tcon_dbg(VFS, "Close unmatched open for MID:%llx\n", + cancelled->mid); - SMB2_close(0, cancelled->tcon, cancelled->fid.persistent_fid, - cancelled->fid.volatile_fid); - cifs_put_tcon(cancelled->tcon); + rc = SMB2_close(0, tcon, cancelled->fid.persistent_fid, + cancelled->fid.volatile_fid); + if (rc) { + cifs_tcon_dbg(VFS, "Close cancelled mid failed with rc:%d\n", rc); + } + + cifs_put_tcon(tcon); kfree(cancelled); } @@ -770,6 +777,7 @@ smb2_handle_cancelled_mid(char *buffer, struct TCP_Server_Info *server) cancelled->fid.persistent_fid = rsp->PersistentFileId; cancelled->fid.volatile_fid = rsp->VolatileFileId; cancelled->tcon = tcon; + cancelled->mid = sync_hdr->MessageId; INIT_WORK(&cancelled->work, smb2_cancelled_close_fid); queue_work(cifsiod_wq, &cancelled->work);