search for: btrfs_commit_super

Displaying 8 results from an estimated 8 matches for "btrfs_commit_super".

2010 Dec 01
2
[RFC PATCH 4/4 v2] Btrfs: deal with filesystem state at mount, umount
...t(disk_super)) goto fail_iput; + /* check filesystem state */ + fs_info->fs_state |= btrfs_super_flags(disk_super); + + btrfs_check_super_valid(fs_info, sb->s_flags & MS_RDONLY); + ret = btrfs_parse_options(tree_root, options); if (ret) { err = ret; @@ -2405,10 +2412,17 @@ int btrfs_commit_super(struct btrfs_root *root) up_write(&root->fs_info->cleanup_work_sem); trans = btrfs_join_transaction(root, 1); + if (IS_ERR(trans)) + return PTR_ERR(trans); + ret = btrfs_commit_transaction(trans, root); BUG_ON(ret); + /* run commit again to drop the original snapshot */ tra...
2013 Oct 19
13
[PATCH] Btrfs: fix race condition between writting and scrubing supers
...long <wangsl.fnst@cn.fujitsu.com> --- fs/btrfs/disk-io.c | 2 ++ fs/btrfs/transaction.c | 2 ++ 2 files changed, 4 insertions(+) diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c index 419968e..0debb19 100644 --- a/fs/btrfs/disk-io.c +++ b/fs/btrfs/disk-io.c @@ -3582,7 +3582,9 @@ int btrfs_commit_super(struct btrfs_root *root) return ret; } + btrfs_scrub_pause_super(root); ret = write_ctree_super(NULL, root, 0); + btrfs_scrub_continue_super(root); return ret; } diff --git a/fs/btrfs/transaction.c b/fs/btrfs/transaction.c index 277fe81..3ebcbbd 100644 --- a/fs/btrfs/transaction.c +++...
2012 Apr 26
7
[PATCH 2/4] Btrfs: fix deadlock on sb->s_umount when doing umount
The reason the deadlock is that: Task Btrfs-cleaner umount() down_write(&s->s_umount) sync_filesystem() do auto-defragment and produce lots of dirty pages close_ctree() wait for the end of btrfs-cleaner start_transaction reserve space shrink_delalloc() writeback_inodes_sb_nr_if_idle()
2012 Sep 17
2
'umount' of multi-device volume hangs until the device is physically un-plugged
...1/0x1eb [btrfs] [ 469.038099] [<ffffffffa0569aad>] btrfs_commit_transaction+0x59d/0xac0 [btrfs] [ 469.038105] [<ffffffff8107f610>] ? wake_up_bit+0x40/0x40 [ 469.038134] [<ffffffffa05b4d46>] ? __btrfs_scrub_cancel+0x106/0x110 [btrfs] [ 469.038160] [<ffffffffa0564aa6>] btrfs_commit_super+0x86/0x110 [btrfs] [ 469.038185] [<ffffffffa0566358>] close_ctree+0x2c8/0x320 [btrfs] [ 469.038191] [<ffffffff811aa067>] ? evict_inodes+0xb7/0x100 [ 469.038208] [<ffffffffa053d4b9>] btrfs_put_super+0x19/0x20 [btrfs] [ 469.038215] [<ffffffff81191611>] generic_shutdown...
2009 Nov 12
0
[PATCH 05/12] Btrfs: Avoid orphan inodes cleanup during replaying log
...>cleaner_mutex); mutex_init(&fs_info->volume_mutex); init_rwsem(&fs_info->extent_commit_sem); + init_rwsem(&fs_info->cleanup_work_sem); init_rwsem(&fs_info->subvol_sem); btrfs_init_free_cluster(&fs_info->meta_alloc_cluster); @@ -2388,6 +2388,11 @@ int btrfs_commit_super(struct btrfs_root *root) mutex_lock(&root->fs_info->cleaner_mutex); btrfs_clean_old_snapshots(root); mutex_unlock(&root->fs_info->cleaner_mutex); + + /* wait until ongoing cleanup work done */ + down_write(&root->fs_info->cleanup_work_sem); + up_write(&root-&...
2010 Apr 19
0
[PATCH 08/12] Btrfs: Introduce global metadata reservation
...aner_kthread)) @@ -2439,15 +2437,15 @@ int close_ctree(struct btrfs_root *root) fs_info->closing = 1; smp_mb(); - kthread_stop(root->fs_info->transaction_kthread); - kthread_stop(root->fs_info->cleaner_kthread); - if (!(fs_info->sb->s_flags & MS_RDONLY)) { ret = btrfs_commit_super(root); if (ret) printk(KERN_ERR "btrfs: commit super ret %d\n", ret); } + kthread_stop(root->fs_info->transaction_kthread); + kthread_stop(root->fs_info->cleaner_kthread); + fs_info->closing = 2; smp_mb(); diff -urp 8/fs/btrfs/extent-tree.c 9/fs/btrfs/exten...
2010 Sep 03
0
[PATCH 1/2] btrfs: document where we use BUG_ON instead of error handling
...trans, root); } @@ -1954,20 +1954,20 @@ struct btrfs_root *open_ctree(struct super_block *sb, blocksize, generation + 1); ret = btrfs_recover_log_trees(log_tree_root); - BUG_ON(ret); + btrfs_fixable_bug_on(ret); if (sb->s_flags & MS_RDONLY) { ret = btrfs_commit_super(tree_root); - BUG_ON(ret); + btrfs_fixable_bug_on(ret); } } ret = btrfs_find_orphan_roots(tree_root); - BUG_ON(ret); + btrfs_fixable_bug_on(ret); if (!(sb->s_flags & MS_RDONLY)) { ret = btrfs_cleanup_fs_roots(fs_info); - BUG_ON(ret); + btrfs_fixable_bug_on(ret); re...
2009 Aug 24
0
[PATCH] Btrfs: proper metadata -ENOSPC handling
...ino = 1; fs_info->btree_inode->i_nlink = 1; - fs_info->metadata_ratio = 8; + fs_info->metadata_ratio = 0; fs_info->thread_pool_size = min_t(unsigned long, num_online_cpus() + 2, 8); @@ -2285,18 +2283,15 @@ int btrfs_cleanup_fs_roots(struct btrfs_fs_info *fs_info) int btrfs_commit_super(struct btrfs_root *root) { - struct btrfs_trans_handle *trans; int ret; mutex_lock(&root->fs_info->cleaner_mutex); btrfs_clean_old_snapshots(root); mutex_unlock(&root->fs_info->cleaner_mutex); - trans = btrfs_start_transaction(root, 1); - ret = btrfs_commit_transactio...