diff options
author | Steve French <sfrench@us.ibm.com> | 2008-04-15 22:40:48 +0400 |
---|---|---|
committer | Steve French <sfrench@us.ibm.com> | 2008-04-15 22:40:48 +0400 |
commit | 5d941ca628a142f44d7a2440fe919f8e8691f590 (patch) | |
tree | fb1028cc422187b2507f3830eac5dfc92c7eb29d /fs/cifs/transport.c | |
parent | e48d199ba10bb8267f491a3a585ca4a833e950a4 (diff) | |
download | linux-5d941ca628a142f44d7a2440fe919f8e8691f590.tar.xz |
[CIFS] Fix oops when slow oplock process races with unmount
If a tcon is being freed in call tconInfoFree, clean up any entries that may
exist in global oplock queue as the tcon structure hanging off of those entries
will be invalid and can cause oops while accesing any elements in the
tcon structure.
Signed-off-by: Shirish Pargaonkar <shirishp@us.ibm.com>
Signed-off-by: Steve French <sfrench@us.ibm.com>
Diffstat (limited to 'fs/cifs/transport.c')
-rw-r--r-- | fs/cifs/transport.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/fs/cifs/transport.c b/fs/cifs/transport.c index 3612d6c0a0bb..000ac509c98a 100644 --- a/fs/cifs/transport.c +++ b/fs/cifs/transport.c @@ -142,6 +142,24 @@ void DeleteOplockQEntry(struct oplock_q_entry *oplockEntry) kmem_cache_free(cifs_oplock_cachep, oplockEntry); } + +void DeleteTconOplockQEntries(struct cifsTconInfo *tcon) +{ + struct oplock_q_entry *temp; + + if (tcon == NULL) + return; + + spin_lock(&GlobalMid_Lock); + list_for_each_entry(temp, &GlobalOplock_Q, qhead) { + if ((temp->tcon) && (temp->tcon == tcon)) { + list_del(&temp->qhead); + kmem_cache_free(cifs_oplock_cachep, temp); + } + } + spin_unlock(&GlobalMid_Lock); +} + int smb_send(struct socket *ssocket, struct smb_hdr *smb_buffer, unsigned int smb_buf_length, struct sockaddr *sin) |