[PATCH] btrfs: add support to search subvolume by rootid and uuid

2017-07-12 Thread Anand Jain
Unless the top level is mounted there is no way to know the details of all the subvolume. For example: mount -o subvol=sv1/newsv1 /dev/sdb /btrfs btrfs su list /btrfs ID 257 gen 12 top level 5 path sv1 ID 258 gen 9 top level 257 path sv1/snap ID 259 gen 11 top level 257 path sv1/newsv1 You can'

Re: [PATCH] btrfs: qgroups: Fix BUG_ON condition

2017-07-12 Thread Qu Wenruo
在 2017年07月12日 14:42, Nikolay Borisov 写道: The current code was erroneously checking for root_level > BTRFS_MAX_LEVEL. If we had a root_level of 8 then the check won't trigger and we could potentially hit a buffer overflow. The correct check should be root_level >= BTRFS_MAX_LEVEL Thanks for ca

[PATCH] btrfs-progs: add support to search subvolume by rootid and uuid

2017-07-12 Thread Anand Jain
Unless the top level is mounted there is no way to know the details of all the subvolume. For example: mount -o subvol=sv1/newsv1 /dev/sdb /btrfs btrfs su list /btrfs ID 257 gen 12 top level 5 path sv1 ID 258 gen 9 top level 257 path sv1/snap ID 259 gen 11 top level 257 path sv1/newsv1 You can'

[PATCH] btrfs-progs: fix the path use full_path as provided by the root info

2017-07-12 Thread Anand Jain
This is a kind of preparatory patch for the patch which will add --rootid and --uuid options for the btrfs subvol show command. As of now btrfs subvol show is using the external user provided subvol path to show in the output. Which is kind of confusing. btrfs su show /btrfs /btrfs <-- Na

Re: Btrfs check reports errors, filesystem seems fine

2017-07-12 Thread Qu Wenruo
Sorry for the late reply. After investigating the dumps, I found the output is quite strange. 1) Mismatching output. In "btrfs-debug-tree-grep-79177.txt" I found only 79177 as offset for INODE_REF is here, while 79177 as objectid for DIR_ITEM/DIR_INDEX is not here at all. While in "btrfs-deb

Re: Leveldb in google-chrome incompatible with btrfs?

2017-07-12 Thread Cerem Cem ASLAN
The day before I re-checked to see if I could recover any of my files and it seems that disk is all alive. Nothing missed, nothing deleted. I run `btrfs scrub`, there are only a few uncorrectable errors (they were there before the event). I'm using the disk as before for two days and there is nothi

[PATCH] btrfs: Check if tgt_device is not null

2017-07-12 Thread Nikolay Borisov
btrfs_err_in_rcu indiscriminately dereferences tgt_device to access its ->name member in an error path. However, couple of lines below there is code which checks whether tgt_device is not NULL. Let's be consistent and check if the tgt_device is NULL before dereferencing it. Signed-off-by: Nikolay

[PATCH v14.4 00/15] Btrfs In-band De-duplication

2017-07-12 Thread Lu Fengqi
This patchset can be fetched from github: https://github.com/littleroad/linux.git dedupe_20170712 This is just a normal rebase update. Now the new base is kdave/for-4.13-part1 Normal test cases from auto group exposes no regression, and ib-dedupe group can pass without problem. Changelog: v2:

[PATCH v14.4 04/15] btrfs: dedupe: Introduce dedupe framework and its header

2017-07-12 Thread Lu Fengqi
From: Wang Xiaoguang Introduce the header for btrfs in-band(write time) de-duplication framework and needed header. The new de-duplication framework is going to support 2 different dedupe methods and 1 dedupe hash. Signed-off-by: Qu Wenruo Signed-off-by: Wang Xiaoguang --- fs/btrfs/ctree.h

[PATCH v14.4 03/15] btrfs: Introduce COMPRESS reserve type to fix false enospc for compression

2017-07-12 Thread Lu Fengqi
From: Wang Xiaoguang When testing btrfs compression, sometimes we got ENOSPC error, though fs still has much free space, xfstests generic/171, generic/172, generic/173, generic/174, generic/175 can reveal this bug in my test environment when compression is enabled. After some debuging work, we f

[PATCH v14.4 02/15] btrfs: introduce type based delalloc metadata reserve

2017-07-12 Thread Lu Fengqi
From: Wang Xiaoguang Introduce type based metadata reserve parameter for delalloc space reservation/freeing function. The problem we are going to solve is, btrfs use different max extent size for different mount options. For compression, the max extent size is 128K, while for non-compress write

[PATCH v14.4 08/15] btrfs: delayed-ref: Add support for increasing data ref under spinlock

2017-07-12 Thread Lu Fengqi
From: Qu Wenruo For in-band dedupe, btrfs needs to increase data ref with delayed_ref locked, so add a new function btrfs_add_delayed_data_ref_lock() to increase extent ref with delayed_refs already locked. Signed-off-by: Qu Wenruo Reviewed-by: Josef Bacik Signed-off-by: Lu Fengqi --- fs/btr

[PATCH v14.4 15/15] btrfs: dedupe: Introduce new reconfigure ioctl

2017-07-12 Thread Lu Fengqi
From: Qu Wenruo Introduce new reconfigure ioctl, and new FORCE flag for in-band dedupe ioctls. Now dedupe enable and reconfigure ioctl are stateful. | Current state | Ioctl| Next state | | Disabled

[PATCH v14.4 11/15] btrfs: ordered-extent: Add support for dedupe

2017-07-12 Thread Lu Fengqi
From: Wang Xiaoguang Add ordered-extent support for dedupe. Note, current ordered-extent support only supports non-compressed source extent. Support for compressed source extent will be added later. Signed-off-by: Qu Wenruo Signed-off-by: Wang Xiaoguang Reviewed-by: Josef Bacik --- fs/btrfs

[PATCH v14.4 13/15] btrfs: dedupe: Add ioctl for inband dedupelication

2017-07-12 Thread Lu Fengqi
From: Wang Xiaoguang Add ioctl interface for inband dedupelication, which includes: 1) enable 2) disable 3) status And a pseudo RO compat flag, to imply that btrfs now supports inband dedup. However we don't add any ondisk format change, it's just a pseudo RO compat flag. All these ioctl interf

[PATCH v14.4 06/15] btrfs: dedupe: Introduce function to add hash into in-memory tree

2017-07-12 Thread Lu Fengqi
From: Wang Xiaoguang Introduce static function inmem_add() to add hash into in-memory tree. And now we can implement the btrfs_dedupe_add() interface. Signed-off-by: Qu Wenruo Signed-off-by: Wang Xiaoguang Reviewed-by: Josef Bacik --- fs/btrfs/dedupe.c | 151 +

[PATCH v14.4 01/15] btrfs: improve inode's outstanding_extents computation

2017-07-12 Thread Lu Fengqi
From: Wang Xiaoguang This issue was revealed by modifying BTRFS_MAX_EXTENT_SIZE(128MB) to 64KB, When modifying BTRFS_MAX_EXTENT_SIZE(128MB) to 64KB, fsstress test often gets these warnings from btrfs_destroy_inode(): WARN_ON(BTRFS_I(inode)->outstanding_extents); WARN_ON(BTRFS_I(in

[PATCH v14.4 14/15] btrfs: relocation: Enhance error handling to avoid BUG_ON

2017-07-12 Thread Lu Fengqi
From: Qu Wenruo Since the introduce of btrfs dedupe tree, it's possible that balance can race with dedupe disabling. When this happens, dedupe_enabled will make btrfs_get_fs_root() return PTR_ERR(-ENOENT). But due to a bug in error handling branch, when this happens backref_cache->nr_nodes is in

[PATCH v14.4 05/15] btrfs: dedupe: Introduce function to initialize dedupe info

2017-07-12 Thread Lu Fengqi
From: Wang Xiaoguang Add generic function to initialize dedupe info. Signed-off-by: Qu Wenruo Signed-off-by: Wang Xiaoguang Reviewed-by: Josef Bacik Signed-off-by: Lu Fengqi --- fs/btrfs/Makefile | 2 +- fs/btrfs/dedupe.c | 181 +++

[PATCH v14.4 09/15] btrfs: dedupe: Introduce function to search for an existing hash

2017-07-12 Thread Lu Fengqi
From: Wang Xiaoguang Introduce static function inmem_search() to handle the job for in-memory hash tree. The trick is, we must ensure the delayed ref head is not being run at the time we search the for the hash. With inmem_search(), we can implement the btrfs_dedupe_search() interface. Signed-

[PATCH v14.4 10/15] btrfs: dedupe: Implement btrfs_dedupe_calc_hash interface

2017-07-12 Thread Lu Fengqi
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 Signed-off-by: Wang Xiaoguang Reviewed-by: Josef Bacik Signed-off-by: Lu Fengqi --- fs/btrfs/dedup

[PATCH v14.4 07/15] btrfs: dedupe: Introduce function to remove hash from in-memory tree

2017-07-12 Thread Lu Fengqi
From: Wang Xiaoguang Introduce static function inmem_del() to remove hash from in-memory dedupe tree. And implement btrfs_dedupe_del() and btrfs_dedup_disable() interfaces. Also for btrfs_dedupe_disable(), add new functions to wait existing writer and block incoming writers to eliminate all poss

[PATCH v14.4 12/15] btrfs: dedupe: Inband in-memory only de-duplication implement

2017-07-12 Thread Lu Fengqi
From: Qu Wenruo Core implement for inband de-duplication. It reuse the async_cow_start() facility to do the calculate dedupe hash. And use dedupe hash to do inband de-duplication at extent level. The work flow is as below: 1) Run delalloc range for an inode 2) Calculate hash for the delalloc ran

RE: HELLO

2017-07-12 Thread selvi
I am Ms.Ella Golan, I am the Executive Vice President Banking Division with FIRST INTERNATIONAL BANK OF ISRAEL LTD (FIBI). I am getting in touch with you regarding an extremely important and urgent matter. If you would oblige me the opportunity, I shall provide you with details upon your res

Re: Btrfs check reports errors, filesystem seems fine

2017-07-12 Thread Filippe LeMarchand
> Maybe something wrong in grep happened which skip "(79177" ? Yes, my bad. Now I used grep -E "\(79177| 79177" pattern, file on GDrive updated. And btrfs check --mode=lowmem gives this: checking extents ERROR: extent[1609877700608, 94208] referencer count mismatch (root: 260, owner: 61720, off

Re: Btrfs check reports errors, filesystem seems fine

2017-07-12 Thread Qu Wenruo
On 2017年07月12日 19:12, Filippe LeMarchand wrote: Maybe something wrong in grep happened which skip "(79177" ? Yes, my bad. Now I used grep -E "\(79177| 79177" pattern, file on GDrive updated. It looks much better, thanks. And btrfs check --mode=lowmem gives this: checking extents ERROR:

Re: Btrfs check reports errors, filesystem seems fine

2017-07-12 Thread Filippe LeMarchand
Done, files added to same GDrive folder with corresponding names. If it matters, subvol 4546 is my root filesystem (r/w snapshot created with snapper rollback), and 5134 is its snapshot. In a letter dated Wednesday, July 12, 2017 15:44:52 MSK user Qu Wenruo wrote: > > On 2017年07月12日 19:12, Filip

Re: [PATCH] btrfs: qgroups: Fix BUG_ON condition

2017-07-12 Thread David Sterba
On Wed, Jul 12, 2017 at 03:09:42PM +0800, Qu Wenruo wrote: > > > 在 2017年07月12日 14:42, Nikolay Borisov 写道: > > The current code was erroneously checking for root_level > BTRFS_MAX_LEVEL. > > If > > we had a root_level of 8 then the check won't trigger and we could > > potentially hit a buffer ove

Re: [PATCH] btrfs: qgroups: Fix BUG_ON condition

2017-07-12 Thread Nikolay Borisov
On 12.07.2017 16:42, David Sterba wrote: > On Wed, Jul 12, 2017 at 03:09:42PM +0800, Qu Wenruo wrote: >> >> >> 在 2017年07月12日 14:42, Nikolay Borisov 写道: >>> The current code was erroneously checking for root_level > BTRFS_MAX_LEVEL. >>> If >>> we had a root_level of 8 then the check won't trigger

Re: [PATCH] btrfs: qgroups: Fix BUG_ON condition

2017-07-12 Thread David Sterba
On Wed, Jul 12, 2017 at 04:50:20PM +0300, Nikolay Borisov wrote: > > As you wrote, it was not obvious that there was no change on the line, > > this just slowed down reading the patch. > > I didn't intentionally fix this, I've configured vi so as to > automatically do this. There is also whitespac

Re: [PATCH] btrfs: qgroups: Fix BUG_ON condition

2017-07-12 Thread Qu Wenruo
On 2017年07月12日 21:42, David Sterba wrote: On Wed, Jul 12, 2017 at 03:09:42PM +0800, Qu Wenruo wrote: 在 2017年07月12日 14:42, Nikolay Borisov 写道: The current code was erroneously checking for root_level > BTRFS_MAX_LEVEL. If we had a root_level of 8 then the check won't trigger and we could pot

Re: [PATCH] btrfs: qgroups: Fix BUG_ON condition

2017-07-12 Thread Qu Wenruo
On 2017年07月12日 21:51, David Sterba wrote: On Wed, Jul 12, 2017 at 04:50:20PM +0300, Nikolay Borisov wrote: As you wrote, it was not obvious that there was no change on the line, this just slowed down reading the patch. I didn't intentionally fix this, I've configured vi so as to automaticall

Re: [PATCH] Btrfs: report errors when checksum is not found

2017-07-12 Thread David Sterba
On Tue, Jul 11, 2017 at 02:43:16PM -0600, Liu Bo wrote: > When btrfs fails the checksum check, it'll fill the whole page with > "1". One could ask, why is the page filled with 1s. Brought by commit 07157aacb1ecd394a54949 from 2007, without mentioning any justification. I'm more inclined to revisit

Re: [PATCH] btrfs: Remove never reached code

2017-07-12 Thread David Sterba
The subject is too generic, and the changelog could say something about the btrfs_panic semantics. Otherwise the change is ok, previously there was just BUG_ON, then if -> btrfs_panic and after moving the kfree after the print, the return has been added, but this is just redundant. On Wed, Jul 12,

Re: [PATCH] btrfs: Remove redundant code

2017-07-12 Thread David Sterba
On Wed, Jul 12, 2017 at 09:32:15AM +0300, Nikolay Borisov wrote: > insert_into_bitmap has only one caller which always allocates the info struct > passed. As such remove the any NULL checks for info and also remove code > to allocate info in case it was NULL. > > Signed-off-by: Nikolay Borisov >

Re: [PATCH] btrfs: Check if tgt_device is not null

2017-07-12 Thread David Sterba
On Wed, Jul 12, 2017 at 11:39:22AM +0300, Nikolay Borisov wrote: > btrfs_err_in_rcu indiscriminately dereferences tgt_device to access its > ->name member in an error path. However, couple of lines below there is code > which checks whether tgt_device is not NULL. Let's be consistent and check if >

Re: [PATCH v2 08/13] btrfs: convert prelimary reference tracking to use rbtrees

2017-07-12 Thread David Sterba
On Tue, Jul 11, 2017 at 05:12:27PM -0600, Edmund Nadolski wrote: > > > On 07/11/2017 09:15 AM, David Sterba wrote: > > On Wed, Jun 28, 2017 at 09:57:00PM -0600, Edmund Nadolski wrote: > >> It's been known for a while that the use of multiple lists > >> that are periodically merged was an algorith

Re: [PATCH v4 0/6] Chunk level degradable check

2017-07-12 Thread David Sterba
On Wed, Jun 28, 2017 at 01:43:29PM +0800, Qu Wenruo wrote: > The patchset can be fetched from my github repo: > https://github.com/adam900710/linux/tree/degradable > > The patchset is based on David's for-4.13-part1 branch. > > Btrfs currently uses num_tolerated_disk_barrier_failures to do global

Re: [PATCH] btrfs: Prevent possible ERR_PTR() dereference

2017-07-12 Thread David Sterba
On Tue, Jul 11, 2017 at 10:29:49PM +0300, Nikolay Borisov wrote: > > > On 11.07.2017 20:24, David Sterba wrote: > > On Tue, Jul 11, 2017 at 04:55:51PM +0300, Nikolay Borisov wrote: > >> In btrfs_full_stripe_len/btrfs_is_parity_mirror we have similar code which > >> gets the chunk map for a partic

Re: [PATCH 00/19] fs_info refactor part 2 (disk-io.h and volumes.h based)

2017-07-12 Thread David Sterba
On Tue, Jul 11, 2017 at 05:11:16PM +0800, Qu Wenruo wrote: > Any comment? Patches applied, sorry for the delay. > 在 2017年06月13日 17:19, Qu Wenruo 写道: > > This is the part 2 patchset to refactor btrfs_root usage to > > btrfs_fs_info. > > > > The most obvious advantage is to make function calls a li

Re: [proposal] making filesystem tools more machine friendly

2017-07-12 Thread Richard W.M. Jones
libguestfs could really use structured output from more of the command line tools. Particularly: - all the ext4 tools - all the xfs tools - all the btrfs tools - parted and more. See also: https://github.com/libguestfs/libguestfs/tree/master/daemon A dbus service would not be useful.

Re: [PATCH] btrfs: Check if tgt_device is not null

2017-07-12 Thread Nikolay Borisov
On 12.07.2017 18:03, David Sterba wrote: > On Wed, Jul 12, 2017 at 11:39:22AM +0300, Nikolay Borisov wrote: >> btrfs_err_in_rcu indiscriminately dereferences tgt_device to access its >> ->name member in an error path. However, couple of lines below there is code >> which checks whether tgt_device

Re: [PATCH] Btrfs: report errors when checksum is not found

2017-07-12 Thread Liu Bo
On Wed, Jul 12, 2017 at 04:40:36PM +0200, David Sterba wrote: > On Tue, Jul 11, 2017 at 02:43:16PM -0600, Liu Bo wrote: > > When btrfs fails the checksum check, it'll fill the whole page with > > "1". > > One could ask, why is the page filled with 1s. Brought by commit > 07157aacb1ecd394a54949 fro

Re: Lock between userspace and btrfs-cleaner on extent_buffer

2017-07-12 Thread Sargun Dhillon
On Thu, Jun 29, 2017 at 11:49 AM, Jeff Mahoney wrote: > On 6/29/17 2:46 PM, Sargun Dhillon wrote: >> On Thu, Jun 29, 2017 at 11:42 AM, Jeff Mahoney wrote: >>> On 6/28/17 6:02 PM, Sargun Dhillon wrote: On Wed, Jun 28, 2017 at 2:55 PM, Jeff Mahoney wrote: > On 6/27/17 5:12 PM, Jeff Mahone

[PATCH] btrfs-progs: Enable ThreadSanitizer, using D=tsan.

2017-07-12 Thread Adam Buchbinder
Tested with clang-3.9. Signed-off-by: Adam Buchbinder --- Makefile | 6 ++ 1 file changed, 6 insertions(+) diff --git a/Makefile b/Makefile index 81598df..8948301 100644 --- a/Makefile +++ b/Makefile @@ -17,6 +17,7 @@ # abort - call abort() on first error (dumps core) #

[PATCH] btrfs-progs: Fix data races in btrfs-image.

2017-07-12 Thread Adam Buchbinder
Making the code data-race safe requires that reads *and* writes happen under a mutex lock, if any of the access are writes. See Dmitri Vyukov, "Benign data races: what could possibly go wrong?" for more details. The fix here was to put most of the main loop of restore_worker under a mutex lock. T

[PATCH] btrfs-progs: Use '-t btrfs' mount option in tests.

2017-07-12 Thread Adam Buchbinder
Without it, mount (at least from util-linux 2.20.1) tries (and fails) to mount some filesystems as NTFS. Signed-off-by: Adam Buchbinder --- tests/common | 2 +- tests/fsck-tests/012-leaf-corruption/test.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)

[PATCH] btrfs-progs: Fix data race in btrfs-convert.

2017-07-12 Thread Adam Buchbinder
The status display was reading the state while the task was updating it. Use a mutex to prevent the race. This race was detected using ThreadSanitizer and misc-tests/005-convert-progress-thread-crash. == WARNING: ThreadSanitizer: data race Write of size 8 by main thread: #0

Re: [PATCH] btrfs-progs: Enable ThreadSanitizer, using D=tsan.

2017-07-12 Thread David Sterba
On Wed, Jul 12, 2017 at 01:04:49PM -0700, Adam Buchbinder wrote: > Tested with clang-3.9. > > Signed-off-by: Adam Buchbinder > --- > Makefile | 6 ++ > 1 file changed, 6 insertions(+) > > diff --git a/Makefile b/Makefile > index 81598df..8948301 100644 > --- a/Makefile > +++ b/Makefile > @@

Re: [PATCH] btrfs-progs: Use '-t btrfs' mount option in tests.

2017-07-12 Thread David Sterba
On Wed, Jul 12, 2017 at 01:05:22PM -0700, Adam Buchbinder wrote: > Without it, mount (at least from util-linux 2.20.1) tries (and > fails) to mount some filesystems as NTFS. > > Signed-off-by: Adam Buchbinder Applied, thanks. -- To unsubscribe from this list: send the line "unsubscribe linux-btr

Re: [PATCH] btrfs-progs: Fix data race in btrfs-convert.

2017-07-12 Thread David Sterba
On Wed, Jul 12, 2017 at 01:05:38PM -0700, Adam Buchbinder wrote: > The status display was reading the state while the task was updating > it. Use a mutex to prevent the race. > > This race was detected using ThreadSanitizer and > misc-tests/005-convert-progress-thread-crash. > > =

Re: [PATCH] btrfs-progs: Fix data races in btrfs-image.

2017-07-12 Thread David Sterba
On Wed, Jul 12, 2017 at 01:05:10PM -0700, Adam Buchbinder wrote: > Making the code data-race safe requires that reads *and* writes > happen under a mutex lock, if any of the access are writes. See > Dmitri Vyukov, "Benign data races: what could possibly go wrong?" > for more details. > > The fix h

Re: [PATCH] btrfs-progs: fix the path use full_path as provided by the root info

2017-07-12 Thread David Sterba
On Wed, Jul 12, 2017 at 03:20:27PM +0800, Anand Jain wrote: > This is a kind of preparatory patch for the patch which will add > --rootid and --uuid options for the btrfs subvol show command. > > As of now btrfs subvol show is using the external user provided subvol > path to show in the output. W

[PATCH v3 00/13] use rbtrees for preliminary backrefs

2017-07-12 Thread Edmund Nadolski
This patch series attempts to improve the performance of backref searches by changing the prelim_refs implementation to use rbtrees instead of lists. This also aims to reduce the soft lockup occurences that can result when a backref search consumes too much cpu time. Test runs of btrfs/130 show a

[PATCH v3 08/13] btrfs: convert prelimary reference tracking to use rbtrees

2017-07-12 Thread Edmund Nadolski
It's been known for a while that the use of multiple lists that are periodically merged was an algorithmic problem within btrfs. There are several workloads that don't complete in any reasonable amount of time (e.g. btrfs/130) and others that cause soft lockups. The solution is to use a set of rb

[PATCH v3 11/13] btrfs: add cond_resched() calls when resolving backrefs

2017-07-12 Thread Edmund Nadolski
Since backref resolution is CPU-intensive, the cond_resched calls should help alleviate soft lockup occurences. Signed-off-by: Edmund Nadolski Signed-off-by: Jeff Mahoney --- fs/btrfs/backref.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/fs/btrfs/backref.c b/fs/btrfs/backref.c index

[PATCH v3 09/13] btrfs: add a node counter to each of the rbtrees

2017-07-12 Thread Edmund Nadolski
From: Jeff Mahoney This patch adds counters to each of the rbtrees so that we can tell how large they are growing for a given workload. These counters will be exported by tracepoints in the next patch. Signed-off-by: Jeff Mahoney --- fs/btrfs/backref.c | 6 +- 1 file changed, 5 insertions

[PATCH v3 13/13] btrfs: clean up extraneous computations in add_delayed_refs

2017-07-12 Thread Edmund Nadolski
Repeating the same computation in multiple places is not necessary. Signed-off-by: Edmund Nadolski Signed-off-by: Jeff Mahoney --- fs/btrfs/backref.c | 30 +- 1 file changed, 13 insertions(+), 17 deletions(-) diff --git a/fs/btrfs/backref.c b/fs/btrfs/backref.c inde

[PATCH v3 12/13] btrfs: allow backref search checks for shared extents

2017-07-12 Thread Edmund Nadolski
When called with a struct share_check, find_parent_nodes() will detect a shared extent and immediately return with BACKREF_SHARED_FOUND. Signed-off-by: Edmund Nadolski Signed-off-by: Jeff Mahoney --- fs/btrfs/backref.c | 164 + 1 file changed,

[PATCH v3 10/13] btrfs: backref, add tracepoints for prelim_ref insertion and merging

2017-07-12 Thread Edmund Nadolski
From: Jeff Mahoney This patch adds a tracepoint event for prelim_ref insertion and merging. For each, the ref being inserted or merged and the count of tree nodes is issued. Signed-off-by: Jeff Mahoney --- fs/btrfs/backref.c | 119 ++- fs/btrf

Re: [PATCH] btrfs-progs: add support to search subvolume by rootid and uuid

2017-07-12 Thread David Sterba
On Wed, Jul 12, 2017 at 03:20:50PM +0800, Anand Jain wrote: > Unless the top level is mounted there is no way to know the > details of all the subvolume. For example: > > mount -o subvol=sv1/newsv1 /dev/sdb /btrfs > > btrfs su list /btrfs > ID 257 gen 12 top level 5 path sv1 > ID 258 gen 9 top l

Re: [PATCH] btrfs-progs: Fix missing internal deps in tests.

2017-07-12 Thread David Sterba
On Mon, Jul 10, 2017 at 02:29:08PM -0700, Adam Buchbinder wrote: > Doing a straight 'make test' would fail because some misc and fsck > tests require particular tools to already be built. Add dependencies > at the Makefile and shell-script level. > > Signed-off-by: Adam Buchbinder Applied, thank

Re: [PATCH] btrfs-progs: Tighten integer types in print-tree.

2017-07-12 Thread David Sterba
On Mon, Jul 10, 2017 at 02:29:09PM -0700, Adam Buchbinder wrote: > There are likely more places where the wrong size types are used, but > these tripped Clang's warnings because they eventually get passed to > printf. > > Signed-off-by: Adam Buchbinder Applied, thanks. -- To unsubscribe from thi

Re: [Patch v2] Btrfs-progs: fix infinite loop in find_free_extent

2017-07-12 Thread David Sterba
On Mon, Jun 26, 2017 at 11:34:41AM -0600, Liu Bo wrote: > If the found %ins is crossing a stripe len, ie. BTRFS_STRIPE_LEN, we'd > search again with a stripe-aligned %search_start. The current code > calculates %search_start by adding a wrong offset, in order to fix it, the > start position of the

Re: [PATCH] btrfs-progs: Fix an infinite loop in btrfs_next_bg

2017-07-12 Thread David Sterba
On Fri, Jun 09, 2017 at 11:09:35AM -0700, Justin Maggard wrote: > I've run into a couple filesystems where btrfs-find-root would spin > indefinitely. > > If the first cache extent start location is 0, we end up in an infinite > loop in btrfs_next_bg(). Fix it by checking for that situation, and >

Re: [PATCH] Btrfs: report errors when checksum is not found

2017-07-12 Thread Liu Bo
On Wed, Jul 12, 2017 at 11:46:29AM -0600, Liu Bo wrote: > On Wed, Jul 12, 2017 at 04:40:36PM +0200, David Sterba wrote: > > On Tue, Jul 11, 2017 at 02:43:16PM -0600, Liu Bo wrote: > > > When btrfs fails the checksum check, it'll fill the whole page with > > > "1". > > > > One could ask, why is the

[PATCH V2] btrfs-progs: add support to search subvolume by rootid and uuid

2017-07-12 Thread Anand Jain
Unless the top level is mounted there is no way to know the details of all the subvolume. For example: mount -o subvol=sv1/newsv1 /dev/sdb /btrfs btrfs su list /btrfs ID 257 gen 12 top level 5 path sv1 ID 258 gen 9 top level 257 path sv1/snap ID 259 gen 11 top level 257 path sv1/newsv1 You can'

Re: [PATCH] btrfs-progs: Enable ThreadSanitizer, using D=tsan.

2017-07-12 Thread David Sterba
On Wed, Jul 12, 2017 at 03:45:46PM -0700, Adam Buchbinder wrote: > On Wed, Jul 12, 2017 at 2:51 PM, David Sterba wrote: > > > > On Wed, Jul 12, 2017 at 01:04:49PM -0700, Adam Buchbinder wrote: > > > Tested with clang-3.9. > > > > > > Signed-off-by: Adam Buchbinder > > > --- > > > Makefile | 6 ++

Re: [PATCH V2] btrfs-progs: add support to search subvolume by rootid and uuid

2017-07-12 Thread David Sterba
On Thu, Jul 13, 2017 at 06:47:11AM +0800, Anand Jain wrote: > Unless the top level is mounted there is no way to know the > details of all the subvolume. For example: > > mount -o subvol=sv1/newsv1 /dev/sdb /btrfs > > btrfs su list /btrfs > ID 257 gen 12 top level 5 path sv1 > ID 258 gen 9 top l

Re: [PATCH] Btrfs: report errors when checksum is not found

2017-07-12 Thread David Sterba
On Wed, Jul 12, 2017 at 03:35:43PM -0600, Liu Bo wrote: > On Wed, Jul 12, 2017 at 11:46:29AM -0600, Liu Bo wrote: > > On Wed, Jul 12, 2017 at 04:40:36PM +0200, David Sterba wrote: > > > On Tue, Jul 11, 2017 at 02:43:16PM -0600, Liu Bo wrote: > > > > When btrfs fails the checksum check, it'll fill t

Re: [PATCH v4 0/6] Chunk level degradable check

2017-07-12 Thread Qu Wenruo
On 2017年07月12日 23:24, David Sterba wrote: On Wed, Jun 28, 2017 at 01:43:29PM +0800, Qu Wenruo wrote: The patchset can be fetched from my github repo: https://github.com/adam900710/linux/tree/degradable The patchset is based on David's for-4.13-part1 branch. Btrfs currently uses num_tolerated

Re: [PATCH v3 13/13] btrfs: clean up extraneous computations in add_delayed_refs

2017-07-12 Thread David Sterba
On Wed, Jul 12, 2017 at 04:20:11PM -0600, Edmund Nadolski wrote: > Repeating the same computation in multiple places is not > necessary. > > Signed-off-by: Edmund Nadolski > Signed-off-by: Jeff Mahoney Reviewed-by: David Sterba -- To unsubscribe from this list: send the line "unsubscribe linux

Re: [PATCH v3 11/13] btrfs: add cond_resched() calls when resolving backrefs

2017-07-12 Thread David Sterba
On Wed, Jul 12, 2017 at 04:20:09PM -0600, Edmund Nadolski wrote: > Since backref resolution is CPU-intensive, the cond_resched calls > should help alleviate soft lockup occurences. > > Signed-off-by: Edmund Nadolski > Signed-off-by: Jeff Mahoney Reviewed-by: David Sterba -- To unsubscribe from

Re: [PATCH v3 10/13] btrfs: backref, add tracepoints for prelim_ref insertion and merging

2017-07-12 Thread David Sterba
On Wed, Jul 12, 2017 at 04:20:08PM -0600, Edmund Nadolski wrote: > From: Jeff Mahoney > > This patch adds a tracepoint event for prelim_ref insertion and > merging. For each, the ref being inserted or merged and the count > of tree nodes is issued. > > Signed-off-by: Jeff Mahoney Reviewed-by:

Re: [PATCH v4 0/6] Chunk level degradable check

2017-07-12 Thread David Sterba
On Mon, Jul 10, 2017 at 09:11:50PM +0300, Dmitrii Tcvetkov wrote: > Tested on top of current mainline master (commit > af3c8d98508d37541d4bf57f13a984a7f73a328c). Didn't find any > regressions. Thanks for testing. If anybody wants to get their Tested-by in the patches, please let me know, I'll add

Re: [PATCH v3 09/13] btrfs: add a node counter to each of the rbtrees

2017-07-12 Thread David Sterba
On Wed, Jul 12, 2017 at 04:20:07PM -0600, Edmund Nadolski wrote: > From: Jeff Mahoney > > This patch adds counters to each of the rbtrees so that we can tell > how large they are growing for a given workload. These counters > will be exported by tracepoints in the next patch. > > Signed-off-by:

Re: [PATCH v4 0/6] Chunk level degradable check

2017-07-12 Thread Adam Borowski
On Thu, Jul 13, 2017 at 02:50:10AM +0200, David Sterba wrote: > On Mon, Jul 10, 2017 at 09:11:50PM +0300, Dmitrii Tcvetkov wrote: > > Tested on top of current mainline master (commit > > af3c8d98508d37541d4bf57f13a984a7f73a328c). Didn't find any > > regressions. I've retested this yet again. No r

Re: BTRFS: error (device dm-2) in btrfs_run_delayed_refs:2960: errno=-17 Object already exists

2017-07-12 Thread Marc MERLIN
On Tue, Jul 11, 2017 at 09:48:12AM -0700, Marc MERLIN wrote: > On Tue, Jul 11, 2017 at 10:00:40AM -0600, Chris Murphy wrote: > > > ---[ end trace feb4b95c83ac065f ]--- > > > BTRFS: error (device dm-2) in btrfs_run_delayed_refs:2960: errno=-17 > > > Object already exists > > > BTRFS info (device dm

Re: My Second Email to You, Pls Reply Me

2017-07-12 Thread Makl Na
Hello Dear, How are you doing? I hope you are doing well. I am writing as I have written to you previously without any response from you. I hope all is well with you.I will appreciate if you will acknowledge your receipt of this mail. Thank you and have a good day. Miss Naya Please Write Me a

[PATCH] btrfs-progs: add support to sort by topid

2017-07-12 Thread Anand Jain
As users generally organize the subvols and snapshots based on the subvol directory hierarchy. So providing an ability to sort them by topid would help. Thanks. Signed-off-by: Anand Jain --- btrfs-list.c | 18 ++ btrfs-list.h | 1 + cmds-subvolume.c | 8 3 file

degraded raid scribbling upon wrong device

2017-07-12 Thread Adam Borowski
Hi! Here's a set of test cases, two of them in some cases seem to scribble upon the wrong device: * deg-mid-missing * deg-last-replaced (not on the innocent "re") * but never deg-last-missing When all goes ok, there are no errors other than wrong generation on the re-added disk (expected). When