Re: Corrupted system due to imbalanced metadata chunks

2016-05-17 Thread Chris Murphy
On Tue, May 17, 2016 at 9:45 AM, Peter Kese wrote: > Then I tried a software upgrade (Ubuntu 15.10 -> 16.04) and it turned > out that while there was more than 100 GB (45%) of free disk space, > the upgrade process broke down somewhere in the middle reporting IO > errors

Re: Corrupted system due to imbalanced metadata chunks

2016-05-17 Thread Chris Murphy
On Tue, May 17, 2016 at 3:58 PM, Goni Zahavy wrote: > On 5/18/16, Chris Murphy wrote: >> On Tue, May 17, 2016 at 2:27 PM, Goni Zahavy wrote: >>> Guys, just remember that this crappy-installer behavior works >>> "as-expected" >>>

Re: problems with free space cache

2016-05-17 Thread Qu Wenruo
Nicholas D Steeves wrote on 2016/05/17 14:17 -0400: On 16 May 2016 at 07:36, Austin S. Hemmelgarn wrote: On 2016-05-16 02:20, Qu Wenruo wrote: Duncan wrote on 2016/05/16 05:59 +: Qu Wenruo posted on Mon, 16 May 2016 10:24:23 +0800 as excerpted: IIRC

Re: [PATCH 0/4] Add support to clear v1 free space cache for btrfs check

2016-05-17 Thread Qu Wenruo
Not familiar about the problem, but you don't really need to install the patch. You can just execute '/btrfsck' directly to call the new fsck. And there is still some time before the patch is merged, there is really no need to install. Thanks, Qu Ivan P wrote on 2016/05/17 20:12 +0200:

Re: [RFC PATCH v2.1 16/16] btrfs-progs: fsck: Introduce low memory mode

2016-05-17 Thread Qu Wenruo
Josef Bacik wrote on 2016/05/17 11:29 -0400: On 05/17/2016 05:38 AM, Qu Wenruo wrote: From: Lu Fengqi You can add Reviewed-by: Josef Bacik To the whole series. Thanks, Josef Thanks for the review. I'll add it to github branch to avoid

Re: [PATCH v10 10/21] btrfs: try more times to alloc metadata reserve space

2016-05-17 Thread Qu Wenruo
David Sterba wrote on 2016/05/17 15:20 +0200: On Fri, Apr 01, 2016 at 02:35:01PM +0800, Qu Wenruo wrote: @@ -5815,6 +5817,23 @@ out_fail: } if (delalloc_lock) mutex_unlock(_I(inode)->delalloc_mutex); + /* +* The number of metadata bytes is

Re: [PATCH v10 11/21] btrfs: dedupe: Add ioctl for inband dedupelication

2016-05-17 Thread Qu Wenruo
David Sterba wrote on 2016/05/17 15:14 +0200: On Wed, Apr 27, 2016 at 09:29:29AM +0800, Qu Wenruo wrote: @@ -5542,6 +5606,10 @@ long btrfs_ioctl(struct file *file, unsigned int return btrfs_ioctl_get_fslabel(file, argp); case BTRFS_IOC_SET_FSLABEL:

Re: [PATCH 1/4] btrfs-progs: corrupt-block: Add ability to corrupt free space cache file

2016-05-17 Thread Qu Wenruo
David Sterba wrote on 2016/05/17 15:00 +0200: On Tue, May 17, 2016 at 11:47:55AM +0800, Qu Wenruo wrote: Btrfs-progs fix will follow soon. Reported-by: Ivan P Signed-off-by: Qu Wenruo --- btrfs-corrupt-block.c | 124

Re: [PATCH 2/4] btrfs-progs: ctree: return earlier for btrfs_previous_item

2016-05-17 Thread Qu Wenruo
David Sterba wrote on 2016/05/17 14:50 +0200: On Tue, May 17, 2016 at 11:47:56AM +0800, Qu Wenruo wrote: Btrfs_previous_item() has a parameter to specify minimal objectid to return. But surprisingly it doesn't use it at all. Although that's OK, but it would take years long for large tree, so

[PATCH] Btrfs: fix unexpected return value of fiemap

2016-05-17 Thread Liu Bo
btrfs's fiemap is supposed to return 0 on success and return < 0 on error, however, ret becomes 1 after looking up the last file extent, and if the offset is beyond EOF, we can return 1. This may confuse applications using ioctl(FIEL_IOC_FIEMAP). Signed-off-by: Liu Bo ---

Re: [PATCH] Btrfs: fix handling of faults from btrfs_copy_from_user

2016-05-17 Thread Chris Mason
On Tue, May 17, 2016 at 11:57:07PM +0200, Adam Borowski wrote: > On Tue, May 17, 2016 at 05:00:49PM -0400, Chris Mason wrote: > > On Tue, May 17, 2016 at 10:47:27PM +0200, Adam Borowski wrote: > > > > Hmmm, some of your traces mentioned compression, do you have compression > > > > enabled? > > >

Re: Corrupted system due to imbalanced metadata chunks

2016-05-17 Thread Goni Zahavy
On 5/18/16, Chris Murphy wrote: > On Tue, May 17, 2016 at 2:27 PM, Goni Zahavy wrote: >> Guys, just remember that this crappy-installer behavior works >> "as-expected" >> on every other filesystem. > > It also fails as expected on every other file

Re: [PATCH] Btrfs: fix handling of faults from btrfs_copy_from_user

2016-05-17 Thread Adam Borowski
On Tue, May 17, 2016 at 05:00:49PM -0400, Chris Mason wrote: > On Tue, May 17, 2016 at 10:47:27PM +0200, Adam Borowski wrote: > > > Hmmm, some of your traces mentioned compression, do you have compression > > > enabled? > > > > Yeah, I mount with noatime,compress=lzo. > > > > > Also, if you can

Re: Corrupted system due to imbalanced metadata chunks

2016-05-17 Thread Chris Murphy
On Tue, May 17, 2016 at 2:27 PM, Goni Zahavy wrote: > Guys, just remember that this crappy-installer behavior works "as-expected" > on every other filesystem. It also fails as expected on every other file system if the upgrade is interrupted for reasons that have nothing to

Re: Corrupted system due to imbalanced metadata chunks

2016-05-17 Thread Goni Zahavy
On 5/17/16, Chris Murphy wrote: > On Tue, May 17, 2016 at 9:45 AM, Peter Kese wrote: >> I've been using btrfs on my main system for a few months. I know btrfs >> is a little bit beta, but I thought not using any fancy features like >> quotas,

Re: [PATCH] Btrfs: fix handling of faults from btrfs_copy_from_user

2016-05-17 Thread Chris Mason
On Tue, May 17, 2016 at 10:47:27PM +0200, Adam Borowski wrote: > On Tue, May 17, 2016 at 12:23:44PM -0400, Chris Mason wrote: > > On Tue, May 17, 2016 at 05:14:51PM +0200, Adam Borowski wrote: > > > On Mon, May 16, 2016 at 05:06:55PM -0400, Chris Mason wrote: > > > > And now for the patch: > > >

Re: [PATCH] Btrfs: fix handling of faults from btrfs_copy_from_user

2016-05-17 Thread Adam Borowski
On Tue, May 17, 2016 at 12:23:44PM -0400, Chris Mason wrote: > On Tue, May 17, 2016 at 05:14:51PM +0200, Adam Borowski wrote: > > On Mon, May 16, 2016 at 05:06:55PM -0400, Chris Mason wrote: > > > And now for the patch: > > [...] > > > > I then tried your test case, and alas: > > > > Here's

[SOLVED] Re: Scrub status regression (repost kinda)

2016-05-17 Thread al
Duncan <1i5t5.duncan cox.net> writes: > That's almost certainly due to the state of the location where btrfs > stores scrub status information, /var/lib/btrfs, which should be a > directory that's both writable by btrfs during the scrub, and readable at > the time btrfs scrub status is run. >

Re: Corrupted system due to imbalanced metadata chunks

2016-05-17 Thread Chris Murphy
On Tue, May 17, 2016 at 12:03 PM, Austin S. Hemmelgarn wrote: > On 2016-05-17 11:45, Peter Kese wrote: >> >> I've been using btrfs on my main system for a few months. I know btrfs >> is a little bit beta, but I thought not using any fancy features like >> quotas,

Re: Corrupted system due to imbalanced metadata chunks

2016-05-17 Thread Chris Murphy
On Tue, May 17, 2016 at 9:45 AM, Peter Kese wrote: > I've been using btrfs on my main system for a few months. I know btrfs > is a little bit beta, but I thought not using any fancy features like > quotas, snapshotting, raid, etc. would keep me on the safe side. > > Then I

Re: Hot data tracking / hybrid storage

2016-05-17 Thread Kai Krakow
Am Tue, 17 May 2016 07:32:11 -0400 schrieb "Austin S. Hemmelgarn" : > On 2016-05-17 02:27, Ferry Toth wrote: > > Op Mon, 16 May 2016 01:05:24 +0200, schreef Kai Krakow: > > > >> Am Sun, 15 May 2016 21:11:11 + (UTC) > >> schrieb Duncan <1i5t5.dun...@cox.net>: > >> >

Re: problems with free space cache

2016-05-17 Thread Nicholas D Steeves
On 16 May 2016 at 07:36, Austin S. Hemmelgarn wrote: > On 2016-05-16 02:20, Qu Wenruo wrote: >> >> >> >> Duncan wrote on 2016/05/16 05:59 +: >>> >>> Qu Wenruo posted on Mon, 16 May 2016 10:24:23 +0800 as excerpted: >>> IIRC clear_cache option is fs level option.

Re: [PATCH 0/4] Add support to clear v1 free space cache for btrfs check

2016-05-17 Thread Ivan P
Thank you, however I can't seem to be able to compile that snapshot, I'm getting === /usr/bin/install -c -m644 -d 64-btrfs-dm.rules /home/myuser/aur/btrfs-progs-git/pkg/btrfs-progs-git/usr/lib/udev/rules.d /usr/bin/install: cannot create directory ‘64-btrfs-dm.rules’: File

Re: Corrupted system due to imbalanced metadata chunks

2016-05-17 Thread Austin S. Hemmelgarn
On 2016-05-17 11:45, Peter Kese wrote: I've been using btrfs on my main system for a few months. I know btrfs is a little bit beta, but I thought not using any fancy features like quotas, snapshotting, raid, etc. would keep me on the safe side. Then I tried a software upgrade (Ubuntu 15.10 ->

Re: [PATCH 3/7] Btrfs: check if extent buffer is aligned to sectorsize

2016-05-17 Thread Liu Bo
On Tue, May 17, 2016 at 11:39:52AM +0200, David Sterba wrote: > On Mon, May 16, 2016 at 11:01:41AM -0700, Liu Bo wrote: > > On Sat, May 14, 2016 at 06:30:52PM +0800, Qu Wenruo wrote: > > > Hi Liu, > > > > > > Thanks for your patch first. > > > > > > On 05/14/2016 08:06 AM, Liu Bo wrote: > > > >

[PATCH V2] Btrfs: introduce ticketed enospc infrastructure

2016-05-17 Thread Josef Bacik
Our enospc flushing sucks. It is born from a time where we were early enospc'ing constantly because multiple threads would race in for the same reservation and randomly starve other ones out. So I came up with this solution to block any other reservations from happening while one guy tried to

Re: [PATCH 5/7] Btrfs: replace BUG_ON with WARN in merge_bio

2016-05-17 Thread Liu Bo
On Tue, May 17, 2016 at 11:55:19AM +0200, David Sterba wrote: > On Mon, May 16, 2016 at 10:24:01AM -0700, Liu Bo wrote: > > On Mon, May 16, 2016 at 10:44:38AM +0200, David Sterba wrote: > > > On Fri, May 13, 2016 at 05:07:00PM -0700, Liu Bo wrote: > > > > We have two BUG_ON in merge_bio, but since

Re: [PATCH] Btrfs: fix handling of faults from btrfs_copy_from_user

2016-05-17 Thread Chris Mason
On Tue, May 17, 2016 at 05:14:51PM +0200, Adam Borowski wrote: > On Mon, May 16, 2016 at 05:06:55PM -0400, Chris Mason wrote: > > Hi everyone, > > > > I've tried to cc most of the recent reports of this warning. It was > > pretty hard to track down, but I've got a test program for it now. My >

Corrupted system due to imbalanced metadata chunks

2016-05-17 Thread Peter Kese
I've been using btrfs on my main system for a few months. I know btrfs is a little bit beta, but I thought not using any fancy features like quotas, snapshotting, raid, etc. would keep me on the safe side. Then I tried a software upgrade (Ubuntu 15.10 -> 16.04) and it turned out that while there

Re: [RFC PATCH v2.1 16/16] btrfs-progs: fsck: Introduce low memory mode

2016-05-17 Thread Josef Bacik
On 05/17/2016 05:38 AM, Qu Wenruo wrote: From: Lu Fengqi You can add Reviewed-by: Josef Bacik To the whole series. Thanks, Josef -- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to

Re: RFE: 'btrfs' tools machine readable output

2016-05-17 Thread David Sterba
On Tue, May 17, 2016 at 02:32:14PM +0100, Richard W.M. Jones wrote: > As I said I don't have any particular favourite format. However I'll > just point you to the code that qemu uses (basically open-coding) to > write json: > >

Re: [PATCH] fs: Add MODULE_SOFTDEP declarations for hard-coded crypto drivers

2016-05-17 Thread David Sterba
On Tue, May 17, 2016 at 02:36:31PM +0100, Ben Hutchings wrote: > This helps initramfs builders and other tools to find the full > dependencies of a module. > > References: https://bugs.debian.org/819725 > Signed-off-by: Ben Hutchings > --- > --- a/fs/btrfs/super.c > +++

[PATCH 2/6] fstests: btrfs: add functions to get and put a device for replace target

2016-05-17 Thread Anand Jain
For the replace tests we need a device as a spare device, here functions _spare_dev_get() and _spare_dev_put() will get it from the SCRATCH_DEV_POOL_SAVED, which is set when _scratch_dev_pool_get() is called, and is based on how many has already been assigned to SCRATCH_DEV_POOL. usage:

[PATCH 4/6] fstests: btrfs: add helper function to check if btrfs is module

2016-05-17 Thread Anand Jain
We need btrfs to be a module so that it can unloaded and reloaded, so that we can clean up the btrfs internal in memory device list. This patch adds _require_btrfs_unloadable() and _reload_btrfs_ko() to help with the same. Signed-off-by: Anand Jain --- common/rc | 12

[PATCH 1/6] fstests: btrfs: add functions to set and reset required number of SCRATCH_DEV_POOL

2016-05-17 Thread Anand Jain
This patch provides functions _scratch_dev_pool_get() _scratch_dev_pool_put() Which will help to set/reset SCRATCH_DEV_POOL with the required number of devices. SCRATCH_DEV_POOL_SAVED will hold all the devices. Usage: _scratch_dev_pool_get() :: do stuff _scratch_dev_pool_put()

[PATCH 3/6] fstests: btrfs: 027 make use of new device get and put helper functions

2016-05-17 Thread Anand Jain
Below patches added helper function to get the requested number of devices for scratch and spare device fstest: btrfs: add functions to get and put a device for replace target fstests: btrfs: add functions to set and reset required number of SCRATCH_DEV_POOL This patch makes use of them.

[PATCH 5/6] fstests: btrfs: test RAID1 device reappear and balanced

2016-05-17 Thread Anand Jain
The test does the following: Initialize a RAID1 with some data Re-mount RAID1 degraded with _dev1_ and write up to half of the FS capacity Save md5sum checkpoint1 Re-mount healthy RAID1 Let balance re-silver. Save md5sum checkpoint2 Re-mount RAID1 degraded with _dev2_ Save

[PATCH] btrfs-progs: device usage: report slack space

2016-05-17 Thread David Sterba
The total filesystem space on a given device might be smaller than the device size. We should report that space as well. The original idea was to report the 'occupied' size but the term was not all clear, so the logic was reversed to report the slack space. Signed-off-by: David Sterba

[PATCH 6/6] fstests: btrfs: test RAID5 device reappear and balance

2016-05-17 Thread Anand Jain
The test does the following: Initialize a RAID5 with some data Re-mount RAID5 degraded with _dev3_ missing and write data. Save md5sum checkpoint1 Re-mount healthy RAID5 Let balance fix degraded blocks. Save md5sum checkpoint2 Re-mount RAID1 degraded now with _dev1_ missing. Save md5sum

BTRFS RAID 1 broken: Mounted drive(s) basically empty after repair attempt

2016-05-17 Thread Quanttek Jonas
Hey there, first up, I'll provide the basic information: (I'm using Fedora 23 on my system with newest available kernel etc, but I'm currently booted up with a Live-USB-Stick) $ uname -a Linux localhost 4.2.3-300.fc23.x86_64 #1 SMP Mon Oct 5 15:42:54 UTC 2015 x86_64 x86_64 x86_64

Re: [PATCH 1/2] Btrfs: add more valid checks for superblock

2016-05-17 Thread David Sterba
On Sat, May 14, 2016 at 07:42:26AM +0800, Qu Wenruo wrote: > > For fsck code, we can go forth and back to fix them. In fact I don't > > think fsck could work out anything, as superblock checksum has _matched_ > > but the values inside superblock are invalid, in this case we cannot trust > >

Re: [PATCH 2/2] Btrfs: add valid checks for chunk loading

2016-05-17 Thread David Sterba
On Fri, May 13, 2016 at 04:57:17PM -0700, Liu Bo wrote: > > > + chunk)); > > > + return -EIO; > > > + } > > > if (!length || !IS_ALIGNED(length, root->sectorsize)) { > > > btrfs_err(root->fs_info, > > >

[PATCH] fs: Add MODULE_SOFTDEP declarations for hard-coded crypto drivers

2016-05-17 Thread Ben Hutchings
This helps initramfs builders and other tools to find the full dependencies of a module. References: https://bugs.debian.org/819725 Signed-off-by: Ben Hutchings --- --- a/fs/btrfs/super.c +++ b/fs/btrfs/super.c @@ -2456,3 +2456,4 @@ late_initcall(init_btrfs_fs);

Re: RFE: 'btrfs' tools machine readable output

2016-05-17 Thread Richard W.M. Jones
As I said I don't have any particular favourite format. However I'll just point you to the code that qemu uses (basically open-coding) to write json: http://git.qemu.org/?p=qemu.git;a=blob;f=qobject/qjson.c;h=ef160d2119eb18aa917b71b40e37d54880b1ac7f;hb=HEAD#l83 Hopefully this is useful as a

Re: [PATCH v10 10/21] btrfs: try more times to alloc metadata reserve space

2016-05-17 Thread David Sterba
On Fri, Apr 01, 2016 at 02:35:01PM +0800, Qu Wenruo wrote: > @@ -5815,6 +5817,23 @@ out_fail: > } > if (delalloc_lock) > mutex_unlock(_I(inode)->delalloc_mutex); > + /* > + * The number of metadata bytes is calculated by the difference > + * between

Re: [PATCH v10 07/21] btrfs: dedupe: Implement btrfs_dedupe_calc_hash interface

2016-05-17 Thread David Sterba
On Fri, Apr 01, 2016 at 02:34:58PM +0800, Qu Wenruo wrote: > From: Wang Xiaoguang > > Unlike in-memory or on-disk dedupe method, only SHA256 hash method is > supported yet, so implement btrfs_dedupe_calc_hash() interface using > SHA256. > > Signed-off-by: Qu Wenruo

Re: [PATCH v10 11/21] btrfs: dedupe: Add ioctl for inband dedupelication

2016-05-17 Thread David Sterba
On Wed, Apr 27, 2016 at 09:29:29AM +0800, Qu Wenruo wrote: > > @@ -5542,6 +5606,10 @@ long btrfs_ioctl(struct file *file, unsigned int > > return btrfs_ioctl_get_fslabel(file, argp); > > case BTRFS_IOC_SET_FSLABEL: > > return btrfs_ioctl_set_fslabel(file, argp); > >

Re: RFE: 'btrfs' tools machine readable output

2016-05-17 Thread Austin S. Hemmelgarn
On 2016-05-17 08:23, David Sterba wrote: On Tue, May 17, 2016 at 07:14:12AM -0400, Austin S. Hemmelgarn wrote: By this example I don't mean that JSON has to be the format -- in fact it's a terrible format with all sorts of problems -- any format which is parseable with C libraries would do for

Re: [PATCH 1/4] btrfs-progs: corrupt-block: Add ability to corrupt free space cache file

2016-05-17 Thread David Sterba
On Tue, May 17, 2016 at 03:00:04PM +0200, David Sterba wrote: > > @@ -1065,11 +1163,12 @@ int main(int argc, char **argv) > > { "delete", no_argument, NULL, 'd'}, > > { "root", no_argument, NULL, 'r'}, > > { "csum", required_argument,

Re: [PATCH 1/4] btrfs-progs: corrupt-block: Add ability to corrupt free space cache file

2016-05-17 Thread David Sterba
On Tue, May 17, 2016 at 11:47:55AM +0800, Qu Wenruo wrote: > > Btrfs-progs fix will follow soon. > > Reported-by: Ivan P > Signed-off-by: Qu Wenruo > --- > btrfs-corrupt-block.c | 124 > +- > 1

Re: [PATCH 2/4] btrfs-progs: ctree: return earlier for btrfs_previous_item

2016-05-17 Thread David Sterba
On Tue, May 17, 2016 at 11:47:56AM +0800, Qu Wenruo wrote: > Btrfs_previous_item() has a parameter to specify minimal objectid to > return. > > But surprisingly it doesn't use it at all. > Although that's OK, but it would take years long for large tree, so > return it earlier. This makes it

Re: [RCF - PATCH] btrfs: do not ignore errors from primary superblock

2016-05-17 Thread Austin S. Hemmelgarn
On 2016-05-17 07:24, Alex Lyakas wrote: RFC: This patch not for merging, but only for review and discussion. When mounting, we consider only the primary superblock on each device. But when writing the superblocks, we might silently ignore errors from the primary superblock, if we succeeded to

Re: [PATCH] btrfs: switch to common message helpers in open_ctree, adjust messages

2016-05-17 Thread David Sterba
On Wed, May 11, 2016 at 07:55:57PM +0800, Anand Jain wrote: > > * current default is to print the device name -- so this would mean a > >forced change in defaults > > * the FSID is not very human friendly. I can remember several device > >names and I'll probably know which filesystem is on

Re: RFE: 'btrfs' tools machine readable output

2016-05-17 Thread David Sterba
On Tue, May 17, 2016 at 07:14:12AM -0400, Austin S. Hemmelgarn wrote: > >> By this example I don't mean that JSON has to be the format -- in fact > >> it's a terrible format with all sorts of problems -- any format which > >> is parseable with C libraries would do for us. > > > > My ideas was to

Re: Hot data tracking / hybrid storage

2016-05-17 Thread Austin S. Hemmelgarn
On 2016-05-17 02:27, Ferry Toth wrote: Op Mon, 16 May 2016 01:05:24 +0200, schreef Kai Krakow: Am Sun, 15 May 2016 21:11:11 + (UTC) schrieb Duncan <1i5t5.dun...@cox.net>: Ferry Toth posted on Sun, 15 May 2016 12:12:09 + as excerpted: You can go there with only one additional HDD

Re: BTRFS Data at Rest File Corruption

2016-05-17 Thread Austin S. Hemmelgarn
On 2016-05-16 23:42, Chris Murphy wrote: On Mon, May 16, 2016 at 5:44 PM, Richard A. Lochner wrote: Chris, It has actually happened to me three times that I know of in ~7mos., but your point about the "larger footprint" for data corruption is a good one. No doubt I have

[RCF - PATCH] btrfs: do not ignore errors from primary superblock

2016-05-17 Thread Alex Lyakas
RFC: This patch not for merging, but only for review and discussion. When mounting, we consider only the primary superblock on each device. But when writing the superblocks, we might silently ignore errors from the primary superblock, if we succeeded to write secondary superblocks. In such case,

Re: RFE: 'btrfs' tools machine readable output

2016-05-17 Thread Austin S. Hemmelgarn
On 2016-05-17 05:33, David Sterba wrote: On Mon, May 16, 2016 at 01:14:56PM +0100, Richard W.M. Jones wrote: I don't have time to implement this right now, so I'm just posting this as a suggestion/request ... Neither do have I, but agree with the idea and the proposed way. Here are my notes

Re: [PATCH 5/7] Btrfs: replace BUG_ON with WARN in merge_bio

2016-05-17 Thread David Sterba
On Mon, May 16, 2016 at 10:24:01AM -0700, Liu Bo wrote: > On Mon, May 16, 2016 at 10:44:38AM +0200, David Sterba wrote: > > On Fri, May 13, 2016 at 05:07:00PM -0700, Liu Bo wrote: > > > We have two BUG_ON in merge_bio, but since it can gracefully return errors > > > to callers, use WARN_ONCE to

[PATCH] btrfs: scrub: Set bbio to NULL before calling btrfs_map_block

2016-05-17 Thread Zhao Lei
We usually call btrfs_put_bbio() when btrfs_map_block() failed, btrfs_put_bbio() works right whether bbio is a valid value, or NULL. But there is a exception, in some case, btrfs_map_block() will return fail without touching *bbio(keeping its original value), and if bbio was not initialized yet,

[RFC PATCH v2.1 08/16] btrfs-progs: fsck: Introduce function to check an extent

2016-05-17 Thread Qu Wenruo
From: Lu Fengqi Introduce function check_extent_item() using previous introduced functions. With previous function to check referencer and backref, this function can be quite easy. Signed-off-by: Lu Fengqi Signed-off-by: Qu Wenruo

[RFC PATCH v2.1 02/16] btrfs-progs: fsck: Introduce function to check data backref in extent tree

2016-05-17 Thread Qu Wenruo
From: Lu Fengqi Introduce a new function check_data_extent_item() to check if the corresponding data backref exists in extent tree. Signed-off-by: Lu Fengqi Signed-off-by: Qu Wenruo --- cmds-check.c | 152

[RFC PATCH v2.1 05/16] btrfs-progs: fsck: Introduce function to check shared block ref

2016-05-17 Thread Qu Wenruo
From: Lu Fengqi Introduce function check_shared_block_backref() to check shared block ref. Signed-off-by: Lu Fengqi Signed-off-by: Qu Wenruo --- cmds-check.c | 42 ++ 1 file

[RFC PATCH v2.1 10/16] btrfs-progs: fsck: Introduce function to check dev used space

2016-05-17 Thread Qu Wenruo
From: Lu Fengqi Introduce function check_dev_item() to check used space with dev extent items. Signed-off-by: Lu Fengqi Signed-off-by: Qu Wenruo --- cmds-check.c | 64

[RFC PATCH v2.1 14/16] btrfs-progs: fsck: Introduce function to speed up fs tree check

2016-05-17 Thread Qu Wenruo
From: Lu Fengqi Introduce function should_check() to reduced duplicated tree block check for fs/subvolume tree. The idea is, we only check the fs/subvolue tree block if we have the highest referencer rootid, according to extent tree. In that case, we can skip a lot of

Re: [PATCH 3/7] Btrfs: check if extent buffer is aligned to sectorsize

2016-05-17 Thread David Sterba
On Mon, May 16, 2016 at 11:01:41AM -0700, Liu Bo wrote: > On Sat, May 14, 2016 at 06:30:52PM +0800, Qu Wenruo wrote: > > Hi Liu, > > > > Thanks for your patch first. > > > > On 05/14/2016 08:06 AM, Liu Bo wrote: > > > Thanks to fuzz testing, we can pass an invalid bytenr to extent buffer > > >

[RFC PATCH v2.1 11/16] btrfs-progs: fsck: Introduce function to check block group item

2016-05-17 Thread Qu Wenruo
From: Lu Fengqi Introduce function check_block_group_item() to check a block group item. It will check the referencer chunk and the used space accounting with extent tree. Signed-off-by: Lu Fengqi Signed-off-by: Qu Wenruo

[RFC PATCH v2.1 15/16] btrfs-progs: fsck: Introduce traversal function for fsck

2016-05-17 Thread Qu Wenruo
From: Lu Fengqi Introduce a new function traversal_tree_block() to do pre-order traversal, to co-operate with new fs/subvolume tree skip function. Signed-off-by: Lu Fengqi Signed-off-by: Qu Wenruo --- cmds-check.c |

[RFC PATCH v2.1 09/16] btrfs-progs: fsck: Introduce function to check dev extent item

2016-05-17 Thread Qu Wenruo
From: Lu Fengqi Introduce function check_dev_extent_item() to find its referencer chunk. Signed-off-by: Lu Fengqi Signed-off-by: Qu Wenruo --- cmds-check.c | 58

[RFC PATCH v2.1 07/16] btrfs-progs: fsck: Introduce function to check shared data backref

2016-05-17 Thread Qu Wenruo
From: Lu Fengqi Introduce the function check_shared_data_backref() to check the referencer of a given shared data backref. Signed-off-by: Lu Fengqi Signed-off-by: Qu Wenruo --- cmds-check.c | 44

[RFC PATCH v2.1 13/16] btrfs-progs: fsck: Introduce hub function for later fsck

2016-05-17 Thread Qu Wenruo
From: Lu Fengqi Introduce a hub function, check_items() to check all known/valuable items and update related accounting like total_bytes and csum_bytes. Signed-off-by: Lu Fengqi Signed-off-by: Qu Wenruo ---

[RFC PATCH v2.1 00/16] Introduce low memory usage btrfsck mode

2016-05-17 Thread Qu Wenruo
The branch can be fetched from my github: https://github.com/adam900710/btrfs-progs.git low_mem_fsck_v2.1 == RFC v2.1 patchset is a readability enhancement update. == Original btrfsck checks extent tree in a very efficient method, by recording every checked extent in extent record tree

[RFC PATCH v2.1 03/16] btrfs-progs: fsck: Introduce function to query tree block level

2016-05-17 Thread Qu Wenruo
From: Lu Fengqi Introduce function query_tree_block_level() to resolve tree block level by the following method: 1) tree block backref level 2) tree block header level And only when header level == backref level, and transid matches, it will return the tree block

[RFC PATCH v2.1 12/16] btrfs-progs: fsck: Introduce function to check chunk item

2016-05-17 Thread Qu Wenruo
From: Lu Fengqi Introduce function check_chunk_item() to check a chunk item. It will check all chunk stripes with dev extents and the corresponding block group item. Signed-off-by: Lu Fengqi Signed-off-by: Qu Wenruo

[RFC PATCH v2.1 01/16] btrfs-progs: fsck: Introduce function to check tree block backref in extent tree

2016-05-17 Thread Qu Wenruo
From: Lu Fengqi Introduce function check_tree_block_ref() to check whether a tree block has correct backref in extent tree. Unlike old extent tree check method, we only use search_slot() to search reference, no extra structure will be allocated in heap to record what

[RFC PATCH v2.1 04/16] btrfs-progs: fsck: Introduce function to check referencer of a backref

2016-05-17 Thread Qu Wenruo
From: Lu Fengqi Introduce a new function check_tree_block_backref() to check if a backref points to correct referencer. Signed-off-by: Lu Fengqi Signed-off-by: Qu Wenruo --- cmds-check.c | 95

[RFC PATCH v2.1 16/16] btrfs-progs: fsck: Introduce low memory mode

2016-05-17 Thread Qu Wenruo
From: Lu Fengqi Introduce a new fsck mode: low memory mode. Old btrfsck is doing a quite efficient but uses some memory for each extent item. Old method will ensure extents are only iterated once at extent/chunk tree check process. But since it uses a little memory

[RFC PATCH v2.1 06/16] btrfs-progs: fsck: Introduce function to check referencer for data backref

2016-05-17 Thread Qu Wenruo
From: Lu Fengqi Introduce new function check_extent_data_backref() to search referencer for a given data backref. Signed-off-by: Lu Fengqi Signed-off-by: Qu Wenruo --- cmds-check.c | 100

Re: RFE: 'btrfs' tools machine readable output

2016-05-17 Thread David Sterba
On Mon, May 16, 2016 at 01:14:56PM +0100, Richard W.M. Jones wrote: > I don't have time to implement this right now, so I'm just posting > this as a suggestion/request ... Neither do have I, but agree with the idea and the proposed way. Here are my notes

Re: Scrub status regression (repost kinda)

2016-05-17 Thread Duncan
al posted on Tue, 17 May 2016 01:40:19 + as excerpted: > I'm still getting this regression on scrub. Scrub status no longer > reports the progress of the scrub. It always used to. > > The scrub itself proceeds normally and using '-B' returns the usual and > complete output. > > # btrfs

Re: Hot data tracking / hybrid storage

2016-05-17 Thread Ferry Toth
Op Mon, 16 May 2016 01:05:24 +0200, schreef Kai Krakow: > Am Sun, 15 May 2016 21:11:11 + (UTC) > schrieb Duncan <1i5t5.dun...@cox.net>: > >> Ferry Toth posted on Sun, 15 May 2016 12:12:09 + as excerpted: >> > > You can go there with only one additional HDD as temporary storage. Just >