public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Andrew Morton <andrewm@uow.edu.au>
To: Alan Cox <alan@lxorguk.ukuu.org.uk>
Cc: lkml <linux-kernel@vger.kernel.org>
Subject: Re: [patch] s_maxbytes handling
Date: Wed, 23 May 2001 00:47:43 +1000	[thread overview]
Message-ID: <3B0A7C0F.C824FDB5@uow.edu.au> (raw)
In-Reply-To: <3B0A6124.E90717E7@uow.edu.au> from "Andrew Morton" at May 22, 2001 10:52:52 PM <E152CCP-0001rM-00@the-village.bc.nu>

Alan Cox wrote:
> 
> > If ->f_pos is positioned exactly at sb->s_maxbytes, a non-zero-length
> > write to the file doesn't write anything, and write() returns zero.
> 
> Are you absolutely sure here. Because I ran that code through a set of standards
> verification tests. So unless you can cite page and paragraph from SuS and
> the LFS spec I think the 0 might in fact be correct..

I don't know the standards Alan, but returning zero
from write() when f_pos is at s_maxbytes will make
a lot of apps hang up.  dd, bash and zsh certainly do.

Are they buggy?  Should they be testing the return value
of write() and assuming that zero is file-full?

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.

  reply	other threads:[~2001-05-22 14:52 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 [this message]
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
  -- 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=3B0A7C0F.C824FDB5@uow.edu.au \
    --to=andrewm@uow.edu.au \
    --cc=alan@lxorguk.ukuu.org.uk \
    --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