Re: [PATCH] Add an option not to use link(src, dest) && unlink(src) when that is unreliable
- From
Johannes Schindelin <johannes.schindelin@gmx.de>
- Date
- Apr 23, 2009, 19:33 UTC
- Message-ID
- <alpine.DEB.1.00.0904232132380.10279@pacific.mpi-cbg.de>
- In-Reply-To
- <200904232116.10769.j6t@kdbg.org>
Hi,
On Thu, 23 Apr 2009, Johannes Sixt wrote:
Show 11 quoted lines
> On Donnerstag, 23. April 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. > > > > It seems as if the calls are simply not serialized correctly, as > > single-stepping through the function move_temp_to_file() works flawlessly. > > > > As ufsd is "Commertial software", I cannot fix it, and have to work > > "commercial software"
I just quoted the license string of that wonderfully high-quality kernel module.
Maybe I should have added the beloved "[sic!]".
Show 17 quoted lines
> > At the same time, it seems that this fixes msysGit issues 222 and 229 to
> > assume that Windows cannot handle link() && unlink().
> >
> > Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
> ...
> > @@ -2225,7 +2225,9 @@ int move_temp_to_file(const char *tmpfile, const char
> > *filename) {
> > int ret = 0;
> >
> > - if (link(tmpfile, filename))
> > + if (unreliable_hardlinks)
> > + ret = ~EEXIST;
>
> It took me a while to see why we need a tilde here, but it's ok. Perhaps this
> helps others:
>
> + ret = ~EEXIST; /* anything but EEXIST */Will do.
> Nevertheless: > > Acked-by: Johannes Sixt <j6t@kdbg.org>
Thanks.
But it will have to wait for Saturday.
Ciao, Dscho