Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 52e5087c authored by Chris Mason's avatar Chris Mason Committed by Sasha Levin
Browse files

Btrfs: remove root_log_ctx from ctx list before btrfs_sync_log returns



[ Upstream commit cbd60aa7cd17d81a434234268c55192862147439 ]

We use a btrfs_log_ctx structure to pass information into the
tree log commit, and get error values out.  It gets added to a per
log-transaction list which we walk when things go bad.

Commit d1433deb added an optimization to skip waiting for the log
commit, but didn't take root_log_ctx out of the list.  This
patch makes sure we remove things before exiting.

Signed-off-by: default avatarChris Mason <clm@fb.com>
Fixes: d1433deb
cc: stable@vger.kernel.org # 3.15+
Signed-off-by: default avatarSasha Levin <alexander.levin@verizon.com>
parent a55325e1
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -2605,6 +2605,7 @@ int btrfs_sync_log(struct btrfs_trans_handle *trans,

	if (log_root_tree->log_transid_committed >= root_log_ctx.log_transid) {
		blk_finish_plug(&plug);
		list_del_init(&root_log_ctx.list);
		mutex_unlock(&log_root_tree->log_mutex);
		ret = root_log_ctx.log_ret;
		goto out;