Re: [PATCH] btrfs: ioctl: Try to use btrfs_fs_info instead of *file

2019-10-10 Thread Nikolay Borisov
On 11.10.19 г. 3:23 ч., Marcos Paulo de Souza wrote: > Some functions are doing some bikeshedding to reach the btrfs_fs_info > struct. Change these functions to receive a btrfs_fs_info struct instead > of a *file. > > Signed-off-by: Marcos Paulo de Souza Changes seems pretty self-explanatory

Re: rsync -ax and subvolumes

2019-10-10 Thread Ulli Horlacher
On Thu 2019-10-10 (20:47), Kai Krakow wrote: > Actually, you could also just bind-mount into /mnt/btrfs, bind-mounts > won't inherit other mounts but will still see pure subvolumes. Next problem: root@ptm1:~# sysinfo System:Linux ptm1 4.4.180-94.100-default x86_64 Distribution: SUSE Li

Re: [PULL REQUEST] btrfs-progs: For next merge window

2019-10-10 Thread Qu Wenruo
On 2019/10/11 上午12:17, David Sterba wrote: > On Thu, Oct 10, 2019 at 04:59:32PM +0800, Qu Wenruo wrote: >> This patchset can be fetched from github: >> https://github.com/adam900710/btrfs-progs/tree/for_next >> Which is based on devel branch, with the following HEAD: > > Thanks for putting the b

Re: [PATCH] btrfs: ioctl: Try to use btrfs_fs_info instead of *file

2019-10-10 Thread Anand Jain
(cleaned up cc list - I didn't want to clutter others inboxes with my review). On 10/11/19 8:23 AM, Marcos Paulo de Souza wrote: Some functions are doing some bikeshedding to reach the btrfs_fs_info struct. Change these functions to receive a btrfs_fs_info struct instead of a *file. Signed-off

[PATCH] btrfs: ioctl: Try to use btrfs_fs_info instead of *file

2019-10-10 Thread Marcos Paulo de Souza
Some functions are doing some bikeshedding to reach the btrfs_fs_info struct. Change these functions to receive a btrfs_fs_info struct instead of a *file. Signed-off-by: Marcos Paulo de Souza --- The kernel survived btrfs-progs tests with this patch applied. fs/btrfs/ioctl.c | 36 +

Re: rsync -ax and subvolumes

2019-10-10 Thread Ulli Horlacher
On Thu 2019-10-10 (20:47), Kai Krakow wrote: > > I run into the problem that "rsync -ax" sees btrfs subvolumes as "other > > filesystems" and ignores them. > > I worked around it by mounting the btrfs-pool at a special directory: > > mount -o subvolid=0 /dev/disk/by-label/rootfs /mnt/btrfs-pool

Re: rsync -ax and subvolumes

2019-10-10 Thread Kai Krakow
Hi! Am Do., 10. Okt. 2019 um 19:32 Uhr schrieb Ulli Horlacher : > > I run into the problem that "rsync -ax" sees btrfs subvolumes as "other > filesystems" and ignores them. I worked around it by mounting the btrfs-pool at a special directory: mount -o subvolid=0 /dev/disk/by-label/rootfs /mnt/bt

rsync -ax and subvolumes

2019-10-10 Thread Ulli Horlacher
I run into the problem that "rsync -ax" sees btrfs subvolumes as "other filesystems" and ignores them. framstag@tux:~: rsync -h | grep one-file-system -x, --one-file-system don't cross filesystem boundaries How could I tell rsync to include btrfs subvolumes, but exclude other mounted files

Re: [PATCH 19/19] btrfs: make smaller extents more likely to go into bitmaps

2019-10-10 Thread Josef Bacik
On Mon, Oct 07, 2019 at 04:17:50PM -0400, Dennis Zhou wrote: > It's less than ideal for small extents to eat into our extent budget, so > force extents <= 32KB into the bitmaps save for the first handful. > > Signed-off-by: Dennis Zhou Reviewed-by: Josef Bacik Thanks, Josef

Re: [PATCH 18/19] btrfs: increase the metadata allowance for the free_space_cache

2019-10-10 Thread Josef Bacik
On Mon, Oct 07, 2019 at 04:17:49PM -0400, Dennis Zhou wrote: > Currently, there is no way for the free space cache to recover from > being serviced by purely bitmaps because the extent threshold is set to > 0 in recalculate_thresholds() when we surpass the metadata allowance. > > This adds a recov

Re: [PATCH 17/19] btrfs: add async discard header

2019-10-10 Thread Josef Bacik
On Mon, Oct 07, 2019 at 04:17:48PM -0400, Dennis Zhou wrote: > Give a brief overview for how async discard is implemented. > > Signed-off-by: Dennis Zhou > --- Reviewed-by: Josef Bacik Thanks, Josef

Re: [PATCH 16/19] btrfs: keep track of discard reuse stats

2019-10-10 Thread Josef Bacik
On Mon, Oct 07, 2019 at 04:17:47PM -0400, Dennis Zhou wrote: > Keep track of how much we are discarding and how often we are reusing > with async discard. > > Signed-off-by: Dennis Zhou Reviewed-by: Josef Bacik Thanks, Josef

Re: [PATCH 15/19] btrfs: load block_groups into discard_list on mount

2019-10-10 Thread Josef Bacik
On Mon, Oct 07, 2019 at 04:17:46PM -0400, Dennis Zhou wrote: > Async discard doesn't remember the discard state of a block_group when > unmounting or when we crash. So, any block_group that is not fully used > may have undiscarded regions. However, free space caches are read in on > demand. Let the

Re: [PATCH] btrfs: use bool argument in free_root_pointers()

2019-10-10 Thread David Sterba
On Thu, Oct 10, 2019 at 10:39:25AM +0800, Anand Jain wrote: > We don't need int argument bool shall do in free_root_pointers(). > And rename the argument as it confused two people. > > Signed-off-by: Anand Jain Added to misc-next, thanks.

Re: [PATCH] btrfs-progs: unbreak btrfs-sb-mod compilation

2019-10-10 Thread David Sterba
On Thu, Oct 10, 2019 at 04:09:49PM +0200, Johannes Thumshirn wrote: > Fix compiler warnings and errors in btrfs-sb-mod due to incorrect > conversion with the checksum updates. > > Signed-off-by: Johannes Thumshirn > --- Applied, thnanks.

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

2019-10-10 Thread David Sterba
On Thu, Oct 10, 2019 at 03:59:56PM +0800, Chengguang Xu wrote: > DEFINE_HASHTABLE itself has already included initialization code, > we don't have to call hash_init() again, so remove it. > > Signed-off-by: Chengguang Xu 1-3 added to misc-next, with minor updates. Thanks.

Re: [PATCH 14/19] btrfs: only keep track of data extents for async discard

2019-10-10 Thread Josef Bacik
On Mon, Oct 07, 2019 at 04:17:45PM -0400, Dennis Zhou wrote: > As mentioned earlier, discarding data can be done either by issuing an > explicit discard or implicitly by reusing the LBA. Metadata chunks see > much more frequent reuse due to well it being metadata. So instead of > explicitly discard

Re: [PATCH 13/19] btrfs: have multiple discard lists

2019-10-10 Thread Josef Bacik
On Mon, Oct 07, 2019 at 04:17:44PM -0400, Dennis Zhou wrote: > Non-block group destruction discarding currently only had a single list > with no minimum discard length. This can lead to caravaning more > meaningful discards behind a heavily fragmented block group. > > This adds support for multipl

Re: [PATCH] Btrfs: add missing extents release on file extent cluster relocation error

2019-10-10 Thread David Sterba
On Thu, Oct 10, 2019 at 09:13:43AM +0200, Johannes Thumshirn wrote: > On 09/10/2019 18:43, fdman...@kernel.org wrote: > > From: Filipe Manana > > > > If we error out when finding a page at relocate_file_extent_cluster(), we > > need to release the outstanding extents counter on the relocation ino

Re: [PATCH] btrfs: Rename btrfs_join_transaction_nolock

2019-10-10 Thread David Sterba
On Tue, Oct 08, 2019 at 08:43:06PM +0300, Nikolay Borisov wrote: > This function is used only during the final phase of freespace cache > writeout. This is necessary since using the plain btrfs_join_transaction > api is deadlock prone. The deadlock looks like: > > T1: > btrfs_commit_Transaction >

Re: [PATCH] btrfs: User assert to document transaction requirement

2019-10-10 Thread David Sterba
On Tue, Oct 08, 2019 at 04:26:16PM +0300, Nikolay Borisov wrote: > Using an ASSERT in btrfs_pin_extent allows to more stringently observe > whether the function is called under a transaction or not. > > Signed-off-by: Nikolay Borisov Added to misc-next, thanks.

Re: [PULL REQUEST] btrfs-progs: For next merge window

2019-10-10 Thread David Sterba
On Thu, Oct 10, 2019 at 04:59:32PM +0800, Qu Wenruo wrote: > This patchset can be fetched from github: > https://github.com/adam900710/btrfs-progs/tree/for_next > Which is based on devel branch, with the following HEAD: Thanks for putting the branch together, I've been too busy with kernel work so

Re: [PATCH 12/19] btrfs: limit max discard size for async discard

2019-10-10 Thread Josef Bacik
On Mon, Oct 07, 2019 at 04:17:43PM -0400, Dennis Zhou wrote: > Throttle the maximum size of a discard so that we can provide an upper > bound for the rate of async discard. While the block layer is able to > split discards into the appropriate sized discards, we want to be able > to account more ac

Re: [PATCH 2/3] btrfs: Don't use objectid_mutex during mount

2019-10-10 Thread David Sterba
On Thu, Oct 10, 2019 at 06:06:46PM +0300, Nikolay Borisov wrote: > Since the filesystem is not well formed and no trees are loaded it's > pointless holding the objectid_mutex. Just remove its usage. Yes. There's a case when the lock should be kept even in that phase, so we could add a lockdep ass

Re: [PATCH 11/19] btrfs: add bps discard rate limit

2019-10-10 Thread Josef Bacik
On Mon, Oct 07, 2019 at 04:17:42PM -0400, Dennis Zhou wrote: > Provide an ability to rate limit based on mbps in addition to the iops > delay calculated from number of discardable extents. > > Signed-off-by: Dennis Zhou > --- > fs/btrfs/ctree.h | 2 ++ > fs/btrfs/discard.c | 11 +++ >

Re: [GIT PULL] Btrfs fixes for 5.4-rc3

2019-10-10 Thread pr-tracker-bot
The pull request you sent on Thu, 10 Oct 2019 16:48:51 +0200: > git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux.git for-5.4-rc2-tag has been merged into torvalds/linux.git: https://git.kernel.org/torvalds/c/f8779876d4a79d243870a5b5d60009e4ec6f22f4 Thank you! -- Deet-doot-dot, I am a

Re: [PATCH 10/19] btrfs: calculate discard delay based on number of extents

2019-10-10 Thread Josef Bacik
On Mon, Oct 07, 2019 at 04:17:41PM -0400, Dennis Zhou wrote: > Use the number of discardable extents to help guide our discard delay > interval. This value is reevaluated every transaction commit. > > Signed-off-by: Dennis Zhou > --- > fs/btrfs/ctree.h | 2 ++ > fs/btrfs/discard.c | 3

Re: [PATCH 09/19] btrfs: keep track of discardable_bytes

2019-10-10 Thread Josef Bacik
On Mon, Oct 07, 2019 at 04:17:40PM -0400, Dennis Zhou wrote: > Keep track of this metric so that we can understand how ahead or behind > we are in discarding rate. > > Signed-off-by: Dennis Zhou Same comment as the discard_extents patch. Thanks, Josef

Re: [PATCH 08/19] btrfs: track discardable extents for asnyc discard

2019-10-10 Thread Josef Bacik
On Mon, Oct 07, 2019 at 04:17:39PM -0400, Dennis Zhou wrote: > The number of discardable extents will serve as the rate limiting metric > for how often we should discard. This keeps track of discardable extents > in the free space caches by maintaining deltas and propagating them to > the global co

Re: [PATCH 07/19] btrfs: discard one region at a time in async discard

2019-10-10 Thread Josef Bacik
On Mon, Oct 07, 2019 at 04:17:38PM -0400, Dennis Zhou wrote: > The prior two patches added discarding via a background workqueue. This > just piggybacked off of the fstrim code to trim the whole block at once. > Well inevitably this is worse performance wise and will aggressively > overtrim. But it

[PATCH 1/3] btrfs: Factor out tree roots initialization during mount

2019-10-10 Thread Nikolay Borisov
The code responsible for reading and initilizing tree roots is scattered in open_ctree among 2 labels, emulating a loop. This is rather confusing to reason about. Instead, factor the code in a new function, init_tree_roots which implements the same logical flow. Signed-off-by: Nikolay Borisov ---

[PATCH 3/3] btrfs: Jump to correct label on init_root_trees failure

2019-10-10 Thread Nikolay Borisov
During the refactoring and introduction of init_root_trees the code retained the special handling of 'next_root_backup' failure by returning -ESPIPE from init_root_trees and jumping to fail_block_groups. This is wrong because next_root_backup doesn't tinker with blockgroups at all and so any failu

[PATCH 2/3] btrfs: Don't use objectid_mutex during mount

2019-10-10 Thread Nikolay Borisov
Since the filesystem is not well formed and no trees are loaded it's pointless holding the objectid_mutex. Just remove its usage. Signed-off-by: Nikolay Borisov --- fs/btrfs/disk-io.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c index b850988023aa

[PATCH 0/3] Cleanups in mount path

2019-10-10 Thread Nikolay Borisov
Following the misunderstanding around the 2nd argument of free_root_pointers it became apparent that the relevant code in open_ctre is not entirely clear. That's mainly due it being split among 2 labels, emulating a loop. This series cleans that up by factoring it out in a discrete function, init

Re: [PATCH 06/19] btrfs: handle empty block_group removal

2019-10-10 Thread Josef Bacik
On Mon, Oct 07, 2019 at 04:17:37PM -0400, Dennis Zhou wrote: > block_group removal is a little tricky. It can race with the extent > allocator, the cleaner thread, and balancing. The current path is for a > block_group to be added to the unused_bgs list. Then, when the cleaner > thread comes around

[GIT PULL] Btrfs fixes for 5.4-rc3

2019-10-10 Thread David Sterba
Hi, a few more stabitly fixes, one build warning fix. Changes: - fix inode allocation under NOFS context - fix leak in fiemap due to concurrent append writes - fix log-root tree updates - fix balance convert of single profile on 32bit architectures - silence false positive warning on old GCC

Re: [PATCH 05/19] btrfs: add the beginning of async discard, discard workqueue

2019-10-10 Thread Josef Bacik
On Mon, Oct 07, 2019 at 04:17:36PM -0400, Dennis Zhou wrote: > When discard is enabled, everytime a pinned extent is released back to > the block_group's free space cache, a discard is issued for the extent. > This is an overeager approach when it comes to discarding and helping > the SSD maintain

Re: [PATCH 04/19] btrfs: keep track of cleanliness of the bitmap

2019-10-10 Thread Josef Bacik
On Mon, Oct 07, 2019 at 04:17:35PM -0400, Dennis Zhou wrote: > There is a cap in btrfs in the amount of free extents that a block group > can have. When it surpasses that threshold, future extents are placed > into bitmaps. Instead of keeping track of if a certain bit is trimmed or > not in a secon

[PATCH] btrfs-progs: unbreak btrfs-sb-mod compilation

2019-10-10 Thread Johannes Thumshirn
Fix compiler warnings and errors in btrfs-sb-mod due to incorrect conversion with the checksum updates. Signed-off-by: Johannes Thumshirn --- btrfs-sb-mod.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/btrfs-sb-mod.c b/btrfs-sb-mod.c index 348991b39451..ad143ca05aa6

Re: [PATCH 03/19] btrfs: keep track of which extents have been discarded

2019-10-10 Thread Josef Bacik
On Mon, Oct 07, 2019 at 06:38:10PM -0400, Dennis Zhou wrote: > On Mon, Oct 07, 2019 at 04:37:28PM -0400, Josef Bacik wrote: > > On Mon, Oct 07, 2019 at 04:17:34PM -0400, Dennis Zhou wrote: > > > Async discard will use the free space cache as backing knowledge for > > > which extents to discard. Thi

Apply For Financial investment at a lower rate 2%

2019-10-10 Thread Coryna Rizky Amelia, SST
-- Hello, We are private lenders based in UK. Do you need a loan (credit) as soon as possible. Are you in search of money to solve your personal needs or finance your business venture, then get Your desired loan today! Consult us at Sunrise Funding Ltd. * We offer personal loan & huge capital lo

[PULL REQUEST] btrfs-progs: For next merge window

2019-10-10 Thread Qu Wenruo
This patchset can be fetched from github: https://github.com/adam900710/btrfs-progs/tree/for_next Which is based on devel branch, with the following HEAD: commit d928fcabc8aed32b5ccab71220abcff9bffac377 (david/devel) Author: David Sterba Date: Mon Oct 7 18:23:52 2019 +0200 btrfs-progs: add

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

2019-10-10 Thread Chengguang Xu
In order to keep coding style consistency, set BTRFS_NR_COMPRESS_TYPES to the total number of cmpressoin type and fix related calling places. Signed-off-by: Chengguang Xu --- v1->v2: - Modify change log. - Explicitly specify value for enum. - Change the BTRFS_COMPRESS_TYPES to BTRFS_NR_COMPRESS_T

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

2019-10-10 Thread Chengguang Xu
DEFINE_HASHTABLE itself has already included initialization code, we don't have to call hash_init() again, so remove it. Signed-off-by: Chengguang Xu --- v1->v2: - Modify change log to explain why hash_init() is not needed. fs/btrfs/props.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/f

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

2019-10-10 Thread Chengguang Xu
Using enum to replace macro definition of extent types. Signed-off-by: Chengguang Xu --- v1->v2: - Explicitly specify value for enum. - Change the name BTRFS_FILE_EXTENT_TYPES to BTRFS_NR_FILE_EXTENT_TYPES. fs/btrfs/tree-checker.c | 4 ++-- include/uapi/linux/btrfs_tree.h | 10 ++--

[PATCH RESEND] btrfs-progs: btrfstune -M|m drop test_uuid_unique

2019-10-10 Thread Anand Jain
It's common to copy/snapshot an OS image to run another instance of the OS. A duplicate fsid can't be mounted on the same system unless the fsid is changed by using btrfstune -m. However in some circumstances the image needs to go back to the original fsid /metadata_uuid. As of now btrfstune -M f

Re: [PATCH] Btrfs: add missing extents release on file extent cluster relocation error

2019-10-10 Thread Johannes Thumshirn
On 09/10/2019 18:43, fdman...@kernel.org wrote: > From: Filipe Manana > > If we error out when finding a page at relocate_file_extent_cluster(), we > need to release the outstanding extents counter on the relocation inode, > set by the previous call to btrfs_delalloc_reserve_metadata(), otherwise

Re: [PATCH v3 1/3] btrfs: block-group: Fix a memory leak due to missing btrfs_put_block_group()

2019-10-10 Thread Johannes Thumshirn
Reviewed-by: Johannes Thumshirn -- Johannes ThumshirnSUSE Labs Filesystems jthumsh...@suse.de+49 911 74053 689 SUSE Software Solutions Germany GmbH Maxfeldstr. 5 90409 Nürnberg Germany (HRB 247165, AG München) Key fingerprint = EC38 9CA

Re: [PATCH v2 0/4] btrfs-progs: fix clone from wrong subvolume

2019-10-10 Thread Qu Wenruo
On 2019/9/5 上午4:35, Omar Sandoval wrote: > On Mon, Jul 22, 2019 at 12:15:01PM -0700, Omar Sandoval wrote: >> From: Omar Sandoval >> >> This is v2 of [1]. Changes from v1: >> >> - Split out removing commented-out code to new patch 1 and removed a >> related comment block. >> - Made subvol_path