diff options
author | Josef Bacik <josef@redhat.com> | 2010-01-26 09:30:53 -0500 |
---|---|---|
committer | Chris Mason <chris.mason@oracle.com> | 2010-01-28 16:20:39 -0500 |
commit | e3acc2a6850efff647f1c5458524eb3a8bcba20a (patch) | |
tree | a111740f879f5f0cbbcaf079c2500535263c1278 /fs/btrfs/disk-io.c | |
parent | f858153c367a397235d3e81136741e40e44faf1d (diff) |
Btrfs: run orphan cleanup on default fs root
This patch revert's commit
6c090a11e1c403b727a6a8eff0b97d5fb9e95cb5
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: Josef Bacik <josef@redhat.com>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
Diffstat (limited to 'fs/btrfs/disk-io.c')
-rw-r--r-- | fs/btrfs/disk-io.c | 6 |
1 files changed, 6 insertions, 0 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: |