Re: [PATCH 2/5] btrfs: fix transaction leak and crash after cleaning up orphans on RO mount

2021-03-15 Thread robbieko
Hi All, The patch delayed find orphan roots. Move to after orphan cleanup with tree_root. I think this will cause all orphan items to be deleted when orphan cleanup with tree_root. Afterwards, find orphan roots cannot find the subvolume being deleted. Is my suspicion correct? Thanks. Robbie Ko

Re: [PATCH] btrfs-progs: common: make sure that qgroup id is in range

2021-03-15 Thread Qu Wenruo
On 2021/3/15 下午11:56, Sidong Yang wrote: When user assign qgroup with qgroup id that is too big to exceeds range and invade level value, and it works without any error. but this action would be make undefined error. this code make sure that qgroup id doesn't exceed range(0 ~ 2^48-1). Signed-o

Re: [PATCH v2 2/5] btrfs: initial fsverity support

2021-03-15 Thread Eric Biggers
On Mon, Mar 15, 2021 at 05:42:48PM -0700, Boris Burkov wrote: > > Is the separate size field really needed? It seems like the type of thing > > that > > would be redundant with information that btrfs already stores about the tree > > items. Having two sources of truth is error-prone. > > For th

Re: [PATCH v2 2/5] btrfs: initial fsverity support

2021-03-15 Thread Boris Burkov
On Mon, Mar 15, 2021 at 04:17:17PM -0700, Eric Biggers wrote: > On Fri, Mar 05, 2021 at 11:26:30AM -0800, Boris Burkov wrote: > > +static int end_page_read(struct page *page, bool uptodate, u64 start, u32 > > len) > > { > > - struct btrfs_fs_info *fs_info = btrfs_sb(page->mapping->host->i_sb);

Re: [PATCH 0/2] btrfs: fixes for subpage which also affect read-only mount

2021-03-15 Thread Qu Wenruo
On 2021/3/15 下午11:42, David Sterba wrote: On Mon, Mar 15, 2021 at 01:39:13PM +0800, Qu Wenruo wrote: During the fstests run for btrfs subpage read-write support, generic/475 crashes the system with a very high chance. It turns out the cause is also affecting btrfs subpage read-only mount so

Re: [PATCH v2 01/15] btrfs: add sysfs interface for supported sectorsize

2021-03-15 Thread Anand Jain
On 16/03/2021 08:05, Qu Wenruo wrote: On 2021/3/16 上午2:44, David Sterba wrote: On Mon, Mar 15, 2021 at 08:39:31PM +0800, Qu Wenruo wrote: On 2021/3/15 下午7:59, Anand Jain wrote: On 10/03/2021 17:08, Qu Wenruo wrote: Add extra sysfs interface features/supported_ro_sectorsize and features

Re: [PATCH v2 01/15] btrfs: add sysfs interface for supported sectorsize

2021-03-15 Thread Qu Wenruo
On 2021/3/16 上午2:44, David Sterba wrote: On Mon, Mar 15, 2021 at 08:39:31PM +0800, Qu Wenruo wrote: On 2021/3/15 下午7:59, Anand Jain wrote: On 10/03/2021 17:08, Qu Wenruo wrote: Add extra sysfs interface features/supported_ro_sectorsize and features/supported_rw_sectorsize to indicate subp

Re: [PATCH 1/2] btrfs: fix wild pointer access during metadata read failure for subpage

2021-03-15 Thread Qu Wenruo
On 2021/3/16 上午2:51, David Sterba wrote: On Mon, Mar 15, 2021 at 04:25:32PM +0800, Qu Wenruo wrote: On 2021/3/15 下午3:55, Johannes Thumshirn wrote: On 15/03/2021 06:40, Qu Wenruo wrote: The difference against find_extent_buffer_nospinlock() is: - Also handles regular sectorsize == PAGE_SIZ

Re: [PATCH v2 0/5] btrfs: support fsverity

2021-03-15 Thread Boris Burkov
On Mon, Mar 15, 2021 at 04:09:41PM -0700, Eric Biggers wrote: > On Fri, Mar 05, 2021 at 11:26:28AM -0800, Boris Burkov wrote: > > This patchset provides support for fsverity in btrfs. > > > > At a high level, we store the verity descriptor and Merkle tree data > > in the file system btree with the

Re: [PATCH v2 1/5] btrfs: add compat_flags to btrfs_inode_item

2021-03-15 Thread Boris Burkov
On Mon, Mar 15, 2021 at 04:07:24PM -0700, Eric Biggers wrote: > On Fri, Mar 05, 2021 at 11:26:29AM -0800, Boris Burkov wrote: > > The tree checker currently rejects unrecognized flags when it reads > > btrfs_inode_item. Practically, this means that adding a new flag makes > > the change backwards i

Re: [PATCH v2] btrfs-progs: build system: Fix the test for EXT4_EPOCH_MASK

2021-03-15 Thread David Sterba
On Mon, Mar 15, 2021 at 11:19:47PM +0100, Pierre Labastie wrote: > On Mon, 2021-03-15 at 15:53 +0100, David Sterba wrote: > > On Sun, Mar 14, 2021 at 07:49:13PM +0100, Pierre Labastie wrote: > > > +AX_CHECK_DEFINE([ext2fs/ext2_fs.h], [EXT4_EPOCH_MASK], > > > +    [AC_DEFINE([HAVE_EXT4_E

Re: [PATCH v2 2/5] btrfs: initial fsverity support

2021-03-15 Thread Eric Biggers
On Fri, Mar 05, 2021 at 11:26:30AM -0800, Boris Burkov wrote: > +static int end_page_read(struct page *page, bool uptodate, u64 start, u32 > len) > { > - struct btrfs_fs_info *fs_info = btrfs_sb(page->mapping->host->i_sb); > + int ret = 0; > + struct inode *inode = page->mapping->host

Re: [PATCH v2 0/5] btrfs: support fsverity

2021-03-15 Thread Eric Biggers
On Fri, Mar 05, 2021 at 11:26:28AM -0800, Boris Burkov wrote: > This patchset provides support for fsverity in btrfs. > > At a high level, we store the verity descriptor and Merkle tree data > in the file system btree with the file's inode as the objectid, and > direct reads/writes to those items

Re: [PATCH v2 1/5] btrfs: add compat_flags to btrfs_inode_item

2021-03-15 Thread Eric Biggers
On Fri, Mar 05, 2021 at 11:26:29AM -0800, Boris Burkov wrote: > The tree checker currently rejects unrecognized flags when it reads > btrfs_inode_item. Practically, this means that adding a new flag makes > the change backwards incompatible if the flag is ever set on a file. > > Take up one of the

Re: [PATCH v2] btrfs-progs: build system: Fix the test for EXT4_EPOCH_MASK

2021-03-15 Thread Pierre Labastie
On Mon, 2021-03-15 at 15:53 +0100, David Sterba wrote: > On Sun, Mar 14, 2021 at 07:49:13PM +0100, Pierre Labastie wrote: > > After sending the first version of the patch, I realized that it > > was flawed, because of some formatting by the MUA. It took me > > some time to set up an MTA so that git

Re: [PATCH 2/9] btrfs: always pin deleted leaves when there are active tree mod log users

2021-03-15 Thread David Sterba
On Thu, Mar 11, 2021 at 02:31:06PM +, fdman...@kernel.org wrote: > From: Filipe Manana > > When freeing a tree block we may end up adding its extent back to the > free space cache/tree, as long as there are no more references for it, > it was created in the current transaction and writeback f

Re: [PATCH 1/2] btrfs: fix wild pointer access during metadata read failure for subpage

2021-03-15 Thread David Sterba
On Mon, Mar 15, 2021 at 04:25:32PM +0800, Qu Wenruo wrote: > > > On 2021/3/15 下午3:55, Johannes Thumshirn wrote: > > On 15/03/2021 06:40, Qu Wenruo wrote: > >> The difference against find_extent_buffer_nospinlock() is: > >> - Also handles regular sectorsize == PAGE_SIZE case > >> - No extent buffe

Re: [PATCH v2 01/15] btrfs: add sysfs interface for supported sectorsize

2021-03-15 Thread David Sterba
On Mon, Mar 15, 2021 at 08:39:31PM +0800, Qu Wenruo wrote: > > > On 2021/3/15 下午7:59, Anand Jain wrote: > > On 10/03/2021 17:08, Qu Wenruo wrote: > >> Add extra sysfs interface features/supported_ro_sectorsize and > >> features/supported_rw_sectorsize to indicate subpage support. > >> > >> Curren

Re: [PATCH] btrfs-progs: common: make sure that qgroup id is in range

2021-03-15 Thread David Sterba
On Mon, Mar 15, 2021 at 03:56:38PM +, Sidong Yang wrote: > When user assign qgroup with qgroup id that is too big to exceeds > range and invade level value, and it works without any error. but > this action would be make undefined error. this code make sure that > qgroup id doesn't exceed range

Re: [PATCH] [PATCH] mm, slub: enable slub_debug static key when creating cache with explicit debug flags

2021-03-15 Thread Paul E. McKenney
On Mon, Mar 15, 2021 at 06:36:34PM +0100, Vlastimil Babka wrote: > On 3/15/21 6:32 PM, Paul E. McKenney wrote: > > On Mon, Mar 15, 2021 at 06:28:42PM +0100, Vlastimil Babka wrote: > >> On 3/15/21 6:16 PM, David Rientjes wrote: > >> > On Mon, 15 Mar 2021, Vlastimil Babka wrote: > >> > > >> >> Commi

Re: [PATCH] [PATCH] mm, slub: enable slub_debug static key when creating cache with explicit debug flags

2021-03-15 Thread Vlastimil Babka
On 3/15/21 6:32 PM, Paul E. McKenney wrote: > On Mon, Mar 15, 2021 at 06:28:42PM +0100, Vlastimil Babka wrote: >> On 3/15/21 6:16 PM, David Rientjes wrote: >> > On Mon, 15 Mar 2021, Vlastimil Babka wrote: >> > >> >> Commit ca0cab65ea2b ("mm, slub: introduce static key for slub_debug()") >> >> intr

Re: [PATCH] [PATCH] mm, slub: enable slub_debug static key when creating cache with explicit debug flags

2021-03-15 Thread Paul E. McKenney
On Mon, Mar 15, 2021 at 06:28:42PM +0100, Vlastimil Babka wrote: > On 3/15/21 6:16 PM, David Rientjes wrote: > > On Mon, 15 Mar 2021, Vlastimil Babka wrote: > > > >> Commit ca0cab65ea2b ("mm, slub: introduce static key for slub_debug()") > >> introduced a static key to optimize the case where no d

Re: [PATCH] [PATCH] mm, slub: enable slub_debug static key when creating cache with explicit debug flags

2021-03-15 Thread Vlastimil Babka
On 3/15/21 6:16 PM, David Rientjes wrote: > On Mon, 15 Mar 2021, Vlastimil Babka wrote: > >> Commit ca0cab65ea2b ("mm, slub: introduce static key for slub_debug()") >> introduced a static key to optimize the case where no debugging is enabled >> for >> any cache. The static key is enabled when sl

[PATCH] btrfs-progs: common: make sure that qgroup id is in range

2021-03-15 Thread Sidong Yang
When user assign qgroup with qgroup id that is too big to exceeds range and invade level value, and it works without any error. but this action would be make undefined error. this code make sure that qgroup id doesn't exceed range(0 ~ 2^48-1). Signed-off-by: Sidong Yang --- common/utils.c | 5 ++

Re: [PATCH 0/2] btrfs: fixes for subpage which also affect read-only mount

2021-03-15 Thread David Sterba
On Mon, Mar 15, 2021 at 01:39:13PM +0800, Qu Wenruo wrote: > During the fstests run for btrfs subpage read-write support, generic/475 > crashes the system with a very high chance. > > It turns out the cause is also affecting btrfs subpage read-only mount > so it's worthy a quick fix. > > Also the

Re: [PATCH] btrfs: zoned: fix linked list corruption after log root tree allocation failure

2021-03-15 Thread David Sterba
On Thu, Mar 11, 2021 at 03:13:30PM +, fdman...@kernel.org wrote: > From: Filipe Manana > > When using a zoned filesystem, while syncing the log, if we fail to > allocate the root node for the log root tree, we are not removing the > log context we allocated on stack from the list of log conte

[PATCH] [PATCH] mm, slub: enable slub_debug static key when creating cache with explicit debug flags

2021-03-15 Thread Vlastimil Babka
Commit ca0cab65ea2b ("mm, slub: introduce static key for slub_debug()") introduced a static key to optimize the case where no debugging is enabled for any cache. The static key is enabled when slub_debug boot parameter is passed, or CONFIG_SLUB_DEBUG_ON enabled. However, some caches might be creat

Re: [PATCH v2] btrfs-progs: build system: Fix the test for EXT4_EPOCH_MASK

2021-03-15 Thread David Sterba
On Sun, Mar 14, 2021 at 07:49:13PM +0100, Pierre Labastie wrote: > After sending the first version of the patch, I realized that it > was flawed, because of some formatting by the MUA. It took me > some time to set up an MTA so that git send-email works. Now the > patch should apply cleanly. Please

Re: [PATCH v2] btrfs-progs: build system: Fix the test for EXT4_EPOCH_MASK

2021-03-15 Thread David Sterba
On Sun, Mar 14, 2021 at 07:49:13PM +0100, Pierre Labastie wrote: > After sending the first version of the patch, I realized that it > was flawed, because of some formatting by the MUA. It took me > some time to set up an MTA so that git send-email works. Now the > patch should apply cleanly. Please

[PATCH] btrfs: fix slab cache flags for free space tree bitmap

2021-03-15 Thread David Sterba
The free space tree bitmap slab cache is created with SLAB_RED_ZONE but that's a debugging flag and not always enabled. Also the other slabs are created with at least SLAB_MEM_SPREAD that we want as well to average the memory placement cost. Reported-by: Vlastimil Babka Fixes: 3acd48507dc4 ("btrf

Re: [PATCH v2 01/15] btrfs: add sysfs interface for supported sectorsize

2021-03-15 Thread Qu Wenruo
On 2021/3/15 下午7:59, Anand Jain wrote: On 10/03/2021 17:08, Qu Wenruo wrote: Add extra sysfs interface features/supported_ro_sectorsize and features/supported_rw_sectorsize to indicate subpage support. Currently for supported_rw_sectorsize all architectures only have their PAGE_SIZE listed.

Re: [PATCH v2 03/15] btrfs: remove unnecessary variable shadowing in btrfs_invalidatepage()

2021-03-15 Thread Anand Jain
On 10/03/2021 17:08, Qu Wenruo wrote: In btrfs_invalidatepage() we re-declare @tree variable as btrfs_ordered_inode_tree. Since it's only used to do the spinlock, we can grab it from inode directly, and remove the unnecessary declaration completely. Signed-off-by: Qu Wenruo --- Reviewed-by:

Re: [PATCH v2 02/15] btrfs: use min() to replace open-code in btrfs_invalidatepage()

2021-03-15 Thread Anand Jain
On 10/03/2021 17:08, Qu Wenruo wrote: In btrfs_invalidatepage() we introduce a temporary variable, new_len, to update ordered->truncated_len. But we can use min() to replace it completely and no need for the variable. Signed-off-by: Qu Wenruo --- Reviewed-by: Anand Jain -Anand fs/btrf

Re: [PATCH v2 01/15] btrfs: add sysfs interface for supported sectorsize

2021-03-15 Thread Anand Jain
On 10/03/2021 17:08, Qu Wenruo wrote: Add extra sysfs interface features/supported_ro_sectorsize and features/supported_rw_sectorsize to indicate subpage support. Currently for supported_rw_sectorsize all architectures only have their PAGE_SIZE listed. While for supported_ro_sectorsize, for sys

Re: [PATCH 5/9] btrfs: use a bit to track the existence of tree mod log users

2021-03-15 Thread Filipe Manana
On Sat, Mar 13, 2021 at 7:31 AM Wang Yugui wrote: > > Hi, > > It will be more easy to backport for heavy i/o load if we put this patch > before '[PATCH 3/9] btrfs: move the tree mod log code into its own file' ? Only bug fixes and fixes for serious performance regressions are backported to stable

Re: [PATCH 2/2] btrfs: make reada to be subpage compatible

2021-03-15 Thread Johannes Thumshirn
Looks good, Reviewed-by: Johannes Thumshirn

Re: [PATCH] btrfs: zoned: fix linked list corruption after log root tree allocation failure

2021-03-15 Thread Naohiro Aota
Looks good to me. Thanks. Reviewed-by: Naohiro Aota On Thu, Mar 11, 2021 at 03:13:30PM +, fdman...@kernel.org wrote: > From: Filipe Manana > > When using a zoned filesystem, while syncing the log, if we fail to > allocate the root node for the log root tree, we are not removing the > log co

Re: [PATCH 1/2] btrfs: fix wild pointer access during metadata read failure for subpage

2021-03-15 Thread Qu Wenruo
On 2021/3/15 下午3:55, Johannes Thumshirn wrote: On 15/03/2021 06:40, Qu Wenruo wrote: The difference against find_extent_buffer_nospinlock() is: - Also handles regular sectorsize == PAGE_SIZE case - No extent buffer refs increase/decrease As extent buffer under IO must has non-zero refs.

Re: [PATCH 1/2] btrfs: fix wild pointer access during metadata read failure for subpage

2021-03-15 Thread Johannes Thumshirn
On 15/03/2021 06:40, Qu Wenruo wrote: > The difference against find_extent_buffer_nospinlock() is: > - Also handles regular sectorsize == PAGE_SIZE case > - No extent buffer refs increase/decrease > As extent buffer under IO must has non-zero refs. Can these be merged into a single function? The