git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH v3] Add an option not to use link(src, dest) && unlink(src) when that is unreliable

From
Linus Torvalds <torvalds@linux-foundation.org>
Date
Apr 27, 2009, 20:13 UTC
Message-ID
<alpine.LFD.2.00.0904271304300.22156@localhost.localdomain>
In-Reply-To
<7vljpl3m8i.fsf@gitster.siamese.dyndns.org>
On Mon, 27 Apr 2009, Junio C Hamano wrote:
> 
> The coda hack comment in move_temp_to_file() shows what we can do to
> autodetect (i.e. try cross directory hardlink)
The thing is, we cannot do it reliably across different systems.

Coda simply doesn't _support_ hardlinks across directories at all. So it will always return an error when you try, and you can see the error directly and easily.

> but I somehow thought that we changed the code enough to ensure that we 
> create the tmpfiles in the same directory as their final destination?

This was for a totally different case - a certain kind of NFS client bug with a certain kind of (arguably buggy, but I can understand it because NFS is just a bad protocol in this respect) NFS server, where you may be able to do cross-directory renames, but it caused problems later.

Now, the reason cross-directory name movement matters is that it makes many things much harder, and filesystems thus have a much harder time doing them well (or decide to not support them at all, as in Coda). Within a single directory, things are just simpler, and thus less likely to hit bugs.

IOW, with cross-directory link/rename, you didn't get an error, you got some unreliable behavior - very much like the thing we see with ufsd. But with those problems, we could fix it by just always making the link and the rename be within a single directory.

Now, it seems, even being in the same directory isn't sufficient for that ufsd thing (but rename works. Knock wood).

			Linus
Previous: Junio C HamanoNext: Linus Torvalds
Message 26 of 38 in “Add an option not to use link(src, dest) && unlink(src) when that is unreliable”
  1. Add an option not to use link(src, dest) && unlink(src) when that is unreliableJohannes Schindelin, Apr 23, 2009
  2. Johannes SixtApr 23, 2009
  3. Johannes SchindelinApr 23, 2009
  4. Add an option not to use link(src, dest) && unlink(src) when that is unreliableJohannes Schindelin, Apr 25, 2009
  5. Junio C HamanoApr 25, 2009
  6. Linus TorvaldsApr 25, 2009
  7. Michael GaberApr 25, 2009
  8. Linus TorvaldsApr 25, 2009
  9. Jay SoffianApr 27, 2009
  10. Johannes SixtApr 25, 2009
  11. Junio C HamanoApr 25, 2009
  12. Johannes SchindelinApr 26, 2009
  13. Linus TorvaldsApr 25, 2009
  14. Alex RiesenApr 23, 2009
  15. Johannes SchindelinApr 23, 2009
  16. Alex RiesenApr 24, 2009
  17. Linus TorvaldsApr 25, 2009
  18. Johannes SixtApr 25, 2009
  19. Junio C HamanoApr 26, 2009
  20. Johannes SchindelinApr 26, 2009
  21. Add an option not to use link(src, dest) && unlink(src) when that is unreliableJohannes Schindelin, Apr 27, 2009
  22. Linus TorvaldsApr 27, 2009
  23. Johannes SchindelinApr 27, 2009
  24. Linus TorvaldsApr 27, 2009
  25. Junio C HamanoApr 27, 2009
  26. Linus TorvaldsApr 27, 2009
  27. Linus TorvaldsApr 27, 2009
  28. Junio C HamanoApr 27, 2009
  29. Johannes SchindelinApr 27, 2009
  30. Linus TorvaldsApr 27, 2009
  31. Rename core.unreliableHardlinks to core.createObjectJohannes Schindelin, Apr 27, 2009
  32. Junio C HamanoApr 27, 2009
  33. Johannes SchindelinApr 28, 2009
  34. Junio C HamanoApr 28, 2009
  35. Johannes SchindelinApr 28, 2009
  36. Junio C HamanoApr 28, 2009
  37. Johannes SchindelinApr 28, 2009
  38. Johannes SchindelinApr 26, 2009

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.