From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ian Kent Subject: Re: [autofs4 patch] Use /proc/mounts instead of /etc/mtab Date: Thu, 09 Nov 2006 11:29:11 +0800 Message-ID: <1163042951.4475.5.camel@localhost> References: <1163042229.4475.2.camel@localhost> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: autofs-bounces@linux.kernel.org Errors-To: autofs-bounces@linux.kernel.org To: Jeff Moyer Cc: autofs mailing list On Wed, 2006-11-08 at 22:25 -0500, Jeff Moyer wrote: > ==> On Thu, 09 Nov 2006 11:17:09 +0800, Ian Kent said: > > Ian> On Wed, 2006-11-08 at 22:03 -0500, Jeff Moyer wrote: > Hi, Ian, > Ian> list, > Ian> > > Ian> > Here is a patch to consult /proc/mounts instead of /etc/mtab > Ian> when > deciding if a path has already been mounted. The problem > Ian> with using > /etc/mtab, as you know, is that it sometimes does > Ian> not get updated. We > know that /proc/mounts will always be > Ian> right, so why not use it? > > Ian> Good for v4 but keep in mind that in v5 /proc/mounts can have a > Ian> lot of entries compared to /etc/mtab. The cost of doing this can > Ian> be quite high. mount(8) must play well with mtab for v5. > > It's not just mount(8), but also the caller's responsibility. You > have to be sure to check for the mtab not updated return value, and > issue another mount call to try to update it. Ya .. been there before. I'll need to check that. Ian