]> git.baikalelectronics.ru Git - kernel.git/commit
cifs: don't call cifs_new_fileinfo unless cifs_open succeeds
authorJeff Layton <jlayton@redhat.com>
Wed, 16 Jun 2010 17:40:17 +0000 (13:40 -0400)
committerJeff Layton <jlayton@redhat.com>
Wed, 16 Jun 2010 17:40:17 +0000 (13:40 -0400)
commitdb87fd4811c87f5cb45857a6cec38cc26da5079c
tree2b4cc492dee33f47836b252a4a1819006e5d0644
parent39b83792e88739bae1d80486fb74889d90f03070
cifs: don't call cifs_new_fileinfo unless cifs_open succeeds

It's currently possible for cifs_open to fail after it has already
called cifs_new_fileinfo. In that situation, the new fileinfo will be
leaked as the caller doesn't call fput. That in turn leads to a busy
inodes after umount problem since the fileinfo holds an extra inode
reference now. Shuffle cifs_open around a bit so that it only calls
cifs_new_fileinfo if it's going to succeed.

Signed-off-by: Jeff Layton <jlayton@redhat.com>
Reviewed-and-Tested-by: Suresh Jayaraman <sjayaraman@suse.de>
fs/cifs/file.c