stable.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Greg KH <gregkh@linuxfoundation.org>
To: Sasha Levin <sashal@kernel.org>
Cc: fdmanana@suse.com, dsterba@suse.com, stable@vger.kernel.org
Subject: Re: FAILED: patch "[PATCH] btrfs: fix log context list corruption after rename whiteout" failed to apply to 4.14-stable tree
Date: Mon, 23 Mar 2020 18:44:16 +0100	[thread overview]
Message-ID: <20200323174416.GA590267@kroah.com> (raw)
In-Reply-To: <20200323164458.GY4189@sasha-vm>

On Mon, Mar 23, 2020 at 12:44:58PM -0400, Sasha Levin wrote:
> On Mon, Mar 23, 2020 at 03:43:02PM +0100, gregkh@linuxfoundation.org wrote:
> > 
> > The patch below does not apply to the 4.14-stable tree.
> > If someone wants it applied there, or to any other stable or longterm
> > tree, then please email the backport, including the original git commit
> > id to <stable@vger.kernel.org>.
> > 
> > thanks,
> > 
> > greg k-h
> > 
> > ------------------ original commit in Linus's tree ------------------
> > 
> > > From 236ebc20d9afc5e9ff52f3cf3f365a91583aac10 Mon Sep 17 00:00:00 2001
> > From: Filipe Manana <fdmanana@suse.com>
> > Date: Tue, 10 Mar 2020 12:13:53 +0000
> > Subject: [PATCH] btrfs: fix log context list corruption after rename whiteout
> > error
> > 
> > During a rename whiteout, if btrfs_whiteout_for_rename() returns an error
> > we can end up returning from btrfs_rename() with the log context object
> > still in the root's log context list - this happens if 'sync_log' was
> > set to true before we called btrfs_whiteout_for_rename() and it is
> > dangerous because we end up with a corrupt linked list (root->log_ctxs)
> > as the log context object was allocated on the stack.
> > 
> > After btrfs_rename() returns, any task that is running btrfs_sync_log()
> > concurrently can end up crashing because that linked list is traversed by
> > btrfs_sync_log() (through btrfs_remove_all_log_ctxs()). That results in
> > the same issue that commit e6c617102c7e4 ("Btrfs: fix log context list
> > corruption after rename exchange operation") fixed.
> > 
> > Fixes: d4682ba03ef618 ("Btrfs: sync log after logging new name")
> > CC: stable@vger.kernel.org # 4.19+
> > Signed-off-by: Filipe Manana <fdmanana@suse.com>
> > Signed-off-by: David Sterba <dsterba@suse.com>
> 
> Greg, I'm not sure why you tried this for 4.14 - it's tagged 4.19+ and
> we don't have d4682ba03ef618 in 4.14 either.

Ah, I thought this was backported, as "simple" grep shows it showing up
in 4.14.110, but that was just a reference to the short git commit id.

I need to fix my scripts to always expand it to the full sha1 to prevent
that from catching.

thanks,

greg k-h

      reply	other threads:[~2020-03-23 17:44 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-23 14:43 FAILED: patch "[PATCH] btrfs: fix log context list corruption after rename whiteout" failed to apply to 4.14-stable tree gregkh
2020-03-23 16:44 ` Sasha Levin
2020-03-23 17:44   ` Greg KH [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=20200323174416.GA590267@kroah.com \
    --to=gregkh@linuxfoundation.org \
    --cc=dsterba@suse.com \
    --cc=fdmanana@suse.com \
    --cc=sashal@kernel.org \
    --cc=stable@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;
as well as URLs for NNTP newsgroup(s).