Re: [PATCH 0/5] More lockdep annotations

2019-06-05 Thread Nikolay Borisov
On 31.05.19 г. 20:01 ч., David Sterba wrote: > Lockdep annotations are better than comments about necessary locks. > > David Sterba (5): > btrfs: tests: add locks around add_extent_mapping > btrfs: assert extent map tree lock in add_extent_mapping > btrfs: assert tree mod log lock in __tr

Re: [PATCH 1/3] btrfs: Introduce struct btrfs_io_geometry

2019-06-05 Thread Johannes Thumshirn
I'd merge this patch into the next one, so you only introduce btrfs_io_geometry when there are actual users for it. But that's personal preference I guess. Byte, Johannes -- Johannes ThumshirnSUSE Labs Filesystems jthumsh...@suse.de

Re: [PATCH 2/3] btrfs: Introduce btrfs_io_geometry

2019-06-05 Thread Johannes Thumshirn
And maybe this patch should be merged into the next one as well, so one can see the actual code movement between __btrfs_map_block() and btrfs_io_geometry() -- Johannes ThumshirnSUSE Labs Filesystems jthumsh...@suse.de+49 911 74053 689 S

Re: [PATCH 1/4] btrfs: Document __etree_search

2019-06-05 Thread Johannes Thumshirn
On Mon, Jun 03, 2019 at 01:05:59PM +0300, Nikolay Borisov wrote: > The function has a lot of return values and specific conventions making > it cumbersome to understand what's returned. Have a go at documenting > its parameters and return values. > > Signed-off-by: Nikolay Borisov > --- > fs/btr

Re: [PATCH 3/4] btrfs: Skip first megabyte on device when trimming

2019-06-05 Thread Johannes Thumshirn
Looks good, Reviewed-by: Johannes Thumshirn -- Johannes ThumshirnSUSE Labs Filesystems jthumsh...@suse.de+49 911 74053 689 SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg GF: Felix Imendörffer, Mary Higgins, Sri Rasiah HRB 21284 (AG Nürnb

Re: [PATCH 1/4] btrfs: Document __etree_search

2019-06-05 Thread Qu Wenruo
On 2019/6/3 下午6:05, Nikolay Borisov wrote: > The function has a lot of return values and specific conventions making > it cumbersome to understand what's returned. Have a go at documenting > its parameters and return values. > > Signed-off-by: Nikolay Borisov The idea is pretty good, will help

Re: [PATCH 2/4] btrfs: Always trim all unallocated space in btrfs_trim_free_extents

2019-06-05 Thread Qu Wenruo
On 2019/6/3 下午6:06, Nikolay Borisov wrote: > This patch removes support for range parameters of FITRIM ioctl when > trimming unallocated space on devices. This is necessary since ranges > passed from user space are generally interpreted as logical addresses, > whereas btrfs_trim_free_extents use

Re: [PATCH 3/4] btrfs: Skip first megabyte on device when trimming

2019-06-05 Thread Qu Wenruo
On 2019/6/3 下午6:06, Nikolay Borisov wrote: > Currently the first megabyte on a device housing a btrfs filesystem is > exempt from allocation and trimming. Currently this is not a problem > since 'start' is set to 1m at the beginning of btrfs_trim_free_extents > and find_first_clear_extent_bit al

Re: [PATCH 4/4] btrfs: Don't trim returned range based on input value in find_first_clear_extent_bit

2019-06-05 Thread Qu Wenruo
On 2019/6/3 下午6:06, Nikolay Borisov wrote: > Currently find_first_clear_extent_bit always returns a range whose > starting value is >= passed 'start'. This implicit trimming behavior is > somewhat subtle and an implementation detail. Instead, this patch > modifies the function such that now it a

Re: [PATCH v2] fstests: generic/260: Make it handle btrfs more gracefully

2019-06-05 Thread Nikolay Borisov
On 3.06.19 г. 9:40 ч., Qu Wenruo wrote: > If a filesystem doesn't map its logical address space (normally the > bytenr/blocknr returned by fiemap) directly to its devices(s), the > following assumptions used in the test case is no longer true: > - trim range start beyond the end of fs should fai

Re: [PATCH 3/4] btrfs: Skip first megabyte on device when trimming

2019-06-05 Thread Nikolay Borisov
On 5.06.19 г. 12:14 ч., Qu Wenruo wrote: > > > On 2019/6/3 下午6:06, Nikolay Borisov wrote: >> Currently the first megabyte on a device housing a btrfs filesystem is >> exempt from allocation and trimming. Currently this is not a problem >> since 'start' is set to 1m at the beginning of btrfs_tr

[PATCH v2] btrfs: Document __etree_search

2019-06-05 Thread Nikolay Borisov
The function has a lot of return values and specific conventions making it cumbersome to understand what's returned. Have a go at documenting its parameters and return values. Signed-off-by: Nikolay Borisov --- * Document 'tree' argument to silence error (Johaness) * Document that if a range is

Re: [PATCH v2] btrfs: Document __etree_search

2019-06-05 Thread Johannes Thumshirn
Looks good, Reviewed-by: Johannes Thumshirn -- Johannes ThumshirnSUSE Labs Filesystems jthumsh...@suse.de+49 911 74053 689 SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg GF: Felix Imendörffer, Mary Higgins, Sri Rasiah HRB 21284 (AG Nürnb

Re: [PATCH v2] fstests: generic/260: Make it handle btrfs more gracefully

2019-06-05 Thread Qu Wenruo
On 2019/6/5 下午7:16, Nikolay Borisov wrote: > > > On 3.06.19 г. 9:40 ч., Qu Wenruo wrote: >> If a filesystem doesn't map its logical address space (normally the >> bytenr/blocknr returned by fiemap) directly to its devices(s), the >> following assumptions used in the test case is no longer true:

Re: [PATCH v2] fstests: generic/260: Make it handle btrfs more gracefully

2019-06-05 Thread Nikolay Borisov
On 5.06.19 г. 14:53 ч., Qu Wenruo wrote: > > > On 2019/6/5 下午7:16, Nikolay Borisov wrote: >> >> >> On 3.06.19 г. 9:40 ч., Qu Wenruo wrote: >>> If a filesystem doesn't map its logical address space (normally the >>> bytenr/blocknr returned by fiemap) directly to its devices(s), the >>> followin

Re: [PATCH 1/4] zstd: pass pointer rathen than structure to functions

2019-06-05 Thread David Sterba
On Tue, Jun 04, 2019 at 03:43:26PM -0700, Andrew Morton wrote: > On Mon, 3 Jun 2019 14:32:03 +0530 Maninder Singh > wrote: > > > currently params structure is passed in all functions, which increases > > stack usage in all the function and lead to stack overflow on target like > > ARM with kern

Re: [PATCH v2] fstests: generic/260: Make it handle btrfs more gracefully

2019-06-05 Thread Qu Wenruo
On 2019/6/5 下午7:54, Nikolay Borisov wrote: > > > On 5.06.19 г. 14:53 ч., Qu Wenruo wrote: >> >> >> On 2019/6/5 下午7:16, Nikolay Borisov wrote: >>> >>> >>> On 3.06.19 г. 9:40 ч., Qu Wenruo wrote: If a filesystem doesn't map its logical address space (normally the bytenr/blocknr returned

Re: [PATCH 1/4] zstd: pass pointer rathen than structure to functions

2019-06-05 Thread David Sterba
On Wed, Jun 05, 2019 at 01:57:03PM +0200, David Sterba wrote: > On Tue, Jun 04, 2019 at 03:43:26PM -0700, Andrew Morton wrote: > > On Mon, 3 Jun 2019 14:32:03 +0530 Maninder Singh > > wrote: > > > > > currently params structure is passed in all functions, which increases > > > stack usage in al

Re: [PATCH 1/3] btrfs: Introduce struct btrfs_io_geometry

2019-06-05 Thread David Sterba
On Wed, Jun 05, 2019 at 09:35:33AM +0200, Johannes Thumshirn wrote: > I'd merge this patch into the next one, so you only introduce > btrfs_io_geometry when there are actual users for it. > > But that's personal preference I guess. Yeah 1+2 is a good idea, I'll to that.

Re: [PATCH] btrfs-progs: fix invalid memory write in get_fs_info()

2019-06-05 Thread David Sterba
On Mon, Jun 03, 2019 at 09:27:54AM +0800, damenly...@gmail.com wrote: > From: Su Yue > > As the link reported, btrfs fi sh may crash while a device is removing. > > valgrind reported: > == > ... > ==883== Invalid write of size 8

Re: [PATCH] btrfs-progs: Cleanup BTRFS_COMPAT_EXTENT_TREE_V0

2019-06-05 Thread David Sterba
On Wed, May 29, 2019 at 03:27:23PM +0800, Qu Wenruo wrote: > BTRFS_COMPAT_EXTENT_TREE_V0 is introduced for a short time in kernel, > and it's over 10 years ago. > > Nowadays there should be no user for that feature, and kernel has remove > this support in Jun, 2018. There is no need for btrfs-prog

Re: [PATCH] btrfs-progs: check/lowmem: Reset path in repair mode to avoid incorrect item from being passed to lowmem check.

2019-06-05 Thread David Sterba
On Fri, May 17, 2019 at 10:00:03PM +0800, Qu Wenruo wrote: > In lowmem mode, we check fs roots and free space cache by iterating > each root item and inode item, using btrfs_next_item() and a path > pointing to the root tree. > > However in repair mode, check_fs_root() can modify the fs root, thus

Re: [PATCH 2/2] btrfs-progs: tests: Test fs on image files is correctly recognised

2019-06-05 Thread David Sterba
On Thu, May 16, 2019 at 04:12:50PM +0300, Nikolay Borisov wrote: > This ensures that 'btrfs filesystem show' can correctly identify a > filesystem on a newly created local file. > > Signed-off-by: Nikolay Borisov > --- > tests/cli-tests/010-fi-show-on-new-file/test.sh | 16 Test

Re: [PATCH 1/2] btrfs-progs: Correctly open filesystem on image file

2019-06-05 Thread David Sterba
On Thu, May 16, 2019 at 04:12:49PM +0300, Nikolay Borisov wrote: > When btrfs' 'filesystem' subcommand is passed path to an image file it > currently fails since the code expects the image file is going to be > recognised by libblkid (called from btrfs_scan_devices()). This is not > the case since

Re: [PATCH 1/2] btrfs-progs: Avoid nested chunk allocation call

2019-06-05 Thread David Sterba
On Tue, Apr 16, 2019 at 06:21:43PM +0800, Qu Wenruo wrote: > There is a hidden call loop which can trigger itself: > > btrfs_reserve_extent() <--| > |- do_chunk_alloc() | >|- btrfs_alloc_chunk() | > |- btrfs_insert_item() | >|- b

Re: [PATCH 0/2] btrfs-progs: Metadata preallocation enhancement

2019-06-05 Thread David Sterba
On Tue, Apr 16, 2019 at 06:21:42PM +0800, Qu Wenruo wrote: > This patchset will address the github issue #123 to make btrfs-convert > less possible to report false ENOSPC. > > The first patch will try to avoid the nested chunk/extent tree > modification in a more explicit way. > > The 2nd patch w

Re: [PATCH 1/4] zstd: pass pointer rathen than structure to functions

2019-06-05 Thread Andrew Morton
On Wed, 5 Jun 2019 14:32:53 +0200 David Sterba wrote: > > > > > > -static ZSTD_parameters zstd_get_btrfs_parameters(unsigned int level, > > > +static ZSTD_parameters *zstd_get_btrfs_parameters(unsigned int level, > > >size_t src_len) > > > { > > > -

Re: [PATCH 1/2] btrfs-progs: Avoid nested chunk allocation call

2019-06-05 Thread Qu Wenruo
On 2019/6/6 上午12:32, David Sterba wrote: > On Tue, Apr 16, 2019 at 06:21:43PM +0800, Qu Wenruo wrote: >> There is a hidden call loop which can trigger itself: >> >> btrfs_reserve_extent() <--| >> |- do_chunk_alloc() | >>|- btrfs_alloc_chunk() | >>

Re: [PATCH] btrfs-progs: check/lowmem: Reset path in repair mode to avoid incorrect item from being passed to lowmem check.

2019-06-05 Thread Qu Wenruo
On 2019/6/6 上午12:08, David Sterba wrote: > On Fri, May 17, 2019 at 10:00:03PM +0800, Qu Wenruo wrote: >> In lowmem mode, we check fs roots and free space cache by iterating >> each root item and inode item, using btrfs_next_item() and a path >> pointing to the root tree. >> >> However in repair m