[PATCH] btrfs: Fix a C compliance issue

2018-06-15 Thread Bart Van Assche
The C programming language does not allow to use preprocessor statements inside macro arguments (pr_info() is defined as a macro). Hence rework the pr_info() statement in btrfs_print_mod_info() such that it becomes compliant. This patch allows tools like sparse to analyze the BTRFS source code.

Re: [PATCH] btrfs-progs: detect zoned disks and prevent their raw use

2018-06-15 Thread Luis R. Rodriguez
On Fri, Jun 15, 2018 at 01:59:37PM -0700, Luis R. Rodriguez wrote: > +static int is_zoned_disk(char *file) > +{ > + char str[PATH_MAX]; > + char *devname = basename(file); > + FILE *f; > + int len; > + > + len = snprintf(str, sizeof(str), "/sys/block/%s/queue/zoned", devname);

[PATCH] btrfs-progs: detect zoned disks and prevent their raw use

2018-06-15 Thread Luis R. Rodriguez
Using raw zoned disks by filesystems requires special handling, only f2fs currently supports this. All other filesystems do not support dealing with zoned disks directly. As such using raw zoned disks is not supported by btrfs-progs, to use them you need to use dm-zoned-tools, format them with

Re: ntfs -> qemu -> raw-image -> btrfs -> iscsi

2018-06-15 Thread ein
On 06/15/2018 08:10 PM, Austin S. Hemmelgarn wrote: > On 2018-06-15 13:40, Chris Murphy wrote: >> On Fri, Jun 15, 2018 at 5:33 AM, ein wrote: >>> Hello group, >>> >>> does anyone have had any luck with hosting qemu kvm images resided on BTRFS >>> filesystem while serving >>> the volume via

Re: ntfs -> qemu -> raw-image -> btrfs -> iscsi

2018-06-15 Thread Austin S. Hemmelgarn
On 2018-06-15 13:40, Chris Murphy wrote: On Fri, Jun 15, 2018 at 5:33 AM, ein wrote: Hello group, does anyone have had any luck with hosting qemu kvm images resided on BTRFS filesystem while serving the volume via iSCSI? I encouraged some unidentified problem and I am able to replicate it.

Re: ntfs -> qemu -> raw-image -> btrfs -> iscsi

2018-06-15 Thread Chris Murphy
On Fri, Jun 15, 2018 at 5:33 AM, ein wrote: > Hello group, > > does anyone have had any luck with hosting qemu kvm images resided on BTRFS > filesystem while serving > the volume via iSCSI? > > I encouraged some unidentified problem and I am able to replicate it. > Basically the NTFS filesystem

Re: [PATCH 2/2] Btrfs: sync log after logging new name

2018-06-15 Thread Filipe Manana
On Fri, Jun 15, 2018 at 4:54 PM, David Sterba wrote: > On Mon, Jun 11, 2018 at 07:24:28PM +0100, fdman...@kernel.org wrote: >> From: Filipe Manana >> Fixes: 12fcfd22fe5b ("Btrfs: tree logging unlink/rename fixes") >> Reported-by: Vijay Chidambaram >> Signed-off-by: Filipe Manana > > There are

Re: [PATCH 2/2] Btrfs: sync log after logging new name

2018-06-15 Thread David Sterba
On Mon, Jun 11, 2018 at 07:24:28PM +0100, fdman...@kernel.org wrote: > From: Filipe Manana > Fixes: 12fcfd22fe5b ("Btrfs: tree logging unlink/rename fixes") > Reported-by: Vijay Chidambaram > Signed-off-by: Filipe Manana There are some warnings and possible lock up caused by this patch, the

Btrfs progs release 4.17

2018-06-15 Thread David Sterba
Hi, btrfs-progs version 4.17 have been released. There's no change since rc1 and released one day later becasue Friday is the perfect day for a release. Changes: * check * many lowmem mode improvements * properly report qgroup mismatch errors * check symlinks with append/immutable

ntfs -> qemu -> raw-image -> btrfs -> iscsi

2018-06-15 Thread ein
Hello group, does anyone have had any luck with hosting qemu kvm images resided on BTRFS filesystem while serving the volume via iSCSI? I encouraged some unidentified problem and I am able to replicate it. Basically the NTFS filesystem inside RAW image gets corrupted every time when Windows

[PATCH 0/6] Freespace tree repair support

2018-06-15 Thread Nikolay Borisov
Hello, This patchset adds support to btrfs check to repair corrupted freespace tree. Once this has been merged then we can start thinking of making the freespace tree the default freespace cache and deprecate the existing v1 cache in new filesystems. This series depend on the already sent

[PATCH 1/6] btrfs-progs: Add support for freespace tree in btrfs_read_fs_root

2018-06-15 Thread Nikolay Borisov
For completeness sake add code to btrfs_read_fs_root so that it can handle the freespace tree. Signed-off-by: Nikolay Borisov --- disk-io.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/disk-io.c b/disk-io.c index 8da6e3ce5fc8..9ad826b83b3e 100644 --- a/disk-io.c +++ b/disk-io.c @@

[PATCH 5/6] btrfs-progs: check: Add support for freespace tree fixing

2018-06-15 Thread Nikolay Borisov
Now that all the prerequisite code for proper support of free space tree repair is in, it's time to wire it in. This is achieved by first hooking the freespace tree to the __free_extent/alloc_reserved_tree_block functions. And then introducing a wrapper function to contains the existing

[PATCH 6/6] btrfs-progs: tests: Test for FST corruption detection/repair

2018-06-15 Thread Nikolay Borisov
Simple test case which preps a filesystem, then corrupts the FST and finally repairs it. Tests both extent based and bitmap based FSTs. Signed-off-by: Nikolay Borisov --- tests/fsck-tests/035-freespacetree-repair/test.sh | 79 +++ 1 file changed, 79 insertions(+) create

[PATCH 4/6] btrfs-progs: Add freespace tree as compat_ro supported feature

2018-06-15 Thread Nikolay Borisov
The RO_FREE_SPACE_TREE(_VALID) flags are required in order to be able to open an FST filesystem in repair mode. Add them to BTRFS_FEATURE_COMPAT_RO_SUPP. Signed-off-by: Nikolay Borisov --- ctree.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ctree.h b/ctree.h index

[PATCH 3/6] btrfs-progs: Pull free space tree related code from kernel

2018-06-15 Thread Nikolay Borisov
To help implement free space tree checker in user space some kernel function are necessary, namely iterating/deleting/adding freespace items, some internal search functions. Functions to populate a block group based on the extent tree. The code is largely copy/paste from the kernel with locking

[PATCH 2/6] btrfs-progs: Add extent buffer bitmap manipulation infrastructure

2018-06-15 Thread Nikolay Borisov
Those functions are in preparation for adding the freespace tree repair code since it needs to be able to deal with bitmap based fsts. This patch adds extent_buffer_bitmap_set and extent_buffer_bitmap_clear functions. Since in userspace we don't have to deal with page mappings their implementation