From: Linus Torvalds <torvalds@linux-foundation.org>
To: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Cc: git@vger.kernel.org, gitster@pobox.com, j6t@kdbg.org
Subject: Re: [PATCH] Add an option not to use link(src, dest) && unlink(src) when that is unreliable
Date: Sat, 25 Apr 2009 10:56:01 -0700 (PDT) [thread overview]
Message-ID: <alpine.LFD.2.00.0904251042490.3101@localhost.localdomain> (raw)
In-Reply-To: <alpine.DEB.1.00.0904231252080.10279@pacific.mpi-cbg.de>
On Thu, 23 Apr 2009, Johannes Schindelin wrote:
>
> It seems that accessing NTFS partitions with ufsd (at least on my EeePC)
> has an unnerving bug: if you link() a file and unlink() it right away,
> the target of the link() will have the correct size, but consist of NULs.
So I assume that the way ufsd works is that it implements a user-level
NTFS driver and then exposes it as a NFS mount over local networking (and
perhaps also remotely?)
> It seems as if the calls are simply not serialized correctly, as single-stepping
> through the function move_temp_to_file() works flawlessly.
So presumably there is some cached writes somewhere (a NFS client _should_
not cache writes past a 'close()', but maybe there is a bug there and/or
buffering inside ufsd itself that means that the writes are still queued
up). And when the unlink() happens, it loses the writes to the original
file, and thus to the new one too.
If you _don't_ do this patch, does
[core]
fsyncobjectfiles = true
hide the bug?
I don't disagree with your patch (apart from the error number games), but
I'd like to understand what's going on. I also wonder if we should make
that fsync thign be the default.
[ That said, I think the http walker and possibly others may be using
'move_temp_to_file()' without going through any of the paths that know
about fsync, so 'fsyncobjectfiles' wouldn't fix all cases anyway. ]
Hmm. I hate how we have problems with that "link/unlink" sequence, and
"rename()" would be much better, but I'd hate overwriting existing objects
even _more_, and the normal POSIX rename() behavior is to overwrite any
old object. So link/unlink is supposed to be a lot safer, but it's clearly
problematic.
Linus
next prev parent reply other threads:[~2009-04-25 18:00 UTC|newest]
Thread overview: 38+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-04-23 10:53 [PATCH] Add an option not to use link(src, dest) && unlink(src) when that is unreliable Johannes Schindelin
2009-04-23 19:16 ` Johannes Sixt
2009-04-23 19:33 ` Johannes Schindelin
2009-04-25 9:57 ` [PATCH v2] " Johannes Schindelin
2009-04-25 16:49 ` Junio C Hamano
2009-04-25 17:40 ` Linus Torvalds
2009-04-25 18:38 ` Michael Gaber
2009-04-25 18:43 ` Linus Torvalds
2009-04-27 3:37 ` Jay Soffian
2009-04-25 18:50 ` Johannes Sixt
2009-04-25 17:05 ` Junio C Hamano
2009-04-26 17:39 ` Johannes Schindelin
2009-04-25 17:39 ` Linus Torvalds
2009-04-23 19:39 ` [PATCH] " Alex Riesen
2009-04-23 21:59 ` Johannes Schindelin
2009-04-24 5:44 ` Alex Riesen
2009-04-25 17:56 ` Linus Torvalds [this message]
2009-04-25 18:52 ` Johannes Sixt
2009-04-26 1:17 ` Junio C Hamano
2009-04-26 17:40 ` Johannes Schindelin
2009-04-27 12:00 ` [PATCH v3] " Johannes Schindelin
2009-04-27 15:15 ` Linus Torvalds
2009-04-27 16:11 ` Johannes Schindelin
2009-04-27 16:53 ` Linus Torvalds
2009-04-27 19:55 ` Junio C Hamano
2009-04-27 20:13 ` Linus Torvalds
2009-04-27 20:18 ` Linus Torvalds
2009-04-27 22:10 ` Junio C Hamano
2009-04-27 22:28 ` Johannes Schindelin
2009-04-27 23:06 ` Linus Torvalds
2009-04-27 22:32 ` [PATCH] Rename core.unreliableHardlinks to core.createObject Johannes Schindelin
2009-04-27 23:48 ` Junio C Hamano
2009-04-28 8:23 ` Johannes Schindelin
2009-04-28 8:44 ` Junio C Hamano
2009-04-28 14:50 ` Johannes Schindelin
2009-04-28 20:59 ` Junio C Hamano
2009-04-28 22:07 ` Johannes Schindelin
2009-04-26 17:38 ` [PATCH] Add an option not to use link(src, dest) && unlink(src) when that is unreliable Johannes Schindelin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=alpine.LFD.2.00.0904251042490.3101@localhost.localdomain \
--to=torvalds@linux-foundation.org \
--cc=Johannes.Schindelin@gmx.de \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=j6t@kdbg.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox