[Top][All Lists]

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

Re: fatfs locking

From: marco
Subject: Re: fatfs locking
Date: Mon, 1 Apr 2002 22:52:51 +0200 (CEST)

On Monday 01 April 2002 02:17, you wrote:
> It seems reasonable to me to leave it up to the filesystem-specific code to
> decide what nodes it might need to lock, and just give it enough
> information to avoid deadlock.  I have in my tree a slightly different
> change that adds a struct node * argument to diskfs_cached_lookup instead
> of a flag, indicating the directory node (or none if null) that the caller
> has locked.  I think that by using this the special case for ".." in
> libdiskfs/name-cache.c can be removed.  I have changes that add the
> argument, remove the ".." special case for unlocking in
> diskfs_check_lookup_cache, and instead makes each diskfs_cached_lookup
> implementation check for the lookup matching the already-locked node.

I made the same changes in my tree. By doing this fatfs doesn't have to
search the node in the cache when the node is locked, so there is a
performance boost as well. Some other minor things can be done easier
by changing this as well I think.

I think your solution is great :)

> It occurs to me that without this change, if a directory in a ufs or ext2fs
> filesystem contains a link to itself by a name other than "..", then a
> lookup of that name will deadlock the directory node.  (That is probably an
> invalid state that fsck would fix, but still.)  Am I right about that?

I think you are because most functions only check if the name of the
directory is .. (like diskfs_check_lookup_cache does).

> I'll put these changes in if Thomas agrees it makes sense.

reply via email to

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