summaryrefslogtreecommitdiffstats
path: root/fs/btrfs
diff options
context:
space:
mode:
authorIngo Molnar <mingo@kernel.org>2019-11-25 09:08:29 +0100
committerIngo Molnar <mingo@kernel.org>2019-11-25 09:08:29 +0100
commitc494cd6469ab0f4bdd663d1a2d396b0ec2f42103 (patch)
tree5830ff0a0266c5500188d1ee9df8f2cbe0871b35 /fs/btrfs
parent8cacac6ecd6d289d4ab52590784636a5b1043c66 (diff)
parentc4b75479741c9c3a4f0abff5baa5013d27640ac1 (diff)
downloadtalos-op-linux-c494cd6469ab0f4bdd663d1a2d396b0ec2f42103.tar.gz
talos-op-linux-c494cd6469ab0f4bdd663d1a2d396b0ec2f42103.zip
Merge branch 'perf/urgent' into perf/core, to pick up fixes
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'fs/btrfs')
-rw-r--r--fs/btrfs/inode.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c
index c6dc4dd16cf7..015910079e73 100644
--- a/fs/btrfs/inode.c
+++ b/fs/btrfs/inode.c
@@ -9744,6 +9744,18 @@ out_fail:
commit_transaction = true;
}
if (commit_transaction) {
+ /*
+ * We may have set commit_transaction when logging the new name
+ * in the destination root, in which case we left the source
+ * root context in the list of log contextes. So make sure we
+ * remove it to avoid invalid memory accesses, since the context
+ * was allocated in our stack frame.
+ */
+ if (sync_log_root) {
+ mutex_lock(&root->log_mutex);
+ list_del_init(&ctx_root.list);
+ mutex_unlock(&root->log_mutex);
+ }
ret = btrfs_commit_transaction(trans);
} else {
int ret2;
@@ -9757,6 +9769,9 @@ out_notrans:
if (old_ino == BTRFS_FIRST_FREE_OBJECTID)
up_read(&fs_info->subvol_sem);
+ ASSERT(list_empty(&ctx_root.list));
+ ASSERT(list_empty(&ctx_dest.list));
+
return ret;
}
OpenPOWER on IntegriCloud