Displaying 20 results from an estimated 86 matches for "btrfs_commit_transaction".
2010 Oct 26
0
[PATCH v2] Btrfs: fix deadlock in btrfs_commit_transaction
...btrfs_end_transaction(struct btrfs_trans_handle *trans,
WARN_ON(cur_trans->num_writers < 1);
cur_trans->num_writers--;
+ smp_mb();
if (waitqueue_active(&cur_trans->writer_wait))
wake_up(&cur_trans->writer_wait);
put_transaction(cur_trans);
@@ -992,7 +993,6 @@ int btrfs_commit_transaction(struct btrfs_trans_handle *trans,
struct btrfs_root *root)
{
unsigned long joined = 0;
- unsigned long timeout = 1;
struct btrfs_transaction *cur_trans;
struct btrfs_transaction *prev_trans = NULL;
DEFINE_WAIT(wait);
@@ -1063,11 +1063,6 @@ int btrfs_commit_transaction(struct btrfs...
2013 Mar 04
0
[PATCH 2/2] Btrfs: fix unclosed transaction handler when the async transaction commitment fails
If the async transaction commitment failed, we need close the
current transaction handler, or the current transaction will be
blocked to commit because of this orphan handler.
We fix the problem by doing sync transaction commitment, that is
to invoke btrfs_commit_transaction().
Signed-off-by: Miao Xie <miaox@cn.fujitsu.com>
---
fs/btrfs/ioctl.c | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c
index 94c0e42..3fdfabc 100644
--- a/fs/btrfs/ioctl.c
+++ b/fs/btrfs/ioctl.c
@@ -527,6 +527,8 @@ fail:
if (...
2010 Oct 25
14
[PATCH 0/6] Btrfs commit fixes, async subvol operations
...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
git://git.kernel.org/pub/scm/linux/kernel/git/sage/btrfs.git snap_ioctls
The first patch is strictly a bug fix for a deadlock in
btrfs_commit_transaction().
The next few patches are a repost (with a few minor revisions) of the
async snapshot/subvolume ioctls I originally posted last spring. They
include:
- Some async commit helper functions
- Start and wait sync ioctls, for initiating and waiting for a sync
- An ioctl to start a snapshot cre...
2010 Mar 22
5
[PATCH 0/5] asynchronous commit, snapshot ponies
...ery similar to what I was doing before (using the
''flushoncommit'' mount option and tiggering a sync_fs to flush data). The only
difference is the old snapshots stick around for a bit longer before I delete
them and the references get dropped.
The first patch introduces a generic btrfs_commit_transaction_async() helper,
which starts btrfs_commit_transaction asynchronously and returns either
when the commit starts (blocked=1) or when it has done it''s dirty work
(blocked=0). The second patch adds ioctls that let you start and wait for
an asynchronous commit. The third introduces a SNAP_CRE...
2011 Sep 10
12
WARNING: at fs/btrfs/inode.c:2193 btrfs_orphan_commit_root+0xb0/0xc0 [btrfs]()
...l+0x1a/0x20
[ 5472.099935] [<ffffffffa003f420>] btrfs_orphan_commit_root+0xb0/0xc0
[btrfs]
[ 5472.099961] [<ffffffffa00380aa>] commit_fs_roots.clone.21+0xba/0x1a0
[btrfs]
[ 5472.099971] [<ffffffff815db96e>] ? _raw_spin_lock+0xe/0x20
[ 5472.099997] [<ffffffffa003966f>]
btrfs_commit_transaction+0x3ef/0x870 [btrfs]
[ 5472.100065] [<ffffffff81012871>] ? __switch_to+0x261/0x2f0
[ 5472.100084] [<ffffffff81086bf0>] ? wake_up_bit+0x40/0x40
[ 5472.100120] [<ffffffffa0039af0>] ?
btrfs_commit_transaction+0x870/0x870 [btrfs]
[ 5472.100155] [<ffffffffa0039b0f>] do_async_...
2012 Aug 24
4
[PATCH] Btrfs: pass lockdep rwsem metadata to async commit transaction
...container_of(work, struct btrfs_async_commit, work.work);
+ /*
+ * We''ve got freeze protection passed with the transaction.
+ * Tell lockdep about it.
+ */
+ rwsem_acquire_read(
+ &ac->root->fs_info->sb->s_writers.lock_map[SB_FREEZE_FS-1],
+ 0, 1, _THIS_IP_);
+
btrfs_commit_transaction(ac->newtrans, ac->root);
kfree(ac);
}
@@ -1257,6 +1265,14 @@ int btrfs_commit_transaction_async(struct btrfs_trans_handle *trans,
atomic_inc(&cur_trans->use_count);
btrfs_end_transaction(trans, root);
+
+ /*
+ * Tell lockdep we''ve released the freeze rwsem, since the...
2009 Aug 24
0
[PATCH] Btrfs: proper metadata -ENOSPC handling
...re-working that code.
This patch also turns off the metadata_ratio stuff in order to make sure users
can get the most disk space as possible. We only force metadata chunk
allocations when we pass 80% used in the metadata space.
Also, instead of doing a
trans = btrfs_start_transaction(root, 1);
btrfs_commit_transaction(trans, root);
You will want to do
btrfs_force_transacation_commit(root, 0);
This does not do any of the free space checks that btrfs_start_transaction or
btrfs_join_transaction does, since we expect to _only_ be committing the
transaction. This makes sure that we use the reserved space for comm...
2010 Dec 01
2
[RFC PATCH 4/4 v2] Btrfs: deal with filesystem state at mount, umount
...= 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 */
trans = btrfs_join_transaction(root, 1);
+ if (IS_ERR(trans))
+ return PTR_ERR(trans);
+
btrfs_commit_transaction(trans, root);
ret = btrfs_write_and_wait_transaction(NULL, root);
BUG_ON(ret);
@@ -2426,8...
2013 Oct 19
13
[PATCH] Btrfs: fix race condition between writting and scrubing supers
...fs_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
+++ b/fs/btrfs/transaction.c
@@ -1892,7 +1892,9 @@ int btrfs_commit_transaction(struct btrfs_trans_handle *trans,
goto cleanup_transaction;
}
+ btrfs_scrub_pause_super(root);
ret = write_ctree_super(trans, root, 0);
+ btrfs_scrub_continue_super(root);
if (ret) {
mutex_unlock(&root->fs_info->tree_log_mutex);
goto cleanup_transaction;
--
1.7.11.7
--...
2007 Aug 09
1
[RFC] All my fsync changes
...amp;root->fs_info->trans_mutex);
+ goto out;
+ }
+ mutex_unlock(&root->fs_info->trans_mutex);
+
+ /*
+ * ok we haven't committed the transaction yet, lets do a commit
+ */
trans = btrfs_start_transaction(root, 1);
if (!trans) {
ret = -ENOMEM;
goto out;
}
ret = btrfs_commit_transaction(trans, root);
+out:
mutex_unlock(&root->fs_info->fs_mutex);
-out:
return ret > 0 ? EIO : ret;
}
diff -r f6da57af2473 inode.c
--- a/inode.c Wed Aug 08 20:17:12 2007 -0400
+++ b/inode.c Thu Aug 09 17:23:57 2007 -0400
@@ -193,6 +193,7 @@ static int btrfs_update_inode(struct btr...
2009 Jan 24
2
[PATCH] btrfs: flushoncommit mount option
...struct btrfs_root *root = btrfs_sb(sb);
int ret;
- root = btrfs_sb(sb);
if (sb->s_flags & MS_RDONLY)
return 0;
diff --git a/fs/btrfs/transaction.c b/fs/btrfs/transaction.c
index 919172d..b8822d5 100644
--- a/fs/btrfs/transaction.c
+++ b/fs/btrfs/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...
2010 Sep 03
0
[PATCH 1/2] btrfs: document where we use BUG_ON instead of error handling
...generation = btrfs_root_generation(&root->root_item);
blocksize = btrfs_level_size(root, btrfs_root_level(&root->root_item));
@@ -1501,7 +1501,7 @@ static int transaction_kthread(void *arg)
trans = btrfs_join_transaction(root, 1);
if (transid == trans->transid) {
ret = btrfs_commit_transaction(trans, root);
- BUG_ON(ret);
+ btrfs_fixable_bug_on(ret);
} else {
btrfs_end_transaction(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);...
2011 Sep 27
2
high CPU usage and low perf
...02e2ea3>] ? btrfs_insert_empty_items+0x6a/0xba [btrfs]
[<ffffffffa02e9bf3>] ? run_clustered_refs+0x370/0x682 [btrfs]
[<ffffffffa032d201>] ? btrfs_find_ref_cluster+0xd/0x13c [btrfs]
[<ffffffffa02e9fd6>] ? btrfs_run_delayed_refs+0xd1/0x17c [btrfs]
[<ffffffffa02f8467>] ? btrfs_commit_transaction+0x38f/0x709 [btrfs]
[<ffffffff8136f6e6>] ? _raw_spin_lock+0xe/0x10
[<ffffffffa02f79fe>] ? join_transaction.clone.23+0xc1/0x200 [btrfs]
[<ffffffff81068ffb>] ? wake_up_bit+0x2a/0x2a
[<ffffffffa02f28fd>] ? transaction_kthread+0x175/0x22a [btrfs]
[<ffffffffa02f2788>]...
2010 Apr 19
0
[PATCH 08/12] Btrfs: Introduce global metadata reservation
...ked &&
+ (now < cur->start_time || now - cur->start_time < 30)) {
+ spin_unlock(&root->fs_info->new_trans_lock);
delay = HZ * 5;
goto sleep;
}
- mutex_unlock(&root->fs_info->trans_mutex);
- trans = btrfs_join_transaction(root, 1);
- ret = btrfs_commit_transaction(trans, root);
+ transid = cur->transid;
+ spin_unlock(&root->fs_info->new_trans_lock);
+ trans = btrfs_join_transaction(root, 1);
+ if (transid == trans->transid) {
+ ret = btrfs_commit_transaction(trans, root);
+ BUG_ON(ret);
+ } else {
+ btrfs_end_transaction(trans, r...
2010 Oct 26
0
[PATCH] Btrfs: set trans to null in reserve_metadata_bytes if we commit the transaction
btrfs_commit_transaction will free our trans, but because we pass trans to
shrink_delalloc we could possibly have a use after free situation. So instead
if we commit the transaction, set trans to null and set committed to true so we
don''t keep trying to commit a transaction. This fixes a panic I could reproduce...
2011 Nov 09
12
WARNING: at fs/btrfs/inode.c:2198 btrfs_orphan_commit_root+0xa8/0xc0
...h_common+0x7a/0xb0
[ 3924.297806] [<ffffffff81036e15>] warn_slowpath_null+0x15/0x20
[ 3924.297816] [<ffffffffa0137478>] btrfs_orphan_commit_root+0xa8/0xc0
[btrfs]
[ 3924.297825] [<ffffffffa012bc54>] commit_fs_roots+0xc4/0x1b0 [btrfs]
[ 3924.297835] [<ffffffffa012cc1e>]
btrfs_commit_transaction+0x3be/0x7e0 [btrfs]
[ 3924.297840] [<ffffffff813fa0fb>] ? __schedule+0x2fb/0x940
[ 3924.297845] [<ffffffff810a1f20>] ? refresh_cpu_vm_stats+0x150/0x150
[ 3924.297849] [<ffffffff81052840>] ? wake_up_bit+0x40/0x40
[ 3924.297858] [<ffffffffa012d040>] ?
btrfs_commit_transac...
2013 Oct 25
0
[PATCH] Btrfs: return an error from btrfs_wait_ordered_range
...x_unlock(&inode->i_mutex);
if (ret != BTRFS_NO_LOG_SYNC) {
- if (ret > 0) {
- /*
- * If we didn''t already wait for ordered extents we need
- * to do that now.
- */
- if (!full_sync)
- btrfs_wait_ordered_range(inode, start,
- end - start + 1);
- ret = btrfs_commit_transaction(trans, root);
- } else {
+ if (!ret) {
ret = btrfs_sync_log(trans, root);
- if (ret == 0) {
+ if (!ret) {
ret = btrfs_end_transaction(trans, root);
- } else {
- if (!full_sync)
- btrfs_wait_ordered_range(inode, start,
- end -
- start + 1);
- ret = btrfs_co...
2013 Jun 05
8
btrfs raid1 on 16TB goes read-only after "btrfs: block rsv returned -28"
...ffff811dbc5a>] ? btrfs_insert_empty_items+0x5c/0xaf
kernel: [<ffffffff811e5089>] ? run_clustered_refs+0x852/0x8e6
kernel: [<ffffffff811e4d20>] ? run_clustered_refs+0x4e9/0x8e6
kernel: [<ffffffff811e7f6b>] ? btrfs_run_delayed_refs+0x10d/0x289
kernel: [<ffffffff811f4ec6>] ? btrfs_commit_transaction+0x3a5/0x93c
kernel: [<ffffffff810427f0>] ? abort_exclusive_wait+0x79/0x79
kernel: [<ffffffff811f5a8c>] ? start_transaction+0x311/0x408
kernel: [<ffffffff811eed7e>] ? transaction_kthread+0xd1/0x16d
kernel: [<ffffffff811eecad>] ? btrfs_alloc_root+0x34/0x34
kernel: [<fffffff...
2008 Jul 24
4
umount oops
...4:54 minerva kernel: [ 1532.887057]
[btrfs:write_one_page+0x7b/0x430] write_one_page+0x7b/0x100
Jul 24 22:44:54 minerva kernel: [ 1532.887140]
[btrfs:btrfs_write_and_wait_transaction+0xc6/0x130]
:btrfs:btrfs_write_and_wait_transaction+0xc6/0x130
Jul 24 22:44:54 minerva kernel: [ 1532.887246]
[btrfs:btrfs_commit_transaction+0x3c8/0x700]
:btrfs:btrfs_commit_transaction+0x3c8/0x700
Jul 24 22:44:54 minerva kernel: [ 1532.887314] [<ffffffff80253a00>]
autoremove_wake_function+0x0/0x30
Jul 24 22:44:54 minerva kernel: [ 1532.887398]
[btrfs:btrfs_transaction_cleaner+0xf0/0x110]
:btrfs:btrfs_transaction_cleaner+0xf0/0x1...
2012 Mar 10
8
kernel BUG at fs/btrfs/transaction.c:1337!
...sbhid hid
ahci libahci libata scsi_mod ehci_hcd usbcore usb_common
[11558.528323]
[11558.528333] Pid: 125, comm: btrfs-transacti Tainted: G C
3.2.9-1-ARCH #1 LENOVO IdeaPad Y460 /KL2
[11558.528389] RIP: 0010:[<ffffffffa014c879>] [<ffffffffa014c879>]
btrfs_commit_transaction+0x879/0x880 [btrfs]
[11558.528439] RSP: 0018:ffff8801af1dfde0 EFLAGS: 00010282
[11558.528460] RAX: 00000000fffffffb RBX: ffff8801afa91690 RCX: 0000000000000000
[11558.528484] RDX: ffff8801af1dfce8 RSI: 0000000003c10000 RDI: ffff8801afa916f0
[11558.528510] RBP: ffff8801af1dfe70 R08: 000000000000200...