cifs: pass instantiated filp back after open call
authorJeff Layton <jlayton@redhat.com>
Wed, 16 Jun 2010 17:40:16 +0000 (13:40 -0400)
committerJeff Layton <jlayton@redhat.com>
Wed, 16 Jun 2010 17:40:16 +0000 (13:40 -0400)
commit6ca9f3bae8b1854794dfa63cdd3b88b7dfe24c13
treeb2f880172b2e23ca4f57bef5e2141c062351d6ec
parent2422f676fb78942d054f7e7a2c3ceaeb7945d814
cifs: pass instantiated filp back after open call

The current scheme of sticking open files on a list and assuming that
cifs_open will scoop them off of it is broken and leads to "Busy
inodes after umount..." errors at unmount time.

The problem is that there is no guarantee that cifs_open will always
be called after a ->lookup or ->create operation. If there are
permissions or other problems, then it's quite likely that it *won't*
be called.

Fix this by fully instantiating the filp whenever the file is created
and pass that filp back to the VFS. If there is a problem, the VFS
can clean up the references.

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