Commit e3acc2a6 authored by Josef Bacik's avatar Josef Bacik Committed by Chris Mason
Browse files

Btrfs: run orphan cleanup on default fs root

This patch revert's commit


Since it introduces this problem where we can run orphan cleanup on a
volume that can have orphan entries re-added.  Instead of my original
fix, Yan Zheng pointed out that we can just revert my original fix and
then run the orphan cleanup in open_ctree after we look up the fs_root.
I have tested this with all the tests that gave me problems and this
patch fixes both problems.  Thanks,
Signed-off-by: default avatarJosef Bacik <>
Signed-off-by: default avatarChris Mason <>
parent f858153c
......@@ -1993,6 +1993,12 @@ struct btrfs_root *open_ctree(struct super_block *sb,
if (!fs_info->fs_root)
goto fail_trans_kthread;
if (!(sb->s_flags & MS_RDONLY)) {
return tree_root;
......@@ -3797,12 +3797,6 @@ struct inode *btrfs_lookup_dentry(struct inode *dir, struct dentry *dentry)
if (location.type == BTRFS_INODE_ITEM_KEY) {
inode = btrfs_iget(dir->i_sb, &location, root);
if (unlikely(root->clean_orphans) &&
!(inode->i_sb->s_flags & MS_RDONLY)) {
return inode;
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment