]> git.baikalelectronics.ru Git - kernel.git/commit
cifs: fix inode leak in cifs_get_inode_info_unix
authorJeff Layton <jlayton@redhat.com>
Sat, 12 Jul 2008 20:47:59 +0000 (13:47 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Sat, 12 Jul 2008 21:33:42 +0000 (14:33 -0700)
commit6fa4c03184632362b2936a7aebee8839bed04b9a
treec2549fb1caa266f17d25c20e0c499db823578372
parent674ba863e755b013b45ae951c4bd6dde34950ceb
cifs: fix inode leak in cifs_get_inode_info_unix

Try this:

    mount a share with unix extensions
    create a file on it
    umount the share

You'll get the following message in the ring buffer:

VFS: Busy inodes after unmount of cifs. Self-destruct in 5 seconds.  Have a
nice day...

...the problem is that cifs_get_inode_info_unix is creating and hashing
a new inode even when it's going to return error anyway. The first
lookup when creating a file returns an error so we end up leaking this
inode before we do the actual create. This appears to be a regression
caused by commit 95f604fb34ba2040166583dee14574ddde9efcf8.

The following patch seems to fix it for me, and fixes a minor
formatting nit as well.

Signed-off-by: Jeff Layton <jlayton@redhat.com>
Acked-by: Steven French <sfrench@us.ibm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
fs/cifs/inode.c