Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6
[cascardo/linux.git] / fs / cifs / misc.c
index de6073c..c4e296f 100644 (file)
@@ -347,7 +347,7 @@ header_assemble(struct smb_hdr *buffer, char smb_command /* command */ ,
                                if (current_fsuid() != treeCon->ses->linux_uid) {
                                        cFYI(1, "Multiuser mode and UID "
                                                 "did not match tcon uid");
-                                       read_lock(&cifs_tcp_ses_lock);
+                                       spin_lock(&cifs_tcp_ses_lock);
                                        list_for_each(temp_item, &treeCon->ses->server->smb_ses_list) {
                                                ses = list_entry(temp_item, struct cifsSesInfo, smb_ses_list);
                                                if (ses->linux_uid == current_fsuid()) {
@@ -361,7 +361,7 @@ header_assemble(struct smb_hdr *buffer, char smb_command /* command */ ,
                                                        }
                                                }
                                        }
-                                       read_unlock(&cifs_tcp_ses_lock);
+                                       spin_unlock(&cifs_tcp_ses_lock);
                                }
                        }
                }
@@ -551,7 +551,7 @@ is_valid_oplock_break(struct smb_hdr *buf, struct TCP_Server_Info *srv)
                return false;
 
        /* look up tcon based on tid & uid */
-       read_lock(&cifs_tcp_ses_lock);
+       spin_lock(&cifs_tcp_ses_lock);
        list_for_each(tmp, &srv->smb_ses_list) {
                ses = list_entry(tmp, struct cifsSesInfo, smb_ses_list);
                list_for_each(tmp1, &ses->tcon_list) {
@@ -567,16 +567,6 @@ is_valid_oplock_break(struct smb_hdr *buf, struct TCP_Server_Info *srv)
                                if (pSMB->Fid != netfile->netfid)
                                        continue;
 
-                               /*
-                                * don't do anything if file is about to be
-                                * closed anyway.
-                                */
-                               if (netfile->closePend) {
-                                       spin_unlock(&cifs_file_list_lock);
-                                       read_unlock(&cifs_tcp_ses_lock);
-                                       return true;
-                               }
-
                                cFYI(1, "file id match, oplock break");
                                pCifsInode = CIFS_I(netfile->dentry->d_inode);
                                pCifsInode->clientCanCacheAll = false;
@@ -587,7 +577,7 @@ is_valid_oplock_break(struct smb_hdr *buf, struct TCP_Server_Info *srv)
                                 * cifs_oplock_break_put() can't be called
                                 * from here.  Get reference after queueing
                                 * succeeded.  cifs_oplock_break() will
-                                * synchronize using GlobalSMSSeslock.
+                                * synchronize using cifs_file_list_lock.
                                 */
                                if (queue_work(system_nrt_wq,
                                               &netfile->oplock_break))
@@ -595,16 +585,16 @@ is_valid_oplock_break(struct smb_hdr *buf, struct TCP_Server_Info *srv)
                                netfile->oplock_break_cancelled = false;
 
                                spin_unlock(&cifs_file_list_lock);
-                               read_unlock(&cifs_tcp_ses_lock);
+                               spin_unlock(&cifs_tcp_ses_lock);
                                return true;
                        }
                        spin_unlock(&cifs_file_list_lock);
-                       read_unlock(&cifs_tcp_ses_lock);
+                       spin_unlock(&cifs_tcp_ses_lock);
                        cFYI(1, "No matching file for oplock break");
                        return true;
                }
        }
-       read_unlock(&cifs_tcp_ses_lock);
+       spin_unlock(&cifs_tcp_ses_lock);
        cFYI(1, "Can not process oplock break for non-existent connection");
        return true;
 }