GNU bug report logs - #25680
[PATCH] copy: Avoid race when creating hard link over recently-created file

Previous Next

Package: coreutils;

Reported by: Mike Crowe <mac <at> mcrowe.com>

Date: Fri, 10 Feb 2017 19:50:02 UTC

Severity: normal

Tags: patch

Done: Paul Eggert <eggert <at> cs.ucla.edu>

Bug is archived. No further changes may be made.

Full log


Message #19 received at 25680 <at> debbugs.gnu.org (full text, mbox):

From: Mike Crowe <mac <at> mcrowe.com>
To: Paul Eggert <eggert <at> cs.ucla.edu>
Cc: 25680 <at> debbugs.gnu.org
Subject: Re: bug#25680: [PATCH] copy: Avoid race when creating hard link over
 recently-created file
Date: Mon, 13 Feb 2017 12:28:19 +0000
On Saturday 11 February 2017 at 23:20:24 -0800, Paul Eggert wrote:
> Mike Crowe wrote:
> >Do you think that if I added such a limit and diagnostic then the patch
> >would be acceptable?
> 
> I'd rather fix the underlying problem more systematically. How about the
> attached patch instead? I've installed this on Savannah so you can give it a
> whirl easily. It fixes the problem for me so I'm boldly marking this bug
> report as done; we can unmark it later if it turns out that I'm wrong.

My recipe for reproducing problem on demand relied on inserting sleeps in
the code. After your fix, the potential race now occurs inside the renameat
system call so there's nowhere appropriate to place such sleeps. I think
this means that your fix is clearly much better.

Thanks!

Mike.




This bug report was last modified 8 years and 101 days ago.

Previous Next


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