Oleg Drokin writes:
<br />

<blockquote type="cite" class="cite0"><div class="quotedtext">Hello!
<br />
<p>On Aug 11, 2009, at 1:24 PM, office@hailoo.com wrote:
<br />

<blockquote type="cite" class="cite1"><div class="quotedtext">Thanks for the information.  Doesn't this entail that for every call  to
write() involving a striped file, Lustre must necessarily consult  all
OSSs, in order to determine 1) the file size and 2) if the  current write
operation will extend the file?
</div></blockquote>

<p>Why does write need to know the entire file size? We only care if we  are
extending currently accessed stripe. We know this the moment we  obtained
the lock on
<br />the stripe region we are interested in.
</div></blockquote>

<p>Consider the following situation:
<br />
<p>You have 4 OSTs and you create a file striped across all 4 OSTs, and you set the stripe size to 4 bytes.  (Obviously that is too small, but I just want to keep this simple.)
<br />
<p>The file is created and it starts out as a 0 byte file.  Now, suppose you write one byte to offset 5.  So now Lustre has to write one byte to the second OST.  But, in POSIX compliant file I/O, if you write to an offset that is greater than the file size, the file system must write zeros to the disk to fill the gap between the old end of the file and the offset.  So, in the case of Lustre, the system must not only write a single byte to the second OST, it also must write 4 zero-bytes to the first OST.  But in order to even know that is has to do this, wouldn't Lustre need to know the entire file size?