help-hurd
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Syncfs & node locking


From: Marcus Brinkmann
Subject: Re: Syncfs & node locking
Date: Tue, 19 Nov 2002 18:16:54 +0100
User-agent: Mutt/1.4i

On Tue, Nov 19, 2002 at 06:41:45PM +0100, Ludovic Courtès wrote:
> I have a small question about how syncfs should work on the server side.
> We could expect the server to lock each node before trying to sync it.
> However, it turns out that syncfs (the command-line tool) looks up the
> file specified on the command-line and then calls fsys_syncfs () with
> the file port.

It uses file_syncfs, not fsys_syncfs.

synchronization of file data with the underlying storage device must be
done without locking the node.  Look how this is done in ext2fs with
the node_to_page_lock.

> The problem is that, as specified by the comments in netfs.h for
> netfs_attempt_lookup (), on successful lookups, the node found must
> be locked.  Therefore, if the server's syncfs stub tries to acquire a
> lock on the node that has just been looked up by syncfs(1), it will
> just hang.

Have you actually tried this?  The node is unlocked before returning the
port to the user (via nput/nrele).

> So what is the right way to implement syncfs on the server side?

This depends on what syncfs means in your filesystem.  For diskfs based
filesystems the right way is given by the implementations we have.  For
other filesystems, no existing filesystems requires syncing, AFAIK.

Thanks,
Marcus
-- 
`Rhubarb is no Egyptian god.' GNU      http://www.gnu.org    marcus@gnu.org
Marcus Brinkmann              The Hurd http://www.gnu.org/software/hurd/
Marcus.Brinkmann@ruhr-uni-bochum.de
http://www.marcus-brinkmann.de/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]