diff options
author | Joel Stanley <joel@jms.id.au> | 2019-12-12 01:32:01 +0300 |
---|---|---|
committer | Joel Stanley <joel@jms.id.au> | 2019-12-12 01:32:06 +0300 |
commit | fdc60468f3e452364d432f1a7c3f83d58bba1b84 (patch) | |
tree | de7197f150958ae72cb87b6cf4885610f3edd704 /fs/btrfs/inode.c | |
parent | 20572eecd7248b66d855a8e4812debd9f828ccba (diff) | |
parent | 8539dfa4fcbcf58c3c2f92ac57b964add884d12b (diff) | |
download | linux-dev-5.3.tar.xz |
Merge tag 'v5.3.15' into dev-5.3dev-5.3
This is the 5.3.15 stable release
Signed-off-by: Joel Stanley <joel@jms.id.au>
Diffstat (limited to 'fs/btrfs/inode.c')
-rw-r--r-- | fs/btrfs/inode.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c index a0318bc57fa6..5b7768ccd20b 100644 --- a/fs/btrfs/inode.c +++ b/fs/btrfs/inode.c @@ -9723,6 +9723,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; @@ -9736,6 +9748,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; } |