Displaying 9 results from an estimated 9 matches for "btrfs_dir_item_key_to_cpu".
2013 Oct 28
0
[PATCH] Btrfs: log recovery, don't unlink inode always on error
...-log.c
index d75303e..2990fa4 100644
--- a/fs/btrfs/tree-log.c
+++ b/fs/btrfs/tree-log.c
@@ -1832,7 +1832,7 @@ again:
dir_key->offset,
name, name_len, 0);
}
- if (IS_ERR_OR_NULL(log_di)) {
+ if (!log_di || (IS_ERR(log_di) && PTR_ERR(log_di) == -ENOENT)) {
btrfs_dir_item_key_to_cpu(eb, di, &location);
btrfs_release_path(path);
btrfs_release_path(log_path);
@@ -1869,6 +1869,9 @@ again:
goto again;
ret = 0;
goto out;
+ } else if (IS_ERR(log_di)) {
+ kfree(name);
+ return PTR_ERR(log_di);
}
btrfs_release_path(log_path);
kfree(name);
--
1.7...
2010 Jul 29
1
[Bug] check return of kmalloc()
...nline int overwrite_item(struc
btrfs_release_path(root, path);
return 0;
}
- dst_copy = kmalloc(item_size, GFP_NOFS);
- src_copy = kmalloc(item_size, GFP_NOFS);
read_extent_buffer(eb, src_copy, src_ptr, item_size);
@@ -664,7 +662,6 @@ static noinline int drop_one_dir_item(st
btrfs_dir_item_key_to_cpu(leaf, di, &location);
name_len = btrfs_dir_name_len(leaf, di);
- name = kmalloc(name_len, GFP_NOFS);
read_extent_buffer(leaf, name, (unsigned long)(di + 1), name_len);
btrfs_release_path(root, path);
@@ -819,7 +816,6 @@ again:
ref = (struct btrfs_inode_ref *)ref_ptr;
namelen = btr...
2008 Jan 07
1
[PATCH]Add rollback support for the converter
...(&root->fs_info->super_copy);
+ dir = btrfs_lookup_dir_item(NULL, root->fs_info->tree_root, &path,
+ root_dir, name, strlen(name), 0);
+ if (!dir || IS_ERR(dir)) {
+ fprintf(stderr, "unable to find subvol %s\n", name);
+ goto fail;
+ }
+ leaf = path.nodes[0];
+ btrfs_dir_item_key_to_cpu(leaf, dir, &key);
+ btrfs_release_path(root->fs_info->tree_root, &path);
+
+ ext2_root = btrfs_read_fs_root(root->fs_info, &key);
+ if (!ext2_root || IS_ERR(ext2_root)) {
+ fprintf(stderr, "unable to open subvol %s\n", name);
+ goto fail;
+ }
+
+ name = "image&...
2008 Jun 24
1
[RFC][PATCH] btrfs orphan code
..._lookup_orphan_dir_item(NULL, root, path, 0);
+
+ if (IS_ERR(di)) {
+ btrfs_free_path(path);
+ mutex_unlock(&root->fs_info->fs_mutex);
+
+ err = PTR_ERR(di);
+
+ if (err == -ENOENT)
+ inode = btrfs_create_orphan_dir(root);
+ else
+ inode = ERR_PTR(err);
+
+ return inode;
+ }
+
+ btrfs_dir_item_key_to_cpu(path->nodes[0], di, &location);
+
+ btrfs_free_path(path);
+ mutex_unlock(&root->fs_info->fs_mutex);
+
+ inode = btrfs_iget_locked(dir->i_sb, location.objectid, root);
+
+ if (!inode) {
+ inode = ERR_PTR(-EACCES);
+ goto out;
+ }
+
+ /* should technically always be true */
+ i...
2010 Sep 03
0
[PATCH 1/2] btrfs: document where we use BUG_ON instead of error handling
...>d_name.len);
- BUG_ON(ret);
+ btrfs_fixable_bug_on(ret);
if (inode->i_nlink == 0) {
ret = btrfs_orphan_add(trans, inode);
- BUG_ON(ret);
+ btrfs_fixable_bug_on(ret);
}
nr = trans->blocks_used;
@@ -2905,7 +2905,7 @@ int btrfs_unlink_subvol(struct btrfs_trans_handle *trans,
btrfs_dir_item_key_to_cpu(leaf, di, &key);
WARN_ON(key.type != BTRFS_ROOT_ITEM_KEY || key.objectid != objectid);
ret = btrfs_delete_one_dir_name(trans, root, path, di);
- BUG_ON(ret);
+ btrfs_fixable_bug_on(ret);
btrfs_release_path(root, path);
ret = btrfs_del_root_ref(trans, root->fs_info->tree_root,
@@...
2012 Jun 21
0
[RFC PATCH V2] Btrfs: introduce extent buffer cache for each i-node
...tatic noinline int inode_in_dir(struct btrfs_root *root,
goto out;
btrfs_release_path(path);
- di = btrfs_lookup_dir_item(NULL, root, path, dirid, name, name_len, 0);
+ di = btrfs_lookup_dir_item(NULL, root, NULL, path, dirid, name,
+ name_len, 0);
if (di && !IS_ERR(di)) {
btrfs_dir_item_key_to_cpu(path->nodes[0], di, &location);
if (location.objectid != objectid)
@@ -920,7 +921,7 @@ again:
btrfs_release_path(path);
/* look for a conflicing name */
- di = btrfs_lookup_dir_item(trans, root, path, btrfs_ino(dir),
+ di = btrfs_lookup_dir_item(trans, root, dir, path, btrfs_ino(dir...
2012 Mar 20
13
[PATCH 0 of 3 v2] PV-GRUB: add support for ext4 and btrfs
Hi,
The following patches add support for ext4 and btrfs to
PV-GRUB. These patches are taken nearly verbatim from those provided
by Fedora and Gentoo.
We''ve been using these patches for the PV-GRUB images available in EC2
for some time now with no problems.
Changes from v1:
- Makefile has been changed to check the exit code from patch
- The btrfs patch has been rebased to apply
2013 Aug 14
23
[RFC] btrfs-progs: fix sparse checking and warnings
Hi gang,
I was a little surprised to see that patch go by recently
which fixed an endian bug. I went to see how sparse
checking looked and it was.. broken. I got it going
again in my Fedora environment.
Most of the patches are just cleanups, but there *were*
three real bugs lurking in all that sparse warning spam.
So I maintain that it''s worth our time to keep it going
and fix
2008 Jul 20
26
[PATCH] NFS support for btrfs - v2
Hi,
Here''s an implementation of NFS support for btrfs. It does not work in one
particular case as described in
http://www.mail-archive.com/linux-btrfs@vger.kernel.org/msg00298.html.
This uses the btrfs_iget helper introduced previously.
Comments ?
---
Signed-off-by: Balaji Rao <balajirrao@gmail.com>
diff -r 3f0eee804974 Makefile
--- a/Makefile Thu Jun 26 10:34:20 2008 -0400