]> git.hungrycats.org Git - linux/commit
sysfs: fix oops in directory removal.
authorPatrick Mochel <mochel@osdl.org>
Mon, 3 Mar 2003 03:43:37 +0000 (21:43 -0600)
committerPatrick Mochel <mochel@osdl.org>
Mon, 3 Mar 2003 03:43:37 +0000 (21:43 -0600)
commit2201a8156bb22abb8e64f8aa34e4dcb4406b8e1d
tree132b0d9ef2d04e17c2505be5e5e12af8062d30b5
parentab6671e98f80025ed95da3bfcc214b6808717460
sysfs: fix oops in directory removal.

If a file that doesn't exist was looked up in a directory, and that
directory is later removed, sysfs would reap the negative dentrys along
with the valid ones.

Fix is to manually remove the dentrys from the parent's list under the
dcache_lock, then check if they're valid with dget_locked().

This ensures all the dentrys are removed, valid and invalid, and we don't
reap anything we shouldn't.
fs/sysfs/inode.c