linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] btrfs-progs: check: run delayed refs after writing out dirty block groups
@ 2019-04-02 18:09 jeffm
  2019-04-02 18:09 ` [PATCH 2/2] btrfs-progs: check: fixup_extent_flags needs to deal with non-skinny metadata jeffm
  2019-04-02 19:19 ` [PATCH 1/2] btrfs-progs: check: run delayed refs after writing out dirty block groups Filipe Manana
  0 siblings, 2 replies; 10+ messages in thread
From: jeffm @ 2019-04-02 18:09 UTC (permalink / raw)
  To: linux-btrfs; +Cc: Jeff Mahoney

From: Jeff Mahoney <jeffm@suse.com>

When repairing the extent tree, it's possible for delayed extents to
be created when running btrfs_write_dirty_block_groups.  We run
delayed refs one last time in the kernel but that is missing in
the userspace tools.

That results in delayed refs getting dropped on the floor, the extent
records not getting created, and in the next tranaction, when the
extent tree is CoW'd again, we hit the BUG_ON when we can't find
the extent record.

We can fix this by running the delayed refs after writing out the
dirty block groups.

Signed-off-by: Jeff Mahoney <jeffm@suse.com>
---
 transaction.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/transaction.c b/transaction.c
index e756db33..2f19e9c8 100644
--- a/transaction.c
+++ b/transaction.c
@@ -194,6 +194,8 @@ commit_tree:
 	ret = btrfs_run_delayed_refs(trans, -1);
 	BUG_ON(ret);
 	btrfs_write_dirty_block_groups(trans);
+	ret = btrfs_run_delayed_refs(trans, -1);
+	BUG_ON(ret);
 	__commit_transaction(trans, root);
 	if (ret < 0)
 		goto out;
-- 
2.16.4


^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2019-07-24 14:17 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-04-02 18:09 [PATCH 1/2] btrfs-progs: check: run delayed refs after writing out dirty block groups jeffm
2019-04-02 18:09 ` [PATCH 2/2] btrfs-progs: check: fixup_extent_flags needs to deal with non-skinny metadata jeffm
2019-04-02 19:21   ` Filipe Manana
2019-04-02 19:19 ` [PATCH 1/2] btrfs-progs: check: run delayed refs after writing out dirty block groups Filipe Manana
2019-04-04  2:38   ` Jeff Mahoney
2019-05-15 14:16     ` David Sterba
2019-05-15 14:45       ` Filipe Manana
2019-05-17 13:12         ` David Sterba
2019-07-24 13:53           ` Jeff Mahoney
2019-07-24 14:17             ` David Sterba

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).