[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <9219.1277258833@jrobl>
Date: Wed, 23 Jun 2010 11:07:13 +0900
From: "J. R. Okajima" <hooanon05@...oo.co.jp>
To: Ian Kent <raven@...maw.net>
Cc: Miklos Szeredi <miklos@...redi.hu>, viro@...iv.linux.org.uk,
vaurora@...hat.com, autofs@...ux.kernel.org,
linux-kernel@...r.kernel.org, hch@...radead.org,
linux-fsdevel@...r.kernel.org, jblunck@...e.de
Subject: Re: [autofs] [PATCH 04/38] autofs4: Save autofs trigger's vfsmount in super block info
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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists