Re: [PATCH 2.6.10-rc2-bk15] sysfs_dir_close memory leak

From: Adam J. Richter
Date: Fri Dec 03 2004 - 06:16:43 EST


Chris Wright wrote:
>* Adam J. Richter (adam@xxxxxxxxxxxxx) wrote:
>> sysfs_dir_close did not free the "cursor" sysfs_dirent
>> used for keeping track of position in the list of sysfs_dirent nodes.
>> Consequently, doing a "find /sys" would leak a sysfs_dirent for
>> each of the 1140 directories in my /sys tree, or about 36kB
>> each time.

>Yeah, I noticed this as well. Why the BUGON()?

My thinking was that the preconditions in my tree for
calling release_sysfs_dirent are dirent->s_dentry == NULL and
list_empty(&dirent->s_sibling). The latter should be apparent
from two lines above, but the former is less obvious, although
it is also theoretically always true.

I'm OK with deleting the BUG_ON(). It was not verifying
anything passed in by an outside caller.

__ ______________
Adam J. Richter \ /
adam@xxxxxxxxxxxxx | g g d r a s i l
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/