From: "Stephen C. Tweedie" <sct@redhat.com>
To: Alan Cox <alan@lxorguk.ukuu.org.uk>
Cc: Andrew Morton <andrewm@uow.edu.au>,
lkml <linux-kernel@vger.kernel.org>,
Stephen Tweedie <sct@redhat.com>
Subject: Re: [patch] s_maxbytes handling
Date: Wed, 23 May 2001 19:02:22 +0100 [thread overview]
Message-ID: <20010523190222.J27177@redhat.com> (raw)
In-Reply-To: <3B0A7C0F.C824FDB5@uow.edu.au> <E152Dik-00021y-00@the-village.bc.nu>
In-Reply-To: <E152Dik-00021y-00@the-village.bc.nu>; from alan@lxorguk.ukuu.org.uk on Tue, May 22, 2001 at 04:05:14PM +0100
Hi,
On Tue, May 22, 2001 at 04:05:14PM +0100, Alan Cox wrote:
> > The s_maxbytes logic is different from the
> > MAX_NON_LFS logic:
> > if ( pos + count > MAX_NON_LFS && !(file->f_flags&O_LARGEFILE)) {
> > if (pos >= MAX_NON_LFS) {
> > send_sig(SIGXFSZ, current, 0);
> > goto out;
> > }
> The spec says of write
> [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.
SuS also states
If a write() requests that more bytes be written than there is room
for (for example, the ulimit or the physical end of a medium), only as
many bytes as there is room for will be written. For example, suppose
there is space for 20 bytes more in a file before reaching a limit. A
write of 512 bytes will return 20. The next write of a non-zero number
of bytes will give a failure return (except as noted below) and the
implementation will generate a SIGXFSZ signal for the thread.
so SIGXFSZ plus -EFBIG returned would appear to be the correct
behaviour. That's certainly what 2.2 used to when it encountered such
limits.
Cheers,
Stephen
next prev parent reply other threads:[~2001-05-23 18:03 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-05-22 12:52 [patch] s_maxbytes handling Andrew Morton
2001-05-22 13:27 ` Alan Cox
2001-05-22 14:47 ` Andrew Morton
2001-05-22 15:05 ` Alan Cox
2001-05-22 17:49 ` Linus Torvalds
2001-05-22 18:24 ` David N. Lombard
2001-05-23 18:02 ` Stephen C. Tweedie [this message]
-- strict thread matches above, loose matches on Subject: below --
2001-05-22 19:33 Andries.Brouwer
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20010523190222.J27177@redhat.com \
--to=sct@redhat.com \
--cc=alan@lxorguk.ukuu.org.uk \
--cc=andrewm@uow.edu.au \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox