Re: Btrfs wiki, add Parrot as production user

2019-09-28 Thread David Sterba
On Fri, Sep 27, 2019 at 10:38:44PM -0400, Nicholas D Steeves wrote: > Hi David, > > David Sterba writes: > > > On Mon, Aug 26, 2019 at 06:55:47PM -0600, Chris Murphy wrote: > >> https://blog.parrotlinux.org/parrot-4-4-release-notes/ > >> > >> Loo

Re: [PATCH v2] btrfs: removed unused return variable

2019-09-30 Thread David Sterba
On Mon, Sep 30, 2019 at 06:30:21PM +0530, Aliasgar Surti wrote: > From: Aliasgar Surti > > Removed unused return variable and replaced it with returning > the value directly This change has been sent several times and I give the same answer each time: https://lore.kernel.org/linux-btrfs/2019041

[GIT PULL] Btrfs fixes for 5.4-rc2

2019-09-30 Thread David Sterba
Hi, a bunch of fixes that accumulated in recent weeks, mostly material for stable. Summary: - fix for regression from 5.3 that prevents to use balance convert with single profile - qgroup fixes: rescan race, accounting leak with multiple writers, potential leak after io failure recovery -

Re: [PATCH][v3] btrfs: use refcount_inc_not_zero in kill_all_nodes

2019-09-30 Thread David Sterba
On Thu, Sep 26, 2019 at 08:29:32AM -0400, Josef Bacik wrote: > We hit the following warning while running down a different problem > > [ 6197.175850] [ cut here ] > [ 6197.185082] refcount_t: underflow; use-after-free. > [ 6197.194704] WARNING: CPU: 47 PID: 966 at lib/refco

Re: [PATCH RFC] btrfs: relocation: Hunt down BUG_ON() in merge_reloc_roots()

2019-09-30 Thread David Sterba
On Thu, Sep 26, 2019 at 02:35:45PM +0800, Qu Wenruo wrote: > [BUG] > There is one BUG_ON() report where a transaction is aborted during > balance, then kernel BUG_ON() in merge_reloc_roots(): Do you have details from the report, eg. what's the error code? > void merge_reloc_roots(struct reloc_c

Re: [PATCH] Btrfs: fix memory leak due to concurrent append writes with fiemap

2019-09-30 Thread David Sterba
On Mon, Sep 30, 2019 at 10:20:25AM +0100, fdman...@kernel.org wrote: > From: Filipe Manana > > When we have a buffered write that starts at an offset greater than or > equals to the file's size happening concurrently with a full ranged > fiemap, we can end up leaking an extent state structure. >

Re: [PATCH] btrfs: fix incorrect updating of log root tree

2019-10-01 Thread David Sterba
On Mon, Sep 30, 2019 at 04:27:25PM -0400, Josef Bacik wrote: > We've historically had reports of being unable to mount file systems > because the tree log root couldn't be read. Usually this is the "parent > transid failure", but could be any of the related errors, including > "fsid mismatch" or "

Re: [PATCH] btrfs: fix balance convert to single on 32-bit host CPUs

2019-10-01 Thread David Sterba
On Mon, Sep 23, 2019 at 05:14:04PM +0200, David Sterba wrote: > On Thu, Sep 12, 2019 at 07:55:01PM -0400, Zygo Blaxell wrote: > > Currently, the command: > > > > btrfs balance start -dconvert=single,soft . > > > > on a Raspberry Pi produces the following k

[PATCH 0/2] Bit helpers cleanup

2019-10-01 Thread David Sterba
Depends on patch "btrfs: fix balance convert to single on 32-bit host CPUs" that's now in misc-next and cleans up the helpers as discussed at https://lore.kernel.org/linux-btrfs/20190912235507.3de79423...@james.kirk.hungrycats.org/ David Sterba (2): btrfs: add 64bit safe help

[PATCH 1/2] btrfs: add 64bit safe helper for power of two checks

2019-10-01 Thread David Sterba
As is_power_of_two takes unsigned long, it's not safe on 32bit architectures, but we could pass any u64 value in seveal places. Add a separate helper and also an alias that better expresses the purpose for which the helper is used. Signed-off-by: David Sterba --- fs/btrfs/misc.h

[PATCH 2/2] btrfs: use has_single_bit_set for clarity

2019-10-01 Thread David Sterba
Replace is_power_of_2 with the helper that is self-documenting and remove the open coded call in alloc_profile_is_valid. Signed-off-by: David Sterba --- fs/btrfs/tree-checker.c | 15 --- fs/btrfs/volumes.c | 7 +-- 2 files changed, 9 insertions(+), 13 deletions(-) diff

[PATCH 0/3] Coldify, constify, purify (function attributes)

2019-10-01 Thread David Sterba
86835 19bd33 post/btrfs.ko DELTA: -1455 Release build textdata bss dec hex filename 1079288 17316 14912 516 10f5dc pre/btrfs.ko 1078138 17316 14912 1110366 10f15e post/btrfs.ko DELTA: -1150 David Sterba (3): btrfs: add __cold attribute to more functions btrfs

[PATCH 2/3] btrfs: add const function attribute

2019-10-01 Thread David Sterba
. The effects are rather small, though, about 60 bytes decrese of btrfs.ko. Signed-off-by: David Sterba --- fs/btrfs/ctree.h | 2 +- fs/btrfs/super.c | 2 +- fs/btrfs/volumes.c | 2 +- fs/btrfs/volumes.h | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/fs/btrfs/ctree.h b/fs

[PATCH 1/3] btrfs: add __cold attribute to more functions

2019-10-01 Thread David Sterba
decrease of btrfs.ko by 1000-1300, depending on the config options. Signed-off-by: David Sterba --- fs/btrfs/disk-io.c | 4 ++-- fs/btrfs/disk-io.h | 4 ++-- fs/btrfs/super.c | 2 +- fs/btrfs/volumes.c | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/fs/btrfs/disk-io.c b/fs

[PATCH 3/3] btrfs: add __pure attribute to functions

2019-10-01 Thread David Sterba
summarize. Signed-off-by: David Sterba --- fs/btrfs/async-thread.c | 6 ++ fs/btrfs/async-thread.h | 4 ++-- fs/btrfs/ctree.c| 2 +- fs/btrfs/ctree.h| 4 ++-- fs/btrfs/dev-replace.c | 2 +- fs/btrfs/dev-replace.h | 2 +- fs/btrfs/ioctl.c| 2 +- fs/btrfs/space-info.c

Re: [PATCH] btrfs: nofs inode allocations

2019-10-01 Thread David Sterba
On Mon, Sep 09, 2019 at 05:28:11PM +0300, Nikolay Borisov wrote: > > This is because btrfs_new_inode() calls new_inode() under the > > transaction. We could probably move the new_inode() outside of this but > > for now just wrap it in memalloc_nofs_save(). > > If I'm understanding correctly what

Re: [PATCH] btrfs: nofs inode allocations

2019-10-01 Thread David Sterba
On Mon, Sep 09, 2019 at 10:12:04AM -0400, Josef Bacik wrote: > A user reported a lockdep splat > > == > WARNING: possible circular locking dependency detected > 5.2.11-gentoo #2 Not tainted > --

Re: [PATCH][v3] btrfs: add a force_chunk_alloc to space_info's sysfs

2019-10-01 Thread David Sterba
On Mon, Aug 05, 2019 at 02:31:53PM -0400, Josef Bacik wrote: > In testing various things such as the btrfsck patch to detect over > allocation of chunks, empty block group deletion, and balance I've had > various ways to force chunk allocations for debug purposes. Add a sysfs > file to enable forc

Re: [PATCH][v2] btrfs-progs: add a --check-bg-usage option to fsck

2019-10-01 Thread David Sterba
On Fri, Aug 02, 2019 at 12:09:53PM -0400, Josef Bacik wrote: > Sometimes when messing with the chunk allocator code we can end up > over-allocating chunks. Generally speaking I'll notice this when a > random xfstest fails with ENOSPC when it shouldn't, but I'm super > worried that I won't catch a

Re: [PATCH] btrfs: add device scanned-by process name in the scan message

2019-10-02 Thread David Sterba
On Wed, Oct 02, 2019 at 06:30:48PM +0800, Anand Jain wrote: > Its very helpful if we had logged the device scanner process name > to debug the race condition between the systemd-udevd scan and the > user initiated device forget command. > > This patch adds scanned-by process name to the scan messa

Re: [PATCH] btrfs: add device scanned-by process name in the scan message

2019-10-02 Thread David Sterba
On Wed, Oct 02, 2019 at 01:39:03PM +0300, Nikolay Borisov wrote: > > > On 2.10.19 г. 13:30 ч., Anand Jain wrote: > > Its very helpful if we had logged the device scanner process name > > to debug the race condition between the systemd-udevd scan and the > > user initiated device forget command. >

Re: [PATCH 0/3] Relocation/backref cache cleanups

2019-10-02 Thread David Sterba
On Fri, Sep 06, 2019 at 10:15:30AM -0700, Mark Fasheh wrote: > Hi, > > Relocation caches extent backrefs in an rbtree (the 'backref cache'). The > following patches move the backref cache code out of relocation.c and into > it's own file. We then do a straight-forward cleanup the main backref ca

Re: [PATCH 1/2] btrfs: transaction: Add comment for btrfs transaction lifespan

2019-10-02 Thread David Sterba
l variant start_transaction() functions > - Relationship to transaction N+1 > > This doesn't provide much tech details, but just a cheat sheet for > reader to get into the code a little easier. > > Signed-off-by: Qu Wenruo Great, thanks. Reviewed-by: David Sterba

Re: [PATCH 2/2] btrfs: transaction: Cleanup unused TRANS_STATE_BLOCKED

2019-10-02 Thread David Sterba
e") the > state is completely removed. > > So we can just clean up the state since it's only compared but never > set. > > Signed-off-by: Qu Wenruo Reviewed-by: David Sterba

Re: [PATCHSET v3 btrfs/for-next] btrfs: fix cgroup writeback support

2019-10-02 Thread David Sterba
On Fri, Sep 06, 2019 at 10:46:56AM -0700, Tejun Heo wrote: > On Thu, Sep 05, 2019 at 01:59:37PM +0200, David Sterba wrote: > > On Fri, Jul 26, 2019 at 05:13:21PM +0200, David Sterba wrote: > > > On Wed, Jul 10, 2019 at 12:28:13PM -0700, Tejun Heo wrote: > > > > T

Re: [PATCH] btrfs: fix uninitialized ret in ref-verify

2019-10-02 Thread David Sterba
> ret and think there was an errror. Fix this by initializing ret to 0. > > Reported-by: Colin Ian King > Signed-off-by: Josef Bacik Reviewed-by: David Sterba Added to misc-next, thanks.

Re: [PATCH v2] btrfs: Properly handle backref_in_log retval

2019-10-03 Thread David Sterba
On Thu, Sep 26, 2019 at 01:39:58PM +0300, Nikolay Borisov wrote: > >> - if (backref_in_log(log_root, &search_key, dirid, name, name_len)) > >> + ret = backref_in_log(log_root, &search_key, dirid, name, name_len); > >> + if (ret == 1) > >> return true; > > > > This

Re: [PATCH v2] btrfs: Properly handle backref_in_log retval

2019-10-03 Thread David Sterba
On Thu, Oct 03, 2019 at 02:55:59PM +0200, David Sterba wrote: > On Thu, Sep 26, 2019 at 01:39:58PM +0300, Nikolay Borisov wrote: > > >> - if (backref_in_log(log_root, &search_key, dirid, name, name_len)) > > >> + ret = backref_in_log(log_root, &search

Re: [PATCH] btrfs: add device scanned-by process name in the scan message

2019-10-03 Thread David Sterba
On Wed, Oct 02, 2019 at 06:30:48PM +0800, Anand Jain wrote: > Its very helpful if we had logged the device scanner process name > to debug the race condition between the systemd-udevd scan and the > user initiated device forget command. > > This patch adds scanned-by process name to the scan messa

[PATCH] btrfs: drop unused parameter is_new from btrfs_iget

2019-10-03 Thread David Sterba
The parameter is now always set to NULL and could be dropped. The last user was get_default_root but that got reworked in 05dbe6837b60 ("Btrfs: unify subvol= and subvolid= mounting") and the parameter became unused. Signed-off-by: David Sterba --- fs/btrfs/ctree.h| 5

Re: [PATCH 1/3] btrfs: add __cold attribute to more functions

2019-10-04 Thread David Sterba
On Wed, Oct 02, 2019 at 01:52:16PM +0300, Nikolay Borisov wrote: > On 1.10.19 г. 20:57 ч., David Sterba wrote: > > The attribute can mark functions supposed to be called rarely if at all > > and the text can be moved to sections far from the other code. The > > attribute has

Re: [PATCH 2/3] btrfs: add const function attribute

2019-10-04 Thread David Sterba
On Wed, Oct 02, 2019 at 02:07:50PM +0300, Nikolay Borisov wrote: > > +struct list_head * __attribute_const__ btrfs_get_fs_uuids(void) > > I'm not entirely sure this function is cons. According to the manual: > > Calls to functions whose return value is not affected by changes to the > observable

Re: [PATCH 2/3] btrfs: code cleanup for compression type

2019-10-06 Thread David Sterba
On Sat, Oct 05, 2019 at 01:17:35PM +0800, Chengguang Xu wrote: > Let BTRFS_COMPRESS_TYPES represents the total number > of cmpressoin types and fix related calling places. > It will be more safe when adding new compression type > in the future. I think we're not going to add a new type anytime soo

Re: [PATCH 3/3] btrfs: using enum to replace macro

2019-10-06 Thread David Sterba
On Sat, Oct 05, 2019 at 01:17:36PM +0800, Chengguang Xu wrote: > using enum to replace macro definition for extent > types. > > Signed-off-by: Chengguang Xu > --- > fs/btrfs/tree-checker.c | 4 ++-- > include/uapi/linux/btrfs_tree.h | 10 ++ > 2 files changed, 8 insertions(+), 6

Re: [PATCH] btrfs: fix Wmaybe-uninitialized warning

2019-10-07 Thread David Sterba
On Tue, Sep 03, 2019 at 12:30:19PM +0900, Austin Kim wrote: > gcc throws warning message as below: > > ‘clone_src_i_size’ may be used uninitialized in this function > [-Wmaybe-uninitialized] > #define IS_ALIGNED(x, a) (((x) & ((typeof(x))(a) - 1)) == 0) >^ > fs/btrfs/send

Re: [PATCH 0/3] Relocation/backref cache cleanups

2019-10-07 Thread David Sterba
On Wed, Oct 02, 2019 at 02:58:55PM +0200, David Sterba wrote: > On Fri, Sep 06, 2019 at 10:15:30AM -0700, Mark Fasheh wrote: > > Hi, > > > > Relocation caches extent backrefs in an rbtree (the 'backref cache'). The > > following patches move the backref ca

Re: [PATCH 1/3] btrfs: tree-checker: Fix false alerts on log trees

2019-10-07 Thread David Sterba
On Fri, Oct 04, 2019 at 03:15:51PM +0100, Filipe Manana wrote: > On Fri, Oct 4, 2019 at 11:27 AM Qu Wenruo wrote: > > Reported-by: David Sterba > > Fixes: 59b0d030fb30 ("btrfs: tree-checker: Try to detect missing > > INODE_ITEM") > > So this is bogus, si

Re: [PATCH v6] btrfs-progs: add xxhash64 to mkfs

2019-10-07 Thread David Sterba
On Mon, Oct 07, 2019 at 07:11:17PM +0800, Qu Wenruo wrote: > On 2019/9/26 下午6:11, Johannes Thumshirn wrote: > > Signed-off-by: Johannes Thumshirn > > --- > > Not related to the patchset itself, but it would be pretty nice if we > check the sysfs interface to guess if we can mount the fs. > > And

Re: [PATCH 1/3] btrfs: remove unnecessary hash_init()

2019-10-07 Thread David Sterba
On Sat, Oct 05, 2019 at 01:17:34PM +0800, Chengguang Xu wrote: > hash_init() is not necessary in btrfs_props_init(), > so remove it. The part that explains why it's not necessary is missing in the changelo. And looking what hash_init and plain DEFINE_HASHTABLE does I don't think that removing hash

Re: [PATCH 3/4] btrfs: sysfs: export supported checksums

2019-10-07 Thread David Sterba
On Mon, Oct 07, 2019 at 06:36:14PM +0300, Nikolay Borisov wrote: > > > On 7.10.19 г. 12:11 ч., Johannes Thumshirn wrote: > > From: David Sterba > > > > Export supported checksum algorithms via sysfs. > > > > Co-developed-by: David Sterba

Re: [PATCH] btrfs-progs: add sha256 as supported checksumming algorithm

2019-10-07 Thread David Sterba
On Mon, Oct 07, 2019 at 01:13:26PM +0200, Johannes Thumshirn wrote: > Signed-off-by: Johannes Thumshirn Please write even a short changelog. The patch adds the definition and allows the new hash in mkfs, that's beyond what I'd consider trivial that a subject would be sufficient. I wrote something

Re: [PATCH 0/3] btrfs: tree-checker: False alerts fixes for log trees

2019-10-07 Thread David Sterba
On Fri, Oct 04, 2019 at 05:31:30PM +0800, Qu Wenruo wrote: > There is a false alerts of tree-checker when running fstests/btrfs/063 > in a loop. > > The bug is caused by commit 59b0d030fb30 ("btrfs: tree-checker: Try to detect > missing INODE_ITEM"). > For the full error analyse, please check the

Re: [PATCH 4/5] btrfs: remove identified alien device in open_fs_devices

2019-10-07 Thread David Sterba
On Mon, Oct 07, 2019 at 09:37:49PM +0800, Qu Wenruo wrote: > > > On 2019/10/7 下午9:30, Nikolay Borisov wrote: > > > > > > On 7.10.19 г. 12:45 ч., Anand Jain wrote: > >> Following test case explains it all, even though the degraded mount is > >> successful the btrfs-progs fails to report the missin

Re: [PATCH v3 0/5] btrfs: fix issues due to alien device

2019-10-07 Thread David Sterba
On Mon, Oct 07, 2019 at 05:45:10PM +0800, Anand Jain wrote: > v3: Fix alien device is due to wipefs in Patch4. > Fix a nit in Patch3. > Patches are reordered. > > Alien device is a device in fs_devices list having a different fsid than > the expected fsid or no btrfs_magic. This patch set

Re: [PATCH v3] btrfs-progs: add verbose option to btrfs device scan

2019-10-07 Thread David Sterba
On Wed, Oct 02, 2019 at 12:11:52PM +0800, Anand Jain wrote: > To help debug device scan issues, add verbose option to btrfs device scan. The common options like --verbose are going to be added into the global command so I'd rather avoid adding them to new subcommands as this would become unnecessa

Re: [PATCH] Setup GitLab-CI for btrfs-progs

2019-10-07 Thread David Sterba
On Mon, Sep 30, 2019 at 10:26:54PM +0530, Lakshmipathi.G wrote: > Make use of GitLab-CI nested virutal environment to start QEMU instance > inside containers > and perform btrfs-progs build, execute unit test cases and save the logs. This looks good, thanks! > More details can be found at https:

[PATCH 0/5] Remove extent_map::bdev

2019-10-07 Thread David Sterba
meter lighter. This has survived several fstests runs David Sterba (5): btrfs: assert extent_map bdevs and lookup_map and split btrfs: get bdev from latest_dev for dio bh_result btrfs: drop bio_set_dev where not needed btrfs: remove extent_map::bdev btrfs: drop bdev argument

[PATCH 1/5] btrfs: assert extent_map bdevs and lookup_map and split

2019-10-07 Thread David Sterba
n will not change. The lookup map pointer misused bdev, this has been changed in commit 95617d69326c ("btrfs: cleanup, stop casting for extent_map->lookup everywhere") to the explicit type. But the semantics hasn't changed and bdev was not actually used to decide if maps are merg

[PATCH 5/5] btrfs: drop bdev argument from submit_extent_page

2019-10-07 Thread David Sterba
After previous patches removing bdev being passed around to set it to bio, it has become unused in submit_extent_page. So it now has "only" 13 parameters. Signed-off-by: David Sterba --- fs/btrfs/extent_io.c | 11 +++ 1 file changed, 3 insertions(+), 8 deletions(-) diff

[PATCH 4/5] btrfs: remove extent_map::bdev

2019-10-07 Thread David Sterba
We can now remove the bdev from extent_map. Previous patches made sure that bio_set_dev is correctly in all places and that we don't need to grab it from latest_bdev or pass it around inside the extent map. Signed-off-by: David Sterba --- fs/btrfs/disk-io.c| 3 --- fs/btrfs/extent

[PATCH 3/5] btrfs: drop bio_set_dev where not needed

2019-10-07 Thread David Sterba
and fixup eventually, and for that all bdev management is independent * raid56: rbio_add_io_page, for the RMW write * integrity-checker: does it's own low-level block tracking Signed-off-by: David Sterba --- fs/btrfs/compression.c | 10 -- fs/btrfs/extent_io.c | 2 -- 2 files

[PATCH 2/5] btrfs: get bdev from latest_dev for dio bh_result

2019-10-07 Thread David Sterba
we do them in btrfs code before any call to DIO. We can't pass NULL because there are dereferences of bdev in __blockdev_direct_IO, even though it's not going to be used later. So it's safe to pass any valid bdev that's used within the filesystem. Signed-off-by: David Sterba -

Re: [PATCH v2 3/3] btrfs-progs: check: Cleanup all checkpatch error and warning

2018-02-01 Thread David Sterba
On Thu, Feb 01, 2018 at 10:28:13AM +0200, Nikolay Borisov wrote: > >>> @@ -3175,7 +3184,8 @@ static int check_extent_data_backref(struct > >>> btrfs_fs_info *fs_info, > >>>   btrfs_header_owner(leaf) != root_id) > >>>   goto next; > >>>   btrfs_item_key_to_cpu(leaf,

Re: [PATCH v2 0/3] btrfs-progs: Split lowmem mode check to its own

2018-02-01 Thread David Sterba
On Thu, Feb 01, 2018 at 02:45:38PM +0800, Qu Wenruo wrote: > As usual, the main part is over 500K so the biggest patch won't reach > mail list. > Please fetch the whole branch from github: > https://github.com/adam900710/btrfs-progs/tree/split_check Thanks, patches added to devel, with some more a

Re: [PATCH 04/26] libbtrfsutil: add btrfs_util_is_subvolume() and btrfs_util_subvolume_id()

2018-02-01 Thread David Sterba
On Tue, Jan 30, 2018 at 08:54:08AM +0200, Nikolay Borisov wrote: > > > On 29.01.2018 23:43, Omar Sandoval wrote: > > On Mon, Jan 29, 2018 at 12:24:26PM +0200, Nikolay Borisov wrote: > >> On 26.01.2018 20:40, Omar Sandoval wrote: > > [snip] > >>> +/* > >>> + * This intentionally duplicates btrfs_u

Re: [PATCH 25/26] btrfs-progs: deprecate libbtrfs helpers with libbtrfsutil equivalents

2018-02-02 Thread David Sterba
On Fri, Jan 26, 2018 at 10:41:13AM -0800, Omar Sandoval wrote: > From: Omar Sandoval > > The old libbtrfs defines some helpers which do the same thing as some > libbtrfsutil helpers. Reimplement the libbtrfs helpers in terms of the > libbtrfsutil APIs and mark the libbtrfs versions as deprecated,

Re: [RESEND PATCH] btrfs: Fix UAF when cleaning up fs_devs with a single stale device

2018-02-02 Thread David Sterba
On Tue, Jan 30, 2018 at 04:07:37PM +0200, Nikolay Borisov wrote: > Commit 4fde46f0cc71 ("Btrfs: free the stale device") introduced > btrfs_free_stale_device which iterates the device lists for all > registered btrfs filesystems and deletes those devices which aren't > mounted. In a btrfs_devices st

Re: [PATCH] btrfs: print error if primary super block write fails

2018-02-02 Thread David Sterba
On Fri, Jan 26, 2018 at 02:47:09PM -0800, Howard McLauchlan wrote: > Presently, failing a primary super block write but succeeding in at > least one super block write in general will appear to users as if > nothing important went wrong. However, upon unmounting and re-mounting, > the file system wi

Re: [PATCH] btrfs: Streamline btrfs_delalloc_reserve_metadata initial operations

2018-02-02 Thread David Sterba
On Tue, Jan 30, 2018 at 04:47:54PM +0200, Nikolay Borisov wrote: > On 30.01.2018 16:34, David Sterba wrote: > > On Fri, Jan 12, 2018 at 04:21:05PM +0200, Nikolay Borisov wrote: > >> @@ -6062,19 +6062,19 @@ int btrfs_delalloc_reserve_metadata(struct > >> btrfs_

Re: [PATCH v2] btrfs: Remove btrfs_inode::delayed_iput_count

2018-02-02 Thread David Sterba
d to count the number of iputs. So let's just remove the unused > member and all unused code. This patch essentially provides no > functional changes. While at it, also add proper documentation for > btrfs_add_delayed_iput > > Signed-off-by: Nikolay Borisov Reviewed-by: Da

Re: [PATCH 1/2] libcrc32c: Add crc32c_impl function

2018-02-02 Thread David Sterba
Adding linux-cry...@vger.kernel.org to CC Link to the 2/2 patch https://patchwork.kernel.org/patch/10149203/ On Mon, Jan 08, 2018 at 11:45:04AM +0200, Nikolay Borisov wrote: > This function returns a string with the currently in-use implementation > of the crc32c algorithm, i.e crc32c-generic (fo

Re: [PATCH 2/2] btrfs: Remove custom crc32c init code

2018-02-02 Thread David Sterba
On Mon, Jan 08, 2018 at 11:45:05AM +0200, Nikolay Borisov wrote: > The custom crc32 init code was introduced in > 14a958e678cd ("Btrfs: fix btrfs boot when compiled as built-in") to > enable using btrfs as a built-in. However, later as pointed out by > 60efa5eb2e88 ("Btrfs: use late_initcall instea

Re: [PATCH RESEND 4/4] btrfs: Remove btrfs_fs_info::open_ioctl_trans

2018-02-02 Thread David Sterba
On Wed, Jan 10, 2018 at 06:32:13PM +0200, Nikolay Borisov wrote: > Since userspace transaction have been removed we no longer have use > for this field so delete it. > > Signed-off-by: Nikolay Borisov Reviewed-by: David Sterba -- To unsubscribe from this list: send the line "

Re: [PATCH RESEND 1/4] btrfs: Remove userspace transaction ioctls

2018-02-02 Thread David Sterba
On Wed, Jan 10, 2018 at 06:32:10PM +0200, Nikolay Borisov wrote: > Commit 3558d4f88ec8 ("btrfs: Deprecate userspace transaction ioctls") > marked the beginning of the end of userspace transaction. This commit > finishes the job! > > Signed-off-by: Nikolay Borisov

Re: [PATCH RESEND 3/4] btrfs: Remove transaction handle from btrfs_file_private

2018-02-02 Thread David Sterba
On Wed, Jan 10, 2018 at 06:32:12PM +0200, Nikolay Borisov wrote: > Since we no longer support userspace transaction there is no need to > keep this member variable, so remove it. > > Signed-off-by: Nikolay Borisov Reviewed-by: David Sterba -- To unsubscribe from this list: s

Re: [PATCH RESEND 2/4] btrfs: Remove code referencing unused TRANS_USERSPACE

2018-02-02 Thread David Sterba
On Wed, Jan 10, 2018 at 06:32:11PM +0200, Nikolay Borisov wrote: > Now that the userspace transaction ioctls have been removed, > TRANS_USERSPACE is no longer used hence we can remove it. > > Signed-off-by: Nikolay Borisov Reviewed-by: David Sterba > -struct btr

Re: [PATCH RESEND 1/4] btrfs: Remove userspace transaction ioctls

2018-02-02 Thread David Sterba
On Wed, Jan 10, 2018 at 06:32:10PM +0200, Nikolay Borisov wrote: > Commit 3558d4f88ec8 ("btrfs: Deprecate userspace transaction ioctls") > marked the beginning of the end of userspace transaction. This commit > finishes the job! > > Signed-off-by: Nikolay Borisov This does not compile without th

Re: [RFC PATCH v2 2/4] btrfs-progs: Add EXEC represent path of executable file

2018-02-02 Thread David Sterba
On Fri, Feb 02, 2018 at 04:34:03PM +0800, Gu Jinxiang wrote: > Use EXEC instead of TOP to represent the path of excutable file. > EXEC is set to TOP by default, but when there is no excutable file > in TOP, use the path where btrfs is install as EXEC. What if we just allow to change TOP (ie. do no

Re: [RFC PATCH v2 3/4] btrfs-progs: Modify rootdir files when use mkfs.btrfs

2018-02-02 Thread David Sterba
On Fri, Feb 02, 2018 at 04:34:04PM +0800, Gu Jinxiang wrote: > Since there is no $TOP/Documentation file after package the testsuite. > So use a common file that is usually exsits. > > Signed-off-by: Gu Jinxiang > --- > tests/misc-tests/002-uuid-rewrite/test.sh | 4 ++-- > tests/misc-tests

Re: [RFC PATCH v2 0/4] Add support for export testsuits

2018-02-02 Thread David Sterba
On Fri, Feb 02, 2018 at 04:34:01PM +0800, Gu Jinxiang wrote: > Achieved: > 1. export testsuit by: > $ make EXPORT=/where/you/want/to/generate/tests.tar.gz package > relative path and absolute path both be ok. > Besides tests itself, fssum and btrfs-corrupt-block will also be > included in tests.ta

Re: [PATCH v2 1/4] btrfs: Remove userspace transaction ioctls

2018-02-05 Thread David Sterba
On Mon, Feb 05, 2018 at 05:52:52PM +0900, Wang Shilong wrote: >These ioctl are originally introduced by Sage Weil for Ceph use? > Not sure whether it still useful, Cc Sage just in case. We have checked that the ioctl is not used in ceph, the reasons why we think it's ok to remove the ioctl wer

Re: [RFC PATCH v2 2/4] btrfs-progs: Add EXEC represent path of executable file

2018-02-05 Thread David Sterba
On Sat, Feb 03, 2018 at 09:07:47AM +, Gu, Jinxiang wrote: > > > > -Original Message- > > From: David Sterba [mailto:dste...@suse.cz] > > Sent: Saturday, February 03, 2018 2:08 AM > > To: Gu, Jinxiang/顾 金香 > > Cc: linux-btrfs@vger.kernel.org; dst

Re: [PATCH v3] btrfs: print error if primary super block write fails

2018-02-05 Thread David Sterba
On Fri, Feb 02, 2018 at 11:19:59AM -0800, Howard McLauchlan wrote: > On 02/02/2018 11:09 AM, Howard McLauchlan wrote: > > Presently, failing a primary super block write but succeeding in at > > least one super block write in general will appear to users as if > > nothing important went wrong. Howev

Re: [PATCH v3] btrfs: print error if primary super block write fails

2018-02-05 Thread David Sterba
On Mon, Feb 05, 2018 at 02:45:21PM +0800, Anand Jain wrote: > On 02/05/2018 02:38 PM, Anand Jain wrote: > > On 02/03/2018 03:09 AM, Howard McLauchlan wrote: > >> Presently, failing a primary super block write but succeeding in at > >> least one super block write in general will appear to users as i

Re: [PATCH v2] btrfs: handle failure of add_pending_csums

2018-02-05 Thread David Sterba
. On read > > this > > could lead to the filesystem erroring out due to crc mismatch. Fix it by > > propagating failure from add_pending_csums and handling them > > > > Signed-off-by: Nikolay Borisov > > Reviewed-by: Josef Bacik Reviewed-by: David Sterb

Re: [PATCH 2/2] btrfs: Remove custom crc32c init code

2018-02-05 Thread David Sterba
On Fri, Feb 02, 2018 at 09:46:40PM +0200, Andy Shevchenko wrote: > On Mon, Jan 8, 2018 at 11:45 AM, Nikolay Borisov wrote: > > The custom crc32 init code was introduced in > > 14a958e678cd ("Btrfs: fix btrfs boot when compiled as built-in") to > > enable using btrfs as a built-in. However, later a

Re: [PATCH 0/2] Remove custom crc32c init code from btrfs

2018-02-05 Thread David Sterba
On Mon, Jan 08, 2018 at 11:45:03AM +0200, Nikolay Borisov wrote: > So here is a small 2 patch set which removes btrfs' manual initialisation of > the lower level crc32c module. Explanation why is ok can be found in Patch > 2/2. > > Patch 1/2 just adds a function to the generic crc32c header whic

Re: [PATCH] btrfs-progs: fsck-tests: Cleanup the restored image for 028

2018-02-06 Thread David Sterba
On Tue, Feb 06, 2018 at 03:31:42PM +0800, Qu Wenruo wrote: > Signed-off-by: Qu Wenruo Applied, thanks. -- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html

Re: [PATCH][btrfs-next] btrfs: remove redundant check on ret and goto

2018-02-06 Thread David Sterba
On Fri, Jan 12, 2018 at 04:52:58PM +, Colin King wrote: > From: Colin Ian King > > The check for a non-zero ret is redundant as the goto will jump to > the very next statement anyway. Remove this extraneous code. > > Detected by CoverityScan, CID#1463784 ("Identical code for different > bra

Re: [PATCH v3 1/2] btrfs: use enum instead of constant value

2018-02-06 Thread David Sterba
On Thu, Jan 11, 2018 at 04:12:17PM +0800, Gu Jinxiang wrote: > populate_free_space_tree calls function btrfs_search_slot_for_read with > parameter int find_higher = 1, it means that, if no exact match is found, > then use the next higher item. > So in function populate_free_space_tree, use READA_FO

Re: [PATCH][btrfs-next] Btrfs: extent map selftest: add missing void parameter to btrfs_test_extent_map

2018-02-06 Thread David Sterba
On Mon, Jan 08, 2018 at 11:06:32PM +, Colin King wrote: > From: Colin Ian King > > Add a missing void parameter to function btrfs_test_extent_map, fixes > sparse warning: > > warning: non-ANSI function declaration of function 'btrfs_test_extent_map' > > Signed-off-by: Colin Ian King Added

Re: [PATCH v2] btrfs: Handle btrfs_set_extent_delalloc failure in relocate_file_extent_cluster

2018-02-06 Thread David Sterba
On Wed, Jan 31, 2018 at 05:14:02PM +0200, Nikolay Borisov wrote: > Essentially duplicate the error handling from the above block which > handles the !PageUptodate(page) case and additionally clear > EXTENT_BOUNDARY. > > Signed-off-by: Nikolay Borisov > Reviewed-by: Josef Bacik Added to next, th

Re: [PATCH v3] btrfs: not a disk error if the bio_add_page fails

2018-02-06 Thread David Sterba
located the bio, so both of those failures can't > occur. So drop the check for fail. Which would also drop write error > statistics. > > Signed-off-by: Anand Jain Reviewed-by: David Sterba -- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the b

Re: [PATCH] btrfs-progs: tests common: remove meaningless colon in extract_image()

2018-02-07 Thread David Sterba
On Wed, Feb 07, 2018 at 05:57:43PM +0800, Su Yue wrote: > The colon is meaningless so remove it. > > Signed-off-by: Su Yue Applied, thanks. -- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to majord...@vger.kernel.org More majordomo info at http

Re: [PATCH] btrfs-progs: ctree: Add extra level check for read_node_slot()

2018-02-07 Thread David Sterba
On Wed, Feb 07, 2018 at 05:18:25PM +0800, Qu Wenruo wrote: > Strangely, we have level check in btrfs_print_tree() while we don't have > the same check in read_node_slot(). > > That's to say, for the following corruption, btrfs_search_slot() or > btrfs_next_leaf() can return invalid leaf: > > Pare

Re: [PATCH v4 2/3] btrfs-progs: introduce TEST_TOP for resources except binaries

2018-02-07 Thread David Sterba
On Tue, Feb 06, 2018 at 01:37:24PM +0800, Gu Jinxiang wrote: > Use TEST_TOP for tests/common, Documentation, images, and internal > binaries. Well, the point of TEST_TOP was also to remove the /tests/ subdirectory from the paths if it's inside git and to set it to the top directory where the expor

Re: [PATCH 1/3] btrfs-progs: add prerequisite mkfs.btrfs for test-cli

2018-02-08 Thread David Sterba
On Thu, Feb 08, 2018 at 01:08:56PM +0800, Gu Jinxiang wrote: > Since tests/cli-tests/002-balance-full-no-filters/test.sh need > the mkfs.btrfs for prerequisite. > So add the dependency in Makefile. > > Signed-off-by: Gu Jinxiang 1-3 applied, thanks. -- To unsubscribe from this list: send the lin

Re: [PATCH v5 0/3] Add support for export testsuits

2018-02-08 Thread David Sterba
On Thu, Feb 08, 2018 at 02:34:17PM +0800, Gu Jinxiang wrote: > Achieved: > 1. export testsuite by: > $ make testsuite > files list in testsuites-list will be added into tarball > btrfs-progs-tests.tar.gz. > > 2. after decompress btrfs-progs-tests.tar.gz, run test by: > $ TEST=`MASK` ./tests/mkf

Re: [PATCH] btrfs-progs: print-tree: fix INODE_ITEM sequence and flags

2018-02-12 Thread David Sterba
On Mon, Feb 12, 2018 at 11:21:26PM +0800, Anand Jain wrote: > dump-tree prints wrong sequence number and the flags numbers, > as we misplaced the printf args. This patch fixes it. > > Signed-off-by: Anand Jain Applied, thanks. -- To unsubscribe from this list: send the line "unsubscribe linux-bt

Re: [PATCH] btrfs: use set functions to update latest refs to the SB

2018-02-12 Thread David Sterba
On Mon, Feb 12, 2018 at 11:37:49PM +0800, Anand Jain wrote: > We have btrfs_set_super...() to set the various values, so just use it. Sorry but this is not "just use it", as it fixes an endianness bug and should be documented in the changelog. And there are probably more instances of the bug while

Re: [PATCH] btrfs: fix extent_buffer_uptodate() return

2018-02-12 Thread David Sterba
On Mon, Feb 12, 2018 at 11:34:56PM +0800, Anand Jain wrote: > extent_buffer_uptodate() returns from test_bit() which is of > type bool, so update extent_buffer_uptodate() to it. The return value of test_bit differes by architecture, there are several that return int. You probably refer to x86 that

Re: [PATCH 0/3] cleanup btrfs_dev_replace_cancel()

2018-02-12 Thread David Sterba
On Mon, Feb 12, 2018 at 11:33:28PM +0800, Anand Jain wrote: > Anand Jain (3): > btrfs: open code btrfs_dev_replace_cancel() > btrfs: rename __btrfs_dev_replace_cancel() > btrfs: change the return arg type for btrfs_dev_replace_cancel() 1-3 look good, Reviewed-by: David S

Re: [PATCH 1/1] btrfs: open code btrfs_init_dev_replace_tgtdev_for_resume()

2018-02-12 Thread David Sterba
On Mon, Feb 12, 2018 at 11:36:25PM +0800, Anand Jain wrote: > btrfs_init_dev_replace_tgtdev_for_resume() initializes replace > target device in few simple steps, so do it at the parent function. > Moreover, there isn't any other caller so just open code it. Makes sense, Revi

Re: [PATCH] btrfs: verify max_inline mount parameter

2018-02-12 Thread David Sterba
On Mon, Feb 12, 2018 at 11:35:46PM +0800, Anand Jain wrote: > We aren't verifying the parameter passed to the max_inline mount option, > so we won't report and fail the mount if a junk value is specified for > example, -o max_inline=abc. > This patch converts the max_inline option to %d and checks

Re: [PATCH 00/14] Misc transaction cleanups

2018-02-12 Thread David Sterba
On Wed, Feb 07, 2018 at 05:55:36PM +0200, Nikolay Borisov wrote: > Here are a bunch of transaction-related cleanups all of them present no > functional changes. The first 2 patches could be more interesting - the first > one moves trans_release_metadata to transaction.c and makes it static and the

Re: [PATCH] btrfs: Move qgroup rescan on quota enable to btrfs_quota_enable

2018-02-12 Thread David Sterba
On Sat, Feb 03, 2018 at 11:30:42AM +0800, Qu Wenruo wrote: > > > On 2018年01月31日 16:52, Nikolay Borisov wrote: > > Currently btrfs_run_qgroups is doing a bit too much. Not only is it > > responsible for synchronizing in-memory state of qgroups to disk but > > it also contains code to trigger the i

Re: [PATCH][btrfs-next] Btrfs: extent map selftest: fix non-ANSI btrfs_test_extent_map declaration

2018-02-12 Thread David Sterba
On Thu, Feb 08, 2018 at 02:13:27PM +, Colin King wrote: > From: Colin Ian King > > The function btrfs_test_extent_map requires a void argument to be ANSI C > compliant and so it matches the prototype in fs/btrfs/tests/btrfs-tests.h > > Cleans up sparse warning: > fs/btrfs/tests/extent-map-te

Re: btrfs-progs: compile with musl libc

2018-02-13 Thread David Sterba
On Tue, Feb 13, 2018 at 01:25:10PM +, Dan Robertson wrote: > Ensure that limits.h is included in mkfs/main.c as PATH_MAX is used. The lack > of this currently causes btrfs-progs to fail to compile when the systems libc > is musl. > From 7859e0d01778e844ae0fcbefe55581277ce7cab3 Mon Sep 17 00:00

Re: [PATCH] btrfs: manage thread_pool mount option as %u

2018-02-13 Thread David Sterba
On Tue, Feb 13, 2018 at 05:34:56PM +0200, Nikolay Borisov wrote: > >>> diff --git a/fs/btrfs/super.c b/fs/btrfs/super.c > >>> index 02c7766e6849..8112619cac95 100644 > >>> --- a/fs/btrfs/super.c > >>> +++ b/fs/btrfs/super.c > >>> @@ -346,7 +346,7 @@ static const match_table_t tokens = { > >>>  

Re: [PATCH] btrfs: manage subvolid mount option as %u

2018-02-13 Thread David Sterba
On Tue, Feb 13, 2018 at 05:50:43PM +0800, Anand Jain wrote: > As -o subvolid mount option is an u64 manage it as %u for > token verifications, instead of %s. > > Signed-off-by: Anand Jain > --- > fs/btrfs/super.c | 23 ++- > 1 file changed, 10 insertions(+), 13 deletions(-) >

<    8   9   10   11   12   13   14   15   16   17   >