search for: trans_mutex

Displaying 14 results from an estimated 14 matches for "trans_mutex".

2007 Aug 09
1
[RFC] All my fsync changes
...s removed (meaning it had been committed and freed) we just exit out. So here are the numbers. This is running fs_mark with the following command fs_mark -d /mnt/btrfs-test/default/ -s 10240 -n 1000 run 10 times. First run is without any of the patches, with the exception of the put_transaction/trans_mutex fix. FSUse% Count Size Files/sec App Overhead 0 1000 10240 72.4 6366 0 1000 10240 54.4 6340 0 1000 10240 62.3 6451 0 1000 10240...
2009 Aug 24
0
[PATCH] Btrfs: proper metadata -ENOSPC handling
...tion_kthread(void *arg) { struct btrfs_root *root = arg; - struct btrfs_trans_handle *trans; struct btrfs_transaction *cur; unsigned long now; unsigned long delay; @@ -1485,8 +1484,7 @@ static int transaction_kthread(void *arg) goto sleep; } mutex_unlock(&root->fs_info->trans_mutex); - trans = btrfs_start_transaction(root, 1); - ret = btrfs_commit_transaction(trans, root); + ret = btrfs_force_transaction_commit(root, 0); sleep: wake_up_process(root->fs_info->cleaner_kthread); @@ -1574,7 +1572,7 @@ struct btrfs_root *open_ctree(struct super_block *sb, fs_info-...
2010 Mar 22
5
[PATCH 0/5] asynchronous commit, snapshot ponies
Hi everyone, This patchset is the latest approach I''m using for the Ceph storage daemon to keep track of which data has safely committed to disk. The basic idea is to not use the (problematic) user transaction ioctls at all. Instead, the daemon quiesces its own write requests, initiates an async snapshot, and then continues. The snapshot approach is nice because it provides rollback.
2010 Oct 25
14
[PATCH 0/6] Btrfs commit fixes, async subvol operations
Hi Chris, This is the extent of my current queue of Btrfs snapshot/subvol/commit stuff. Most of these were posted several months ago. Can be sent upstream during this merge window? Not having this functionality is becoming a bit of a roadblock for our efforts to keep the Ceph data in a consistent state. These patches are also available from
2009 Jan 24
2
[PATCH] btrfs: flushoncommit mount option
...transaction.c @@ -892,6 +892,7 @@ int btrfs_commit_transaction(struct btrfs_trans_handle *trans, struct extent_io_tree *pinned_copy; DEFINE_WAIT(wait); int ret; + int ordered = btrfs_test_opt(root, FLUSHONCOMMIT); INIT_LIST_HEAD(&dirty_fs_roots); mutex_lock(&root->fs_info->trans_mutex); @@ -952,7 +953,9 @@ int btrfs_commit_transaction(struct btrfs_trans_handle *trans, mutex_unlock(&root->fs_info->trans_mutex); - if (snap_pending) { + if (ordered || snap_pending) { + if (ordered) + btrfs_start_delalloc_inodes(root); ret = btrfs_wait_ordered_extents(roo...
2010 Apr 19
0
[PATCH 08/12] Btrfs: Introduce global metadata reservation
...unsigned long delay; int ret; do { - smp_mb(); - if (root->fs_info->closing) - break; - delay = HZ * 30; vfs_check_frozen(root->fs_info->sb, SB_FREEZE_WRITE); - mutex_lock(&root->fs_info->transaction_kthread_mutex); - mutex_lock(&root->fs_info->trans_mutex); + spin_lock(&root->fs_info->new_trans_lock); cur = root->fs_info->running_transaction; if (!cur) { - mutex_unlock(&root->fs_info->trans_mutex); + spin_unlock(&root->fs_info->new_trans_lock); goto sleep; } now = get_seconds(); - if (now &...
2010 Oct 26
0
[PATCH v2] Btrfs: fix deadlock in btrfs_commit_transaction
...@ int btrfs_commit_transaction(struct btrfs_trans_handle *trans, snap_pending = 1; WARN_ON(cur_trans != trans->transaction); - if (cur_trans->num_writers > 1) - timeout = MAX_SCHEDULE_TIMEOUT; - else if (should_grow) - timeout = 1; - mutex_unlock(&root->fs_info->trans_mutex); if (flush_on_commit || snap_pending) { @@ -1089,8 +1084,10 @@ int btrfs_commit_transaction(struct btrfs_trans_handle *trans, TASK_UNINTERRUPTIBLE); smp_mb(); - if (cur_trans->num_writers > 1 || should_grow) - schedule_timeout(timeout); + if (cur_trans->num_writers >...
2009 Nov 10
12
[RFC] big fat transaction ioctl
...oto out; + + ret = -EFAULT; + if (copy_from_user(&ut, orig_ut, sizeof(ut))) + goto out; + + ret = mnt_want_write(file->f_path.mnt); + if (ret) + goto out; + + ret = btrfs_reserve_metadata_space(root, 5*ut.num_ops); + if (ret) + goto out_drop_write; + + mutex_lock(&root->fs_info->trans_mutex); + root->fs_info->open_ioctl_trans++; + mutex_unlock(&root->fs_info->trans_mutex); + + ret = -ENOMEM; + trans = btrfs_start_ioctl_transaction(root, 0); + if (!trans) + goto out_drop; + + ret = do_usertrans(root, &ut, &ops_completed); + put_user(ops_completed, &orig_ut-...
2008 Dec 11
0
[PATCH] btrfs: mnt_drop_write in ioctl_trans_end
...ns(+), 0 deletions(-) diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c index 6228b69..69c4a07 100644 --- a/fs/btrfs/ioctl.c +++ b/fs/btrfs/ioctl.c @@ -1059,6 +1059,8 @@ long btrfs_ioctl_trans_end(struct file *file) root->fs_info->open_ioctl_trans--; mutex_unlock(&root->fs_info->trans_mutex); + mnt_drop_write(file->f_path.mnt); + out: return ret; } -- 1.5.6.5 -- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
2010 Mar 15
1
[PATCH 1/2] Btrfs: remove bad fsync transaction check
..., 0 insertions(+), 6 deletions(-) diff --git a/fs/btrfs/file.c b/fs/btrfs/file.c index d146dde..2e6404f 100644 --- a/fs/btrfs/file.c +++ b/fs/btrfs/file.c @@ -1097,12 +1097,6 @@ int btrfs_sync_file(struct file *file, struct dentry *dentry, int datasync) } mutex_unlock(&root->fs_info->trans_mutex); - /* - * ok we haven''t committed the transaction yet, lets do a commit - */ - if (file && file->private_data) - btrfs_ioctl_trans_end(file); - trans = btrfs_start_transaction(root, 1); if (!trans) { ret = -ENOMEM; -- 1.7.0 -- To unsubscribe from this list: send t...
2011 Mar 23
0
[PATCH] Btrfs: cleanup some BUG_ON()
...>fs_info->generation++; cur_trans->num_writers = 1; cur_trans->num_joined = 0; @@ -195,7 +196,11 @@ again: wait_current_trans(root); ret = join_transaction(root); - BUG_ON(ret); + if (ret < 0) { + if (type != TRANS_JOIN_NOLOCK) + mutex_unlock(&root->fs_info->trans_mutex); + return ERR_PTR(ret); + } cur_trans = root->fs_info->running_transaction; cur_trans->use_count++; @@ -1156,7 +1161,8 @@ int btrfs_commit_transaction_async(struc struct btrfs_transaction *cur_trans; ac = kmalloc(sizeof(*ac), GFP_NOFS); - BUG_ON(!ac); + if (!ac) + return -EN...
2011 Jun 21
19
[GIT PULL v3] Btrfs: improve write ahead log with sub transaction
...it brings us a great deal of performance improvement: in my sysbench "write + fsync" test: 451.01Kb/sec -> 4.3621Mb/sec In v2, thanks to Chris, we worked together to solve 2 bugs, and after that it works as expected. Since there are some vital changes in recent rc, like "kill trans_mutex" and "use cur_trans", as David asked, I rebase the patchset to the latest for-linus branch. More tests are welcome! You can also get this patchset from: git://repo.or.cz/linux-btrfs-devel.git sub-trans Liu Bo (12): Btrfs: introduce sub transaction stuff Btrfs: update block g...
2010 Sep 03
0
[PATCH 1/2] btrfs: document where we use BUG_ON instead of error handling
...ans_release_metadata(trans, root); @@ -1019,7 +1019,7 @@ int btrfs_commit_transaction(struct btrfs_trans_handle *trans, cur_trans->delayed_refs.flushing = 1; ret = btrfs_run_delayed_refs(trans, root, 0); - BUG_ON(ret); + btrfs_fixable_bug_on(ret); mutex_lock(&root->fs_info->trans_mutex); if (cur_trans->in_commit) { @@ -1028,7 +1028,7 @@ int btrfs_commit_transaction(struct btrfs_trans_handle *trans, btrfs_end_transaction(trans, root); ret = wait_for_commit(root, cur_trans); - BUG_ON(ret); + btrfs_fixable_bug_on(ret); mutex_lock(&root->fs_info->trans_m...
2011 Mar 08
6
[PATCH v1 0/6] btrfs: scrub
This series adds an initial implementation for scrub. It works quite straightforward. The usermode issues an ioctl for each device in the fs. For each device, it enumerates the allocated device chunks. For each chunk, the contained extents are enumerated and the data checksums fetched. The extents are read sequentially and the checksums verified. If an error occurs (checksum or EIO), a good copy