[PATCH 4.4 1/2] btrfs: Don't clear SGID when inheriting ACLs

2018-03-06 Thread Nikolay Borisov
From: Jan Kara When new directory 'DIR1' is created in a directory 'DIR0' with SGID bit set, DIR1 is expected to have SGID bit set (and owning group equal to the owning group of 'DIR0'). However when 'DIR0' also has some default ACLs that 'DIR1' inherits, setting these ACLs will

Re: [PATCH] fstests: btrfs/004: increase the buffer size of logical-resolve to the maximum value 64K

2018-03-06 Thread Eryu Guan
On Tue, Mar 06, 2018 at 03:02:31PM +0800, Lu Fengqi wrote: > Because of commit e76e13ce8c0b ("fsstress: implement the > clonerange/deduperange ioctls"), dedupe makes the number of references to > the same extent item increase so much that the default 4K buffer of > logical-resolve is no longer

Re: [PATCH 8/8] btrfs-progs: qgroups: export qgroups usage information as JSON

2018-03-06 Thread Qu Wenruo
On 2018年03月03日 02:47, je...@suse.com wrote: > From: Jeff Mahoney > > One of the common requests I receive is for 'df' like facilities > for subvolume usage. Really, the request is for monitoring tools to be > able to understand when subvolumes may be approaching quota in the

Re: [PATCH 0/8] btrfs-progs: qgroups usability [corrected]

2018-03-06 Thread Qu Wenruo
On 2018年03月03日 02:46, je...@suse.com wrote: > From: Jeff Mahoney > > Hi all - > > The following series addresses some usability issues with the qgroups UI. > > 1) Adds -W option so we can wait on a rescan completing without starting one. > 2) Adds qgroup information to 'btrfs

Re: [PATCH 7/8] btrfs-progs: subvolume: add quota info to btrfs sub show

2018-03-06 Thread Qu Wenruo
On 2018年03月03日 02:47, je...@suse.com wrote: > From: Jeff Mahoney > > This patch reports on the first-level qgroup, if any, associated with > a particular subvolume. It displays the usage and limit, subject > to the usual unit parameters. > > Signed-off-by: Jeff Mahoney

Re: [PATCH 6/8] btrfs-progs: qgroups: introduce btrfs_qgroup_query

2018-03-06 Thread Qu Wenruo
On 2018年03月03日 02:47, je...@suse.com wrote: > From: Jeff Mahoney > > The only mechanism we have in the progs for searching qgroups is to load > all of them and filter the results. This works for qgroup show but > to add quota information to 'btrfs subvoluem show' it's pretty

Re: [PATCH 6/8] btrfs-progs: qgroups: introduce btrfs_qgroup_query

2018-03-06 Thread Qu Wenruo
On 2018年03月03日 02:47, je...@suse.com wrote: > From: Jeff Mahoney > > The only mechanism we have in the progs for searching qgroups is to load > all of them and filter the results. This works for qgroup show but > to add quota information to 'btrfs subvoluem show' it's pretty

Re: [PATCH 4/8] btrfs-progs: qgroups: add pathname to show output

2018-03-06 Thread Qu Wenruo
On 2018年03月03日 02:47, je...@suse.com wrote: > From: Jeff Mahoney > > The btrfs qgroup show command currently only exports qgroup IDs, > forcing the user to resolve which subvolume each corresponds to. > > This patch adds pathname resolution to qgroup show so that when > the -P

Re: spurious full btrfs corruption

2018-03-06 Thread Duncan
Christoph Anton Mitterer posted on Tue, 06 Mar 2018 01:57:58 +0100 as excerpted: > In the meantime I had a look of the remaining files that I got from the > btrfs-restore (haven't run it again so far, from the OLD notebook, so > only the results from the NEW notebook here:): > > The remaining

Re: [PATCH 2/2] btrfs: Add unprivileged version of ino_lookup ioctl

2018-03-06 Thread Misono, Tomohiro
On 2018/03/06 17:31, Misono, Tomohiro wrote: > Add unprivileged version of ino_lookup ioctl (BTRFS_IOC_INO_LOOKUP_USER) > to allow normal users to call "btrfs subvololume list/show" etc. in > combination with BTRFS_IOC_GET_SUBVOL_INFO. > > This can be used like BTRFS_IOC_INO_LOOKUP but the

Re: [PATCH 1/2] btrfs: Add unprivileged subvolume search ioctl

2018-03-06 Thread Misono, Tomohiro
On 2018/03/07 5:29, Goffredo Baroncelli wrote: > On 03/06/2018 09:30 AM, Misono, Tomohiro wrote: >> Add new unprivileged ioctl (BTRFS_IOC_GET_SUBVOL_INFO) which searches >> and returns only subvolume related item (ROOT_ITEM/ROOT_BACKREF/ROOT_REF) >> from root tree. The arguments of this ioctl are

Re: ERROR: unsupported checksum algorithm 35355

2018-03-06 Thread Ken Swenson
Thank you so much for fixing that superblock! Wouldn't even know where to begin myself. btrfs check returned Checking filesystem on /dev/mapper/x UUID: 513f07e1-08be-4d94-a55c-11c6251f6c2f checking extents checking free space cache checking fs roots checking csums checking root refs found

Re: [PATCH 1/2] btrfs: Add unprivileged subvolume search ioctl

2018-03-06 Thread Goffredo Baroncelli
On 03/06/2018 09:30 AM, Misono, Tomohiro wrote: > Add new unprivileged ioctl (BTRFS_IOC_GET_SUBVOL_INFO) which searches > and returns only subvolume related item (ROOT_ITEM/ROOT_BACKREF/ROOT_REF) > from root tree. The arguments of this ioctl are the same as treesearch > ioctl and can be used like

Re: How to change/fix 'Received UUID'

2018-03-06 Thread Marc MERLIN
On Tue, Mar 06, 2018 at 08:12:15PM +0100, Hans van Kranenburg wrote: > On 05/03/2018 20:47, Marc MERLIN wrote: > > On Mon, Mar 05, 2018 at 10:38:16PM +0300, Andrei Borzenkov wrote: > >>> If I absolutely know that the data is the same on both sides, how do I > >>> either > >>> 1) force back in a

[PATCH v8 00/63] XArray v8

2018-03-06 Thread Matthew Wilcox
missed file - Rebased on next-20180306 - memfd moved out of shmem - nds32 needed its flush_dcache_mmap_lock fixed - mac80211_hwsim had added a use of IDA_INIT - Improved some documentation and commit messages - Split the rearrangement of struct address_space into its own patch (Kirill) - a

[PATCH v8 03/63] arm64: Turn flush_dcache_mmap_lock into a no-op

2018-03-06 Thread Matthew Wilcox
From: Matthew Wilcox ARM64 doesn't walk the VMA tree in its flush_dcache_page() implementation, so has no need to take the tree_lock. Signed-off-by: Matthew Wilcox Reviewed-by: Will Deacon ---

[PATCH v8 05/63] Export __set_page_dirty

2018-03-06 Thread Matthew Wilcox
From: Matthew Wilcox XFS currently contains a copy-and-paste of __set_page_dirty(). Export it from buffer.c instead. Signed-off-by: Matthew Wilcox Acked-by: Jeff Layton --- fs/buffer.c| 3 ++- fs/xfs/xfs_aops.c |

[PATCH v8 04/63] unicore32: Turn flush_dcache_mmap_lock into a no-op

2018-03-06 Thread Matthew Wilcox
From: Matthew Wilcox Unicore doesn't walk the VMA tree in its flush_dcache_page() implementation, so has no need to take the tree_lock. Signed-off-by: Matthew Wilcox --- arch/unicore32/include/asm/cacheflush.h | 6 ++ 1 file changed, 2

[PATCH v8 08/63] fscache: Use appropriate radix tree accessors

2018-03-06 Thread Matthew Wilcox
From: Matthew Wilcox Don't open-code accesses to data structure internals. Signed-off-by: Matthew Wilcox Reviewed-by: Jeff Layton --- fs/fscache/cookie.c | 2 +- fs/fscache/object.c | 2 +- 2 files changed, 2 insertions(+),

[PATCH v8 06/63] btrfs: Use filemap_range_has_page()

2018-03-06 Thread Matthew Wilcox
From: Matthew Wilcox The current implementation of btrfs_page_exists_in_range() gives the wrong answer if the workingset code has stored a shadow entry in the page cache. The filemap_range_has_page() function does not have this problem, and it's shared code, so use it

[PATCH v8 07/63] xfs: Rename xa_ elements to ail_

2018-03-06 Thread Matthew Wilcox
From: Matthew Wilcox This is a simple rename, except that xa_ail becomes ail_head. Signed-off-by: Matthew Wilcox Reviewed-by: Darrick J. Wong --- fs/xfs/xfs_buf_item.c| 10 ++-- fs/xfs/xfs_dquot.c | 4 +-

[PATCH v8 02/63] radix tree: Use GFP_ZONEMASK bits of gfp_t for flags

2018-03-06 Thread Matthew Wilcox
From: Matthew Wilcox None of these bits may be used for slab allocations, so we can use them as radix tree flags as long as we mask them off before passing them to the slab allocator. Move the IDR flag from the high bits to the GFP_ZONEMASK bits. Signed-off-by: Matthew

[PATCH v8 12/63] xarray: Change definition of sibling entries

2018-03-06 Thread Matthew Wilcox
From: Matthew Wilcox Instead of storing a pointer to the slot containing the canonical entry, store the offset of the slot. Produces slightly more efficient code (~300 bytes) and simplifies the implementation. Signed-off-by: Matthew Wilcox ---

[PATCH v8 09/63] xarray: Add the xa_lock to the radix_tree_root

2018-03-06 Thread Matthew Wilcox
From: Matthew Wilcox This results in no change in structure size on 64-bit machines as it fits in the padding between the gfp_t and the void *. 32-bit machines will grow the structure from 8 to 12 bytes. Almost all radix trees are protected with (at least) a spinlock,

[PATCH v8 11/63] xarray: Replace exceptional entries

2018-03-06 Thread Matthew Wilcox
From: Matthew Wilcox Introduce xarray value entries to replace the radix tree exceptional entry code. This is a slight change in encoding to allow the use of an extra bit (we can now store BITS_PER_LONG - 1 bits in a value entry). It is also a change in emphasis;

[PATCH v8 10/63] page cache: Use xa_lock

2018-03-06 Thread Matthew Wilcox
From: Matthew Wilcox Remove the address_space ->tree_lock and use the xa_lock newly added to the radix_tree_root. Rename the address_space ->page_tree to ->i_pages, since we don't really care that it's a tree. Signed-off-by: Matthew Wilcox

[PATCH v8 17/63] xarray: Add xa_get_tag, xa_set_tag and xa_clear_tag

2018-03-06 Thread Matthew Wilcox
From: Matthew Wilcox XArray tags are slightly more strongly typed than the radix tree tags, but occupy the same bits. This commit also adds the xas_ family of tag operations, for cases where the caller is already holding the lock, and xa_tagged() to ask whether any array

[PATCH v8 16/63] xarray: Add xa_load

2018-03-06 Thread Matthew Wilcox
From: Matthew Wilcox This first function in the XArray API brings with it a lot of support infrastructure. The advanced API is based around the xa_state which is a more capable version of the radix_tree_iter. As the test-suite demonstrates, it is possible to use the

[PATCH v8 15/63] xarray: Add documentation

2018-03-06 Thread Matthew Wilcox
From: Matthew Wilcox This is documentation on how to use the XArray, not details about its internal implementation. Signed-off-by: Matthew Wilcox --- Documentation/core-api/index.rst | 1 + Documentation/core-api/xarray.rst | 361

[PATCH v8 19/63] xarray: Add xa_cmpxchg and xa_insert

2018-03-06 Thread Matthew Wilcox
From: Matthew Wilcox Like cmpxchg(), xa_cmpxchg will only store to the index if the current entry matches the old entry. It returns the current entry, which is usually more useful than the errno returned by radix_tree_insert(). For the users who really only want the

[PATCH v8 18/63] xarray: Add xa_store

2018-03-06 Thread Matthew Wilcox
From: Matthew Wilcox xa_store() differs from radix_tree_insert() in that it will overwrite an existing element in the array rather than returning an error. This is the behaviour which most users want, and those that want more complex behaviour generally want to use the

[PATCH v8 23/63] xarray: Add xas_next and xas_prev

2018-03-06 Thread Matthew Wilcox
From: Matthew Wilcox These two functions move the xas index by one position, and adjust the rest of the iterator state to match it. This is more efficient than calling xas_set() as it keeps the iterator at the leaves of the tree instead of walking the iterator from the

[PATCH v8 24/63] xarray: Add xas_create_range

2018-03-06 Thread Matthew Wilcox
From: Matthew Wilcox This hopefully temporary function is useful for users who have not yet been converted to multi-index entries. Signed-off-by: Matthew Wilcox --- include/linux/xarray.h | 2 ++ lib/xarray.c | 22

[PATCH v8 21/63] xarray: Add xa_extract

2018-03-06 Thread Matthew Wilcox
From: Matthew Wilcox This function combines the functionality of radix_tree_gang_lookup() and radix_tree_gang_lookup_tagged(). It extracts entries matching the specified filter into a normal array. Signed-off-by: Matthew Wilcox ---

[PATCH v8 20/63] xarray: Add xa_for_each

2018-03-06 Thread Matthew Wilcox
From: Matthew Wilcox This iterator allows the user to efficiently walk a range of the array, executing the loop body once for each entry in that range that matches the filter. This commit also includes xa_find() and xa_find_above() which are helper functions for

[PATCH v8 22/63] xarray: Add xa_destroy

2018-03-06 Thread Matthew Wilcox
From: Matthew Wilcox This function frees all the internal memory allocated to the xarray and reinitialises it to be empty. Signed-off-by: Matthew Wilcox --- include/linux/xarray.h | 1 + lib/xarray.c | 28

[PATCH v8 29/63] page cache: Convert page deletion to XArray

2018-03-06 Thread Matthew Wilcox
From: Matthew Wilcox The code is slightly shorter and simpler. Signed-off-by: Matthew Wilcox --- mm/filemap.c | 30 ++ 1 file changed, 14 insertions(+), 16 deletions(-) diff --git a/mm/filemap.c b/mm/filemap.c index

[PATCH v8 26/63] page cache: Rearrange address_space

2018-03-06 Thread Matthew Wilcox
From: Matthew Wilcox Change i_pages from a radix_tree_root to an xarray, convert the documentation into kernel-doc format and change the order of the elements to pack them better on 64-bit systems. Signed-off-by: Matthew Wilcox ---

[PATCH v8 25/63] xarray: Add MAINTAINERS entry

2018-03-06 Thread Matthew Wilcox
From: Matthew Wilcox Add myself as XArray and IDR maintainer. Signed-off-by: Matthew Wilcox --- MAINTAINERS | 12 1 file changed, 12 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index 6d78237066ab..08613d97a74d 100644 ---

[PATCH v8 27/63] page cache: Convert hole search to XArray

2018-03-06 Thread Matthew Wilcox
From: Matthew Wilcox The page cache offers the ability to search for a miss in the previous or next N locations. Rather than teach the XArray about the page cache's definition of a miss, use xas_prev() and xas_next() to search the page array. This should be more

[PATCH v8 30/63] page cache: Convert page cache lookups to XArray

2018-03-06 Thread Matthew Wilcox
From: Matthew Wilcox Introduce page_cache_pin() to factor out the common logic between the various lookup routines: find_get_entry find_get_entries find_get_pages_range find_get_pages_contig find_get_pages_range_tag find_get_entries_tag filemap_map_pages By using the

[PATCH v8 28/63] page cache: Add and replace pages using the XArray

2018-03-06 Thread Matthew Wilcox
From: Matthew Wilcox Use the XArray APIs to add and replace pages in the page cache. This removes two uses of the radix tree preload API and is significantly shorter code. Signed-off-by: Matthew Wilcox --- include/linux/swap.h | 8 ++-

[PATCH v8 32/63] page cache: Remove stray radix comment

2018-03-06 Thread Matthew Wilcox
From: Matthew Wilcox Signed-off-by: Matthew Wilcox --- mm/filemap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/filemap.c b/mm/filemap.c index 0635e9cdbc06..86c83014c909 100644 --- a/mm/filemap.c +++ b/mm/filemap.c @@

[PATCH v8 31/63] page cache: Convert delete_batch to XArray

2018-03-06 Thread Matthew Wilcox
From: Matthew Wilcox Rename the function from page_cache_tree_delete_batch to just page_cache_delete_batch. Signed-off-by: Matthew Wilcox --- mm/filemap.c | 28 +--- 1 file changed, 13 insertions(+), 15 deletions(-) diff

[PATCH v8 33/63] page cache: Convert filemap_range_has_page to XArray

2018-03-06 Thread Matthew Wilcox
From: Matthew Wilcox Instead of calling find_get_pages_range() and putting any reference, use xas_find() to iterate over any entries in the range, skipping the shadow/swap entries. Signed-off-by: Matthew Wilcox --- mm/filemap.c | 26

[PATCH v8 38/63] mm: Convert delete_from_swap_cache to XArray

2018-03-06 Thread Matthew Wilcox
From: Matthew Wilcox Both callers of __delete_from_swap_cache have the swp_entry_t already, so pass that in to make constructing the XA_STATE easier. Signed-off-by: Matthew Wilcox --- include/linux/swap.h | 5 +++-- mm/swap_state.c | 24

[PATCH v8 37/63] mm: Convert add_to_swap_cache to XArray

2018-03-06 Thread Matthew Wilcox
From: Matthew Wilcox Combine __add_to_swap_cache and add_to_swap_cache into one function since there is no more need to preload. Signed-off-by: Matthew Wilcox --- mm/swap_state.c | 93 ++--- 1

[PATCH v8 34/63] mm: Convert page-writeback to XArray

2018-03-06 Thread Matthew Wilcox
From: Matthew Wilcox Includes moving mapping_tagged() to fs.h as a static inline, and changing it to return bool. Signed-off-by: Matthew Wilcox --- include/linux/fs.h | 17 +-- mm/page-writeback.c | 63

[PATCH v8 36/63] mm: Convert truncate to XArray

2018-03-06 Thread Matthew Wilcox
From: Matthew Wilcox This is essentially xa_cmpxchg() with the locking handled above us, and it doesn't have to handle replacing a NULL entry. Signed-off-by: Matthew Wilcox --- mm/truncate.c | 15 ++- 1 file changed, 6 insertions(+),

[PATCH v8 35/63] mm: Convert workingset to XArray

2018-03-06 Thread Matthew Wilcox
From: Matthew Wilcox We construct a fake XA_STATE and use it to delete the node with xa_store() rather than adding a special function for this unique use case. Signed-off-by: Matthew Wilcox --- include/linux/swap.h | 9 -

[PATCH v8 40/63] mm: Convert page migration to XArray

2018-03-06 Thread Matthew Wilcox
From: Matthew Wilcox Signed-off-by: Matthew Wilcox --- mm/migrate.c | 41 - 1 file changed, 16 insertions(+), 25 deletions(-) diff --git a/mm/migrate.c b/mm/migrate.c index 740b71857898..9a15d27768a0

[PATCH v8 13/63] xarray: Add definition of struct xarray

2018-03-06 Thread Matthew Wilcox
From: Matthew Wilcox This is a direct replacement for struct radix_tree_root. Some of the struct members have changed name; convert those, and use a #define so that radix_tree users continue to work without change. Signed-off-by: Matthew Wilcox

[PATCH v8 39/63] mm: Convert __do_page_cache_readahead to XArray

2018-03-06 Thread Matthew Wilcox
From: Matthew Wilcox This one is trivial. Signed-off-by: Matthew Wilcox --- mm/readahead.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/mm/readahead.c b/mm/readahead.c index 3ff9763b0461..5f528d649d5e 100644 ---

[PATCH v8 41/63] mm: Convert huge_memory to XArray

2018-03-06 Thread Matthew Wilcox
From: Matthew Wilcox Quite a straightforward conversion. Signed-off-by: Matthew Wilcox --- mm/huge_memory.c | 17 +++-- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/mm/huge_memory.c b/mm/huge_memory.c index

[PATCH v8 42/63] mm: Convert collapse_shmem to XArray

2018-03-06 Thread Matthew Wilcox
From: Matthew Wilcox I found another victim of the radix tree being hard to use. Because there was no call to radix_tree_preload(), khugepaged was allocating radix_tree_nodes using GFP_ATOMIC. I also converted a local_irq_save()/restore() pair to disable()/enable().

[PATCH v8 43/63] mm: Convert khugepaged_scan_shmem to XArray

2018-03-06 Thread Matthew Wilcox
From: Matthew Wilcox Slightly shorter and easier to read code. Signed-off-by: Matthew Wilcox --- mm/khugepaged.c | 17 + 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/mm/khugepaged.c b/mm/khugepaged.c index

[PATCH v8 44/63] pagevec: Use xa_tag_t

2018-03-06 Thread Matthew Wilcox
From: Matthew Wilcox Removes sparse warnings. Signed-off-by: Matthew Wilcox --- fs/btrfs/extent_io.c| 4 ++-- fs/ext4/inode.c | 2 +- fs/f2fs/data.c | 2 +- fs/gfs2/aops.c | 2 +- include/linux/pagevec.h | 8

[PATCH v8 47/63] shmem: Convert find_swap_entry to XArray

2018-03-06 Thread Matthew Wilcox
From: Matthew Wilcox This is a 1:1 conversion. Signed-off-by: Matthew Wilcox --- mm/shmem.c | 23 +++ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/mm/shmem.c b/mm/shmem.c index 0af8a439dfad..49f42dc9e1dc

[PATCH v8 53/63] memfd: Convert shmem_wait_for_pins to XArray

2018-03-06 Thread Matthew Wilcox
From: Matthew Wilcox As with shmem_tag_pins(), hold the lock around the entire loop instead of acquiring & dropping it for each entry we're going to untag. Signed-off-by: Matthew Wilcox --- mm/memfd.c | 61

[PATCH v8 52/63] memfd: Convert shmem_tag_pins to XArray

2018-03-06 Thread Matthew Wilcox
From: Matthew Wilcox Simplify the locking by taking the spinlock while we walk the tree on the assumption that many acquires and releases of the lock will be worse than holding the lock for a (potentially) long time. We could replicate the same locking behaviour with the

[PATCH v8 50/63] shmem: Convert shmem_free_swap to XArray

2018-03-06 Thread Matthew Wilcox
From: Matthew Wilcox This is a perfect use for xa_cmpxchg(). Note the use of 0 for GFP flags; we won't be allocating memory. Signed-off-by: Matthew Wilcox --- mm/shmem.c | 7 ++- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git

[PATCH v8 49/63] shmem: Convert shmem_alloc_hugepage to XArray

2018-03-06 Thread Matthew Wilcox
From: Matthew Wilcox xa_find() is a slightly easier API to use than radix_tree_gang_lookup_slot() because it contains its own RCU locking. Signed-off-by: Matthew Wilcox --- mm/shmem.c | 14 -- 1 file changed, 4 insertions(+), 10

[PATCH v8 51/63] shmem: Convert shmem_partial_swap_usage to XArray

2018-03-06 Thread Matthew Wilcox
From: Matthew Wilcox Simpler code because the xarray takes care of things like the limit and dereferencing the slot. Signed-off-by: Matthew Wilcox --- mm/shmem.c | 18 +++--- 1 file changed, 3 insertions(+), 15 deletions(-) diff

[PATCH v8 54/63] shmem: Comment fixups

2018-03-06 Thread Matthew Wilcox
From: Matthew Wilcox Remove the last mentions of radix tree from various comments. Signed-off-by: Matthew Wilcox --- mm/shmem.c | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/mm/shmem.c b/mm/shmem.c index

[PATCH v8 59/63] f2fs: Convert to XArray

2018-03-06 Thread Matthew Wilcox
From: Matthew Wilcox This is a straightforward conversion. Signed-off-by: Matthew Wilcox --- fs/f2fs/data.c | 3 +-- fs/f2fs/dir.c| 5 + fs/f2fs/inline.c | 6 +- fs/f2fs/node.c | 10 ++ 4 files changed, 5

[PATCH v8 58/63] nilfs2: Convert to XArray

2018-03-06 Thread Matthew Wilcox
From: Matthew Wilcox I'm not 100% convinced that the rewrite of nilfs_copy_back_pages is correct, but it will at least have different bugs from the current version. Signed-off-by: Matthew Wilcox --- fs/nilfs2/btnode.c | 37

[PATCH v8 55/63] btrfs: Convert page cache to XArray

2018-03-06 Thread Matthew Wilcox
From: Matthew Wilcox Signed-off-by: Matthew Wilcox --- fs/btrfs/compression.c | 4 +--- fs/btrfs/extent_io.c | 8 +++- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/fs/btrfs/compression.c b/fs/btrfs/compression.c index

[PATCH v8 57/63] fs: Convert writeback to XArray

2018-03-06 Thread Matthew Wilcox
From: Matthew Wilcox A couple of short loops. Signed-off-by: Matthew Wilcox --- fs/fs-writeback.c | 25 + 1 file changed, 9 insertions(+), 16 deletions(-) diff --git a/fs/fs-writeback.c b/fs/fs-writeback.c index

[PATCH v8 56/63] fs: Convert buffer to XArray

2018-03-06 Thread Matthew Wilcox
From: Matthew Wilcox Mostly comment fixes, but one use of __xa_set_tag. Signed-off-by: Matthew Wilcox --- fs/buffer.c | 14 +++--- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/fs/buffer.c b/fs/buffer.c index

[PATCH v8 61/63] dax: Convert to XArray

2018-03-06 Thread Matthew Wilcox
From: Matthew Wilcox The DAX code (by its nature) is deeply interwoven with the radix tree infrastructure, doing operations directly on the radix tree slots. Convert the whole file to use XArray concepts; mostly passing around xa_state instead of address_space, index or

[PATCH v8 60/63] lustre: Convert to XArray

2018-03-06 Thread Matthew Wilcox
From: Matthew Wilcox Signed-off-by: Matthew Wilcox --- drivers/staging/lustre/lustre/llite/glimpse.c | 12 +--- drivers/staging/lustre/lustre/mdc/mdc_request.c | 16 2 files changed, 13 insertions(+), 15 deletions(-)

[PATCH v8 63/63] radix tree: Remove unused functions

2018-03-06 Thread Matthew Wilcox
From: Matthew Wilcox The following functions are (now) unused: - __radix_tree_delete_node - radix_tree_gang_lookup_slot - radix_tree_join - radix_tree_maybe_preload_order - radix_tree_split - radix_tree_split_preload Signed-off-by: Matthew Wilcox

[PATCH v8 62/63] page cache: Finish XArray conversion

2018-03-06 Thread Matthew Wilcox
From: Matthew Wilcox With no more radix tree API users left, we can drop the GFP flags and use xa_init() instead of INIT_RADIX_TREE(). Signed-off-by: Matthew Wilcox --- fs/inode.c | 2 +- mm/swap_state.c | 2 +- 2 files changed, 2

[PATCH v8 46/63] shmem: Convert shmem_confirm_swap to XArray

2018-03-06 Thread Matthew Wilcox
From: Matthew Wilcox xa_load has its own RCU locking, so we can eliminate it here. Signed-off-by: Matthew Wilcox --- mm/shmem.c | 7 +-- 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/mm/shmem.c b/mm/shmem.c index

Re: [PATCH] Btrfs: scrub: batch rebuild for raid56

2018-03-06 Thread Liu Bo
On Tue, Mar 06, 2018 at 11:47:47AM +0100, David Sterba wrote: > On Fri, Mar 02, 2018 at 04:10:37PM -0700, Liu Bo wrote: > > In case of raid56, writes and rebuilds always take BTRFS_STRIPE_LEN(64K) > > as unit, however, scrub_extent() sets blocksize as unit, so rebuild > > process may be triggered

[PATCH v8 48/63] shmem: Convert shmem_add_to_page_cache to XArray

2018-03-06 Thread Matthew Wilcox
From: Matthew Wilcox This removes the last caller of radix_tree_maybe_preload_order(). Simpler code, unless we run out of memory for new xa_nodes partway through inserting entries into the xarray. Hopefully we can support multi-index entries in the page cache soon and

[PATCH v8 14/63] xarray: Define struct xa_node

2018-03-06 Thread Matthew Wilcox
From: Matthew Wilcox This is a direct replacement for struct radix_tree_node. A couple of struct members have changed name, so convert those. Use a #define so that radix tree users continue to work without change. Signed-off-by: Matthew Wilcox

[PATCH v8 45/63] shmem: Convert replace to XArray

2018-03-06 Thread Matthew Wilcox
From: Matthew Wilcox shmem_radix_tree_replace() is renamed to shmem_xa_replace() and converted to use the XArray API. Signed-off-by: Matthew Wilcox --- mm/shmem.c | 22 -- 1 file changed, 8 insertions(+), 14 deletions(-)

[PATCH v8 01/63] mac80211_hwsim: Use DEFINE_IDA

2018-03-06 Thread Matthew Wilcox
From: Matthew Wilcox This is preferred to opencoding an IDA_INIT. Signed-off-by: Matthew Wilcox --- drivers/net/wireless/mac80211_hwsim.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/wireless/mac80211_hwsim.c

Re: How to change/fix 'Received UUID'

2018-03-06 Thread Hans van Kranenburg
On 05/03/2018 20:47, Marc MERLIN wrote: > On Mon, Mar 05, 2018 at 10:38:16PM +0300, Andrei Borzenkov wrote: >>> If I absolutely know that the data is the same on both sides, how do I >>> either >>> 1) force back in a 'Received UUID' value on the destination >> >> I suppose the most simple is to

Re: [PATCH 0/2] btrfs: Add two new unprivileged ioctls to allow normal users to call "sub list/show" etc.

2018-03-06 Thread David Sterba
On Tue, Mar 06, 2018 at 05:29:34PM +0900, Misono, Tomohiro wrote: > This adds two new unprivileged ioctls: > > 1st patch: version of tree_search ioctl which only searches/returns subvolume > related item. > 2nd patch: user version of ino_lookup ioctl which also performs permission > check. > >

Re: [PATCH 0/8] btrfs-progs: qgroups usability [corrected]

2018-03-06 Thread Jeffrey Mahoney
On 3/6/18 7:10 AM, Qu Wenruo wrote: > > > On 2018年03月03日 02:46, je...@suse.com wrote: >> From: Jeff Mahoney >> >> Hi all - >> >> The following series addresses some usability issues with the qgroups UI. >> >> 1) Adds -W option so we can wait on a rescan completing without

Re: [PATCH 3/5] btrfs: Embed sector size check into BTRFS_MAX_INLINE_DATA_SIZE()

2018-03-06 Thread David Sterba
On Fri, Mar 02, 2018 at 01:22:52PM +0800, Qu Wenruo wrote: > We have extra sector size check in cow_file_range_inline(), but doesn't > implement it in BTRFS_MAX_INLINE_DATA_SIZE(). > > The biggest reason is that btrfs_symlink() also uses this macro to check > name length. I'm reading what the

Re: [PATCH 3/3] fstests: btrfs: Add test case to check v1 space cache corruption

2018-03-06 Thread Filipe Manana
On Tue, Mar 6, 2018 at 12:07 PM, Qu Wenruo wrote: > > > On 2018年03月06日 18:12, Filipe Manana wrote: >> On Tue, Mar 6, 2018 at 8:15 AM, Qu Wenruo wrote: >>> There are some btrfs corruption report in mail list for a while, >> >> There have been for years

Re: [PATCH 3/3] fstests: btrfs: Add test case to check v1 space cache corruption

2018-03-06 Thread Filipe Manana
On Tue, Mar 6, 2018 at 10:53 AM, Qu Wenruo wrote: > > > On 2018年03月06日 18:12, Filipe Manana wrote: >> On Tue, Mar 6, 2018 at 8:15 AM, Qu Wenruo wrote: >>> There are some btrfs corruption report in mail list for a while, >> >> There have been for years

Re: [PATCH 0/8] btrfs-progs: qgroups usability [corrected]

2018-03-06 Thread Qu Wenruo
On 2018年03月03日 02:46, je...@suse.com wrote: > From: Jeff Mahoney > > Hi all - > > The following series addresses some usability issues with the qgroups UI. > > 1) Adds -W option so we can wait on a rescan completing without starting one. > 2) Adds qgroup information to 'btrfs

Re: [PATCH 2/5] btrfs: Always limit inline extent size by uncompressed size

2018-03-06 Thread Qu Wenruo
On 2018年03月06日 19:58, David Sterba wrote: > On Fri, Mar 02, 2018 at 07:40:14PM +0800, Qu Wenruo wrote: >> On 2018年03月02日 19:00, Filipe Manana wrote: >>> On Fri, Mar 2, 2018 at 10:54 AM, Qu Wenruo wrote: On 2018年03月02日 18:46, Filipe Manana wrote: > On Fri, Mar 2,

Re: [PATCH 3/3] fstests: btrfs: Add test case to check v1 space cache corruption

2018-03-06 Thread Qu Wenruo
On 2018年03月06日 18:12, Filipe Manana wrote: > On Tue, Mar 6, 2018 at 8:15 AM, Qu Wenruo wrote: >> There are some btrfs corruption report in mail list for a while, > > There have been for years (well, since ever) many reports of different > types of corruptions. > Which kind of

Re: [PATCH 2/5] btrfs: Always limit inline extent size by uncompressed size

2018-03-06 Thread David Sterba
On Fri, Mar 02, 2018 at 07:40:14PM +0800, Qu Wenruo wrote: > On 2018年03月02日 19:00, Filipe Manana wrote: > > On Fri, Mar 2, 2018 at 10:54 AM, Qu Wenruo wrote: > >> On 2018年03月02日 18:46, Filipe Manana wrote: > >>> On Fri, Mar 2, 2018 at 5:22 AM, Qu Wenruo

Re: [PATCH] Btrfs: dev-replace: make sure target is identical to source when raid56 rebuild fails

2018-03-06 Thread David Sterba
On Fri, Mar 02, 2018 at 04:10:41PM -0700, Liu Bo wrote: > In the last step of scrub_handle_error_block, we try to combine good > copies on all possible mirrors, this works fine for raid1 and raid10, > but not for raid56 as it's doing parity rebuild. > > If parity rebuild doesn't get back with

Re: [PATCH] Btrfs: raid56: remove redundant async_missing_raid56

2018-03-06 Thread David Sterba
On Fri, Mar 02, 2018 at 04:10:39PM -0700, Liu Bo wrote: > async_missing_raid56() is identical to async_read_rebuild(). > > Signed-off-by: Liu Bo Reviewed-by: David Sterba -- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the

Re: [PATCH] Btrfs: replace: cache rbio when rebuild data on missing device

2018-03-06 Thread David Sterba
On Fri, Mar 02, 2018 at 04:10:38PM -0700, Liu Bo wrote: > Rebuild on missing device is as same as recover, after it's done, rbio > has data which is consistent with on-disk data, so it can be cached to > avoid further reads. Please add a comment that describes why the READ and REBUILD can be

Re: [PATCH 3/3] fstests: btrfs: Add test case to check v1 space cache corruption

2018-03-06 Thread Nikolay Borisov
On 6.03.2018 12:53, Qu Wenruo wrote: > > [snip] > It breaks the rule that we shouldn't have the hole in file extents. > > IIRC Nikolay is trying to use inode_lock_shared() to solve this race. > Unfortunately the inode_lock_shared approach is a no go since Filipe objected to it quite

Re: [PATCH 3/3] fstests: btrfs: Add test case to check v1 space cache corruption

2018-03-06 Thread Qu Wenruo
On 2018年03月06日 18:12, Filipe Manana wrote: > On Tue, Mar 6, 2018 at 8:15 AM, Qu Wenruo wrote: >> There are some btrfs corruption report in mail list for a while, > > There have been for years (well, since ever) many reports of different > types of corruptions. > Which kind of

Re: [PATCH] Btrfs: scrub: batch rebuild for raid56

2018-03-06 Thread David Sterba
On Fri, Mar 02, 2018 at 04:10:37PM -0700, Liu Bo wrote: > In case of raid56, writes and rebuilds always take BTRFS_STRIPE_LEN(64K) > as unit, however, scrub_extent() sets blocksize as unit, so rebuild > process may be triggered on every block on a same stripe. > > A typical example would be that

Re: [PATCH] Btrfs: scrub: remove unnecessary variable set

2018-03-06 Thread David Sterba
On Fri, Mar 02, 2018 at 04:10:40PM -0700, Liu Bo wrote: > Variable "success" is only checked when !sctx->is_dev_replace. Though it's right, the code becomes less obvious at least to me that it's not missing something. There are several conditions and branches, one more explicit variable setting

Re: ERROR: unsupported checksum algorithm 35355

2018-03-06 Thread David Sterba
On Tue, Mar 06, 2018 at 04:45:40PM +0800, Qu Wenruo wrote: > Here is the fixed superblock. > > csum type and incompat flags get fixed. > > I'm not sure if they are the only problems, but I strongly recommend to > run btrfs check before mount. I haven't found any other obviously corrupted items.

Re: [PATCH 3/3] fstests: btrfs: Add test case to check v1 space cache corruption

2018-03-06 Thread Filipe Manana
On Tue, Mar 6, 2018 at 8:15 AM, Qu Wenruo wrote: > There are some btrfs corruption report in mail list for a while, There have been for years (well, since ever) many reports of different types of corruptions. Which kind of corruption are you referring to? > although such

Re: [PATCH 3/3] fstests: btrfs: Add test case to check v1 space cache corruption

2018-03-06 Thread Qu Wenruo
On 2018年03月06日 17:03, Amir Goldstein wrote: > On Tue, Mar 6, 2018 at 10:15 AM, Qu Wenruo wrote: >> There are some btrfs corruption report in mail list for a while, >> although such corruption is pretty rare and almost impossible to >> reproduce, with dm-log-writes we found it's

Re: [PATCH 3/3] fstests: btrfs: Add test case to check v1 space cache corruption

2018-03-06 Thread Amir Goldstein
On Tue, Mar 6, 2018 at 10:15 AM, Qu Wenruo wrote: > There are some btrfs corruption report in mail list for a while, > although such corruption is pretty rare and almost impossible to > reproduce, with dm-log-writes we found it's highly related to v1 space > cache. > > Unlike

  1   2   >