mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: viro@parcelfarce.linux.theplanet.co.uk
To: William Lee Irwin III <wli@holomorphy.com>,
	Tigran Aivazian <tigran@aivazian.fsnet.co.uk>,
	linux-kernel@vger.kernel.org
Subject: Re: seq_file and exporting dynamically allocated data
Date: Mon, 17 Nov 2003 09:48:32 +0000	[thread overview]
Message-ID: <20031117094832.GU24159@parcelfarce.linux.theplanet.co.uk> (raw)
In-Reply-To: <20031117090339.GC22764@holomorphy.com>

On Mon, Nov 17, 2003 at 01:03:39AM -0800, William Lee Irwin III wrote:
> On Mon, Nov 17, 2003 at 12:48:04AM -0800, William Lee Irwin III wrote:
> > There's a retry loop where the buffer size is doubled each iteration
> > that looks to me like automagic sizing in the code for seq_read(). I
> > can't say I've actually tried to rely on getting more than a page
> > at a time through seq_read(), though.
> 
> Woops. This looks like it only makes sure there's enough to get the
> first ->show() into the buffer; I see that it later gives up when
> m->count == m->size once the first ->show() has enough bufferspace to
> complete later on. So if all ->show() operations to do are less than
> PAGE_SIZE, it'll never hand back more than a page at a time, and may
> hand back short reads prior to EOF, which doesn't bode well for my
> short read == EOF idea (maybe not a great assumption in general).

That's "broken assumption", thank you very much.  There is one and only one
indication of EOF - read() returning 0.  Any application that treats short
read as EOF is broken.  As in "apply Stevens to offender's cranium until
something gives; if it's the book, replace with fresh copy and repeat".

  parent reply	other threads:[~2003-11-17  9:48 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-11-14 20:42 Harald Welte
2003-11-14 21:01 ` Tigran Aivazian
2003-11-15  9:38   ` Harald Welte
2003-11-15 17:18     ` viro
2003-11-15 17:33       ` Harald Welte
2003-11-15 19:49         ` Tigran Aivazian
2003-11-15 20:14           ` viro
2003-11-15 20:41             ` Tigran Aivazian
2003-11-15 21:30               ` viro
2003-11-15 20:50             ` Tigran Aivazian
2003-11-15 21:33               ` viro
2003-11-15 21:54                 ` Tigran Aivazian
2003-11-16  7:27                   ` Tigran Aivazian
2003-11-17  5:48                     ` viro
2003-11-17  8:21                       ` Tigran Aivazian
2003-11-17  8:30                         ` William Lee Irwin III
2003-11-17  8:38                           ` Tigran Aivazian
2003-11-17  8:48                             ` William Lee Irwin III
2003-11-17  9:03                               ` William Lee Irwin III
2003-11-17  9:42                                 ` Tigran Aivazian
2003-11-17  9:50                                   ` William Lee Irwin III
2003-11-17  9:55                                   ` viro
2003-11-17 10:08                                     ` Tigran Aivazian
2003-11-17 10:35                                       ` viro
2003-11-17  9:48                                 ` viro [this message]
2003-11-16 20:45               ` Harald Welte
2003-11-15 20:36         ` viro
2003-11-16 20:42           ` Harald Welte

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=20031117094832.GU24159@parcelfarce.linux.theplanet.co.uk \
    --to=viro@parcelfarce.linux.theplanet.co.uk \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tigran@aivazian.fsnet.co.uk \
    --cc=wli@holomorphy.com \
    /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

Powered by JetHome