History

Merge branch 'for-linus-4.5' of git://git.kernel.org/pub/scm/linux/kernel/git/mason/linux-btrfs

Pull btrfs fix from Chris Mason: "Filipe nailed down a problem where tree log replay would do some work that orphan code wasn't expecting to be done yet, leading to BUG_ON" * 'for-linus-4.5' of git://git.kernel.org/pub/scm/linux/kernel/git/mason/linux-btrfs: Btrfs: fix loading of orphan roots leading to BUG_ON

Linus Torvalds committed 10 years ago

Commit 2cdcb2b2 parents 78baab7 909c3a21 file · +9 −1Browse files

Unified · Split

fs/btrfs/root-tree.c+9−1
@@ -310,8 +310,16 @@ int btrfs_find_orphan_roots(struct btrfs_root *tree_root) · 309 unmodified lines
310310 set_bit(BTRFS_ROOT_ORPHAN_ITEM_INSERTED, &root->state);
311311
312312 err = btrfs_insert_fs_root(root->fs_info, root);
313+ /*
314+ * The root might have been inserted already, as before we look
315+ * for orphan roots, log replay might have happened, which
316+ * triggers a transaction commit and qgroup accounting, which
317+ * in turn reads and inserts fs roots while doing backref
318+ * walking.
319+ */
320+ if (err == -EEXIST)
321+ err = 0;
313322 if (err) {
314− BUG_ON(err == -EEXIST);
315323 btrfs_free_fs_root(root);
316324 break;
317325 }

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t