[PATCH] cifs: fix rare oops in cifs_close
Protect access to cifs file list in cifs_close path
Signed-off-by: Steve French (sfrench@us.ibm.com)
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
diff --git a/fs/cifs/file.c b/fs/cifs/file.c
index dcab7cf..9c77550 100644
--- a/fs/cifs/file.c
+++ b/fs/cifs/file.c
@@ -465,8 +465,10 @@
write_lock(&file->f_owner.lock);
}
}
+ write_lock(&GlobalSMBSeslock);
list_del(&pSMBFile->flist);
list_del(&pSMBFile->tlist);
+ write_unlock(&GlobalSMBSeslock);
write_unlock(&file->f_owner.lock);
kfree(pSMBFile->search_resume_name);
kfree(file->private_data);