search for: btrfs_join_transaction

Displaying 20 results from an estimated 31 matches for "btrfs_join_transaction".

2010 Dec 01
2
[RFC PATCH 4/4 v2] Btrfs: deal with filesystem state at mount, umount
...isk_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 */ trans = btrfs_join_transaction(root, 1); + if (IS_ERR(trans)) + return PTR_ERR(trans); + btrfs_commit_transaction(tr...
2009 Aug 24
0
[PATCH] Btrfs: proper metadata -ENOSPC handling
...ons 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 committing the transaction and don''t end up with ENOSPC being returned to the transaction kthread. This has been hammered on pretty well with various tests and seems to work...
2012 Nov 01
0
[PATCH 1/5] Btrfs: fix joining the same transaction handler more than 2 times
...truct btrfs_root *root = BTRFS_I(inode)->root; - struct btrfs_trans_handle *trans; u64 alloc_hint = 0; u64 num_bytes; unsigned long ram_size; @@ -823,25 +823,10 @@ static noinline int cow_file_range(struct inode *inode, int ret = 0; BUG_ON(btrfs_is_free_space_inode(inode)); - trans = btrfs_join_transaction(root); - if (IS_ERR(trans)) { - extent_clear_unlock_delalloc(inode, - &BTRFS_I(inode)->io_tree, - start, end, locked_page, - EXTENT_CLEAR_UNLOCK_PAGE | - EXTENT_CLEAR_UNLOCK | - EXTENT_CLEAR_DELALLOC | - EXTENT_CLEAR_DIRTY | - EXTENT_SET_WRIT...
2013 May 23
2
Problem with btrfs send/receive
Hi everyone, I was trying the new send/receive feature today but can''t make it work. These are the commands I was using: btrfs subvol snap -r /mnt/data1/@downloads/ /mnt/data1/snapshots/testsnap btrfs send /mnt/data1/snapshots/testsnap | btrfs receive /mnt/data1/snapshots/testreceive/ This command never finishes. A ''ls /mnt/data1/snapshots/testreceive/ '' never
2011 May 11
8
[PATCH 1/4] Btrfs: map the node block when looking for readahead targets
If we have particularly full nodes, we could call btrfs_node_blockptr up to 32 times, which is 32 pairs of kmap/kunmap, which _sucks_. So go ahead and map the extent buffer while we look for readahead targets. Thanks, Signed-off-by: Josef Bacik <josef@redhat.com> --- fs/btrfs/ctree.c | 23 +++++++++++++++++++++-- 1 files changed, 21 insertions(+), 2 deletions(-) diff --git
2010 Apr 19
0
[PATCH 08/12] Btrfs: Introduce global metadata reservation
...nfo->trans_mutex); + if (!cur->blocked && + (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); +...
2010 Jul 01
0
[PATCH] btrfs: handle errors for FS_IOC_SETFLAGS
...++++++++++++----- 1 files changed, 12 insertions(+), 5 deletions(-) diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c index 4dbaf89..8db62c2 100644 --- a/fs/btrfs/ioctl.c +++ b/fs/btrfs/ioctl.c @@ -200,19 +200,26 @@ static int btrfs_ioctl_setflags(struct file *file, void __user *arg) trans = 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...
2010 Oct 26
0
[PATCH] Btrfs: set trans to null in reserve_metadata_bytes if we commit the transaction
...a_bytes(struct btrfs_trans_handle *trans, int retries = 0; int ret = 0; bool reserved = false; + bool committed = false; again: ret = -ENOSPC; @@ -3249,17 +3250,19 @@ again: goto out; ret = -EAGAIN; - if (trans) + if (trans || committed) goto out; - ret = -ENOSPC; trans = btrfs_join_transaction(root, 1); if (IS_ERR(trans)) goto out; ret = btrfs_commit_transaction(trans, root); - if (!ret) + if (!ret) { + trans = NULL; + committed = true; goto again; + } out: if (reserved) { -- 1.6.6.1 -- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in...
2011 Jun 08
1
[PATCH] Btrfs: use join_transaction in btrfs_evict_inode()
...(-) diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c index 02ff4a1..4e9aa28 100644 --- a/fs/btrfs/inode.c +++ b/fs/btrfs/inode.c @@ -3646,7 +3646,7 @@ void btrfs_evict_inode(struct inode *inode) btrfs_i_size_write(inode, 0); while (1) { - trans = btrfs_start_transaction(root, 0); + trans = btrfs_join_transaction(root); BUG_ON(IS_ERR(trans)); trans->block_rsv = root->orphan_block_rsv; -- 1.7.3.1 -- 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....
2011 Aug 08
0
[PATCH] Btrfs: fix how we reserve space for deleting inodes
...our space for our orphan item in the + * unlink. + * 2) We''re going to delete the inode item, so we don''t need to update + * it at all. + * + * So we just need to reserve some slack space in case we add bytes when + * doing the truncate. + */ while (1) { - trans = btrfs_join_transaction(root); - BUG_ON(IS_ERR(trans)); - trans->block_rsv = root->orphan_block_rsv; - - ret = btrfs_block_rsv_check(trans, root, - root->orphan_block_rsv, 0, 5); - if (ret) { - BUG_ON(ret != -EAGAIN); - ret = btrfs_commit_transaction(trans, root); - BUG_ON(ret); - continue; +...
2012 Nov 15
0
[PATCH 2/2] Btrfs: use common work instead of delayed work
...n passed with the transaction. @@ -1329,7 +1329,7 @@ int btrfs_commit_transaction_async(struct btrfs_trans_handle *trans, if (!ac) return -ENOMEM; - INIT_DELAYED_WORK(&ac->work, do_async_commit); + INIT_WORK(&ac->work, do_async_commit); ac->root = root; ac->newtrans = btrfs_join_transaction(root); if (IS_ERR(ac->newtrans)) { @@ -1351,7 +1351,7 @@ int btrfs_commit_transaction_async(struct btrfs_trans_handle *trans, rwsem_release(&root->fs_info->sb->s_writers.lock_map[SB_FREEZE_FS-1], 1, _THIS_IP_); - schedule_delayed_work(&ac->work, 0); + schedule_...
2014 Aug 05
0
Stack dumps in use_block_rsv while rebalancing ("block rsv returned -28")
.../0x80 [btrfs] [376007.682106] [<ffffffffa00f13d6>] start_transaction.part.35+0x86/0x560 [btrfs] [376007.682109] [<ffffffff8132c197>] ? apparmor_capable+0x27/0x80 [376007.682117] [<ffffffffa00f18d9>] start_transaction+0x29/0x30 [btrfs] [376007.682125] [<ffffffffa00f19a7>] btrfs_join_transaction+0x17/0x20 [btrfs] [376007.682133] [<ffffffffa00f7fa8>] btrfs_dirty_inode+0x58/0xe0 [btrfs] [376007.682141] [<ffffffffa00fcaf2>] btrfs_setattr+0xa2/0xf0 [btrfs] [376007.682144] [<ffffffff811eec74>] notify_change+0x1c4/0x3b0 [376007.682146] [<ffffffff811dde96>] ? final_put...
2009 Jun 13
1
[PATCH 1/3] Add ioctl to set per file 'compress' flag
...if (set) { + if (ip->flags & flag) + goto out_unlock; + } else { + if (!(ip->flags & flag)) + goto out_unlock; + } + + ret = mnt_want_write(file->f_path.mnt); + if (ret) + goto out_unlock; + + if (set) + ip->flags |= flag; + else + ip->flags &= ~flag; + + trans = btrfs_join_transaction(root, 1); + BUG_ON(!trans); + + ret = btrfs_update_inode(trans, root, inode); + BUG_ON(ret); + + inode->i_ctime = CURRENT_TIME; + btrfs_end_transaction(trans, root); + + mnt_drop_write(file->f_path.mnt); + out_unlock: + mutex_unlock(&inode->i_mutex); + return 0; +} + long btrfs_ioctl(...
2013 Jun 04
3
[PATCH] Btrfs: fix broken nocow after balance
Balance will create reloc_root for each fs root, and it''s going to record last_snapshot to filter shared blocks. The side effect of setting last_snapshot is to break nocow attributes of files. So it turns out that checking last_snapshot does not always ensure that a node/leaf/file_extent is shared. That''s why shared node/leaf needs to search extent tree for number of
2012 Feb 16
3
[PATCH 1/4] Btrfs: be less strict on finding next node in clear_extent_bit
In clear_extent_bit, it is enough that next node is adjacent in tree level. Signed-off-by: Liu Bo <liubo2009@cn.fujitsu.com> --- fs/btrfs/extent_io.c | 3 +-- 1 files changed, 1 insertions(+), 2 deletions(-) diff --git a/fs/btrfs/extent_io.c b/fs/btrfs/extent_io.c index fcf77e1..e941cc4 100644 --- a/fs/btrfs/extent_io.c +++ b/fs/btrfs/extent_io.c @@ -577,8 +577,7 @@ hit_next: if
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.
2013 Oct 19
13
[PATCH] Btrfs: fix race condition between writting and scrubing supers
From: Wang Shilong <wangsl.fnst@cn.fujitsu.com> Scrubing supers is not in a transaction context, when trying to write supers to disk, we should check if we are trying to scrub supers.Fix it. Signed-off-by: Wang Shilong <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
2008 Oct 27
0
[PATCH 3/4] update nodatacow code
...found_key; + u64 cow_start; + u64 cur_offset; + u64 extent_end; + u64 disk_bytenr; + int extent_type; + int ret; + int type; + int nocow; + int check_prev = 1; - total_fs_bytes = btrfs_super_total_bytes(&root->fs_info->super_copy); path = btrfs_alloc_path(); BUG_ON(!path); trans = btrfs_join_transaction(root, 1); BUG_ON(!trans); -again: - ret = btrfs_lookup_file_extent(NULL, root, path, - inode->i_ino, start, 0); - if (ret < 0) { - err = ret; - goto out; - } - - if (ret != 0) { - if (path->slots[0] == 0) - goto not_found; - path->slots[0]--; - } - - leaf = path->no...
2012 Jan 11
12
[PATCH 00/11] Btrfs: some patches for 3.3
The biggest one is a fix for fstrim, and there''s a fix for on-disk free space cache. Others are small fixes and cleanups. The last three have been sent weeks ago. The patchset is also available in this repo: git://repo.or.cz/linux-btrfs-devel.git for-chris Note there''s a small confict with Al Viro''s vfs changes. Li Zefan (11): Btrfs: add pinned extents to
2010 Sep 03
0
[PATCH 1/2] btrfs: document where we use BUG_ON instead of error handling
...if (ret > 0) return -ENOENT; - BUG_ON(ret); + btrfs_fixable_bug_on(ret); 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, block...