Sequence of buffers for reply_write

Green, Paul Paul.Green at
Mon Sep 30 16:04:01 GMT 2002

We've had similar issues on the Stratus VOS system. This isn't a Samba
issue; Samba is just passing along the behavior of the top-level clients
(Winword, WordPad, Excel, and so forth). The Microsoft clients presume the
ability to position to anywhere in the file and write data, and they don't
restrict themselves to writing data in any particular order.  (Hey, they
presume a POSIX world; not so surprising, really).

These repositionings cannot be applied to our proprietary files, either. Any
attempt to reposition  leads to reporting a sudden file system failure to
the client (which in turn leads to the Microsoft clients displaying a rather
obscure error message).  I changed Samba so that our proprietary files
cannot be opened for writing; I force such files to be opened only for
reading (by lying and saying that the user does not have write permission to
such files). If you try to modify a read-only file, the Microsoft editors
give a cogent error message. I can supply a patch for the 2.0 branch for
this "fix".

You can check this by enabling debug messages in Samba. You can then see the
sequence of calls made by a client.

Your workaround sounds ok to me. Of course, it will have performance issues
on large files. I'd be interested in getting a copy of your patch, if and
when you implement it.


-----Original Message-----
From: MCDONOP1 at [mailto:MCDONOP1 at]
Sent: Tuesday, September 24, 2002 3:21 PM
To: samba-technical at
Subject: Sequence of buffers for reply_write

We are using a version of Samba that works in the Tandem OSS environment.
It works with no problems.  I have been trying to modify it to work with
special edit files that exist on Tandem.   The edit files are in a
proprietary format and positioning is based on a RecordNumber.  Basically,
I have everything working except being able to write large files that
require multiple 65K buffers to be transmitted.  It seems the buffers that
are passed to the reply_write() function are out of sequence...  For
example, the line below where startpos=262144 should be the last buffer but
it is actually the 3rd buffer.  I can't use the startpos to position
correctly in the file because positioning in the Edit files is based on
RecordNumber... not byte number.

(Embedded image moved to file: pic06334.pcx)

I was just wondering if what I am seeing makes sense to anyone.   I can get
around it by writing to memory then dumping the memory contents to disk on
the close....

Any help would be appreciated.

More information about the samba-technical mailing list