public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "H. Peter Anvin" <hpa@zytor.com>
To: linux-kernel@vger.kernel.org
Subject: Re: [PATCH][RFC] Re: 2.4.15-pre5: /proc/cpuinfo broken
Date: 17 Nov 2001 11:54:44 -0800	[thread overview]
Message-ID: <9t6fa4$ldo$1@cesium.transmeta.com> (raw)
In-Reply-To: <Pine.LNX.4.33.0111171052060.1458-100000@penguin.transmeta.com> <Pine.GSO.4.21.0111171359410.11475-100000@weyl.math.psu.edu>

Followup to:  <Pine.GSO.4.21.0111171359410.11475-100000@weyl.math.psu.edu>
By author:    Alexander Viro <viro@math.psu.edu>
In newsgroup: linux.dev.kernel
> 
> On Sat, 17 Nov 2001, Linus Torvalds wrote:
> 
> > 
> > On Sat, 17 Nov 2001, Alexander Viro wrote:
> > >
> > > Frankly, I'd prefer to try (b) before reverting to (a).  Patch doing that
> > > variant follows.  Linus, your opinion?
> > 
> > (d) make seq_file have my originally suggested "subposition" code.
> > 
> > Ie make the X low bits of "pos" be the position in the record, with the
> > high bits of "pos" being the current "record index" kind of thing.
> > 
> > That makes lseek() happy.
> 
> It will not help.  lseek() in question is relative and crosses the
> record boundary.  I.e. we have
> 
> 	n = read(fd, buf, ...);
> 	/* process k bytes */
> 	lseek(fd, k-n, SEEK_CUR);
> 
> and that will break just as the current variant does.  It's not about
> seek to remembered position - it's a relative seek to calculated offset.
> Calculated from number of bytes returned by read().
> 

We may really want to consider if we want /proc entries to be
S_IFREG().  The closest equivalent I can think of is really a
character device node (S_IFCHR) more so that S_IFIFO.

	  -hpa

-- 
<hpa@transmeta.com> at work, <hpa@zytor.com> in private!
"Unix gives you enough rope to shoot yourself in the foot."
http://www.zytor.com/~hpa/puzzle.txt	<amsp@zytor.com>

      reply	other threads:[~2001-11-17 19:55 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <15350.36701.89478.960625@kruemel.monster.org>
2001-11-17 17:51 ` [PATCH][RFC] Re: 2.4.15-pre5: /proc/cpuinfo broken Alexander Viro
2001-11-17 18:04   ` Alan Cox
2001-11-17 18:29     ` Alexander Viro
2001-11-17 23:51       ` [PATCH][CFT] seq_file and lseek() Alexander Viro
2001-11-17 18:53   ` [PATCH][RFC] Re: 2.4.15-pre5: /proc/cpuinfo broken Linus Torvalds
2001-11-17 19:03     ` Alexander Viro
2001-11-17 19:54       ` H. Peter Anvin [this message]

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='9t6fa4$ldo$1@cesium.transmeta.com' \
    --to=hpa@zytor.com \
    --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