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 [EMAIL PROTECTED] Marcus Brinkmann The Hurd http://www.gnu.org/software/hurd/ [EMAIL PROTECTED] http://www.marcus-brinkmann.de/ _______________________________________________ Help-hurd mailing list [EMAIL PROTECTED] http://mail.gnu.org/mailman/listinfo/help-hurd
