search for: btrfs_free_path

Displaying 20 results from an estimated 68 matches for "btrfs_free_path".

2008 Jul 20
26
[PATCH] NFS support for btrfs - v2
...t = 0; + + leaf = path->nodes[0]; + slot = path->slots[0]; + nritems = btrfs_header_nritems(leaf); + if (slot >= nritems) { + goto out; + } + + btrfs_item_key_to_cpu(leaf, &key, slot); + if (key.objectid != dir->i_ino || + key.type != BTRFS_INODE_REF_KEY) { + goto out; + } + + btrfs_free_path(path); + objectid = key.offset; + + /* Build a new key for the inode item */ + key.objectid = objectid; + btrfs_set_key_type(&key, BTRFS_INODE_ITEM_KEY); + key.offset = 0; + + inode = btrfs_iget(root->fs_info->sb, &key, root, NULL); + + parent = d_alloc_anon(inode); + if (!parent) {...
2010 Nov 17
0
[PATCH] Btrfs: handle NFS lookups properly
...type = BTRFS_ROOT_BACKREF_KEY; + key.offset = (u64)-1; + root = root->fs_info->tree_root; + } else { + key.objectid = inode->i_ino; + key.offset = dir->i_ino; + key.type = BTRFS_INODE_REF_KEY; + } + + ret = btrfs_search_slot(NULL, root, &key, path, 0, 0); + if (ret < 0) { + btrfs_free_path(path); + return ret; + } else if (ret > 0) { + if (inode->i_ino == BTRFS_FIRST_FREE_OBJECTID) { + path->slots[0]--; + } else { + btrfs_free_path(path); + return -ENOENT; + } + } + leaf = path->nodes[0]; + + if (inode->i_ino == BTRFS_FIRST_FREE_OBJECTID) { + rref = bt...
2008 Oct 27
0
[PATCH 3/4] update nodatacow code
...ectid >= BTRFS_FIRST_FREE_OBJECTID && - ref_objectid != btrfs_ref_objectid(leaf, ref_item))) { - *ref_count = 2; - break; - } - - *ref_count = 1; - if (*min_generation > ref_generation) - *min_generation = ref_generation; - - path->slots[0]++; - } - ret = 0; -out: - btrfs_free_path(path); - return ret; -} - -int btrfs_cross_ref_exists(struct btrfs_trans_handle *trans, - struct btrfs_root *root, - struct btrfs_key *key, u64 bytenr) -{ - struct btrfs_root *old_root; - struct btrfs_path *path = NULL; - struct extent_buffer *eb; - struct btrfs_file_extent_item *item; -...
2011 Jun 09
2
[PATCH] Btrfs: turn to readonly if btrfs_start_transaction() fails
...= btrfs_start_transaction(root, 10); + if (IS_ERR(trans)) + btrfs_abort_transaction(root, PTR_ERR(trans)); if (!IS_ERR(trans) || PTR_ERR(trans) != -ENOSPC) return trans; @@ -2874,6 +2877,7 @@ static struct btrfs_trans_handle *__unlink_start_trans(struct inode *dir, if (IS_ERR(trans)) { btrfs_free_path(path); root->fs_info->enospc_unlink = 0; + btrfs_abort_transaction(root, PTR_ERR(trans)); return trans; } @@ -3511,6 +3515,7 @@ int btrfs_cont_expand(struct inode *inode, loff_t oldsize, loff_t size) trans = btrfs_start_transaction(root, 2); if (IS_ERR(trans)) { err =...
2020 Apr 14
1
[PATCH 1/2] mm, treewide: Rename kzfree() to kfree_sensitive()
...-git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c > index 40b729dce91c..eab3f8510426 100644 > --- a/fs/btrfs/ioctl.c > +++ b/fs/btrfs/ioctl.c > @@ -2691,7 +2691,7 @@ static int btrfs_ioctl_get_subvol_info(struct file *file, void __user *argp) > btrfs_put_root(root); > out_free: > btrfs_free_path(path); > - kzfree(subvol_info); > + kfree_sensitive(subvol_info); This is not in a sensitive context so please switch it to plain kfree. With that you have my acked-by. Thanks.
2020 Jun 16
1
[PATCH v4 3/3] btrfs: Use kfree() in btrfs_ioctl_get_subvol_info()
...-git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c > index f1dd9e4271e9..e8f7c5f00894 100644 > --- a/fs/btrfs/ioctl.c > +++ b/fs/btrfs/ioctl.c > @@ -2692,7 +2692,7 @@ static int btrfs_ioctl_get_subvol_info(struct file *file, void __user *argp) > btrfs_put_root(root); > out_free: > btrfs_free_path(path); > - kfree_sensitive(subvol_info); > + kfree(subvol_info); I would rather merge a patch doing to kzfree -> kfree instead of doing the middle step to switch it to kfree_sensitive. If it would help integration of your patchset I can push it to the next rc so there are no kzfree left i...
2008 Jun 24
1
[RFC][PATCH] btrfs orphan code
..._dir_type(leaf, dir_item, BTRFS_FT_ORPHAN_DIR); + btrfs_set_dir_name_len(leaf, dir_item, name_len); + btrfs_set_dir_data_len(leaf, dir_item, 0); + name_ptr = (unsigned long)(dir_item + 1); + + write_extent_buffer(leaf, name, name_ptr, name_len); + btrfs_mark_buffer_dirty(path->nodes[0]); +out: + btrfs_free_path(path); + return ret; +} + +struct btrfs_dir_item *btrfs_lookup_orphan_dir_item(struct btrfs_trans_handle + *trans, + struct btrfs_root *root, + struct btrfs_path *path, + int mod) +{ + int ret; + struct btrfs_key key; + int ins_len = mod < 0 ? -1 : 0; + int co...
2010 Sep 03
0
[PATCH 1/2] btrfs: document where we use BUG_ON instead of error handling
...0; @@ -1801,7 +1801,7 @@ static int __btrfs_inc_extent_ref(struct btrfs_trans_handle *trans, ret = insert_extent_backref(trans, root->fs_info->extent_root, path, bytenr, parent, root_objectid, owner, offset, refs_to_add); - BUG_ON(ret); + btrfs_fixable_bug_on(ret); out: btrfs_free_path(path); return err; @@ -2003,7 +2003,7 @@ static int run_one_delayed_ref(struct btrfs_trans_handle *trans, ret = btrfs_del_csums(trans, root, node->bytenr, node->num_bytes); - BUG_ON(ret); + btrfs_fixable_bug_on(ret); } } mutex_unlock(&head-...
2013 Feb 03
3
kernel BUG at fs/btrfs/extent-tree.c:6185!
...1ea Feb 02 13:59:58 Edge kernel: 0000000000614000 0000000000000430 0000000000000005 ffff880137a81000 Feb 02 13:59:58 Edge kernel: 0000000000008000 00ff88013788a560 a8000000017f8f10 ffff8801388b6000 Feb 02 13:59:58 Edge kernel: Call Trace: Feb 02 13:59:58 Edge kernel: [<ffffffffa023a1ea>] ? btrfs_free_path+0x2a/0x40 [btrfs] Feb 02 13:59:58 Edge kernel: [<ffffffffa0293990>] replay_one_extent+0x620/0x690 [btrfs] Feb 02 13:59:58 Edge kernel: [<ffffffffa0292fc8>] ? add_inode_ref+0x638/0x9e0 [btrfs] Feb 02 13:59:58 Edge kernel: [<ffffffffa026e940>] ? btrfs_destroy_inode+0x1c0/0x2e0 [b...
2013 Mar 31
9
BTRFS error in __btrfs_inc_extent_ref:1935: Object already exists
...451.490504] [<ffffffffa0203987>] __btrfs_end_transaction+0xf7/0x410 [btrfs] [12451.490538] [<ffffffffa0203cd3>] btrfs_end_transaction_throttle+0x13/0x20 [btrfs] [12451.490576] [<ffffffffa024bf34>] merge_reloc_root+0x274/0x500 [btrfs] [12451.490606] [<ffffffffa01dd32a>] ? btrfs_free_path+0x2a/0x40 [btrfs] [12451.490698] [<ffffffffa024c2d8>] merge_reloc_roots+0x118/0x150 [btrfs] [12451.490741] [<ffffffffa024c91b>] relocate_block_group+0x3db/0x640 [btrfs] [12451.490784] [<ffffffffa024cd45>] btrfs_relocate_block_group+0x1c5/0x300 [btrfs] [12451.490825] [<fffff...
2012 Sep 17
13
[PATCH 1/2 v3] Btrfs: use flag EXTENT_DEFRAG for snapshot-aware defrag
We''re going to use this flag EXTENT_DEFRAG to indicate which range belongs to defragment so that we can implement snapshow-aware defrag: We set the EXTENT_DEFRAG flag when dirtying the extents that need defragmented, so later on writeback thread can differentiate between normal writeback and writeback started by defragmentation. This patch is used for the latter one. Originally patch
2012 Jan 30
3
[PATCH] Btrfs: allow cloning ranges within the same file
...;io_tree, off, off+len, GFP_NOFS); out_unlock: - mutex_unlock(&src->i_mutex); - mutex_unlock(&inode->i_mutex); + if (src != inode) { + mutex_unlock(&src->i_mutex); + mutex_unlock(&inode->i_mutex); + } else { + mutex_unlock(&inode->i_mutex); + } vfree(buf); btrfs_free_path(path); out_fput: -- 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.html
2011 Jan 06
3
Offline Deduplication for Btrfs V2
Just a quick update, I''ve dropped the hashing stuff in favor of doing a memcmp in the kernel to make sure the data is still the same. The thing that takes a while is reading the data up from disk, so doing a memcmp of the entire buffer isn''t that big of a deal, not to mention there''s a possiblity for malicious users if there is a problem with the hashing algorithms we
2020 Jun 16
0
[PATCH v4 3/3] btrfs: Use kfree() in btrfs_ioctl_get_subvol_info()
...insertion(+), 1 deletion(-) diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c index f1dd9e4271e9..e8f7c5f00894 100644 --- a/fs/btrfs/ioctl.c +++ b/fs/btrfs/ioctl.c @@ -2692,7 +2692,7 @@ static int btrfs_ioctl_get_subvol_info(struct file *file, void __user *argp) btrfs_put_root(root); out_free: btrfs_free_path(path); - kfree_sensitive(subvol_info); + kfree(subvol_info); return ret; } -- 2.18.1
2009 Dec 17
0
[PATCH] Btrfs: set a incompat flag when setting default subvol
...truct btrfs_key location; struct btrfs_disk_key disk_key; + struct btrfs_super_block *disk_super; + u64 features; u64 objectid = 0; u64 dir_id; @@ -1610,6 +1612,12 @@ static long btrfs_ioctl_default_subvol(struct file *file, void __user *argp) btrfs_mark_buffer_dirty(path->nodes[0]); btrfs_free_path(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); + } bt...
2011 May 19
0
[PATCH] Btrfs: return error code to caller when btrfs_previous_item fails
...af, extent) < start); - ret = 0; } else if (ret == 0) { leaf = path->nodes[0]; extent = btrfs_item_ptr(leaf, path->slots[0], @@ -1003,6 +1003,7 @@ static int btrfs_free_dev_extent(struct btrfs_trans_handle *trans, ret = btrfs_del_item(trans, root, path); BUG_ON(ret); +out: btrfs_free_path(path); return ret; } -- 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 May 27
0
[PATCH] Btrfs: try to only do one btrfs_search_slot in do_setxattr
...atch_dir_item_name(root, path, name, name_len); + ret = btrfs_delete_one_dir_name(trans, root, path, di); + if (ret) + goto out; + + /* + * We have a value to set, so go back and try to insert it now. + */ + if (value) { + btrfs_release_path(root, path); + goto again; + } + } out: btrfs_free_path(path); return ret; -- 1.7.2.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
2011 Aug 23
40
[PATCH 00/21] [RFC] Btrfs: restriper
Hello, This patch series adds an initial implementation of restriper (it''s a clever name for relocation framework that allows to do selective profile changing and selective balancing with some goodies like pausing/resuming and reporting progress to the user. Profile changing is global (per-FS) so far, per-subvolume profiles require some discussion and can be implemented in future.
2012 Dec 12
1
kernel BUG at fs/btrfs/extent_io.c:4052 (kernel 3.5.3)
...release_extent_buffer.isra.38+0x3f/0xc0 [btrfs] Dec 11 17:49:04 SANOS1 kernel: [<ffffffffa02616b2>] free_extent_buffer+0x32/0x90 [btrfs] Dec 11 17:49:04 SANOS1 kernel: [<ffffffffa02197aa>] btrfs_release_path+0x2a/0xb0 [btrfs] Dec 11 17:49:04 SANOS1 kernel: [<ffffffffa0219aa6>] btrfs_free_path+0x16/0x30 [btrfs] Dec 11 17:49:04 SANOS1 kernel: [<ffffffffa0232df0>] btrfs_del_csums+0x2b0/0x300 [btrfs] Dec 11 17:49:04 SANOS1 kernel: [<ffffffffa0227149>] __btrfs_free_extent+0x639/0x7b0 [btrfs] Dec 11 17:49:04 SANOS1 kernel: [<ffffffffa022b34e>] run_clustered_refs+0x2be/0xa...
2012 Jun 27
7
WARNING: at fs/btrfs/free-space-cache.c:1887 after hard shutdown.
...37.645670] [<ffffffffa0f4a159>] btrfs_remove_free_space+0x329/0x350 [btrfs] [ 37.645674] [<ffffffff81073bb0>] ? abort_exclusive_wait+0xb0/0xb0 [ 37.645682] [<ffffffffa0efaa6f>] btrfs_alloc_logged_file_extent+0x1bf/0x1e0 [btrfs] [ 37.645688] [<ffffffffa0ee7bfa>] ? btrfs_free_path+0x2a/0x40 [btrfs] [ 37.645697] [<ffffffffa0f44c5e>] replay_one_extent+0x5be/0x620 [btrfs] [ 37.645701] [<ffffffff81179f55>] ? iput+0x105/0x210 [ 37.645710] [<ffffffffa0f4549b>] replay_one_buffer+0x27b/0x350 [btrfs] [ 37.645719] [<ffffffffa0f302bd>] ? alloc_extent...