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

2021-04-09 Thread Eric Biggers
On Fri, Apr 09, 2021 at 03:45:17PM -0700, Boris Burkov wrote: > On Thu, Apr 08, 2021 at 03:50:08PM -0700, Eric Biggers wrote: > > On Thu, Apr 08, 2021 at 11:33:53AM -0700, Boris Burkov wrote: > > > diff --git a/fs/btrfs/super.c b/fs/btrfs/super.c > > > index f7a4ad86adee..e5282a8f566a 100644 > > >

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

2021-04-09 Thread Eric Biggers
On Fri, Apr 09, 2021 at 11:05:05AM -0700, Boris Burkov wrote: > On Thu, Apr 08, 2021 at 03:50:08PM -0700, Eric Biggers wrote: > > On Thu, Apr 08, 2021 at 11:33:53AM -0700, Boris Burkov wrote: > > > diff --git a/fs/btrfs/super.c b/fs/btrfs/super.c > > > index f7a4ad86adee..e5282a8f566a 100644 > > >

Re: [PATCH] btrfs-progs: Correct check_running_fs_exclop() return value

2021-04-09 Thread Anand Jain
On 09/04/2021 23:56, Goldwyn Rodrigues wrote: check_running_fs_exclop() can return 1 when exclop is changed to "none" The ret is set by the return value of the select() operation. Checking the exclusive op changes just the exclop variable while ret is still set to 1. Set ret exclusively if exclo

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

2021-04-09 Thread Boris Burkov
On Thu, Apr 08, 2021 at 03:50:08PM -0700, Eric Biggers wrote: > On Thu, Apr 08, 2021 at 11:33:53AM -0700, Boris Burkov wrote: > > diff --git a/fs/btrfs/super.c b/fs/btrfs/super.c > > index f7a4ad86adee..e5282a8f566a 100644 > > --- a/fs/btrfs/super.c > > +++ b/fs/btrfs/super.c > > @@ -1339,6 +1339,7

btrfs+overlayfs: upper fs does not support xattr, falling back to index=off and metacopy=off.

2021-04-09 Thread Chris Murphy
Hi, The primary problem is Bolt (Thunderbolt 3) tests that are experiencing a regression when run in a container using overlayfs, failing at: Bail out! ERROR:../tests/test-common.c:1413:test_io_dir_is_empty: 'empty' should be FALSE https://gitlab.freedesktop.org/bolt/bolt/-/issues/171#note_87211

Re: [GIT PULL][PATCH v9 0/3] Update to zstd-1.4.10

2021-04-09 Thread Nick Terrell
What can I do to help get this merged? Cristoph, is this new patch series with the kernel wrapper API satisfactory? Best, Nick On Tue, Mar 30, 2021 at 3:45 PM Nick Terrell wrote: > > From: Nick Terrell > > Please pull from > > g...@github.com:terrelln/linux.git tags/v9-zstd-1.4.10 > > to get

5.12-rc6 splat, MAX_LOCKDEP_CHAIN_HLOCKS too low, Workqueue: btrfs-delalloc btrfs_work_helper

2021-04-09 Thread Chris Murphy
Got this while building bolt in a podman container. I've got reproduce steps and test files here https://bugzilla.redhat.com/show_bug.cgi?id=1948054 [ 3229.119497] overlayfs: upper fs does not support xattr, falling back to index=off and metacopy=off. [ 3229.155339] overlayfs: upper fs does not s

Re: [PATCH v7 03/38] btrfs: handle errors from select_reloc_root()

2021-04-09 Thread David Sterba
On Thu, Mar 11, 2021 at 01:10:03PM -0500, Josef Bacik wrote: > On 2/26/21 1:30 PM, David Sterba wrote: > > On Wed, Dec 16, 2020 at 11:26:19AM -0500, Josef Bacik wrote: > >> Currently select_reloc_root() doesn't return an error, but followup > >> patches will make it possible for it to return an err

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

2021-04-09 Thread Boris Burkov
On Fri, Apr 09, 2021 at 07:40:44AM +0800, Anand Jain wrote: > On 09/04/2021 02:33, 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

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

2021-04-09 Thread Boris Burkov
On Thu, Apr 08, 2021 at 03:50:08PM -0700, Eric Biggers wrote: > On Thu, Apr 08, 2021 at 11:33:53AM -0700, Boris Burkov wrote: > > diff --git a/fs/btrfs/super.c b/fs/btrfs/super.c > > index f7a4ad86adee..e5282a8f566a 100644 > > --- a/fs/btrfs/super.c > > +++ b/fs/btrfs/super.c > > @@ -1339,6 +1339,7

Re: [PATCH 0/2] vfs/security/NFS/btrfs: clean up and fix LSM option handling

2021-04-09 Thread Ondrej Mosnacek
On Fri, Apr 9, 2021 at 7:00 PM Casey Schaufler wrote: > On 4/9/2021 4:12 AM, Ondrej Mosnacek wrote: > > This series attempts to clean up part of the mess that has grown around > > the LSM mount option handling across different subsystems. > > > > The original motivation was to fix a NFS+SELinux bu

Re: [PATCH 0/2] vfs/security/NFS/btrfs: clean up and fix LSM option handling

2021-04-09 Thread Ondrej Mosnacek
On Fri, Apr 9, 2021 at 2:28 PM Al Viro wrote: > On Fri, Apr 09, 2021 at 01:12:52PM +0200, Ondrej Mosnacek wrote: > > This series attempts to clean up part of the mess that has grown around > > the LSM mount option handling across different subsystems. > > I would not describe growing another FS_..

Re: [PATCH 0/2] vfs/security/NFS/btrfs: clean up and fix LSM option handling

2021-04-09 Thread Casey Schaufler
On 4/9/2021 4:12 AM, Ondrej Mosnacek wrote: > This series attempts to clean up part of the mess that has grown around > the LSM mount option handling across different subsystems. > > The original motivation was to fix a NFS+SELinux bug that I found while > trying to get the NFS part of the selinux-

[PATCH] btrfs-progs: Correct check_running_fs_exclop() return value

2021-04-09 Thread Goldwyn Rodrigues
check_running_fs_exclop() can return 1 when exclop is changed to "none" The ret is set by the return value of the select() operation. Checking the exclusive op changes just the exclop variable while ret is still set to 1. Set ret exclusively if exclop is set to BTRFS_EXCL_NONE. --- common/utils.c

Re: [PATCH v8 00/39] Cleanup error handling in relocation

2021-04-09 Thread David Sterba
On Fri, Mar 12, 2021 at 03:24:55PM -0500, Josef Bacik wrote: > v7->v8: > - Reordered some of the patches, so that the callers of functions that added > new > error cases were fixed first, and then added the new error handler. > - Moved a few of the ASSERT(0) to where they made sense. Left the o

Re: unexpected -ENOMEM from percpu_counter_init()

2021-04-09 Thread Dennis Zhou
On Fri, Apr 09, 2021 at 03:36:39PM +0800, Wang Yugui wrote: > Hi, > > some question about workqueue for percpu. > > > > > > > > > And a question about this, > > > > > > > > upper caller: > > > > > > > > nofs_flag = memalloc_nofs_save(); > > > > > > > > ret = btrfs_drew_lock_init(&root->s

Re: unexpected -ENOMEM from percpu_counter_init()

2021-04-09 Thread Filipe Manana
On Fri, Apr 9, 2021 at 2:39 PM Dennis Zhou wrote: > > On Fri, Apr 09, 2021 at 12:39:38PM +0100, Filipe Manana wrote: > > On Thu, Apr 8, 2021 at 4:02 PM Dennis Zhou wrote: > > > > > > On Thu, Apr 08, 2021 at 03:28:20PM +0100, Filipe Manana wrote: > > > > On Thu, Apr 8, 2021 at 2:50 PM Dennis Zhou

Re: unexpected -ENOMEM from percpu_counter_init()

2021-04-09 Thread Dennis Zhou
On Fri, Apr 09, 2021 at 12:39:38PM +0100, Filipe Manana wrote: > On Thu, Apr 8, 2021 at 4:02 PM Dennis Zhou wrote: > > > > On Thu, Apr 08, 2021 at 03:28:20PM +0100, Filipe Manana wrote: > > > On Thu, Apr 8, 2021 at 2:50 PM Dennis Zhou wrote: > > > > > > > > On Thu, Apr 08, 2021 at 05:20:00PM +080

Re: [PATCH 0/2] vfs/security/NFS/btrfs: clean up and fix LSM option handling

2021-04-09 Thread Al Viro
On Fri, Apr 09, 2021 at 01:12:52PM +0200, Ondrej Mosnacek wrote: > This series attempts to clean up part of the mess that has grown around > the LSM mount option handling across different subsystems. I would not describe growing another FS_... flag *AND* spreading the FS_BINARY_MOUNTDATA further,

Re: unexpected -ENOMEM from percpu_counter_init()

2021-04-09 Thread Filipe Manana
On Thu, Apr 8, 2021 at 4:02 PM Dennis Zhou wrote: > > On Thu, Apr 08, 2021 at 03:28:20PM +0100, Filipe Manana wrote: > > On Thu, Apr 8, 2021 at 2:50 PM Dennis Zhou wrote: > > > > > > On Thu, Apr 08, 2021 at 05:20:00PM +0800, Wang Yugui wrote: > > > > Hi, > > > > > > > > > On Thu, Apr 08, 2021 at

Re: [PATCH v3 1/3] btrfs: discard relocated block groups

2021-04-09 Thread Filipe Manana
On Fri, Apr 9, 2021 at 11:54 AM Johannes Thumshirn wrote: > > When relocating a block group the freed up space is not discarded. On > devices like SSDs this hint is useful to tell the device the space is > freed now. On zoned block devices btrfs' discard code will reset the zone > the block group

[PATCH 2/2] selinux: fix SECURITY_LSM_NATIVE_LABELS flag handling on double mount

2021-04-09 Thread Ondrej Mosnacek
When mounting an NFS export that is a mountpoint on the host, doing the same mount a second time leads to a security_sb_set_mnt_opts() call on an already intialized superblock, which leaves the SECURITY_LSM_NATIVE_LABELS flag unset even if it's provided by the FS. NFS then obediently clears NFS_CAP

[PATCH 1/2] vfs,LSM: introduce the FS_HANDLES_LSM_OPTS flag

2021-04-09 Thread Ondrej Mosnacek
Add a new FS_HANDLES_LSM_OPTS filesystem flag to singal to VFS that the filesystem does LSM option setting for the given mount on its own, so the security_sb_set_mnt_opts() call in vfs_get_tree() can be skipped. This allows the following simplifications: 1. Removal of explicit LSM option handling

[PATCH 0/2] vfs/security/NFS/btrfs: clean up and fix LSM option handling

2021-04-09 Thread Ondrej Mosnacek
This series attempts to clean up part of the mess that has grown around the LSM mount option handling across different subsystems. The original motivation was to fix a NFS+SELinux bug that I found while trying to get the NFS part of the selinux-testsuite [1] to work, which is fixed by patch 2. Th

Re: [PATCH v2] btrfs: zoned: move superblock logging zone location

2021-04-09 Thread David Sterba
On Thu, Apr 08, 2021 at 05:25:28PM +0900, Naohiro Aota wrote: > This commit moves the location of the superblock logging zones. The new > locations of the logging zones are now determined based on fixed block > addresses instead of on fixed zone numbers. > > The old placement method based on fixed

[PATCH v3 3/3] btrfs: zoned: automatically reclaim zones

2021-04-09 Thread Johannes Thumshirn
When a file gets deleted on a zoned file system, the space freed is not returned back into the block group's free space, but is migrated to zone_unusable. As this zone_unusable space is behind the current write pointer it is not possible to use it for new allocations. In the current implementation

[PATCH v3 2/3] btrfs: rename delete_unused_bgs_mutex

2021-04-09 Thread Johannes Thumshirn
As a preparation for another user, rename the unused_bgs_mutex into reclaim_bgs_lock. Signed-off-by: Johannes Thumshirn --- fs/btrfs/block-group.c | 6 +++--- fs/btrfs/ctree.h | 2 +- fs/btrfs/disk-io.c | 6 +++--- fs/btrfs/volumes.c | 46 +---

[PATCH v3 1/3] btrfs: discard relocated block groups

2021-04-09 Thread Johannes Thumshirn
When relocating a block group the freed up space is not discarded. On devices like SSDs this hint is useful to tell the device the space is freed now. On zoned block devices btrfs' discard code will reset the zone the block group is on, freeing up the occupied space. Signed-off-by: Johannes Thumsh

[PATCH v3 0/3] btrfs: zoned: automatic BG reclaim

2021-04-09 Thread Johannes Thumshirn
When a file gets deleted on a zoned file system, the space freed is not returned back into the block group's free space, but is migrated to zone_unusable. As this zone_unusable space is behind the current write pointer it is not possible to use it for new allocations. In the current implementation

Re: [PATCH v2] btrfs: zoned: move superblock logging zone location

2021-04-09 Thread David Sterba
On Thu, Apr 08, 2021 at 10:57:32AM -0400, Josef Bacik wrote: > On 4/8/21 4:25 AM, Naohiro Aota wrote: > > confusion. > > > > Signed-off-by: Naohiro Aota > > Thanks Naohiro, this makes it much easier to understand, > > Reviewed-by: Josef Bacik > > Dave, I know you're on vacation, this needs to

Re: unexpected -ENOMEM from percpu_counter_init()

2021-04-09 Thread Wang Yugui
Hi, Dennis Zhou, Vlastimil Babka, Filipe Manana The root reason of this problem maybe the design of 'memalloc_nofs_restore()/memalloc_nofs_save()'. When some job such as memory pre-alloc and reclaim is needed, that is done in a workqueue now. This is a problem for high-load and over-load. In th

Re: unexpected -ENOMEM from percpu_counter_init()

2021-04-09 Thread Wang Yugui
Hi, Add top/free info when our applicaiton pipeline is running. > Hi, > > some question about workqueue for percpu. > > > > > > > > > And a question about this, > > > > > > > > upper caller: > > > > > > > > nofs_flag = memalloc_nofs_save(); > > > > > > > > ret = btrfs_drew_lock_init(&r

Re: unexpected -ENOMEM from percpu_counter_init()

2021-04-09 Thread Wang Yugui
Hi, some question about workqueue for percpu. > > > > > > And a question about this, > > > > > > > upper caller: > > > > > > > nofs_flag = memalloc_nofs_save(); > > > > > > > ret = btrfs_drew_lock_init(&root->snapshot_lock); > > > > > > > memalloc_nofs_restore(nofs_flag); > > > > >