Btrfs: remove root_log_ctx from ctx list before btrfs_sync_log returns
authorChris Mason <clm@fb.com>
Tue, 6 Sep 2016 12:37:40 +0000 (05:37 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 24 Sep 2016 08:07:41 +0000 (10:07 +0200)
commit5e0286ed4f61c840802adc432cbcb6c90d08e0d8
treef9869684e7a7c93830a48691b2739269a68c83d0
parent3d1ca49a9a784b463f1a0f47fa66eb93a5f5b644
Btrfs: remove root_log_ctx from ctx list before btrfs_sync_log returns

commit cbd60aa7cd17d81a434234268c55192862147439 upstream.

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 d1433debe 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: Chris Mason <clm@fb.com>
Fixes: d1433debe7f4346cf9fc0dafc71c3137d2a97bc4
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/btrfs/tree-log.c