diff options
| -rw-r--r-- | fs/btrfs/disk-io.c | 6 | ||||
| -rw-r--r-- | fs/btrfs/inode.c | 6 |
2 files changed, 6 insertions, 6 deletions
diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c index 009e3bd18f23..87b25543d7d1 100644 --- a/fs/btrfs/disk-io.c +++ b/fs/btrfs/disk-io.c | |||
| @@ -1993,6 +1993,12 @@ struct btrfs_root *open_ctree(struct super_block *sb, | |||
| 1993 | if (!fs_info->fs_root) | 1993 | if (!fs_info->fs_root) |
| 1994 | goto fail_trans_kthread; | 1994 | goto fail_trans_kthread; |
| 1995 | 1995 | ||
| 1996 | if (!(sb->s_flags & MS_RDONLY)) { | ||
| 1997 | down_read(&fs_info->cleanup_work_sem); | ||
| 1998 | btrfs_orphan_cleanup(fs_info->fs_root); | ||
| 1999 | up_read(&fs_info->cleanup_work_sem); | ||
| 2000 | } | ||
| 2001 | |||
| 1996 | return tree_root; | 2002 | return tree_root; |
| 1997 | 2003 | ||
| 1998 | fail_trans_kthread: | 2004 | fail_trans_kthread: |
diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c index 5606361b5f04..8cd109972fa6 100644 --- a/fs/btrfs/inode.c +++ b/fs/btrfs/inode.c | |||
| @@ -3797,12 +3797,6 @@ struct inode *btrfs_lookup_dentry(struct inode *dir, struct dentry *dentry) | |||
| 3797 | 3797 | ||
| 3798 | if (location.type == BTRFS_INODE_ITEM_KEY) { | 3798 | if (location.type == BTRFS_INODE_ITEM_KEY) { |
| 3799 | inode = btrfs_iget(dir->i_sb, &location, root); | 3799 | inode = btrfs_iget(dir->i_sb, &location, root); |
| 3800 | if (unlikely(root->clean_orphans) && | ||
| 3801 | !(inode->i_sb->s_flags & MS_RDONLY)) { | ||
| 3802 | down_read(&root->fs_info->cleanup_work_sem); | ||
| 3803 | btrfs_orphan_cleanup(root); | ||
| 3804 | up_read(&root->fs_info->cleanup_work_sem); | ||
| 3805 | } | ||
| 3806 | return inode; | 3800 | return inode; |
| 3807 | } | 3801 | } |
| 3808 | 3802 | ||
