From: Chris Mason <clmason@fusionio.com>
To: "dsterba@suse.cz" <dsterba@suse.cz>,
David Sterba <dsterba@suse.cz>, Miao Xie <miaox@cn.fujitsu.com>
Cc: "dsterba@suse.cz" <dsterba@suse.cz>, Zach Brown <zab@redhat.com>,
"linux-btrfs@vger.kernel.org" <linux-btrfs@vger.kernel.org>
Subject: Re: [PATCH 0/6] fix INT_MAX readdir hang, plus cleanups
Date: Thu, 6 Jun 2013 10:32:27 -0400 [thread overview]
Message-ID: <20130606143227.4088.53583@localhost.localdomain> (raw)
In-Reply-To: <20130606135550.GG18160@twin.jikos.cz>
Quoting David Sterba (2013-06-06 09:55:50)
> On Thu, Jun 06, 2013 at 09:35:07AM +0800, Miao Xie wrote:
> > On wed, 5 Jun 2013 15:36:36 +0200, David Sterba wrote:
> > > On Wed, Jun 05, 2013 at 10:34:08AM +0800, Miao Xie wrote:
> > >> On tue, 4 Jun 2013 16:26:57 -0700, Zach Brown wrote:
> > >>> On Tue, Jun 04, 2013 at 07:16:53PM -0400, Chris Mason wrote:
> > >>>> Quoting Zach Brown (2013-06-04 18:17:54)
> > >>>>> Hi gang,
> > >>>>>
> > >>>>> I finally sat down to fix that readdir hang that has been in the back
> > >>>>> of my mind for a while. I *hope* that the fix is pretty simple: just
> > >>>>> don't manufacture a fake f_pos, I *think* we can abuse f_version as an
> > >>>>> indicator that we shouldn't return entries. Does this look reasonable?
> > >>>>
> > >>>> I like it, and it doesn't look too far away from how others are abusing
> > >>>> f_version. Have you tried with NFS? I don't think it'll hurt, but NFS
> > >>>> loves to surprise me.
> > >>>
> > >>> Mm, no, I hadn't. I'll give it a go tomorrow. What could go wrong? :)
> > >>
> > >> If we can not use f_version, we can use private_data. I think this variant is
> > >> safe.
> > >
> > > private_data is used within the ioctl user transactions, so a
> > > readdir(mountpoint) with a user transaction running can break it.
> >
> > don't worry, we can allocate a structure to keep both transaction handle and the information
> > of readdir, just like ext3/ext4. It is a flexible way and we can extend the structure to keep
> > more information if need in the future.
> >
> > Beside the above method, we also can abuse the low bits of private_data to indicator that
> > we shouldn't return entries.
>
> Allocating a full structure for private_data sounds better than directly
> modifying the pointer value itself.
I'd actually rather tag the pointers than go through kmalloc, we just
need one bit (maybe that really just shows how badly we've corrupted
poor Miao). But, we're not there yet, I think Zach's initial patch will
work fine.
-chris
next prev parent reply other threads:[~2013-06-06 14:32 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-06-04 22:17 [PATCH 0/6] fix INT_MAX readdir hang, plus cleanups Zach Brown
2013-06-04 22:17 ` [PATCH 1/6] btrfs: set readdir f_pos only after filldir Zach Brown
2013-06-05 1:19 ` Miao Xie
2013-06-04 22:17 ` [PATCH 2/6] btrfs: fix readdir hang with offsets past INT_MAX Zach Brown
2013-06-04 22:17 ` [PATCH 3/6] btrfs: trivial delayed item readdir list cleanups Zach Brown
2013-06-04 22:17 ` [PATCH 4/6] btrfs: simplify finding next/prev delayed items Zach Brown
2013-06-04 22:17 ` [PATCH 5/6] btrfs: add helper to get delayed item root Zach Brown
2013-06-04 22:18 ` [PATCH 6/6] btrfs: get fewer delayed item refs during readdir Zach Brown
2013-06-04 23:16 ` [PATCH 0/6] fix INT_MAX readdir hang, plus cleanups Chris Mason
2013-06-04 23:26 ` Zach Brown
2013-06-05 2:34 ` Miao Xie
2013-06-05 13:36 ` David Sterba
2013-06-06 1:35 ` Miao Xie
2013-06-06 13:55 ` David Sterba
2013-06-06 14:32 ` Chris Mason [this message]
2013-06-10 22:39 ` Zach Brown
2013-06-12 12:59 ` Chris Mason
2013-07-01 12:54 ` Josef Bacik
2013-07-01 13:18 ` Chris Mason
2013-07-01 16:10 ` Zach Brown
2013-07-01 17:18 ` Chris Mason
2013-07-11 23:19 ` Zach Brown
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=20130606143227.4088.53583@localhost.localdomain \
--to=clmason@fusionio.com \
--cc=dsterba@suse.cz \
--cc=linux-btrfs@vger.kernel.org \
--cc=miaox@cn.fujitsu.com \
--cc=zab@redhat.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;
as well as URLs for NNTP newsgroup(s).