> Are they buggy? Should they be testing the return value
> of write() and assuming that zero is file-full?
0 is an EOF.
> The s_maxbytes logic is different from the
> MAX_NON_LFS logic:
>
> /*
> * LFS rule
> */
> if ( pos + count > MAX_NON_LFS && !(file->f_flags&O_LARGEFILE)) {
> if (pos >= MAX_NON_LFS) {
> send_sig(SIGXFSZ, current, 0);
> goto out;
> }
>
> This makes more sense. If the file is full, and
> you're trying to grow it, you fail.
The spec says of write
DESCRIPTION
For regular files, no data transfer will occur past the offset
maximum established in the open file description associated with
fildes.
[EFBIG]
The file is a regular file, nbyte is greater than 0 and the
starting position is greater than or equal to the offset
maximum established in the open file description associated
with fildes.
Which seems to say to me that if we write > 0 bytes and we start at or
on the boundary we should error - which would agree with your change.
Alan
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/