]> git.baikalelectronics.ru Git - kernel.git/commit
cifs: fix oops while traversing open file list (try #4)
authorShirish Pargaonkar <shirishpargaonkar@gmail.com>
Mon, 21 May 2012 14:20:12 +0000 (09:20 -0500)
committerPavel Shilovsky <pshilovsky@samba.org>
Wed, 23 May 2012 08:33:18 +0000 (12:33 +0400)
commitc157f4b588fa67e1addba498204c391c918c1e00
treefe41007499ec9b8371562a4aae78d9a6f6d29c89
parentfa29adc490ffe3d6ea6c799a1fab2ab11453e33a
cifs: fix oops while traversing open file list (try #4)

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.

Cc: <stable@vger.kernel.org>
Signed-off-by: Shirish Pargaonkar <shirishpargaonkar@gmail.com>
Reviewed-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: Steve French <sfrench@us.ibm.com>
fs/cifs/cifsglob.h
fs/cifs/file.c