Linux Btrfs filesystem development
 help / color / mirror / Atom feed
From: Eugeniu Rosca <erosca@de.adit-jv.com>
To: Filipe Manana <fdmanana@kernel.org>, Qu Wenruo <wqu@suse.com>
Cc: <linux-btrfs@vger.kernel.org>, Filipe Manana <fdmanana@suse.com>,
	Rob Landley <rob@landley.net>, <stable@vger.kernel.org>,
	David Sterba <dsterba@suse.com>, <Maksim.Paimushkin@se.bosch.com>,
	<Eugeniu.Rosca@bosch.com>, <erosca@de.adit-jv.com>,
	Eugeniu Rosca <roscaeugeniu@gmail.com>
Subject: Re: [PATCH v2] btrfs: fix infinite directory reads
Date: Thu, 25 Jan 2024 12:33:54 +0100	[thread overview]
Message-ID: <20240125113354.GA2629056@lxhi-087> (raw)
In-Reply-To: <CAL3q7H77i3kv7C352k2R6nr-m-cgh_cdCCeTkXna+v1yjpMuoA@mail.gmail.com>

Hi Filipe and Qu,

On Thu, Jan 25, 2024 at 10:02:01AM +0000, Filipe Manana wrote:
> On Thu, Jan 25, 2024 at 9:51 AM Qu Wenruo <wqu@suse.com> wrote:
> >
> > From: Filipe Manana <fdmanana@suse.com>
> >
> > [ Upstream commit 9b378f6ad48cfa195ed868db9123c09ee7ec5ea2 ]
> >
> > The readdir implementation currently processes always up to the last index
> > it finds. This however can result in an infinite loop if the directory has

[..]

> Thanks for the backport, and running the corresponding test case from
> fstests to verify it's working.
> 
> However when backporting a commit, one should also check if there are
> fixes for that commit, as they
> often introduce regressions or have some other bug - 

+1. Good to see this best practice applied here.

> and that's the
> case here. We also need to backport
> the following 3 commits:
> 
> https:// git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=357950361cbc6d54fb68ed878265c647384684ae
> https:// git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=e60aa5da14d01fed8411202dbe4adf6c44bd2a57
> https:// git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=8e7f82deb0c0386a03b62e30082574347f8b57d5

Good catch. I get the same list thanks to the reference of the culprit:

$ git log --oneline --grep 9b378f6ad linux/master
8e7f82deb0c038 btrfs: fix race between reading a directory and adding entries to it
e60aa5da14d01f btrfs: refresh dir last index during a rewinddir(3) call
357950361cbc6d btrfs: set last dir index to the current last index when opening dir

> One regression, the one regarding rewinddir(3), even has a test case
> in fstests too (generic/471) and would have been caught
> when running the "dir" group tests in fstests:
> 
> https:// git.kernel.org/pub/scm/fs/xfs/xfstests-dev.git/commit/?h=for-next&id=68b958f5dc4ab13cfd86f7fb82621f9f022b7626
> 
> I'll work on making backports of those 3 other patches on top of your
> backport, and then send all of them in a series,
> including your patch, to make it easier to follow and apply all at once.

Thanks for your support. Looking forward.

BR, Eugeniu

  reply	other threads:[~2024-01-25 11:34 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-25  9:50 [PATCH v2] btrfs: fix infinite directory reads Qu Wenruo
2024-01-25 10:02 ` Filipe Manana
2024-01-25 11:33   ` Eugeniu Rosca [this message]
2024-01-25 12:03     ` Filipe Manana
2024-01-25 23:06   ` Qu Wenruo

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=20240125113354.GA2629056@lxhi-087 \
    --to=erosca@de.adit-jv.com \
    --cc=Eugeniu.Rosca@bosch.com \
    --cc=Maksim.Paimushkin@se.bosch.com \
    --cc=dsterba@suse.com \
    --cc=fdmanana@kernel.org \
    --cc=fdmanana@suse.com \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=rob@landley.net \
    --cc=roscaeugeniu@gmail.com \
    --cc=stable@vger.kernel.org \
    --cc=wqu@suse.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