[PATCH] Btrfs: fix double decrease of the writer counter

2012-09-17 Thread Miao Xie
In __btrfs_end_transaction(), we have invoked sb_end_intwrite(), but if we need run btrfs_commit_transaction(), we will decrease the writer counter for two times because btrfs_commit_transaction() also invokes sb_end_intwrite(). Fix it. Signed-off-by: Miao Xie mi...@cn.fujitsu.com ---

Re: Oops with a degraded volume

2012-09-17 Thread Liu Bo
On 09/15/2012 10:17 PM, Antoine Sirinelli wrote: Hi, I have experienced a very reproducible Oops within the btrfs driver. On a linux 3.5.4, if I mount a volume with the option degraded because one of the device is missing, I would get an Oops when I unmount it (or even before). You can see

Experiences: Why BTRFS had to yield for ZFS

2012-09-17 Thread Casper Bang
Abstract For database testing purposes, a COW filesystem was needed in order to facilitate snapshotting and rollback, such as to provide mirrors of our production database at fixed intervals (every night and by demand). Platform An HP Proliant 380P (2x Intel Xeon E5-2620 with 12 cores for a total

Re: Experiences: Why BTRFS had to yield for ZFS

2012-09-17 Thread Ralf Hildebrandt
* Casper Bang casper.b...@gmail.com: Oracle (Unbreakable) Linux x64 2.6.39-200.29.3.el6uek.x86_64 #1 SMP And the btrfs was that from vanilla 2.6.39 (i.e. over a year old)? -- Ralf Hildebrandt Charite Universitätsmedizin Berlin ralf.hildebra...@charite.deCampus

[PATCH 1/2 v3] Btrfs: use flag EXTENT_DEFRAG for snapshot-aware defrag

2012-09-17 Thread Liu Bo
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

[PATCH 2/2 v3] Btrfs: snapshot-aware defrag

2012-09-17 Thread Liu Bo
This comes from one of btrfs's project ideas, As we defragment files, we break any sharing from other snapshots. The balancing code will preserve the sharing, and defrag needs to grow this as well. Now we're able to fill the blank with this patch, in which we make full use of backref walking

Re: [PATCH 2/2 v3] Btrfs: snapshot-aware defrag

2012-09-17 Thread Liu Bo
Please only push this one since the first one remains unchanged, I also posted it for others to better review. thanks, liubo On 09/17/2012 05:58 PM, Liu Bo wrote: This comes from one of btrfs's project ideas, As we defragment files, we break any sharing from other snapshots. The balancing

Re: Experiences: Why BTRFS had to yield for ZFS

2012-09-17 Thread Avi Miller
Hi, On 17/09/2012, at 7:55 PM, Casper Bnag casper.b...@gmail.com wrote: We're using the latest available kernel for our Oracle Unbreakable Linux 6.3 from Aug 28. We have no other option, since the Oracle database software needs to run on a certified distro. Oracle Database is not certified

Re: [PATCH] Btrfs + Btrfs-progs: make pipe functions re-usable

2012-09-17 Thread Hugo Mills
On Mon, Sep 17, 2012 at 12:48:10PM +0800, Anand Jain wrote: btrfs send introduced a part of code to read kernel-data from user-end using pipe. We need this part of code to be useable outside of send sub-cmd, so that developing service sub-cmd can use it. What's 'service sub-cmd'

Re: Experiences: Why BTRFS had to yield for ZFS

2012-09-17 Thread Avi Miller
Hi, On 17/09/2012, at 8:47 PM, Casper Bnag casper.b...@gmail.com wrote: month, that just makes me wonder why Oracle didn't use these latest bits. We used the most stable release of btrfs that was available when the development of the UEK was done. Keep in mind that while it's versioned at

enquiry about autodefrag option (resent)

2012-09-17 Thread ching
I am testing btrfs for long-term storage and backup, and i would like to know more about autodefrag option: 1. Will autodefrag option benefit ssd? My understanding is: autodrag - number of extent decrease - metadata decrease - a healthier filesystem in the long run (P.S. I am

Re: [PATCH 1/2] Btrfs: cleanup duplicated division functions

2012-09-17 Thread Ilya Dryomov
On Mon, Sep 17, 2012 at 10:21:00AM +0800, Miao Xie wrote: On fri, 14 Sep 2012 15:54:18 +0200, David Sterba wrote: On Thu, Sep 13, 2012 at 06:51:36PM +0800, Miao Xie wrote: div_factor{_fine} has been implemented for two times, cleanup it. And I move them into a independent file named math.h

Re: [PATCH] Btrfs: fix race with freeze and free space inodes

2012-09-17 Thread Josef Bacik
On Sun, Sep 16, 2012 at 11:36:57PM -0600, Miao Xie wrote: On fri, 14 Sep 2012 11:26:20 -0400, Josef Bacik wrote: So we start our freeze, somebody comes in and does an fsync() on a file where we have to commit a transaction for whatever reason, and we will deadlock because the freeze is

Re: [PATCH] Btrfs + Btrfs-progs: make pipe functions re-usable

2012-09-17 Thread David Sterba
On Mon, Sep 17, 2012 at 12:48:10PM +0800, Anand Jain wrote: btrfs send introduced a part of code to read kernel-data from user-end using pipe. We need this part of code to be useable outside of send sub-cmd, so that developing service sub-cmd can use it. What's 'service sub-cmd'

Re: [RFC inside][PATCH] btrfs: allow setting NOCOW for a zero sized file via ioctl

2012-09-17 Thread David Sterba
Hi, Josef, I noticed that you did not add the patch to btrfs-next. This is understandable for a RFC patch of course, but I'd like to ask you to add it into the queue, so people testing -next have a chance to give it a try. Thanks, david -- To unsubscribe from this list: send the line unsubscribe

Re: Root dentry has weird name

2012-09-17 Thread Marc MERLIN
On Mon, Sep 17, 2012 at 06:17:53PM +0200, David Sterba wrote: On Fri, Sep 14, 2012 at 10:09:12AM -0700, Marc MERLIN wrote: I only have btrfs on my laptop and just started getting this. Afaik, this is not directly related to btrfs. Search for the Root dentry has weird name message and you'll

This code cannot be right

2012-09-17 Thread Alan Cox
ctree.c:btrfs_insert_some_items() { ... if (total_size + data_size[i]+ ... { break; nr = i; } -- To unsubscribe from this list: send the line unsubscribe linux-btrfs in the body of a message to

Re: [PATCH 1/2] Btrfs: cleanup duplicated division functions

2012-09-17 Thread David Sterba
On Mon, Sep 17, 2012 at 10:21:00AM +0800, Miao Xie wrote: On fri, 14 Sep 2012 15:54:18 +0200, David Sterba wrote: On Thu, Sep 13, 2012 at 06:51:36PM +0800, Miao Xie wrote: div_factor{_fine} has been implemented for two times, cleanup it. And I move them into a independent file named math.h

Re: [PATCH] Btrfs: fix double decrease of the writer counter

2012-09-17 Thread Josef Bacik
On Mon, Sep 17, 2012 at 12:34:27AM -0600, Miao Xie wrote: In __btrfs_end_transaction(), we have invoked sb_end_intwrite(), but if we need run btrfs_commit_transaction(), we will decrease the writer counter for two times because btrfs_commit_transaction() also invokes sb_end_intwrite(). Fix

Re: [PATCH V4 01/12] Btrfs: fix error path in create_pending_snapshot()

2012-09-17 Thread David Sterba
On Thu, Sep 06, 2012 at 06:00:32PM +0800, Miao Xie wrote: This patch fixes the following problem: - If we failed to deal with the delayed dir items, we should abort transaction, just as its comment said. Fix it. - If root reference or root back reference insertion failed, we should

Re: [PATCH 2/2 v3] Btrfs: snapshot-aware defrag

2012-09-17 Thread Josef Bacik
On Mon, Sep 17, 2012 at 03:58:56AM -0600, Liu Bo wrote: This comes from one of btrfs's project ideas, As we defragment files, we break any sharing from other snapshots. The balancing code will preserve the sharing, and defrag needs to grow this as well. Now we're able to fill the blank with

Re: 'umount' of multi-device volume hangs until the device is physically un-plugged

2012-09-17 Thread Josef Bacik
On Sun, Sep 16, 2012 at 10:07:39PM -0600, Kay Sievers wrote: I'm currently playing around with native btrfs multi-device support in systemd. There might be a few hotplug issues to solve, here is the first one: A mounted (otherwise unused) multi-device volume (USB multi-slot card reader),

Re: This code cannot be right

2012-09-17 Thread Chris Mason
On Mon, Sep 17, 2012 at 10:25:54AM -0600, Alan Cox wrote: ctree.c:btrfs_insert_some_items() { ... if (total_size + data_size[i]+ ... { break; nr = i; } Hi Alan, Definitely not right ;) It's

[PATCH] Btrfs: do not hold the write_lock on the extent tree while logging V2

2012-09-17 Thread Josef Bacik
Dave Sterba pointed out a sleeping while atomic bug while doing fsync. This is because I'm an idiot and didn't realize that rwlock's were spin locks, so we've been holding this thing while doing allocations and such which is not good. This patch fixes this by dropping the write lock before we do

Re: Oops with a degraded volume

2012-09-17 Thread Antoine Sirinelli
On Mon, Sep 17, 2012 at 02:46:00PM +0800, Liu Bo wrote: On 09/15/2012 10:17 PM, Antoine Sirinelli wrote: I have experienced a very reproducible Oops within the btrfs driver. On a linux 3.5.4, if I mount a volume with the option degraded because one of the device is missing, I would get an

btrfs raid1 degraded in need of chuck tree rebuild

2012-09-17 Thread Vladi Gergov
Below is my original post about my fs. Just wondering if anyone knows if I can at this point get my data back or cut my losses. Is an fsck cable of getting this fixed close or has my 2 year wait been in vain. Thanks in advance! Excerpts from Vladi Gergov's message of 2010-10-29 16:53:42 -0400:

Re: 'umount' of multi-device volume hangs until the device is physically un-plugged

2012-09-17 Thread Kay Sievers
On Mon, Sep 17, 2012 at 7:19 PM, Josef Bacik jba...@fusionio.com wrote: On Sun, Sep 16, 2012 at 10:07:39PM -0600, Kay Sievers wrote: I'm currently playing around with native btrfs multi-device support in systemd. There might be a few hotplug issues to solve, here is the first one: A mounted

BTRFS_IOC_DEVICES_READY and removed devices

2012-09-17 Thread Kay Sievers
We are currently playing around with native btrfs multi-device support in systemd. We already committed the needed pieces to systemd git, to register all detected btrfs filesystems with the kernel. For volumes which are listed in fstab for mounting, we delay the actual mount-attempt of a

[PATCH 0/2] Btrfs: set mount options permanently

2012-09-17 Thread Hidetoshi Seto
Following patches are going to implement one of unclaimed features listed in the btrfs wiki: https://btrfs.wiki.kernel.org/index.php/Project_ideas#Set_mount_options_permanently Special thanks to Kazuhiro Yamashita for his time and efforts. Your comments/reviews are welcomed. Thanks, H.Seto --

[PATCH 1/2] Btrfs: make space to keep default mount options

2012-09-17 Thread Hidetoshi Seto
This patch create space to hold default mount option, and to use saved default mount option change super.c to read default mount option first when mount devices. Signed-off-by: Hidetoshi Seto seto.hideto...@jp.fujitsu.com --- fs/btrfs/ctree.h |5 - fs/btrfs/super.c |2 ++ 2 files

[PATCH 2/2] Btrfs-progs: add mount-option command

2012-09-17 Thread Hidetoshi Seto
This patch adds mount-option command. The command can set/get default mount options. Now, the command can set/get 24 options. These options are equal to mount options which store in fs_info/mount-opt. Signed-off-by: Hidetoshi Seto seto.hideto...@jp.fujitsu.com --- Makefile |5 +-

Re: [PATCH V4 01/12] Btrfs: fix error path in create_pending_snapshot()

2012-09-17 Thread Miao Xie
On mon, 17 Sep 2012 18:56:27 +0200, David Sterba wrote: On Thu, Sep 06, 2012 at 06:00:32PM +0800, Miao Xie wrote: This patch fixes the following problem: - If we failed to deal with the delayed dir items, we should abort transaction, just as its comment said. Fix it. - If root reference

Re: [PATCH 2/2] Btrfs-progs: add mount-option command

2012-09-17 Thread Miao Xie
On tue, 18 Sep 2012 10:30:17 +0900, Hidetoshi Seto wrote: This patch adds mount-option command. The command can set/get default mount options. Now, the command can set/get 24 options. These options are equal to mount options which store in fs_info/mount-opt. I don't think we need implement a

Re: [PATCH] Btrfs + Btrfs-progs: make pipe functions re-usable

2012-09-17 Thread Anand Jain
As I said in our private email exchange some months ago, I don't think this is the right way to be doing this. For example, if you use an alternative tool (such as btrfs-gui) which uses the ioctls directly, you've lost that logging information. I agree with that Hugo. Thanks. These

Re: [PATCH 1/2] Btrfs: cleanup duplicated division functions

2012-09-17 Thread Miao Xie
On Mon, 17 Sep 2012 18:31:13 +0200, David Sterba wrote: On Mon, Sep 17, 2012 at 10:21:00AM +0800, Miao Xie wrote: On fri, 14 Sep 2012 15:54:18 +0200, David Sterba wrote: On Thu, Sep 13, 2012 at 06:51:36PM +0800, Miao Xie wrote: div_factor{_fine} has been implemented for two times, cleanup it.

Re: [PATCH 2/2] Btrfs-progs: add mount-option command

2012-09-17 Thread Roman Mamedov
On Tue, 18 Sep 2012 10:31:41 +0800 Miao Xie mi...@cn.fujitsu.com wrote: On tue, 18 Sep 2012 10:30:17 +0900, Hidetoshi Seto wrote: This patch adds mount-option command. The command can set/get default mount options. Now, the command can set/get 24 options. These options are equal to mount

Re: Experiences: Why BTRFS had to yield for ZFS

2012-09-17 Thread Anand Jain
A script on the test server, would then apply Oracle archive files from the production environment to this Oracle sync database, every 10'th minute, effectively making it near up-to-date with production. The most reliable way to do this was with a simple NFS mount (rather than rsync or

Re: [PATCH] Btrfs + Btrfs-progs: make pipe functions re-usable

2012-09-17 Thread Anand Jain
What's 'service sub-cmd' please? at the moment 'btrfs service historymnt|dev' to show logs of maintenance. comments/suggestions welcome. Sorry, but without a more detailed description I can hardly give useful comments. David, 'btrfs service history mnt|dev' is basically to

[PATCH] Btrfs: fix the missing error information in create_pending_snapshot()

2012-09-17 Thread Miao Xie
The macro btrfs_abort_transaction() can get the line number of the code where the problem happens, so we should invoke it in the place that the error occurs, or we will lose the line number. Reported-by: David Sterba d...@jikos.cz Signed-off-by: Miao Xie mi...@cn.fujitsu.com ---

Re: [PATCH V3 4/7] Btrfs-progs: fix wrong way to check if the root item contains otime and uuid

2012-09-17 Thread Anand Jain
- if(ri-generation == ri-generation_v2) { + if(sh-len == sizeof(struct btrfs_root_item)) { t = ri-otime.sec; This looks fine now but should this work when we move to v3 and still have access