USB: imx21-hcd: refactor hardware data memory management
[deliverable/linux.git] / fs / cifs / misc.c
index 1394aa37f26c59c057baee608f55ff44ac3401d7..3ccadc1326d613171e92a8bd59bf48d02c12ffc2 100644 (file)
@@ -498,7 +498,6 @@ is_valid_oplock_break(struct smb_hdr *buf, struct TCP_Server_Info *srv)
        struct cifsTconInfo *tcon;
        struct cifsInodeInfo *pCifsInode;
        struct cifsFileInfo *netfile;
-       int rc;
 
        cFYI(1, "Checking for oplock break or dnotify response");
        if ((pSMB->hdr.Command == SMB_COM_NT_TRANSACT) &&
@@ -583,13 +582,18 @@ is_valid_oplock_break(struct smb_hdr *buf, struct TCP_Server_Info *srv)
                                pCifsInode->clientCanCacheAll = false;
                                if (pSMB->OplockLevel == 0)
                                        pCifsInode->clientCanCacheRead = false;
-                               rc = slow_work_enqueue(&netfile->oplock_break);
-                               if (rc) {
-                                       cERROR(1, "failed to enqueue oplock "
-                                                  "break: %d\n", rc);
-                               } else {
-                                       netfile->oplock_break_cancelled = false;
-                               }
+
+                               /*
+                                * cifs_oplock_break_put() can't be called
+                                * from here.  Get reference after queueing
+                                * succeeded.  cifs_oplock_break() will
+                                * synchronize using GlobalSMSSeslock.
+                                */
+                               if (queue_work(system_nrt_wq,
+                                              &netfile->oplock_break))
+                                       cifs_oplock_break_get(netfile);
+                               netfile->oplock_break_cancelled = false;
+
                                read_unlock(&GlobalSMBSeslock);
                                read_unlock(&cifs_tcp_ses_lock);
                                return true;
This page took 0.026312 seconds and 5 git commands to generate.