[Top][All Lists]

[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: Mon, 21 Jul 2003 17:25:04 +0300
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4) Gecko/20030714 Debian/1.4-2

Marco Gerards wrote:
Ognyan Kulev <ogi@fmi.uni-sofia.bg> writes:
$ mkdir d
$ cd d
$ mkdir x
$ mv x y
$ mv y x

I've tested this both with and without your patch. Nothing (weird)

(I suppose you are talking about your patch, not about mine.) I tried your patch and, suprisingly for me, the assertion failure in ext2fs/dir.c:716 didn't trigger. Anyway, by protocol[1] (diskfs.h:313), two diskfs_lookup in the same directory must have diskfs_drop_dirstat or diskfs_dir* between them.

[1] http://mail.gnu.org/archive/html/bug-hurd/2003-07/msg00092.html

BTW There is a possible deadlock in this function when source and destination parent directories are different. Let's name them A and B. Moving A/x to B/x first locks A. If in this moment another thread moves B/y to A/y, then it locks B and tries to lock A and then sleeps waiting A to be unlocked. The first thread continues by trying to lock B, but it's already locked. I'll try to address this and other problems (like reverting back st_nlink when error occurs) in a "final" patch soon.

Ognyan Kulev <ogi@{fmi.uni-sofia.bg,fsa-bg.org}>
7D9F 66E6 68B7 A62B 0FCF  EB04 80BF 3A8C A252 9782

reply via email to

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