Re: [PATCH v1.1 00/14] btrfs-progs: check: Use fs/subvol trees to fix extent tree, not vice versa

2019-03-27 Thread Qu Wenruo
Gentle ping? Any comment on this? Thanks, Qu On 2019/2/27 下午2:05, Qu Wenruo wrote: > This patchset can be fetched from github: > https://github.com/adam900710/btrfs-progs/tree/file_extents_fixes > > This is based on v4.20.2 tag. > > Originally for fsck-tests/001-bad-file-extent-bytenr we're go

[PATCH] fstests: log-writes: Add new option to replay/find next write to sector

2019-03-27 Thread Qu Wenruo
For kernel operation we have METADATA/FUA/FLUSH flags as a beacon, but for user space write we don't have any useful flag unless the user space tool call fsync() to generate a FLUSH bio. This means for user space write, we don't really have an equivalent of --next-fua to find super block write. S

Re:Hello

2019-03-27 Thread Mr Wong
Hello this is Mr Wong again from hongkong,Can we send the Swift as discuss best regards. Mr Wong Cheng --- This email has been checked for viruses by Avast antivirus software. https://www.avast.com/antivirus

Re: [PATCH] btrfs: qgroup: remove obsolete fs_info members

2019-03-27 Thread Qu Wenruo
On 2019/3/28 上午12:02, David Sterba wrote: > The commit fcebe4562dec ("Btrfs: rework qgroup accounting") reworked > qgroups and added some new structures. Another rework of qgroup > mechanics e69bcee37692 ("btrfs: qgroup: Cleanup the old > ref_node-oriented mechanism.") stopped using them and left

Re: [PATCH 01/15] btrfs: create a mount option for dax

2019-03-27 Thread Goldwyn Rodrigues
On 5:00 27/03, Matthew Wilcox wrote: > On Wed, Mar 27, 2019 at 06:00:52AM -0500, Goldwyn Rodrigues wrote: > > On 12:10 26/03, Matthew Wilcox wrote: > > > On Tue, Mar 26, 2019 at 02:02:47PM -0500, Goldwyn Rodrigues wrote: > > > > This sets S_DAX in inode->i_flags, which can be used with > > > > IS_

Re: [PATCH v2 00/15] btrfs dax support

2019-03-27 Thread Goldwyn Rodrigues
On 21:14 27/03, Adam Borowski wrote: > On Tue, Mar 26, 2019 at 02:09:08PM -0500, Goldwyn Rodrigues wrote: > > This patch set adds support for dax on the BTRFS filesystem. > > This patchset doesn't seem to support MAP_SYNC, which is the usual way to > use (and detect) DAX. Basically, it requests f

Re: backup uuid_tree generation not consistent across multi device (raid0) btrfs - won´t mount

2019-03-27 Thread Martin Raiber
On 26.03.2019 14:37 Qu Wenruo wrote: > On 2019/3/26 下午6:24, berodual_xyz wrote: >> Mount messages below. >> >> Thanks for your input, Qu! >> >> ## >> [42763.884134] BTRFS info (device sdd): disabling free space tree >> [42763.884138] BTRFS info (device sdd): force clearing of disk cache >> [42763.8

Re: [PATCH v2 00/15] btrfs dax support

2019-03-27 Thread Adam Borowski
On Tue, Mar 26, 2019 at 02:09:08PM -0500, Goldwyn Rodrigues wrote: > This patch set adds support for dax on the BTRFS filesystem. This patchset doesn't seem to support MAP_SYNC, which is the usual way to use (and detect) DAX. Basically, it requests for page faults to be synchronous -- ie, when a

Re: backup uuid_tree generation not consistent across multi device (raid0) btrfs - won´t mount

2019-03-27 Thread berodual_xyz
Thanks for the extensive answer, Chris! > a. Check with the manufacturer of the hardware raid for firmware > updates for all the controllers. Also check if the new version is > backward compatible with an array made with the version you have, and > if not, if downgrade is possible. That way you h

Re: A collection of btrfs lockup stack traces (4.14.107, kcompactd and two processes running __lock_page)

2019-03-27 Thread Zygo Blaxell
On Tue, Mar 26, 2019 at 10:37:06PM -0400, Zygo Blaxell wrote: > On Tue, Mar 19, 2019 at 11:39:59PM -0400, Zygo Blaxell wrote: > > I haven't been able to easily reproduce these in a test environment; > > however, they have been happening several times a year on servers in > > production. > > > > Ke

Re: backup uuid_tree generation not consistent across multi device (raid0) btrfs - won´t mount

2019-03-27 Thread Chris Murphy
Removing Andrei and Qu. On Wed, Mar 27, 2019 at 12:52 PM Chris Murphy wrote: > > And then also in the meantime, prepare for having to rebuild this array. a. Check with the manufacturer of the hardware raid for firmware updates for all the controllers. Also check if the new version is backward co

Re: [PATCH 04/15] dax: Introduce IOMAP_F_COW for copy-on-write

2019-03-27 Thread Goldwyn Rodrigues
On 10:54 27/03, Darrick J. Wong wrote: > On Tue, Mar 26, 2019 at 02:02:50PM -0500, Goldwyn Rodrigues wrote: > > From: Goldwyn Rodrigues > > > > The IOMAP_F_COW is a flag to notify dax that it needs to copy > > the data from iomap->cow_addr to iomap->addr, if the start/end > > of I/O are not page

Re: backup uuid_tree generation not consistent across multi device (raid0) btrfs - won´t mount

2019-03-27 Thread Chris Murphy
On Wed, Mar 27, 2019 at 7:03 AM berodual_xyz wrote: > My questions now: > > * what is the chance of "btrfs rescue" "chunk-recover" / "super-recover" / > "zero-log" having a positive effect on the filesystem. > > * what is the chance of "btrfs check --init-extent-tree" fixing the described > issu

Re: [PATCH 04/15] dax: Introduce IOMAP_F_COW for copy-on-write

2019-03-27 Thread Darrick J. Wong
On Tue, Mar 26, 2019 at 02:02:50PM -0500, Goldwyn Rodrigues wrote: > From: Goldwyn Rodrigues > > The IOMAP_F_COW is a flag to notify dax that it needs to copy > the data from iomap->cow_addr to iomap->addr, if the start/end > of I/O are not page aligned. > > This also introduces dax_to_dax_copy(

Re: [PATCH 01/15] btrfs: create a mount option for dax

2019-03-27 Thread Adam Borowski
On Tue, Mar 26, 2019 at 12:10:01PM -0700, Matthew Wilcox wrote: > On Tue, Mar 26, 2019 at 02:02:47PM -0500, Goldwyn Rodrigues wrote: > > The dax option is restricted to non multi-device mounts. > > dax interacts with the device directly instead of using bio, so > > all bio-hooks which we use for mu

Re: [PATCH 1/7] btrfs: Preallocate chunks in cow_file_range_async

2019-03-27 Thread David Sterba
On Tue, Mar 12, 2019 at 05:20:24PM +0200, Nikolay Borisov wrote: > @@ -1190,45 +1201,71 @@ static int cow_file_range_async(struct inode *inode, > struct page *locked_page, > unsigned int write_flags) > { > struct btrfs_fs_info *fs_info = btrfs_sb(inode->i_sb);

[PATCH] btrfs: qgroup: remove obsolete fs_info members

2019-03-27 Thread David Sterba
The commit fcebe4562dec ("Btrfs: rework qgroup accounting") reworked qgroups and added some new structures. Another rework of qgroup mechanics e69bcee37692 ("btrfs: qgroup: Cleanup the old ref_node-oriented mechanism.") stopped using them and left uncleaned. Signed-off-by: David Sterba --- fs/bt

hello dear

2019-03-27 Thread Aisha Gadafi
Assalamu Alaikum Wa Rahmatullahi Wa Barakatuh, hello dear I came across your contact during my private search. Mrs Aisha Al- Qaddafi is my name, the only daughter of late Libyan president, am a single Mother and a Widow with three Children.I have funds the sum of $27.5 million USD for, investme

Re: [PATCH URGENT v1.1 0/2] btrfs-progs: Fix the nobarrier behavior of write

2019-03-27 Thread Qu Wenruo
On 2019/3/27 下午10:07, Adam Borowski wrote: > On Wed, Mar 27, 2019 at 05:46:50PM +0800, Qu Wenruo wrote: >> This urgent patchset can be fetched from github: >> https://github.com/adam900710/btrfs-progs/tree/flush_super >> Which is based on v4.20.2. >> >> Before this patch, btrfs-progs writes to th

Re: [PATCH URGENT v1.1 0/2] btrfs-progs: Fix the nobarrier behavior of write

2019-03-27 Thread Qu Wenruo
On 2019/3/27 下午10:39, Qu Wenruo wrote: > > > On 2019/3/27 下午10:07, Adam Borowski wrote: >> On Wed, Mar 27, 2019 at 05:46:50PM +0800, Qu Wenruo wrote: >>> This urgent patchset can be fetched from github: >>> https://github.com/adam900710/btrfs-progs/tree/flush_super >>> Which is based on v4.20.2

Re: [PATCH URGENT v1.1 0/2] btrfs-progs: Fix the nobarrier behavior of write

2019-03-27 Thread Qu Wenruo
On 2019/3/27 下午10:07, Adam Borowski wrote: > On Wed, Mar 27, 2019 at 05:46:50PM +0800, Qu Wenruo wrote: >> This urgent patchset can be fetched from github: >> https://github.com/adam900710/btrfs-progs/tree/flush_super >> Which is based on v4.20.2. >> >> Before this patch, btrfs-progs writes to th

Re: [PATCH URGENT v1.1 0/2] btrfs-progs: Fix the nobarrier behavior of write

2019-03-27 Thread Hugo Mills
On Wed, Mar 27, 2019 at 03:07:48PM +0100, Adam Borowski wrote: > On Wed, Mar 27, 2019 at 05:46:50PM +0800, Qu Wenruo wrote: > > This urgent patchset can be fetched from github: > > https://github.com/adam900710/btrfs-progs/tree/flush_super > > Which is based on v4.20.2. > > > > Before this patch,

Re: [PATCH URGENT v1.1 0/2] btrfs-progs: Fix the nobarrier behavior of write

2019-03-27 Thread Adam Borowski
On Wed, Mar 27, 2019 at 05:46:50PM +0800, Qu Wenruo wrote: > This urgent patchset can be fetched from github: > https://github.com/adam900710/btrfs-progs/tree/flush_super > Which is based on v4.20.2. > > Before this patch, btrfs-progs writes to the fs has no barrier at all. > All metadata and supe

Re: backup uuid_tree generation not consistent across multi device (raid0) btrfs - won´t mount

2019-03-27 Thread berodual_xyz
Dear Chris, correct - the metadata profile was set to single (with the thought of consolidating metadata updates to a smaller subset of disks instead of creating IO overhead between "data" operations and "metadata" updates). It seems that "-o clear_cache" was used early on in an attempt to fix

Re: [PATCH 01/15] btrfs: create a mount option for dax

2019-03-27 Thread Goldwyn Rodrigues
On 5:00 27/03, Matthew Wilcox wrote: > On Wed, Mar 27, 2019 at 06:00:52AM -0500, Goldwyn Rodrigues wrote: > > On 12:10 26/03, Matthew Wilcox wrote: > > > On Tue, Mar 26, 2019 at 02:02:47PM -0500, Goldwyn Rodrigues wrote: > > > > This sets S_DAX in inode->i_flags, which can be used with > > > > IS_

[PATCH v4 08/15] btrfs: Stop using call_rcu for device freeing

2019-03-27 Thread Nikolay Borisov
btrfs_device structs are freed from RCU context since device iteration is protected by RCU. Currently this is achieved by using call_rcu since no blocking functions are called within btrfs_free_device. Future refactoring of pending/pinned chunks will require calling sleeping functions. This patch i

[PATCH v4 11/15] btrfs: Remove 'trans' argument from find_free_dev_extent(_start)

2019-03-27 Thread Nikolay Borisov
Now that those function no longer require a handle to transaction to inspect pending/pinned chunks the argument can be removed. At the same time also remove any surrounding code which acquired the handle. Signed-off-by: Nikolay Borisov --- fs/btrfs/extent-tree.c | 36 +++-

[PATCH v4 14/15] btrfs: Implement find_first_clear_extent_bit

2019-03-27 Thread Nikolay Borisov
This function is very similar to find_first_extent_bit except that it locates the first contiguous span of space which does not have bits set. It's intended use is in the freespace trimming code. Signed-off-by: Nikolay Borisov --- fs/btrfs/extent_io.c | 73 +++

[PATCH v4 15/15] btrfs: Switch btrfs_trim_free_extents to find_first_clear_extent_bit

2019-03-27 Thread Nikolay Borisov
Instead of always calling the allocator to search for a free extent, that satisfies the input criteria, switch btrfs_trim_free_extents to using find_first_clear_extent_bit. With this change it's no longer necessary to read the device tree in order to figure out holes in the devices. Now the code a

[PATCH v4 07/15] btrfs: Implement set_extent_bits_nowait

2019-03-27 Thread Nikolay Borisov
It will be used in a future patch that will require modifying an extent_io_tree struct under a spinlock. Signed-off-by: Nikolay Borisov --- fs/btrfs/extent_io.c | 7 +++ fs/btrfs/extent_io.h | 2 ++ 2 files changed, 9 insertions(+) diff --git a/fs/btrfs/extent_io.c b/fs/btrfs/extent_io.c in

[PATCH v4 13/15] btrfs: Optimize unallocated chunks discard

2019-03-27 Thread Nikolay Borisov
Currently unallocated chunks are always trimmed. For example 2 consecutive trims on large storage would trim freespace twice irrespective of whether the space was actually allocated or not between those trims. Optimise this behavior by exploiting the newly introduced alloc_state tree of btrfs_devi

[PATCH v4 09/15] btrfs: replace pending/pinned chunks lists with io tree

2019-03-27 Thread Nikolay Borisov
From: Jeff Mahoney The pending chunks list contains chunks that are allocated in the current transaction but haven't been created yet. The pinned chunks list contains chunks that are being released in the current transaction. Both describe chunks that are not reflected on disk as in use but are u

[PATCH v4 00/15] FITRIM improvement

2019-03-27 Thread Nikolay Borisov
Here is the (hopefully final) v4 of the fitrim patches. Main changes since v3: * Fixed leaked btrfs_path in patch 3. * Fixed multiple assignemnt on single line in patch 3. * New patch 9 transposing btrfs_close_devices/btrfs_mapping_tree_free, in v3 this change was wrongly squashed in patch "Intr

[PATCH v4 03/15] btrfs: Handle pending/pinned chunks before blockgroup relocation during device shrink

2019-03-27 Thread Nikolay Borisov
During device shrink pinned/pending chunks (i.e those which have been deleted/created respectively, in the current transaction and haven't touched disk) need to be accounted when doing device shrink. Presently this happens after the main relocation loop in btrfs_shrink_device, which could lead to m

[PATCH v4 04/15] btrfs: Rename and export clear_btree_io_tree

2019-03-27 Thread Nikolay Borisov
This function is going to be used to clear out the device extent allocation information. Give it a more generic name and export it. This is in preparation to replacing the pending/pinned chunk lists with an extent tree. No functional changes. Reviewed-by: David Sterba Signed-off-by: Nikolay Boris

[PATCH v4 02/15] btrfs: combine device update operations during transaction commit

2019-03-27 Thread Nikolay Borisov
We currently overload the pending_chunks list to handle updating btrfs_device->commit_bytes used. We don't actually care about the extent mapping or even the device mapping for the chunk - we just need the device, and we can end up processing it multiple times. The fs_devices->resized_list does m

[PATCH v4 10/15] btrfs: Transpose btrfs_close_devices/btrfs_mapping_tree_free in close_ctree

2019-03-27 Thread Nikolay Borisov
Following the introduction of the alloc_state tree, some of the callees of btrfs_mapping_tree_free will have to interact with the btrfs_device of the constituent devices. Enable this by moving the code responsible for freeing devices after the last user (btrfs_mapping_tree_free). Otherwise the kern

[PATCH v4 12/15] btrfs: Factor out in_range macro

2019-03-27 Thread Nikolay Borisov
This is used in more than one places so let's factor it out in ctree.h. No functional changes. Signed-off-by: Nikolay Borisov --- fs/btrfs/ctree.h | 2 ++ fs/btrfs/extent-tree.c | 1 - fs/btrfs/volumes.c | 1 - 3 files changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/btrfs/ctr

[PATCH v4 05/15] btrfs: Populate ->orig_block_len during read_one_chunk

2019-03-27 Thread Nikolay Borisov
Chunks read from disk currently don't get their ->orig_block_len member set, in contrast when a new chunk is allocated, the respective extent_map's ->orig_block_len is assigned the size of the stripe of this chunk. Let's apply the same strategy for chunks which are read from disk, not only does thi

[PATCH v4 06/15] btrfs: Introduce new bits for device allocation tree

2019-03-27 Thread Nikolay Borisov
Rather than hijacking the existing defines let's just define new bits, with more descriptive names. Instead of using yet more (currently at 18) bits for the new flags, use the fact those flags will be specific to the device allocation tree so define them using existing EXTENT_* flags. Signed-off-b

[PATCH v4 01/15] btrfs: Honour FITRIM range constraints during free space trim

2019-03-27 Thread Nikolay Borisov
Up until know trimming the freespace was done irrespective of what the arguments of the FITRIM ioctl were. For example fstrim's -o/-l arguments will be entirely ignored. Fix it by correctly handling those paramter. This requires breaking if the found freespace extent is after the end of the passed

Re: [PATCH 01/15] btrfs: create a mount option for dax

2019-03-27 Thread Matthew Wilcox
On Wed, Mar 27, 2019 at 06:00:52AM -0500, Goldwyn Rodrigues wrote: > On 12:10 26/03, Matthew Wilcox wrote: > > On Tue, Mar 26, 2019 at 02:02:47PM -0500, Goldwyn Rodrigues wrote: > > > This sets S_DAX in inode->i_flags, which can be used with > > > IS_DAX(). > > > > > > The dax option is restricted

Re: [PATCH URGENT v1.1 1/2] btrfs-progs: disk-io: Make super block write error easier to read

2019-03-27 Thread Nikolay Borisov
On 27.03.19 г. 11:46 ч., Qu Wenruo wrote: > When we failed to write super blocks, we just output something like: > WARNING: failed to write sb: I/O error > Or > WARNING: failed to write all sb data > > There is no info about which device failed and there are two different > error message fo

Re: [PATCH 07/10] dax: export functions for use with btrfs

2019-03-27 Thread Goldwyn Rodrigues
On 12:36 26/03, Dan Williams wrote: > On Wed, Dec 5, 2018 at 4:29 AM Goldwyn Rodrigues wrote: > > > > From: Goldwyn Rodrigues > > > > These functions are required for btrfs dax support. > > > > Signed-off-by: Goldwyn Rodrigues > > --- > > fs/dax.c| 35 ---

Re: [PATCH 01/15] btrfs: create a mount option for dax

2019-03-27 Thread Goldwyn Rodrigues
On 12:10 26/03, Matthew Wilcox wrote: > On Tue, Mar 26, 2019 at 02:02:47PM -0500, Goldwyn Rodrigues wrote: > > This sets S_DAX in inode->i_flags, which can be used with > > IS_DAX(). > > > > The dax option is restricted to non multi-device mounts. > > dax interacts with the device directly instead

[PATCH URGENT v1.1 1/2] btrfs-progs: disk-io: Make super block write error easier to read

2019-03-27 Thread Qu Wenruo
When we failed to write super blocks, we just output something like: WARNING: failed to write sb: I/O error Or WARNING: failed to write all sb data There is no info about which device failed and there are two different error message for the same write error. This patch will change it to somet

[PATCH URGENT v1.1 2/2] btrfs-progs: disk-io: Flush to ensure super block write is FUA

2019-03-27 Thread Qu Wenruo
[BUG] There are tons of reports of btrfs-progs screwing up the fs, the most recent one is "btrfs check --clear-space-cache v1" triggered BUG_ON() and then leaving the fs with transid mismatch problem. [CAUSE] In kernel, we have block layer handing the flush work, even on devices without FUA suppor

[PATCH URGENT v1.1 0/2] btrfs-progs: Fix the nobarrier behavior of write

2019-03-27 Thread Qu Wenruo
This urgent patchset can be fetched from github: https://github.com/adam900710/btrfs-progs/tree/flush_super Which is based on v4.20.2. Before this patch, btrfs-progs writes to the fs has no barrier at all. All metadata and superblock are just buffered write, no barrier between super blocks and met

Re: [PATCH URGENT 2/2] btrfs-progs: disk-io: Flush to ensure super block write is FUA

2019-03-27 Thread Qu Wenruo
On 2019/3/27 下午4:37, Nikolay Borisov wrote: > > > On 27.03.19 г. 9:25 ч., Qu Wenruo wrote: >> [BUG] >> There are tons of reports of btrfs-progs screwing up the fs, the most >> recent one is "btrfs check --clear-space-cache v1" triggered BUG_ON() >> and then leaving the fs with transid mismatch p

Re: [PATCH URGENT 2/2] btrfs-progs: disk-io: Flush to ensure super block write is FUA

2019-03-27 Thread Nikolay Borisov
On 27.03.19 г. 9:25 ч., Qu Wenruo wrote: > [BUG] > There are tons of reports of btrfs-progs screwing up the fs, the most > recent one is "btrfs check --clear-space-cache v1" triggered BUG_ON() > and then leaving the fs with transid mismatch problem. > > [CAUSE] > In kernel, we have block layer

Re: [PATCH URGENT 1/2] btrfs-progs: disk-io: Make super block write error more easy to read

2019-03-27 Thread Qu Wenruo
On 2019/3/27 下午4:00, Nikolay Borisov wrote: > > > On 27.03.19 г. 9:24 ч., Qu Wenruo wrote: >> When we failed to write super blocks, we just output something like: >> WARNING: failed to write sb: I/O error >> Or >> WARNING: failed to write all sb data >> >> There is no info about which devi

Re: [PATCH URGENT 1/2] btrfs-progs: disk-io: Make super block write error more easy to read

2019-03-27 Thread Nikolay Borisov
On 27.03.19 г. 9:24 ч., Qu Wenruo wrote: > When we failed to write super blocks, we just output something like: > WARNING: failed to write sb: I/O error > Or > WARNING: failed to write all sb data > > There is no info about which device failed and there are two different > error message for

[PATCH URGENT 1/2] btrfs-progs: disk-io: Make super block write error more easy to read

2019-03-27 Thread Qu Wenruo
When we failed to write super blocks, we just output something like: WARNING: failed to write sb: I/O error Or WARNING: failed to write all sb data There is no info about which device failed and there are two different error message for the same write error. This patch will change it to somet

[PATCH URGENT 2/2] btrfs-progs: disk-io: Flush to ensure super block write is FUA

2019-03-27 Thread Qu Wenruo
[BUG] There are tons of reports of btrfs-progs screwing up the fs, the most recent one is "btrfs check --clear-space-cache v1" triggered BUG_ON() and then leaving the fs with transid mismatch problem. [CAUSE] In kernel, we have block layer handing the flush work, even on devices without FUA suppor

[PATCH URGENT 0/2] btrfs-progs: Fix the nobarrier behavior of write

2019-03-27 Thread Qu Wenruo
This urgent patchset can be fetched from github: https://github.com/adam900710/btrfs-progs/tree/flush_super Which is based on v4.20.2. Before this patch, btrfs-progs writes to the fs has no barrier at all. All metadata and superblock are just buffered write, no barrier between super blocks and met