[prev in list] [next in list] [prev in thread] [next in thread] 

List:       linux-nfs
Subject:    [NFS] rename works? (was: open O_EXCL works?)
From:       Filipe Brandenburger <branden () terra ! com ! br>
Date:       2005-03-23 14:39:03
Message-ID: 20050323113859.BECF.BRANDEN () terra ! com ! br
[Download RAW message or body]


Hi, there.

I found another problem just now. I have two processes calling "rename"
to move all files from one directory to another, they're both calling
the same actions, for example, if process 1 on client 1 calls
rename("a/x","b/x"), process 2 on client 2 will call rename("a/x","b/x").

Apparently, somehow, I had one process trying to move 120 files (all
that were on directory "a"). It said it managed to move 112 files, 8 of
them failed. The second process entered the directory when there were 17
files, it tried to move them, and reported that moved successfully 16 of
them, 1 of them failed. But that means that both together moved 112 + 16
= 128 files! That "8" files are reflected in my other accounting, that
says there are 8 files more than there really are.

What I mean is, is it possible that both processes called the rename for
the same file, and that both of them succeeded? Is it that the success
of the rename operation depends on the destination file being there
instead of the success of the rename operation itself? If that's it, is
there a way to circumvent this restriction? If I use, for example,
hardlink and unlink, it would solve the concurrency problems?

I can provide more information on the problem upon request.

Thanks again,
Filipe



-------------------------------------------------------
This SF.net email is sponsored by: 2005 Windows Mobile Application Contest
Submit applications for Windows Mobile(tm)-based Pocket PCs or Smartphones
for the chance to win $25,000 and application distribution. Enter today at
http://ads.osdn.com/?ad_id=6882&alloc_id=15148&op=click
_______________________________________________
NFS maillist  -  NFS@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nfs
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic