Re: [PATCHSET] Sysfs cleanups from Eric W. Biederman

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Tejun Heo <htejun@...>
Cc: <cornelia.huck@...>, <greg@...>, <linux-kernel@...>, <satyam@...>, <stern@...>, <containers@...>
Date: Wednesday, August 22, 2007 - 10:04 am

Tejun Heo <htejun@gmail.com> writes:


As a base: 
Acked-by: "Eric W. Biederman" <ebiederm@xmission.com>


I think I disagree with the bug spotting.

At least in net we the sysfs_rename_mutex which keeps parent
directories from disappearing.  Further we have a reference
to the leaf sysfs_dirent and are actively manipulating it, so
the sysfs_dirent should not disappear on us.


Right.  __sysfs_get_dentry is an optimization that has makes
the best case for sysfs_get_dentry O(1) instead of O(depth).
However this doesn't matter because sysfs_get_dentry is not
on any fast path and the maximum depth of sysfs directories
is fairly shallow and programmer controlled.

The only user other user of __sysfs_get_dentry is in the tagged
directory support, and even that user doesn't strictly need it.
Although it is a bit silly to populate the dcache just so you
can invalidate it a moment later...

Just doing the dget(sysfs_sb->s_root) is a bit clearer in
sysfs_get_dentry then knowing implicitly that is what
__sysfs_get_dentry does in the worst cased.


Eric
-
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCHSET] Sysfs cleanups from Eric W. Biederman, Tejun Heo, (Mon Aug 20, 8:36 am)
Re: [PATCHSET] Sysfs cleanups from Eric W. Biederman, Eric W. Biederman, (Wed Aug 22, 10:04 am)
Re: [PATCHSET] Sysfs cleanups from Eric W. Biederman, Tejun Heo, (Wed Aug 22, 10:45 am)
Re: [PATCHSET] Sysfs cleanups from Eric W. Biederman, Eric W. Biederman, (Wed Aug 22, 11:51 am)
Re: [PATCHSET] Sysfs cleanups from Eric W. Biederman, Cornelia Huck, (Wed Aug 22, 5:26 am)
[PATCH 12/14] sysfs: kill SYSFS_FLAG_REMOVED, Tejun Heo, (Mon Aug 20, 8:36 am)
[PATCH 10/14] sysfs: simply sysfs_get_dentry, Tejun Heo, (Mon Aug 20, 8:36 am)