Displaying 20 results from an estimated 57 matches for "btrfs_end_transaction".
2013 Aug 27
7
[PATCH] Btrfs: fix deadlock in uuid scan kthread
..._ERR(trans)) {
- ret = PTR_ERR(trans);
- break;
- }
- }
ret = btrfs_uuid_tree_add(trans, fs_info->uuid_root,
root_item.received_uuid,
BTRFS_UUID_KEY_RECEIVED_SUBVOL,
@@ -3557,6 +3559,7 @@ static int btrfs_uuid_scan_kthread(void *data)
if (trans) {
ret = btrfs_end_transaction(trans, fs_info->uuid_root);
+ trans = NULL;
if (ret)
break;
}
--
1.7.9.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
2011 Nov 01
0
[PATCH] Btrfs: release metadata from global reserve if we have to fallback for unlink
...xed a problem where we weren''t reserving space for an orphan item when we
had to fallback to using the global reserve for an unlink, but I introduced
another problem. I was migrating the bytes from the transaction reserve to the
global reserve and then releasing from the global reserve in
btrfs_end_transaction(). The problem with this is that a migrate will jack up
the size for the destination, but leave the size alone for the source, with the
idea that you can do a release normally on the source and it all washes out, and
then you can do a release again on the destination and it works out right. My
wa...
2009 Nov 02
0
[PATCH 7/8] Make fallocate(2) more ENOSPC friendly
...cur_offset > i_size_read(inode))
- btrfs_i_size_write(inode, cur_offset);
+ cur_offset > inode->i_size) {
+ i_size_write(inode, cur_offset);
+ btrfs_ordered_update_i_size(inode, cur_offset, NULL);
+ }
+
ret = btrfs_update_inode(trans, root, inode);
BUG_ON(ret);
+
+ btrfs_end_transaction(trans, root);
+ btrfs_unreserve_metadata_space(root, 3);
}
-
return ret;
}
@@ -5641,8 +5705,6 @@ static long btrfs_fallocate(struct inode
u64 locked_end;
u64 mask = BTRFS_I(inode)->root->sectorsize - 1;
struct extent_map *em;
- struct btrfs_trans_handle *trans;
- struct btrfs_ro...
2013 Nov 12
0
[PATCH] Btrfs: incompatible format change to remove hole extents V4
...*/
- trans = btrfs_start_transaction(root, 3);
+ rsv_count = no_holes ? 2 : 3;
+ trans = btrfs_start_transaction(root, rsv_count);
if (IS_ERR(trans)) {
err = PTR_ERR(trans);
goto out_free;
@@ -2196,7 +2201,7 @@ static int btrfs_punch_hole(struct inode *inode, loff_t offset, loff_t len)
btrfs_end_transaction(trans, root);
btrfs_btree_balance_dirty(root);
- trans = btrfs_start_transaction(root, 3);
+ trans = btrfs_start_transaction(root, rsv_count);
if (IS_ERR(trans)) {
ret = PTR_ERR(trans);
trans = NULL;
diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c
index 30bdacd..38fa301 100644
--...
2013 Jul 03
1
WARNING: at fs/btrfs/backref.c:903 find_parent_nodes+0x616/0x815 [btrfs]()
...ernel: [ 668.551786] [<ffffffffa07513e9>] btrfs_qgroup_account_ref+0x10c/0x44f [btrfs]
Jul 2 21:42:59 bkp010 kernel: [ 668.551948] [<ffffffffa06f316f>] btrfs_delayed_refs_qgroup_accounting+0xab/0xdf [btrfs]
Jul 2 21:42:59 bkp010 kernel: [ 668.552106] [<ffffffffa0706896>] __btrfs_end_transaction+0x49/0x281 [btrfs]
Jul 2 21:42:59 bkp010 kernel: [ 668.552214] [<ffffffffa0706af9>] btrfs_end_transaction+0xb/0xd [btrfs]
Jul 2 21:42:59 bkp010 kernel: [ 668.552321] [<ffffffffa07097f5>] __unlink_end_trans+0x5e/0x63 [btrfs]
Jul 2 21:42:59 bkp010 kernel: [ 668.552428] [<fffff...
2010 Apr 19
0
[PATCH 08/12] Btrfs: Introduce global metadata reservation
...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, root);
+ }
sleep:
wake_up_process(root->fs_info->cleaner_kthread);
mutex_unlock(&root->fs_info->transaction_kthread_mutex);
@@ -1541,10 +1538,10 @@ sleep:
if (freezing(current)) {
refrigerator();
} else {
- if (root->fs_info->closing)
- break;...
2010 Jul 01
0
[PATCH] btrfs: handle errors for FS_IOC_SETFLAGS
...ns = btrfs_join_transaction(root, 1);
- BUG_ON(!trans);
+ if (IS_ERR(trans)) {
+ ret = PTR_ERR(trans);
+ goto out_drop_write;
+ }
ret = btrfs_update_inode(trans, root, inode);
- BUG_ON(ret);
+ if (ret)
+ goto out_endtrans;
btrfs_update_iflags(inode);
inode->i_ctime = CURRENT_TIME;
- btrfs_end_transaction(trans, root);
+ ret = 0;
+out_endtrans:
+ btrfs_end_transaction(trans, root);
+out_drop_write:
mnt_drop_write(file->f_path.mnt);
- out_unlock:
+out_unlock:
mutex_unlock(&inode->i_mutex);
- return 0;
+ return ret;
}
static int btrfs_ioctl_getversion(struct file *file, int __user...
2011 Aug 18
0
[PATCH 3/3] Btrfs: fix unclosed transaction handle in btrfs_cont_expand()
...40 100644
--- a/fs/btrfs/inode.c
+++ b/fs/btrfs/inode.c
@@ -3510,15 +3510,19 @@ int btrfs_cont_expand(struct inode *inode, loff_t oldsize, loff_t size)
err = btrfs_drop_extents(trans, inode, cur_offset,
cur_offset + hole_size,
&hint_byte, 1);
- if (err)
+ if (err) {
+ btrfs_end_transaction(trans, root);
break;
+ }
err = btrfs_insert_file_extent(trans, root,
btrfs_ino(inode), cur_offset, 0,
0, hole_size, 0, hole_size,
0, 0, 0);
- if (err)
+ if (err) {
+ btrfs_end_transaction(trans, root);
break;
+ }
btrfs_drop_extent_cache(inode, hole...
2012 Dec 20
0
[RFC PATCH v7 0/2] Btrfs: get/set label of a mounted file system
Hello,
Per David''s comments upon v6, I missed a check up against the return value of btrfs_end_transaction for
btrfs_ioctl_fs_setlabel(), it was fixed in this version.
v7->v6:
- take care of btrfs_end_transaction() in btrfs_ioctl_fs_setlabel() rather than keeping silence.
The old versions can be found at:
v6:
http://www.spinics.net/lists/linux-btrfs/msg20922.html
v5:
http://www.spinics.net/lists/l...
2010 Sep 03
0
[PATCH 1/2] btrfs: document where we use BUG_ON instead of error handling
...s_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);
- BUG_ON(ret);
+ btrfs_fixable_bug_on(ret);
if (sb->s_flags & MS_RDONLY) {
ret =...
2012 Nov 01
0
[PATCH 1/5] Btrfs: fix joining the same transaction handler more than 2 times
...= num_bytes;
- ret = 0;
/* if this is a small write inside eof, kick off defrag */
if (num_bytes < 64 * 1024 &&
@@ -952,11 +937,9 @@ static noinline int cow_file_range(struct inode *inode,
alloc_hint = ins.objectid + ins.offset;
start += cur_alloc_size;
}
- ret = 0;
out:
- btrfs_end_transaction(trans, root);
-
return ret;
+
out_unlock:
extent_clear_unlock_delalloc(inode,
&BTRFS_I(inode)->io_tree,
@@ -971,6 +954,39 @@ out_unlock:
goto out;
}
+static noinline int cow_file_range(struct inode *inode,
+ struct page *locked_page,
+ u64 start, u64 end, int *p...
2008 Oct 27
0
[PATCH 3/4] update nodatacow code
...}
btrfs_release_path(root, path);
- start = extent_end;
- if (start <= end) {
- loops++;
- goto again;
+ if (cow_start != (u64)-1) {
+ ret = cow_file_range(inode, cow_start,
+ found_key.offset - 1);
+ BUG_ON(ret);
+ cow_start = (u64)-1;
}
- } else {
-not_found:
- btrfs_end_transaction(trans, root);
- btrfs_free_path(path);
- return cow_file_range(inode, start, end);
+
+ disk_bytenr += cur_offset - found_key.offset;
+ ret = btrfs_add_ordered_extent(inode, cur_offset, disk_bytenr,
+ min(end + 1, extent_end) - cur_offset,
+ BTRFS_ORDERED_NOCOW);
+ cur_offset = extent_e...
2009 Aug 24
0
[PATCH] Btrfs: proper metadata -ENOSPC handling
...used > thresh)
meta_sinfo->force_alloc = 1;
- spin_unlock(&meta_sinfo->lock);
-
- trans = btrfs_start_transaction(root, 1);
- if (!trans)
- return -ENOMEM;
-
- ret = do_chunk_alloc(trans, root->fs_info->extent_root,
- 2 * 1024 * 1024, alloc_target, 0);
- btrfs_end_transaction(trans, root);
- goto again;
- }
- spin_unlock(&meta_sinfo->lock);
-
- if (!committed) {
- committed = 1;
- trans = btrfs_join_transaction(root, 1);
- if (!trans)
- return -ENOMEM;
- ret = btrfs_commit_transaction(trans, root);
- if (ret)
- return ret;
- goto again;
-...
2011 Sep 21
3
[PATCH] Btrfs: fix orphan cleanup regression
...transaction(root, 0);
+ if (ret == -ESTALE) {
+ trans = btrfs_start_transaction(root, 1);
if (IS_ERR(trans)) {
ret = PTR_ERR(trans);
goto out;
}
- btrfs_orphan_del(trans, inode);
+ ret = btrfs_del_orphan_item(trans, root,
+ found_key.objectid);
+ BUG_ON(ret);
btrfs_end_transaction(trans, root);
- iput(inode);
continue;
}
+ /*
+ * add this inode to the orphan list so btrfs_orphan_del does
+ * the proper thing when we hit it
+ */
+ spin_lock(&root->orphan_lock);
+ list_add(&BTRFS_I(inode)->i_orphan, &root->orphan_list);
+ spin_unlock(&...
2013 Aug 30
3
[PATCH] btrfs: commit transaction after deleting a subvolume
...)
diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c
index e407f75..4394632 100644
--- a/fs/btrfs/ioctl.c
+++ b/fs/btrfs/ioctl.c
@@ -2268,7 +2268,7 @@ static noinline int btrfs_ioctl_snap_destroy(struct file *file,
out_end_trans:
trans->block_rsv = NULL;
trans->bytes_reserved = 0;
- ret = btrfs_end_transaction(trans, root);
+ ret = btrfs_commit_transaction(trans, root);
if (ret && !err)
err = ret;
inode->i_flags |= S_DEAD;
--
1.7.9
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majordomo@vger.kernel.org
More majordomo in...
2013 Oct 25
0
[PATCH] Btrfs: return an error from btrfs_wait_ordered_range
...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_commit_transaction(trans, root);
+ goto out;
}
}
+ if (!full_sync) {
+ ret = btrfs_wait_ordered_range(inode, start,
+ end - st...
2013 Feb 13
0
Re: Heavy memory leak when using quota groups
...] [<ffffffffa059991b>] btrfs_qgroup_account_ref+0xfb/0x550 [btrfs]
> [ 5123.800325] [<ffffffff81183beb>] ? kfree+0x3b/0x150
> [ 5123.800332] [<ffffffffa05290d3>]
> btrfs_delayed_refs_qgroup_accounting+0xa3/0x100 [btrfs]
> [ 5123.800341] [<ffffffffa0540941>] __btrfs_end_transaction+0x81/0x410 [btrfs]
> [ 5123.800349] [<ffffffffa052b646>] ?
> btrfs_delalloc_release_metadata+0x106/0x180 [btrfs]
> [ 5123.800358] [<ffffffffa0540d20>] btrfs_end_transaction+0x10/0x20 [btrfs]
> [ 5123.800367] [<ffffffffa054965d>] btrfs_finish_ordered_io+0x10d/0x3d0 [...
2007 Jun 29
2
Mknod: Operation not permitted
When trying to move my root to a btrfs filesystem, I found a missing
feature (or a bug). It's not possible to create device files. To
reproduce, run this on a btrfs filesystem:
mknod test c 1 1
result:
mknod: `test': Operation not permitted
Frank
2007 Sep 23
0
[patch]fix get_bh and brelse issues when drop snapshot
...= -EAGAIN;
- get_bh(root->node);
break;
}
for (i = 0; i <= orig_level; i++) {
diff -r 29b8cc7794ac transaction.c
--- a/transaction.c Thu Sep 20 14:14:42 2007 -0400
+++ b/transaction.c Sun Sep 23 12:35:00 2007 +0800
@@ -457,6 +457,7 @@ static int drop_dirty_roots(struct btrfs
ret = btrfs_end_transaction(trans, tree_root);
BUG_ON(ret);
+ btrfs_block_release(dirty->root, dirty->root->node);
kfree(dirty->root);
kfree(dirty);
mutex_unlock(&tree_root->fs_info->fs_mutex);
2009 Dec 17
0
[PATCH] Btrfs: set a incompat flag when setting default subvol
...th(path);
+ disk_super = &root->fs_info->super_copy;
+ features = btrfs_super_incompat_flags(disk_super);
+ if (!(features & BTRFS_FEATURE_INCOMPAT_DEFAULT_SUBVOL)) {
+ features |= BTRFS_FEATURE_INCOMPAT_DEFAULT_SUBVOL;
+ btrfs_set_super_incompat_flags(disk_super, features);
+ }
btrfs_end_transaction(trans, root);
return 0;
--
1.5.4.3
--
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