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.
Showing
Please register or sign in to comment