search for: btrfs_root_ref

Displaying 16 results from an estimated 16 matches for "btrfs_root_ref".

2010 Nov 17
0
[PATCH] Btrfs: handle NFS lookups properly
...+static int btrfs_get_name(struct dentry *parent, char *name, + struct dentry *child) +{ + struct inode *inode = child->d_inode; + struct inode *dir = parent->d_inode; + struct btrfs_path *path; + struct btrfs_root *root = BTRFS_I(dir)->root; + struct btrfs_inode_ref *iref; + struct btrfs_root_ref *rref; + struct extent_buffer *leaf; + unsigned long name_ptr; + struct btrfs_key key; + int name_len; + int ret; + + if (!dir || !inode) + return -EINVAL; + + if (!S_ISDIR(dir->i_mode)) + return -EINVAL; + + path = btrfs_alloc_path(); + if (!path) + return -ENOMEM; + path->leave_spinning...
2015 Sep 09
1
[PATCH v1 1/1] extlinux: fix file descriptors leak
...free(file); free(oldfile); free(c32file); @@ -778,7 +779,7 @@ static char * get_default_subvol(char * rootdir, char * subvol) struct btrfs_ioctl_search_key *sk = &args.key; struct btrfs_ioctl_search_header *sh; int ret, i; - int fd; + int fd = -1; struct btrfs_root_ref *ref; struct btrfs_dir_item *dir_item; unsigned long off = 0; @@ -797,6 +798,8 @@ static char * get_default_subvol(char * rootdir, char * subvol) } if (ret <= 0) { subvol[0] = '\0'; + if (fd >= 0) + close(fd); return NULL; }...
2011 Jul 12
0
[PATCH]: Use a general way to get the default subvolume for btrfs
...typedef __u32 u32; +typedef __u16 u16; +typedef __u8 u8; +typedef u64 __le64; +typedef u16 __le16; + +#define BTRFS_ROOT_BACKREF_KEY 144 +#define BTRFS_ROOT_TREE_DIR_OBJECTID 6ULL +#define BTRFS_DIR_ITEM_KEY 84 + +/* + * * this is used for both forward and backward root refs + * */ +struct btrfs_root_ref { + __le64 dirid; + __le64 sequence; + __le16 name_len; +} __attribute__ ((__packed__)); + +struct btrfs_disk_key { + __le64 objectid; + u8 type; + __le64 offset; +} __attribute__ ((__packed__)); + +struct btrfs_dir_item { + struct btrfs_disk_key loc...
2013 Aug 27
7
[PATCH] Btrfs: fix deadlock in uuid scan kthread
...int slot; struct btrfs_root_item root_item; u32 item_size; - struct btrfs_trans_handle *trans; + struct btrfs_trans_handle *trans = NULL; path = btrfs_alloc_path(); if (!path) { @@ -3509,7 +3509,13 @@ static int btrfs_uuid_scan_kthread(void *data) (int)sizeof(root_item)); if (btrfs_root_refs(&root_item) == 0) goto skip; - if (!btrfs_is_empty_uuid(root_item.uuid)) { + + if (!btrfs_is_empty_uuid(root_item.uuid) || + !btrfs_is_empty_uuid(root_item.received_uuid)) { + if (trans) + goto update_tree; + + btrfs_release_path(path); /* * 1 - subvol uuid item...
2013 Feb 20
1
[PATCH] Btrfs: fix cleaner thread not working with inode cache option
...) diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c index ca7ace7..d9984fa 100644 --- a/fs/btrfs/inode.c +++ b/fs/btrfs/inode.c @@ -7230,8 +7230,9 @@ int btrfs_drop_inode(struct inode *inode) { struct btrfs_root *root = BTRFS_I(inode)->root; + /* the snap/subvol tree is on deleting */ if (btrfs_root_refs(&root->root_item) == 0 && - !btrfs_is_free_space_inode(inode)) + root != root->fs_info->tree_root) return 1; else return generic_drop_inode(inode); diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c index a31cd93..375f31f 100644 --- a/fs/btrfs/ioctl.c +++ b/fs/bt...
2011 Dec 02
3
[PATCH] Btrfs: protect orphan block rsv with spin_lock
...} + + if (root->orphan_cleanup_state != ORPHAN_CLEANUP_DONE) { + spin_unlock(&root->orphan_lock); + return; + } + + block_rsv = root->orphan_block_rsv; + root->orphan_block_rsv = NULL; + spin_unlock(&root->orphan_lock); + if (root->orphan_item_inserted && btrfs_root_refs(&root->root_item) > 0) { ret = btrfs_del_orphan_item(trans, root->fs_info->tree_root, @@ -1965,10 +1981,9 @@ void btrfs_orphan_commit_root(struct btrfs_trans_handle *trans, root->orphan_item_inserted = 0; } - if (root->orphan_block_rsv) { - WARN_ON(root->orphan_...
2013 Nov 19
6
[PATCH] Btrfs: fix very slow inode eviction and fs unmount
...ode(struct inode *inode) { struct btrfs_trans_handle *trans; @@ -4498,7 +4554,8 @@ void btrfs_evict_inode(struct inode *inode) trace_btrfs_inode_evict(inode); - truncate_inode_pages(&inode->i_data, 0); + evict_inode_truncate_pages(inode); + if (inode->i_nlink && ((btrfs_root_refs(&root->root_item) != 0 && root->root_key.objectid != BTRFS_ROOT_TREE_OBJECTID) || @@ -7379,6 +7436,7 @@ static void btrfs_invalidatepage(struct page *page, unsigned int offset, struct extent_state *cached_state = NULL; u64 page_start = page_offset(page); u64 page_en...
2010 Oct 30
0
[PATCH] Use ERR_CAST inlined function instead of ERR_PTR(PTR_ERR(...)) - generated by Coccinelle
...super.c +++ b/fs/btrfs/super.c @@ -380,7 +380,7 @@ static struct dentry *get_default_root(struct super_block *sb, find_root: new_root = btrfs_read_fs_root_no_name(root->fs_info, &location); if (IS_ERR(new_root)) - return ERR_PTR(PTR_ERR(new_root)); + return ERR_CAST(new_root); if (btrfs_root_refs(&new_root->root_item) == 0) return ERR_PTR(-ENOENT); -- Chris Samuel : http://www.csamuel.org/ : Melbourne, VIC This email may come with a PGP signature as a file. Do not panic. For more info see: http://en.wikipedia.org/wiki/OpenPGP
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
2015 Sep 09
0
[PATCH v1 1/1] extlinux: fix memory leak
...f8d1f 100644 --- a/extlinux/main.c +++ b/extlinux/main.c @@ -779,7 +779,7 @@ static char * get_default_subvol(char * rootdir, char * subvol) struct btrfs_ioctl_search_key *sk = &args.key; struct btrfs_ioctl_search_header *sh; int ret, i; - int fd; + int fd = -1; struct btrfs_root_ref *ref; struct btrfs_dir_item *dir_item; unsigned long off = 0; @@ -1044,12 +1044,12 @@ err: } #ifndef __KLIBC__ -static const char *find_device(const char *mtab_file, dev_t dev) +static char *find_device(const char *mtab_file, dev_t dev) { struct mntent *mnt; struct stat dst...
2012 Aug 01
17
[PATCH] add crtime to the snapshot list
From: Anand <anand.jain@oracle.com> This patch adds creation-time to the snapshot list display, which would help user to better manage the snapshots when number of snapshots grow substantially. This patch is developed and on top of the send/receive btrfs and btrfs-progs repo at git://github.com/ablock84/linux-btrfs.git (send-v2) git://github.com/ablock84/btrfs-progs.git (send-v2)
2009 Nov 12
0
[PATCH 05/12] Btrfs: Avoid orphan inodes cleanup during replaying log
...{ @@ -3293,6 +3294,11 @@ void btrfs_delete_inode(struct inode *inode) } btrfs_wait_ordered_range(inode, 0, (u64)-1); + if (root->fs_info->log_root_recovering) { + BUG_ON(!list_empty(&BTRFS_I(inode)->i_orphan)); + goto no_delete; + } + if (inode->i_nlink > 0) { BUG_ON(btrfs_root_refs(&root->root_item) != 0); goto no_delete; @@ -3700,6 +3706,13 @@ struct inode *btrfs_lookup_dentry(struct inode *dir, struct dentry *dentry) } srcu_read_unlock(&root->fs_info->subvol_srcu, index); + if (root != sub_root) { + down_read(&root->fs_info->cleanup_wor...
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
2012 Nov 01
41
[Request for review] [RFC] Add label support for snapshots and subvols
From: Anand Jain <anand.jain@oracle.com> (This patch is for the review/test not yet for the integration). Here is an implementation of the feature to add label to the subvolume and snapshots. Which would help sysadmin to better manager the subvol and snapshots. This can be done in two ways, one - using attr which is user land only changes but drawback is able to change the label
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.
2010 Sep 03
0
[PATCH 1/2] btrfs: document where we use BUG_ON instead of error handling
...); ret = btrfs_insert_orphan_item(trans, root->fs_info->tree_root, snap->root_key.objectid); - BUG_ON(ret); + btrfs_fixable_bug_on(ret); snap->orphan_item_inserted = 1; #endif } @@ -2108,7 +2108,7 @@ void btrfs_orphan_commit_root(struct btrfs_trans_handle *trans, btrfs_root_refs(&root->root_item) > 0) { ret = btrfs_del_orphan_item(trans, root->fs_info->tree_root, root->root_key.objectid); - BUG_ON(ret); + btrfs_fixable_bug_on(ret); root->orphan_item_inserted = 0; } @@ -2177,20 +2177,20 @@ int btrfs_orphan_add(struct btrfs_trans_...