[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#6237: 23.2; INSUFFICIENT RESOURCES writing file via CIFS
From: |
Eli Zaretskii |
Subject: |
bug#6237: 23.2; INSUFFICIENT RESOURCES writing file via CIFS |
Date: |
Sat, 22 May 2010 11:38:35 +0300 |
> Date: Sat, 22 May 2010 00:49:56 -0700
> From: Jack Holloway <forum2@sprucehead.com>
> CC: 6237@debbugs.gnu.org
>
> Written 16384K
> Written 24576K
> !!! Unable to append - (error IO error writing
> z:/Temp/test/temp-write-once-032768: Invalid argument)
> !!! Unable to append - (error IO error writing
> z:/Temp/test/temp-write-once-049152: Invalid argument)
> !!! Unable to append - (error IO error writing
> z:/Temp/test/temp-write-once-065536: Invalid argument)
> !!! Unable to append - (error IO error writing
> z:/Temp/test/temp-write-once-098304: Invalid argument)
> !!! Unable to append - (error IO error writing
> z:/Temp/test/temp-write-once-131072: Invalid argument)
> !!! Unable to append - (error IO error writing
> z:/Temp/test/temp-write-once-196608: Invalid argument)
>
> The would-be 32MB file exists, with zero length.
So 24MB succeeds, but 32MB and all sizes above it fail?
But why does the error message say "Unable to append"? Why "append"?
> I was referring to DEFUN ("copy-file",...) in fileio.c which writes in
> 16K blocks,
> ...
> while ((n = emacs_read (ifd, buf, sizeof buf)) > 0)
> if (emacs_write (ofd, buf, n) != n)
> report_file_error ("I/O error", Fcons (newname, Qnil));
This is not the code that runs on Windows. That one is a little ways
earlier in the body of copy-file:
#ifdef WINDOWSNT
if (!CopyFile (SDATA (encoded_file),
SDATA (encoded_newname),
FALSE))
report_file_error ("Copying file", Fcons (file, Fcons (newname, Qnil)));
/* CopyFile retains the timestamp by default. */
else if (NILP (keep_time))
{
EMACS_TIME now;
DWORD attributes;
char * filename;
EMACS_GET_TIME (now);
filename = SDATA (encoded_newname);
/* Ensure file is writable while its modified time is set. */
attributes = GetFileAttributes (filename);
SetFileAttributes (filename, attributes & ~FILE_ATTRIBUTE_READONLY);
if (set_file_times (filename, now, now))
{
/* Restore original attributes. */
SetFileAttributes (filename, attributes);
xsignal2 (Qfile_date_error,
build_string ("Cannot set file date"), newname);
}
/* Restore original attributes. */
SetFileAttributes (filename, attributes);
}
#else /* not WINDOWSNT */
> 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.