From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#6237: 23.2; INSUFFICIENT RESOURCES writing file via CIFS Date: Sat, 22 May 2010 12:39:41 +0300 Message-ID: <83aarsp95u.fsf@gnu.org> References: <4BF5F6A1.8020206@sprucehead.com> <4BF73D99.4060007@sprucehead.com> <83fx1kzbuh.fsf@gnu.org> <4BF78CA4.2090209@sprucehead.com> <83bpc8pbzo.fsf@gnu.org> Reply-To: Eli Zaretskii NNTP-Posting-Host: lo.gmane.org X-Trace: dough.gmane.org 1274522576 15968 80.91.229.12 (22 May 2010 10:02:56 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sat, 22 May 2010 10:02:56 +0000 (UTC) Cc: 6237@debbugs.gnu.org To: forum2@sprucehead.com Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat May 22 12:02:54 2010 connect(): No such file or directory Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1OFlXf-0004ZA-SM for geb-bug-gnu-emacs@m.gmane.org; Sat, 22 May 2010 12:02:52 +0200 Original-Received: from localhost ([127.0.0.1]:58458 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OFlSI-00050h-3v for geb-bug-gnu-emacs@m.gmane.org; Sat, 22 May 2010 05:57:18 -0400 Original-Received: from [140.186.70.92] (port=48263 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OFlS8-0004w8-AU for bug-gnu-emacs@gnu.org; Sat, 22 May 2010 05:57:09 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OFlS6-0006aE-Bp for bug-gnu-emacs@gnu.org; Sat, 22 May 2010 05:57:08 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:35391) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OFlS6-0006a7-AH for bug-gnu-emacs@gnu.org; Sat, 22 May 2010 05:57:06 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.69) (envelope-from ) id 1OFlBa-0001cB-OV; Sat, 22 May 2010 05:40:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 22 May 2010 09:40:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 6237 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 6237-submit@debbugs.gnu.org id=B6237.12745211886190 (code B ref 6237); Sat, 22 May 2010 09:40:02 +0000 Original-Received: (at 6237) by debbugs.gnu.org; 22 May 2010 09:39:48 +0000 Original-Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OFlBM-0001bm-C8 for submit@debbugs.gnu.org; Sat, 22 May 2010 05:39:48 -0400 Original-Received: from mtaout20.012.net.il ([80.179.55.166]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OFlBK-0001bc-KJ for 6237@debbugs.gnu.org; Sat, 22 May 2010 05:39:47 -0400 Original-Received: from conversion-daemon.a-mtaout20.012.net.il by a-mtaout20.012.net.il (HyperSendmail v2007.08) id <0L2T00L00EQ91100@a-mtaout20.012.net.il> for 6237@debbugs.gnu.org; Sat, 22 May 2010 12:39:42 +0300 (IDT) Original-Received: from HOME-C4E4A596F7 ([77.127.33.125]) by a-mtaout20.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0L2T00GT6EU5RBC0@a-mtaout20.012.net.il>; Sat, 22 May 2010 12:39:42 +0300 (IDT) In-reply-to: <83bpc8pbzo.fsf@gnu.org> X-012-Sender: halo1@inter.net.il X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list Resent-Date: Sat, 22 May 2010 05:40:02 -0400 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:37178 Archived-At: > Date: Sat, 22 May 2010 11:38:35 +0300 > From: Eli Zaretskii > Cc: 6237@debbugs.gnu.org > > > I know nothing about Windows internals, but it would seem that some > > downstream WinNT I/O routine can't handle 32MB or larger writes, so > > perhaps write-region could segment the write? The annotations hair > > makes it hard for me to see if this is easy. > > The breaking of writes into smaller chunks should be in Windows > specific code, i.e. in w32.c:sys_write. And that is very easy. If you can build Emacs yourself from sources, could you please try the following patch? It incorporates the info I found in the git mailing list thread pointed out by Andreas (thanks!). === modified file 'src/w32.c' --- src/w32.c 2010-05-01 18:28:00 +0000 +++ src/w32.c 2010-05-22 09:33:53 +0000 @@ -5700,7 +5700,34 @@ sys_write (int fd, const void * buffer, } else #endif - nchars = _write (fd, buffer, count); + { + /* Some networked filesystems don't like too large writes, so + break them into smaller chunks. See the Comments section of + the MSDN documentation of WriteFile for details behind the + choice of the value of CHUNK below. See also the thread + http://thread.gmane.org/gmane.comp.version-control.git/145294 + in the git mailing list. */ + const unsigned char *p = buffer; + const unsigned chunk = 30 * 1024 * 1024; + + nchars = 0; + while (count > 0) + { + unsigned this_chunk = count < chunk ? count : chunk; + int n = _write (fd, p, this_chunk); + + nchars += n; + if (n < 0) + { + nchars = n; + break; + } + else if (n < this_chunk) + break; + count -= n; + p += n; + } + } return nchars; }