mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Chris Wedgwood <cw@f00f.org>
To: Jan Blunck <j.blunck@tu-harburg.de>
Cc: Linus Torvalds <torvalds@osdl.org>, Andrew Morton <akpm@osdl.org>,
	Linux-Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] ramfs: pretend dirent sizes
Date: Tue, 19 Jul 2005 11:32:06 -0700	[thread overview]
Message-ID: <20050719183206.GA23253@taniwha.stupidest.org> (raw)
In-Reply-To: <42DD44E2.3000605@tu-harburg.de>

On Tue, Jul 19, 2005 at 08:22:26PM +0200, Jan Blunck wrote:

> Since these "arranged" values are also used as the offsets in the
> return dirent IMO it is quite clean.

So the size you want to reflect is n*<stack-depth> i take it?  Where
in this case n is 20?

So you can seek to m*<stack-depth>+<offset> to access an offset into
something at depth m?

> Nope. This value is kind of traditional: tmpfs is using it
> (http://marc.theaimsgroup.com/?l=linux-kernel&m=103208296515378&w=2). I
> think a better value would be 1 (one) since this is also used as the
> dirent offset by dcache_readdir().

I really don't know why tmpfs is doing this.

> The i_size of a directory isn't covered by the POSIX standard. IMO,
> it should be possible to seek in the range of i_size and a following
> readdir() on the directory should succeed.

With what defined semantics?  What if an entry is added in between
seek and readdir?

> But this isn't possible even not with real file systems like ext2.

I'm not sure how expecting a meaningful offset into a directory can
have consistent bahvior.

> But keeping the i_size bound to zero even if the directory contains
> entries does not make sense at all.

Why?  It seems perfectly reasonable that we can return 0 in such
cases.  Zero seems to make more sense as 'magical/unknown' than say
any other arbitrary value.

It's also possible a regular filesystem could return an arbitrary
value such as 20 (not that this directly matters except it becomes
confusing potentially):

    cw@taniwha:~$ mkdir foobar
    cw@taniwha:~$ ls -ld foobar
    drwxr-xr-x  2 cw cw 6 Jul 19 11:29 foobar

    cw@taniwha:~$ mkdir foobar/1234567
    cw@taniwha:~$ ls -ld foobar
    drwxr-xr-x  3 cw cw 20 Jul 19 11:30 foobar

  reply	other threads:[~2005-07-19 18:32 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-07-15  3:01 Jan Blunck
2005-07-15  3:11 ` Andrew Morton
2005-07-15 10:16   ` Jan Blunck
2005-07-15 18:52 ` Linus Torvalds
2005-07-16  0:39   ` Chris Wedgwood
2005-07-19  9:28     ` Jan Blunck
2005-07-19 16:16       ` Chris Wedgwood
2005-07-19 18:22         ` Jan Blunck
2005-07-19 18:32           ` Chris Wedgwood [this message]
2005-07-19 19:14             ` Jan Blunck
2005-07-19 19:16               ` Chris Wedgwood
2005-07-20 11:21                 ` Jörn Engel
2005-07-20 18:11                   ` Chris Wedgwood
2005-07-20 18:48                     ` Jan Blunck
2005-07-20 18:52                       ` Peter Staubach
2005-07-21  7:26                       ` Jörn Engel
2005-07-21  7:20                     ` Jörn Engel
2005-07-21  7:25                       ` Chris Wedgwood
2005-07-21  7:27                         ` Jörn Engel
2005-07-20 18:24                 ` Jan Blunck
2005-07-20 18:50                   ` Peter Staubach
2005-07-19  9:46   ` Jan Blunck
     [not found] <4qoKs-6yv-13@gated-at.bofh.it>
     [not found] ` <4qoU5-6CQ-3@gated-at.bofh.it>
     [not found]   ` <4qvsI-32Y-17@gated-at.bofh.it>
2005-07-15 13:12     ` Bodo Eggert
2005-07-19  9:13       ` Jan Blunck

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=20050719183206.GA23253@taniwha.stupidest.org \
    --to=cw@f00f.org \
    --cc=akpm@osdl.org \
    --cc=j.blunck@tu-harburg.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@osdl.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

all inboxes | Powered by JetHome®