aboutsummaryrefslogtreecommitdiffstats
path: root/fs/cifs/cifsglob.h
diff options
context:
space:
mode:
authorShirish Pargaonkar <shirishpargaonkar@gmail.com>2012-05-21 09:20:12 -0500
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-06-10 00:32:58 +0900
commit93b71523531161bfdd2ac30dd1ea4bb70d1708bd (patch)
tree867f54842fcd7f4a303318afc6e0c2b2cb8f9ef2 /fs/cifs/cifsglob.h
parente48fdd4d095a5340bb88374bbbfa6b72625ab0c1 (diff)
downloadkernel_samsung_smdk4412-93b71523531161bfdd2ac30dd1ea4bb70d1708bd.zip
kernel_samsung_smdk4412-93b71523531161bfdd2ac30dd1ea4bb70d1708bd.tar.gz
kernel_samsung_smdk4412-93b71523531161bfdd2ac30dd1ea4bb70d1708bd.tar.bz2
cifs: fix oops while traversing open file list (try #4)
commit 2c0c2a08bed7a3b791f88d09d16ace56acb3dd98 upstream. While traversing the linked list of open file handles, if the identfied file handle is invalid, a reopen is attempted and if it fails, we resume traversing where we stopped and cifs can oops while accessing invalid next element, for list might have changed. So mark the invalid file handle and attempt reopen if no valid file handle is found in rest of the list. If reopen fails, move the invalid file handle to the end of the list and start traversing the list again from the begining. Repeat this four times before giving up and returning an error if file reopen keeps failing. Signed-off-by: Shirish Pargaonkar <shirishpargaonkar@gmail.com> Reviewed-by: Jeff Layton <jlayton@redhat.com> Signed-off-by: Steve French <sfrench@us.ibm.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'fs/cifs/cifsglob.h')
-rw-r--r--fs/cifs/cifsglob.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/fs/cifs/cifsglob.h b/fs/cifs/cifsglob.h
index 6255fa8..7cb9dd2 100644
--- a/fs/cifs/cifsglob.h
+++ b/fs/cifs/cifsglob.h
@@ -43,6 +43,7 @@
#define CIFS_MIN_RCV_POOL 4
+#define MAX_REOPEN_ATT 5 /* these many maximum attempts to reopen a file */
/*
* default attribute cache timeout (jiffies)
*/