Re: [PATCH v2] vfs: fix fsconfig(2) LSM mount option handling for btrfs

2021-03-18 Thread Ondrej Mosnacek
On Tue, Mar 16, 2021 at 8:25 PM Al Viro wrote: > On Tue, Mar 16, 2021 at 02:21:45PM -0400, Paul Moore wrote: > > On Tue, Mar 16, 2021 at 10:48 AM Ondrej Mosnacek > > wrote: > > > > > > When SELinux security options are passed to btrfs via fsconfig(2) rather > > > than via mount(2), the operation

kernel 5.11.x: BUG: sleeping function called from invalid context at kernel/locking/mutex.c:281

2021-03-18 Thread Stuart Shelton
Hi all, I recently migrated an existing ext4 fs using btrfs-convert (setting nodesize to 32k and enabling optional features `extref`, `skinny-metadata` and `no-holes` - the first two of which I believe are now the default in any case?), but I’m subsequently seeing very frequent BUGs being outpu

[PATCH] btrfs: fix sleep while in non-sleep context during qgroup removal

2021-03-18 Thread fdmanana
From: Filipe Manana While removing a qgroup's sysfs entry we end up taking the kernfs_mutex, through kobject_del(), while holding the fs_info->qgroup_lock spinlock, producing the following trace: [ 821.843637] BUG: sleeping function called from invalid context at kernel/locking/mutex.c:281 [

Re: kernel 5.11.x: BUG: sleeping function called from invalid context at kernel/locking/mutex.c:281

2021-03-18 Thread Filipe Manana
On Thu, Mar 18, 2021 at 10:53 AM Stuart Shelton wrote: > > Hi all, > > I recently migrated an existing ext4 fs using btrfs-convert (setting nodesize > to 32k and enabling optional features `extref`, `skinny-metadata` and > `no-holes` - the first two of which I believe are now the default in any

Re: [PATCH] btrfs: fix sleep while in non-sleep context during qgroup removal

2021-03-18 Thread Qu Wenruo
On 2021/3/18 下午7:22, fdman...@kernel.org wrote: From: Filipe Manana While removing a qgroup's sysfs entry we end up taking the kernfs_mutex, through kobject_del(), while holding the fs_info->qgroup_lock spinlock, producing the following trace: [ 821.843637] BUG: sleeping function called fr

Re: [PATCH] btrfs: fix sleep while in non-sleep context during qgroup removal

2021-03-18 Thread Filipe Manana
On Thu, Mar 18, 2021 at 11:25 AM wrote: > > From: Filipe Manana > > While removing a qgroup's sysfs entry we end up taking the kernfs_mutex, > through kobject_del(), while holding the fs_info->qgroup_lock spinlock, > producing the following trace: > > [ 821.843637] BUG: sleeping function called

[PATCH] btrfs/232: fix umount failure due to fsstress still running

2021-03-18 Thread fdmanana
From: Filipe Manana We start a process that runs fsstress, then kill the process, wait for it to die and then end the test, where we attempt to unmount the fs which often fails because the fsstress subcommand started by the process is still running and using the mount point. This results in a tes

Re: [PATCH 0/1] btrfs-progs: libbtrfsutil: Relicense to LGPLv2.1+

2021-03-18 Thread Marcos Paulo de Souza
On Wed, 2021-03-17 at 16:01 -0400, Neal Gompa wrote: > This is a patch requesting all substantial copyright owners to sign > off > on changing the license of the libbtrfsutil code to LGPLv2.1+ in > order > to resolve various concerns around the mixture of code in btrfs-progs > with libbtrfsutil. >

Re: [PATCH 0/1] btrfs-progs: libbtrfsutil: Relicense to LGPLv2.1+

2021-03-18 Thread Anand Jain
On 18/03/2021 04:01, Neal Gompa wrote: This is a patch requesting all substantial copyright owners to sign off on changing the license of the libbtrfsutil code to LGPLv2.1+ in order to resolve various concerns around the mixture of code in btrfs-progs with libbtrfsutil. Each significant (i.e.

Re: [PATCH 0/3] Handle bad dev_root properly with rescue=all

2021-03-18 Thread David Sterba
On Thu, Mar 11, 2021 at 11:23:13AM -0500, Josef Bacik wrote: [...] > rescue=all working without panicing the machine, > and I verified everything by > using btrfs-corrupt-block to corrupt a dev root of a file system. Thanks, We need to have such testing part of some suite but it depends on the u

Re: [PATCH 0/1] btrfs-progs: libbtrfsutil: Relicense to LGPLv2.1+

2021-03-18 Thread David Sterba
On Thu, Mar 18, 2021 at 08:32:30AM +0800, Qu Wenruo wrote: > > > On 2021/3/18 上午4:01, Neal Gompa wrote: > > This is a patch requesting all substantial copyright owners to sign off > > on changing the license of the libbtrfsutil code to LGPLv2.1+ in order > > to resolve various concerns around the

Re: [PATCH] btrfs: fix sleep while in non-sleep context during qgroup removal

2021-03-18 Thread David Sterba
On Thu, Mar 18, 2021 at 11:22:05AM +, fdman...@kernel.org wrote: > From: Filipe Manana > > While removing a qgroup's sysfs entry we end up taking the kernfs_mutex, > through kobject_del(), while holding the fs_info->qgroup_lock spinlock, > producing the following trace: > > [ 821.843637] BU

[GIT PULL] iomap: fixes for 5.12-rc4

2021-03-18 Thread Darrick J. Wong
Hi Linus, Please pull this single fix to the iomap code for 5.12-rc4, which fixes some drama when someone gives us a {de,ma}liciously fragmented swap file. The branch merges cleanly with upstream as of a few minutes ago and has been soaking in for-next for a week without complaints. Please let m

Re: [GIT PULL] iomap: fixes for 5.12-rc4

2021-03-18 Thread pr-tracker-bot
The pull request you sent on Thu, 18 Mar 2021 09:05:45 -0700: > git://git.kernel.org/pub/scm/fs/xfs/xfs-linux.git iomap-5.12-fixes has been merged into torvalds/linux.git: https://git.kernel.org/torvalds/c/8ff0f3bf5d6513dfb7462246d9c656da7c02b37e Thank you! -- Deet-doot-dot, I am a bot. https:

[GIT PULL] Btrfs fixes for 5.12-rc4

2021-03-18 Thread David Sterba
From: David Sterba Hi, there are still regressions being found and fixed in the zoned mode and subpage code, the rest are fixes for bugs reported by users. Please pull, thanks. Regressions: - subpage block support: - readahead works on the proper block size - fix last page zeroing - zoned

Re: [PATCH v8 04/10] btrfs: fix check_data_csum() error message for direct I/O

2021-03-18 Thread David Sterba
On Thu, Mar 18, 2021 at 07:47:29AM +0800, Qu Wenruo wrote: > > > On 2021/3/18 上午2:33, Omar Sandoval wrote: > > On Wed, Mar 17, 2021 at 07:21:46PM +0800, Qu Wenruo wrote: > >> > >> > >> On 2021/3/17 上午3:43, Omar Sandoval wrote: > >>> From: Omar Sandoval > >>> > >>> Commit 1dae796aabf6 ("btrfs: in

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

2021-03-18 Thread David Sterba
On Thu, Mar 18, 2021 at 02:22:20AM +, Sidong Yang wrote: > On Wed, Mar 17, 2021 at 07:36:47PM +0100, David Sterba wrote: > > On Tue, Mar 16, 2021 at 01:27:46PM +, Sidong Yang wrote: > > > When user assign qgroup with qgroup id that is too big to exceeds > > > range and invade level value, a

Re: [PATCH 0/3] Handle bad dev_root properly with rescue=all

2021-03-18 Thread Josef Bacik
On 3/18/21 11:43 AM, David Sterba wrote: On Thu, Mar 11, 2021 at 11:23:13AM -0500, Josef Bacik wrote: [...] rescue=all working without panicing the machine, and I verified everything by using btrfs-corrupt-block to corrupt a dev root of a file system. Thanks, We need to have such testing par

Re: [GIT PULL] Btrfs fixes for 5.12-rc4

2021-03-18 Thread pr-tracker-bot
The pull request you sent on Thu, 18 Mar 2021 21:14:11 +0100: > git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux.git for-5.12-rc3-tag has been merged into torvalds/linux.git: https://git.kernel.org/torvalds/c/81aa0968b7ea6dbabcdcda37dc8434dca6e1565b Thank you! -- Deet-doot-dot, I am a

[PATCH v3 01/10] fsdax: Factor helpers to simplify dax fault code

2021-03-18 Thread Shiyang Ruan
The dax page fault code is too long and a bit difficult to read. And it is hard to understand when we trying to add new features. Some of the PTE/PMD codes have similar logic. So, factor them as helper functions to simplify the code. Signed-off-by: Shiyang Ruan Reviewed-by: Christoph Hellwig ---

[PATCH v3 00/10] fsdax,xfs: Add reflink&dedupe support for fsdax

2021-03-18 Thread Shiyang Ruan
From: Shiyang Ruan This patchset is attempt to add CoW support for fsdax, and take XFS, which has both reflink and fsdax feature, as an example. Changes from V2: - Fix the mistake in iomap_apply2() and dax_dedupe_file_range_compare() - Add CoW judgement in dax_iomap_zero() - Fix other code st

[PATCH v3 02/10] fsdax: Factor helper: dax_fault_actor()

2021-03-18 Thread Shiyang Ruan
The core logic in the two dax page fault functions is similar. So, move the logic into a common helper function. Also, to facilitate the addition of new features, such as CoW, switch-case is no longer used to handle different iomap types. Signed-off-by: Shiyang Ruan --- fs/dax.c | 291 ++

[PATCH v3 04/10] fsdax: Introduce dax_iomap_cow_copy()

2021-03-18 Thread Shiyang Ruan
In the case where the iomap is a write operation and iomap is not equal to srcmap after iomap_begin, we consider it is a CoW operation. The destance extent which iomap indicated is new allocated extent. So, it is needed to copy the data from srcmap to new allocated extent. In theory, it is better

[PATCH v3 03/10] fsdax: Output address in dax_iomap_pfn() and rename it

2021-03-18 Thread Shiyang Ruan
Add address output in dax_iomap_pfn() in order to perform a memcpy() in CoW case. Since this function both output address and pfn, rename it to dax_iomap_direct_access(). Signed-off-by: Shiyang Ruan Reviewed-by: Christoph Hellwig --- fs/dax.c | 16 1 file changed, 12 insertion

[PATCH v3 06/10] fsdax: Add dax_iomap_cow_copy() for dax_iomap_zero

2021-03-18 Thread Shiyang Ruan
Punch hole on a reflinked file needs dax_copy_edge() too. Otherwise, data in not aligned area will be not correct. So, add the srcmap to dax_iomap_zero() and replace memset() as dax_copy_edge(). Signed-off-by: Shiyang Ruan --- fs/dax.c | 9 +++-- fs/iomap/buffered-io.c | 2 +-

[PATCH v3 05/10] fsdax: Replace mmap entry in case of CoW

2021-03-18 Thread Shiyang Ruan
We replace the existing entry to the newly allocated one in case of CoW. Also, we mark the entry as PAGECACHE_TAG_TOWRITE so writeback marks this entry as writeprotected. This helps us snapshots so new write pagefaults after snapshots trigger a CoW. Signed-off-by: Goldwyn Rodrigues Signed-off-by

[PATCH v3 08/10] fsdax: Dedup file range to use a compare function

2021-03-18 Thread Shiyang Ruan
With dax we cannot deal with readpage() etc. So, we create a dax comparison funciton which is similar with vfs_dedupe_file_range_compare(). And introduce dax_remap_file_range_prep() for filesystem use. Signed-off-by: Goldwyn Rodrigues Signed-off-by: Shiyang Ruan --- fs/dax.c | 56 ++

[PATCH v3 09/10] fs/xfs: Handle CoW for fsdax write() path

2021-03-18 Thread Shiyang Ruan
In fsdax mode, WRITE and ZERO on a shared extent need CoW performed. After CoW, new allocated extents needs to be remapped to the file. So, add an iomap_end for dax write ops to do the remapping work. Signed-off-by: Shiyang Ruan --- fs/xfs/xfs_bmap_util.c | 3 +-- fs/xfs/xfs_file.c | 9 +

[PATCH v3 07/10] iomap: Introduce iomap_apply2() for operations on two files

2021-03-18 Thread Shiyang Ruan
Some operations, such as comparing a range of data in two files under fsdax mode, requires nested iomap_open()/iomap_end() on two file. Thus, we introduce iomap_apply2() to accept arguments from two files and iomap_actor2_t for actions on two files. Signed-off-by: Shiyang Ruan --- fs/iomap/appl

[PATCH v3 10/10] fs/xfs: Add dedupe support for fsdax

2021-03-18 Thread Shiyang Ruan
Add xfs_break_two_dax_layouts() to break layout for tow dax files. Then call compare range function only when files are both DAX or not. Signed-off-by: Shiyang Ruan --- fs/xfs/xfs_file.c| 20 fs/xfs/xfs_inode.c | 8 +++- fs/xfs/xfs_inode.h | 1 + fs/xfs/xfs_re

[PATCH] btrfs-progs: fix inspect-internal --help incomplete sentence

2021-03-18 Thread Anand Jain
btrfs inspect-internal --help show some incomplete sentenses. As shown below, btrfs inspect-internal --help btrfs inspect-internal min-dev-size [options] Get the minimum size the device can be shrunk to. The btrfs inspect-internal dump-tree [options] [ ..] This pat