lkml.org 
[lkml]   [2010]   [Jun]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [autofs] [PATCH 04/38] autofs4: Save autofs trigger's vfsmount in super block info
Date

Ian Kent:
> I may be missing something about this, but why is it safe to use
> iterate_mounts(), since it doesn't take the vfsmount_lock when
> traversing the list of mounts?

The sample code was not correct.
We need to acquire vfsmount_lock or down_read(namespace_sem).

Or it may be better to extract the body of iterate_mounts() and create a
new function __iterate_mounts() such like that.

__iterate_mounts()
{
/* equiv to the current iterate_mounts */
}

iterate_mount()
{
down_read(namespace_sem);
or spin_lock(&vfsmount_lock);

__iterate_mount();

spin_unlock(&vfsmount_lock);
or up_read(namespace_sem);
}


J. R. Okajima


\
 
 \ /
  Last update: 2010-06-23 04:21    [W:0.133 / U:2.140 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site