FAILED: patch "[PATCH] btrfs: don't double lock the subvol_sem for rename exchange" failed to apply to 4.9-stable tree
Subsystems (2)
[email protected]
maintainerThe patch below does not apply to the 4.9-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 <[email protected]>.
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
From 943eb3bf25f4a7b745dd799e031be276aa104d82 Mon Sep 17 00:00:00 2001
From: Josef Bacik <[email protected]>
Date: Tue, 19 Nov 2019 13:59:20 -0500
Subject: [PATCH] btrfs: don't double lock the subvol_sem for rename exchange
If we're rename exchanging two subvols we'll try to lock this lock twice, which is bad. Just lock once if either of the ino's are subvols.
fs/btrfs/inode.c +4 -6
@@ -9554,9 +9554,8 @@ static int btrfs_rename_exchange(struct inode *old_dir,btrfs_init_log_ctx (&ctx_dest, new_inode);/* close the race window with snapshot create/destroy ioctl */ -if (old_ino ==BTRFS_FIRST_FREE_OBJECTID ) -down_read (&fs_info->subvol_sem); -if (new_ino ==BTRFS_FIRST_FREE_OBJECTID ) +if (old_ino ==BTRFS_FIRST_FREE_OBJECTID || + new_ino ==BTRFS_FIRST_FREE_OBJECTID )down_read (&fs_info->subvol_sem);/*
@@ -9790,9 +9789,8 @@ static int btrfs_rename_exchange(struct inode *old_dir, ret = ret ? ret : ret2; } out_notrans: -if (new_ino ==BTRFS_FIRST_FREE_OBJECTID ) -up_read (&fs_info->subvol_sem); -if (old_ino ==BTRFS_FIRST_FREE_OBJECTID ) +if (new_ino ==BTRFS_FIRST_FREE_OBJECTID || + old_ino ==BTRFS_FIRST_FREE_OBJECTID )up_read (&fs_info->subvol_sem);ASSERT (list_empty (&ctx_root.list));
Sasha Levin
maintainerQuoted 17 lines · On Mon, Dec 23, 2019 at 12:11:14PM -0500, [email protected] wrote:
The patch below does not apply to the 4.9-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 <[email protected]>.thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
From
943eb3bf25f4a7b745dd799e031be276aa104d82Mon Sep 17 00:00:00 2001
From: Josef Bacik <[email protected]>
Date: Tue, 19 Nov 2019 13:59:20 -0500
Subject: [PATCH] btrfs: don't double lock thesubvol_semfor rename exchange
Quoted 8 lines
If we're rename exchanging two subvols we'll try to lock this lock twice, which is bad. Just lock once if either of the ino's are subvols.
Fixes cdd1fedf8261 ("btrfs: add support for RENAME_EXCHANGE and RENAME_WHITEOUT")CC [email protected] # 4.4+Signed-off-by Josef Bacik <[email protected]>Reviewed-by David Sterba <[email protected]>Signed-off-by David Sterba <[email protected]>
I've fixed it up and queued for 4.9. I don't think it needs to go to 4.4 as cdd1fedf8261 isn't in 4.4.
Signature · 2 lines
Thanks, Sasha