[PATCH 06/14] sysfs: Rewrite sysfs_get_dentry
cornelia.huck at de.ibm.com
Thu Aug 2 01:28:19 PDT 2007
On Thu, 02 Aug 2007 02:51:19 +0900,
Tejun Heo <htejun at gmail.com> wrote:
> Eric W. Biederman wrote:
> > My practical problem is that I need to hold a lock for the sysfs
> > dirents and while that lock is held I need to call sysfs_get_dentry
> > for the destination directory once for each superblock.
> > It might be that some kind of reader-writer lock strategy is what
> > I need to untangle this mess. Rather then making changing to i_mutex.
> > All I know is at the moment it is taking a lot of code reading and
> > brain storm to come of with something that is easy to maintain.
> Just in case, sysfs used to have sysfs_rename_rwsem to protect
> move/rename against tree walking, which became unnecessary after i_mutex
> -> sysfs_mutex conversion. Move/rename can use stupid big fat locks if
> that helps.
I second that. Reintroduction of sysfs_rename_rwsem or something
similar may be the best way to avoid headaches.
More information about the Containers