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

Re: [PATCH] Fix checkout of large files to network shares under Windows XP

From
René Scharfe <rene.scharfe@lsrfire.ath.cx>
Date
Apr 20, 2010, 20:49 UTC
Message-ID
<4BCE134C.8090802@lsrfire.ath.cx>
In-Reply-To
<t2xbdca99241004200542ud4e8ea5azcad918c37bcacf1a@mail.gmail.com>
Am 20.04.2010 14:42, schrieb Sebastian Schuberth:
Show 7 quoted lines
>> Shouldn't the loop be left in the successful case, too?  write(2) is
>> allowed to write less than requested, so the caller already needs to
>> deal with that case anyway.
> 
> I prefer to make the wrapper as transparent as possible. If a direct
> call to write would not write less than requested, the wrapper should
> not either.

After the call failed, we don't know how many bytes would have been written had it succeeded.

But I agree with Albert's reasoning to use the knowledge of a working chunk size in order to minimize the number of write(2) calls. Otherwise we'd have to search for a working size again and again, generating lots of failing calls.

> I've updated work/issue-409 in 4msysgit.git accordingly.

This patch doesn't help in the test case I cobbled together quickly. It's a Windows XP SP3 client on VMWare mapping a file share exported by a Netapps filer, over a VPN. It's very slow, and I admit that it's a weird setup. I wouldn't actually use it that way, but couldn't find another file share momentarily.

I can check out a 1MB file, but checking out a 32MB file fails. I've added a fprintf() to the loop and I can see that it's halving the size and retries, as intended, until it eventually hits zero.

The file is created using the correct file size (32MB), though.The first failed write(2) call needs to be undone somehow before we can try again, it seems. Do we have to seek back or truncate the file?

Replacing the body of mingw_write() with the following line allows me to check out the 32MB file, by the way:

	return write(fd, buf, min(count, 1024 * 1024));
René
Previous: Sebastian SchuberthNext: René Scharfe
Message 10 of 15 in “Fix checkout of large files to network shares under Windows XP”
  1. Fix checkout of large files to network shares under Windows XPSebastian Schuberth, Apr 19, 2010
  2. Junio C HamanoApr 19, 2010
  3. Johannes SchindelinApr 20, 2010
  4. René ScharfeApr 19, 2010
  5. Albert DvornikApr 19, 2010
  6. Johannes SixtApr 20, 2010
  7. Sebastian SchuberthApr 20, 2010
  8. Johannes SixtApr 20, 2010
  9. Sebastian SchuberthApr 20, 2010
  10. René ScharfeApr 20, 2010
  11. René ScharfeApr 29, 2010
  12. Johannes SixtApr 30, 2010
  13. Sebastian SchuberthApr 30, 2010
  14. René ScharfeOct 16, 2010
  15. Dmitry PotapovOct 17, 2010

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.