GNU bug report logs - #18499
Possible mv race for hardlinks (rhbz #1141368 )

Previous Next

Package: coreutils;

Reported by: ovasik <at> redhat.com

Date: Thu, 18 Sep 2014 10:54:02 UTC

Severity: normal

Done: Pádraig Brady <P <at> draigBrady.com>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: Pádraig Brady <P <at> draigBrady.com>
Cc: tracker <at> debbugs.gnu.org
Subject: bug#18499: closed (Possible mv race for hardlinks (rhbz #1141368 ))
Date: Fri, 21 Nov 2014 11:54:02 +0000
[Message part 1 (text/plain, inline)]
Your message dated Fri, 21 Nov 2014 11:53:28 +0000
with message-id <546F27B8.5080307 <at> draigBrady.com>
and subject line Re: bug#18499: Possible mv race for hardlinks (rhbz #1141368 )
has caused the debbugs.gnu.org bug report #18499,
regarding Possible mv race for hardlinks (rhbz #1141368 )
to be marked as done.

(If you believe you have received this mail in error, please contact
help-debbugs <at> gnu.org.)


-- 
18499: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=18499
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
From: Ondrej Vasik <ovasik <at> redhat.com>
To: CoreutilsBugs <bug-coreutils <at> gnu.org>
Subject: Possible mv race for hardlinks (rhbz #1141368 )
Date: Thu, 18 Sep 2014 12:52:32 +0200
Hi,
as reported in https://bugzilla.redhat.com/show_bug.cgi?id=1141368 ,
there is a possible race condition in mv in the case of hardlinks.

Bug is reproducible even on ext4 filesystem (I guess it is filesystem
independent), even with the latest coreutils. There was already attempt
to fix the non-atomicity of mv for hardlinks
( http://thread.gmane.org/gmane.comp.gnu.coreutils.bugs/12985 ), from
the current reproducer it looks like the fix is probably incomplete.

Regards,
       Ondrej Vasik



[Message part 3 (message/rfc822, inline)]
From: Pádraig Brady <P <at> draigBrady.com>
To: Boris Ranto <branto <at> redhat.com>
Cc: Paul Eggert <eggert <at> cs.ucla.edu>, 18499-done <at> debbugs.gnu.org,
 ovasik <at> redhat.com, Miklos Szeredi <miklos <at> szeredi.hu>
Subject: Re: bug#18499: Possible mv race for hardlinks (rhbz #1141368 )
Date: Fri, 21 Nov 2014 11:53:28 +0000
On 21/11/14 08:29, Boris Ranto wrote:
> On Fri, 2014-11-21 at 03:30 +0000, Pádraig Brady wrote:
>> We want to leave the logic in place for cp and install though,
>> and I've adjusted your patch accordingly. I've also adjusted
>> the tests to pass and augmented the tests to cover one of
>> the cases missed in the previous patch.  I'll push this tomorrow.
>>
>> thanks,
>> Pádraig.
> 
> Just a note: cp already presented this behaviour before the patch, i.e. 
> 
> cp a b
> 
> on hard links to the same file failed with 
> 
> cp: ‘a’ and ‘b’ are the same file
> 
> On the other hand, install does not present it, it copies over b
> creating new inode for b.

Yep, but there were other cases with `cp -a` with hardlinks
to symlinks, and cp --remove-destination a b.

I've pushed that now.

thanks!
Pádraig.


This bug report was last modified 10 years and 180 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.