All of lore.kernel.org
 help / color / mirror / Atom feed
From: Eric Sandeen <sandeen@redhat.com>
To: "Theodore Ts'o" <tytso@mit.edu>
Cc: ext4 development <linux-ext4@vger.kernel.org>,
	Anand Avati <avati@redhat.com>, Jan Kara <jack@suse.cz>
Subject: Re: [PATCH, RFC V3] ext3: add ioctl to force 32-bit hashes from indexed dirs
Date: Mon, 01 Apr 2013 13:21:51 -0500	[thread overview]
Message-ID: <5159D03F.5000606@redhat.com> (raw)
In-Reply-To: <20130401181718.GB22443@thunk.org>

On 4/1/13 1:17 PM, Theodore Ts'o wrote:
> On Mon, Apr 01, 2013 at 10:33:41AM -0500, Eric Sandeen wrote:
>> +		/* Have we already started readdir on this dx dir? */
>> +		if (filp->private_data) {
>> +			err = -EINVAL;
>> +			goto hash32bits_out;
>> +		}
> 
> I'm not sure how much we care, but if filp->private_data is non-NULL
> and filp->f_pos == 0, then the application must have called
> rewinddir(), and at that point it would be fair game for us to free
> the rb_tree (see the code in ext4_dx_readdir() just after the comment
> "Some one has messed with f_pos; reset the world".)

Hm, I originally tested f_pos == 0, and Zach thought that wasn't the right
test, suggested f_private, and that seemed right to me, but yeah, I suppose
!f_pos && f_private means it got rewound.

> This would allow a bit more flexibility than just requiring that the
> ioctl be issued just after the opendir(), and allow it just after a
> call to rewinddir().

I guess I do wonder what real-world use that might have, though.

> This this would invalidate any previously issued telldir() cookies,
> but according to SuSv3, telldir() cookies are not guaranteed to be
> consistent after a rewinddir() or a closedir(), so it would be
> standards compliant to do this.

Well, could do.  Think it's worth it?

If so, then we could also allow flipping the flag on and off.
I suppose it's good to get the interface right to start with;
if we really want to be able to flip it on and off after a rewinddir,
then . . . ok, V4?  It's more flexible, but I don't know what the
usecase might be.

-Eric

> 						- Ted
> 


  reply	other threads:[~2013-04-01 18:22 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-28 16:25 [PATCH, RFC] ext3: add ioctl to force 32-bit hashes from indexed dirs Eric Sandeen
2013-03-28 20:40 ` [PATCH, RFC V2] " Eric Sandeen
2013-03-29 11:43   ` Jan Kara
2013-04-01 15:13     ` Eric Sandeen
2013-04-01 15:33   ` [PATCH, RFC V3] " Eric Sandeen
2013-04-01 18:17     ` Theodore Ts'o
2013-04-01 18:21       ` Eric Sandeen [this message]
2013-04-01 19:08         ` Theodore Ts'o
2013-04-01 19:49           ` Eric Sandeen
2013-04-01 20:00             ` Theodore Ts'o
2013-04-01 20:05               ` Eric Sandeen
2013-04-01 20:09                 ` Theodore Ts'o
     [not found]                 ` <5159E88F.8030704-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2013-04-01 20:34                   ` Anand Avati
2013-04-05 23:05                     ` Andrew Bartlett
2013-04-05 23:28                       ` J. Bruce Fields
2013-04-05 23:26                         ` Anand Avati
2013-04-08  9:28                           ` Andrew Bartlett
2013-04-03 12:54     ` Jan Kara

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=5159D03F.5000606@redhat.com \
    --to=sandeen@redhat.com \
    --cc=avati@redhat.com \
    --cc=jack@suse.cz \
    --cc=linux-ext4@vger.kernel.org \
    --cc=tytso@mit.edu \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.