[PATCH 0/3] bootstrapping btrfs_find_item_interface

2013-11-01 Thread Kelley Nielsen
There are many btrfs functions that manually search the tree for an item. They all reimplement the same mechanism and differ in the conditions that they use to find the item. It has been proposed that a new core interface, btrfs_find_item, be created to take the place of these functions, and

[PATCH 1/3] Bootstrap generic btrfs_find_item interface

2013-11-01 Thread Kelley Nielsen
There are many btrfs functions that manually search the tree for an item. They all reimplement the same mechanism and differ in the conditions that they use to find the item.__inode_info() is one such example. It has been proposed that a new interface be created to take the place of these

[PATCH 2/3] btrfs_find_item expanded to include find_root_ref functionality

2013-11-01 Thread Kelley Nielsen
This patch is the second step in bootstrapping the btrfs_find_item interface. The function btrfs_find_root_ref is similar to the former __inode_info; it accepts four of its parameters, and duplicates the first half of its functionality. The one former call to btrfs_find_root_ref has been replaced

[PATCH 3/3] btrfs_find_item expanded to include find_orphan_item functionality

2013-11-01 Thread Kelley Nielsen
This is the third step in bootstrapping the btrfs_find_item interface. The function find_orphan_item, in orphan.c, is similar to the two functions already replaced by the new interface. It uses two parameters, which are already present in the interface, and is nearly identical to the function

Re: [PATCH] Btrfs: check file extent type before anything else

2013-11-01 Thread Stefan Behrens
On Thu, 31 Oct 2013 16:50:43 -0400, Josef Bacik wrote: I hit this problem with my no holes patch and it made me realize what the problem was for bz 60834. If the first item in the leaf is an inline extent and we try to read anything starting from disk_bytenr onward we will read off the end

Re: [PATCH] Btrfs: fix negative qgroup tracking from owner accounting (bug #61951)

2013-11-01 Thread Jan Schmidt
(cc Arne) On Thu, October 24, 2013 at 16:49 (+0200), Wang Shilong wrote: Hello Jan, btrfs_dec_ref() queued a delayed ref for owner of a tree block. The qgroup tracking is based on delayed refs. The owner of a tree block is set when a tree block is allocated, it is never updated. When you

Re: [PATCH] Btrfs: fix negative qgroup tracking from owner accounting (bug #61951)

2013-11-01 Thread Jan Schmidt
Hi Josef, please consider this patch for btrfs-next and for the following merge window (3.13). The fact that there's another problem concerning qgroups as discussed in the rest of this thread doesn't make this patch any less correct. Thanks, -Jan On Thu, October 24, 2013 at 15:22 (+0200), Jan

Re: btrfs send/receive do not keep inode ctimes

2013-11-01 Thread Jan Schmidt
Hi Karl, On Fri, October 25, 2013 at 15:12 (+0200), Karl Kiniger wrote: is there low level support to change inode ctimes somehow? (on ext[234] it can be done using debugfs) No. It would be nice to make received snapshots as similar as possible to their send source. (I am not talking about

Re: [PATCH] Btrfs: check file extent type before anything else

2013-11-01 Thread Josef Bacik
On Fri, Nov 01, 2013 at 08:30:44AM +0100, Stefan Behrens wrote: On Thu, 31 Oct 2013 16:50:43 -0400, Josef Bacik wrote: I hit this problem with my no holes patch and it made me realize what the problem was for bz 60834. If the first item in the leaf is an inline extent and we try to read

Re: [PATCH] Btrfs: fix negative qgroup tracking from owner accounting (bug #61951)

2013-11-01 Thread Josef Bacik
On Fri, Nov 01, 2013 at 10:16:37AM +0100, Jan Schmidt wrote: (cc Arne) On Thu, October 24, 2013 at 16:49 (+0200), Wang Shilong wrote: Hello Jan, btrfs_dec_ref() queued a delayed ref for owner of a tree block. The qgroup tracking is based on delayed refs. The owner of a tree block is

Re: [PATCH] Btrfs: fix negative qgroup tracking from owner accounting (bug #61951)

2013-11-01 Thread Josef Bacik
On Thu, Oct 24, 2013 at 03:22:06PM +0200, Jan Schmidt wrote: btrfs_dec_ref() queued a delayed ref for owner of a tree block. The qgroup tracking is based on delayed refs. The owner of a tree block is set when a tree block is allocated, it is never updated. When you allocate a tree block and

[PATCH 08/13] btrfs: use feature attribute names to print better error messages

2013-11-01 Thread Jeff Mahoney
Now that we have the feature name strings available in the kernel via the sysfs attributes, we can use them for printing better failure messages from the ioctl path. Signed-off-by: Jeff Mahoney je...@suse.com --- fs/btrfs/ioctl.c | 35 ++- fs/btrfs/sysfs.c |

[PATCH 07/13] btrfs: add ability to change features via sysfs

2013-11-01 Thread Jeff Mahoney
This patch adds the ability to change (set/clear) features while the file system is mounted. A bitmask is added for each feature set for the support to set and clear the bits. A message indicating which bit has been set or cleared is issued when it's been changed and also when permission or

[PATCH 01/13] btrfs: add ioctls to query/change feature bits online

2013-11-01 Thread Jeff Mahoney
There are some feature bits that require no offline setup and can be enabled online. I've only reviewed extended irefs, but there will probably be more. We introduce three new ioctls: - BTRFS_IOC_GET_SUPPORTED_FEATURES: query the kernel for supported features. - BTRFS_IOC_GET_FEATURES: query the

[PATCH 12/13] btrfs: publish fs label in sysfs

2013-11-01 Thread Jeff Mahoney
This adds a writeable attribute which describes the label. Signed-off-by: Jeff Mahoney je...@suse.com --- fs/btrfs/sysfs.c | 44 1 file changed, 44 insertions(+) --- a/fs/btrfs/sysfs.c 2013-10-21 16:20:06.395804741 -0400 +++ b/fs/btrfs/sysfs.c

[PATCH 05/13] btrfs: publish per-super features in sysfs

2013-11-01 Thread Jeff Mahoney
This patch publishes information on which features are enabled in the file system on a per-super basis. At this point, it only publishes information on features supported by the file system implementation. Signed-off-by: Jeff Mahoney je...@suse.com --- fs/btrfs/sysfs.c | 81

[PATCH 09/13] btrfs: add ioctl to export size of global metadata reservation

2013-11-01 Thread Jeff Mahoney
btrfs filesystem df output will show the size of the metadata space and how much of it is used, and the user assumes that the difference is all usable space. Since that's not actually the case due to the global metadata reservation, we should provide the full picture to the user. This patch adds

[PATCH 03/13] btrfs: publish supported featured in sysfs

2013-11-01 Thread Jeff Mahoney
This patch adds the ability to publish supported features to sysfs under /sys/fs/btrfs/features. The files are module-wide and export which features the kernel supports. The content, for now, is just 0\n. Signed-off-by: Jeff Mahoney je...@suse.com --- fs/btrfs/sysfs.c | 44

[PATCH 02/13] kobject: export kobj_sysfs_ops

2013-11-01 Thread Jeff Mahoney
struct kobj_attribute implements the baseline attribute functionality that can be used all over the place. We should export the ops associated with it. Signed-off-by: Jeff Mahoney je...@suse.com Signed-off-by: Greg Kroah-Hartman gre...@linuxfoundation.org --- lib/kobject.c |1 + 1 file

[PATCH 11/13] btrfs: publish device membership in sysfs

2013-11-01 Thread Jeff Mahoney
Now that we have the infrastructure for per-super attributes, we can publish device membership in /sys/fs/btrfs/fsid/devices. The information is published as symlinks to the block devices. Signed-off-by: Jeff Mahoney je...@suse.com --- fs/btrfs/ctree.h |1 + fs/btrfs/sysfs.c | 32

[PATCH 10/13] btrfs: publish allocation data in sysfs

2013-11-01 Thread Jeff Mahoney
While trying to debug ENOSPC issues, it's helpful to understand what the kernel's view of the available space is. We export this information via ioctl, but sysfs files are more easily used. Signed-off-by: Jeff Mahoney je...@suse.com --- fs/btrfs/ctree.h |5 + fs/btrfs/extent-tree.c |

[PATCH 00/13] [PATCH 00/13] sysfs publishing patchset (v2)

2013-11-01 Thread Jeff Mahoney
This patchset implements the stubbed-out sysfs interface for btrfs. Or at least begins to do so. We publish: - Features supported by the file system implementation - Features enabled on the file system, including features unknown to the implemenation. These attributes can also be used to enable

Re: [PATCH 01/13] btrfs: add ioctls to query/change feature bits online

2013-11-01 Thread Zach Brown
+static int btrfs_ioctl_get_supported_features(struct file *file, + void __user *arg) +{ + struct btrfs_ioctl_feature_flags features[3]; + + features[0].compat_flags = BTRFS_FEATURE_COMPAT_SUPP; + features[0].compat_ro_flags =

btrfsck errors is it save to fix?

2013-11-01 Thread Hendrik Friedel
Hello, I have noticed that my server experiences high load average when writing to it. So I checked the file-system and found errors: ./btrfsck /dev/sdc1 Checking filesystem on /dev/sdc1 UUID: 989306aa-d291-4752-8477-0baf94f8c42f checking extents checking free space cache checking fs roots

kernel BUG at fs/btrfs/ctree.c:2964!

2013-11-01 Thread BJ Quinn
I keep running into this issue -- Oct 31 19:45:26 localhost kernel: kernel BUG at fs/btrfs/ctree.c:2964! Oct 31 19:45:26 localhost kernel: invalid opcode: [#2] SMP Oct 31 19:45:26 localhost kernel: Modules linked in: des_generic ecb md4 nls_utf8 cifs fscache dns_resolver usb_storage fuse

Re: kernel BUG at fs/btrfs/ctree.c:2964!

2013-11-01 Thread Josef Bacik
On Fri, Nov 01, 2013 at 07:28:41PM -0500, BJ Quinn wrote: I keep running into this issue -- Oct 31 19:45:26 localhost kernel: kernel BUG at fs/btrfs/ctree.c:2964! Oct 31 19:45:26 localhost kernel: invalid opcode: [#2] SMP Oct 31 19:45:26 localhost kernel: Modules linked in: des_generic

Re: [PATCH] Btrfs: fix negative qgroup tracking from owner accounting (bug #61951)

2013-11-01 Thread Wang Shilong
Hello Jan, Arne On 11/01/2013 05:16 PM, Jan Schmidt wrote: I've understood the problem this reproducer creates. In fact, you can shorten it dramatically. The story of qgroups is going to turn awkward at this point. mkfs and enable quota, put some data in (needs a level 2 tree) - this accounts