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)
commit47c78b7f40a9931a264e3c9bddccacdf8dfb9a30
tree2b4cc492dee33f47836b252a4a1819006e5d0644
parentd9d5d8df953a98621be5b8889e05043d6e32052e
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