bug-hurd
[Top][All Lists]
Advanced

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

Bug#190732: [PATCH] hurd/libdiskfs/dir-renamed.c


From: Ognyan Kulev
Subject: Bug#190732: [PATCH] hurd/libdiskfs/dir-renamed.c
Date: Wed, 16 Jul 2003 01:26:20 +0300
User-agent: Mutt/1.4i

On Tue, Jul 15, 2003 at 05:43:24AM -0500, Marcus Brinkmann wrote:
> 1. What errors do you still expect from the second time diskfs_lookup is
> invoked with REMOVE?  Is there any error that is allowed at that time?
> If there is, the change is correct.

Before the second diskfs_lookup, mutex_unlock is called.  This leaves a 
little time when someone could remove the node.

> 2. Is it possible, and according to diskfs.h it should be, to just
> call dir_lookup with REMOVE only once, at the point you introduced it
> in your patch, and store the dirstat until it is needed for the actual
> disks_dirremove call.  This saves one lookup call.  Can you try such a
> change and look into the code if it is feasible?

While trying to do that now, I recalled why this cannot be done.  If
diskfs_lookup is called only once in the beginning, the assertion in 
ext2fs/dir.c:716 is triggered with the following commands:

$ mkdir x
$ mv x y
$ mv y x

It seems that dirstat of ext2fs can break when there are other 
activities in the directory.  It's possible that ext2fs is wrong, but I 
didn't look further.

I send a revisited patch that I beleive is easier to read, and it fixes 
some tiny bugs too.

Regards
--
Ognyan Kulev <ogi@fmi.uni-sofia.bg>

Attachment: dir-renamed.3.diff
Description: Text document


reply via email to

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