Re: [PATCH man-pages] Document encoded I/O

2019-10-21 Thread Amir Goldstein
On Mon, Oct 21, 2019 at 9:54 PM Omar Sandoval wrote: > > On Mon, Oct 21, 2019 at 09:18:13AM +0300, Amir Goldstein wrote: > > CC: Ted > > > > What ever happened to read/write ext4 encrypted data API? > > https://marc.info/?l=linux-ext4&m=145030599010416&w=2 > > > > Can we learn anything from the ex

Re: [PATCH v2 0/7] btrfs-progs: Support for BG_TREE feature

2019-10-21 Thread Qu Wenruo
BTW, there is one important compatibility problem related to all the BGI related features. Although I'm putting the BG_TREE feature as incompatible feature, but in theory, it should be RO compatible. As except extent/bg tree, we *should* read the fs without any problem. But the problem is, curre

Re: [RFC PATCH v2 2/5] fs: add RWF_ENCODED for reading/writing compressed data

2019-10-21 Thread Aleksa Sarai
On 2019-10-21, Darrick J. Wong wrote: > On Tue, Oct 22, 2019 at 05:38:31AM +1100, Aleksa Sarai wrote: > > On 2019-10-21, Darrick J. Wong wrote: > > > On Tue, Oct 15, 2019 at 11:42:40AM -0700, Omar Sandoval wrote: > > > > From: Omar Sandoval > > > > > > > > Btrfs supports transparent compression

[PATCH 0/2] btrfs-progs: Setting implicit-fallthrough by default

2019-10-21 Thread Marcos Paulo de Souza
From: Marcos Paulo de Souza While compiling btrfs-progs using clang I found an issue using __attribute__(fallthrough), which does not seems to work in clang. To solve this issue, the code was changed to use /* fallthrough */, which is the same notation adopted by linux kernel. Once these places

[PATCH 1/2] btrfs-progs: utils: Replace __attribute__(fallthrough)

2019-10-21 Thread Marcos Paulo de Souza
From: Marcos Paulo de Souza When compiling with clang, this warning is shown: common/utils.c:404:3: warning: declaration does not declare anything [-Wmissing-declarations] __attribute__ ((fallthrough)); This attribute seems to silence the same warning in GCC. Changing this attr

[PATCH 2/2] btrfs-progs: Makefile: Add -Wimplicit-fallthrough

2019-10-21 Thread Marcos Paulo de Souza
From: Marcos Paulo de Souza Avoid introducing new cases of implicit fallthrough by having this flag always set. Signed-off-by: Marcos Paulo de Souza --- Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/Makefile b/Makefile index 21bf2717..2f04e880 100644 --- a/Makefile +++ b/Makefil

Re: [RFC PATCH 00/14] btrfs-progs: global-verbose option

2019-10-21 Thread Anand Jain
On 10/22/19 12:12 AM, David Sterba wrote: On Mon, Oct 21, 2019 at 06:01:08PM +0800, Anand Jain wrote: This patch set brings --verbose option to the top level btrfs command, such as 'btrfs --verbose'. With this we don't have to add or remember verbose option at the sub-commands level. As ther

Re: [RFC PATCH v2 2/5] fs: add RWF_ENCODED for reading/writing compressed data

2019-10-21 Thread Aleksa Sarai
On 2019-10-21, Darrick J. Wong wrote: > On Tue, Oct 22, 2019 at 05:38:31AM +1100, Aleksa Sarai wrote: > > On 2019-10-21, Darrick J. Wong wrote: > > > On Tue, Oct 15, 2019 at 11:42:40AM -0700, Omar Sandoval wrote: > > > > From: Omar Sandoval > > > > > > > > Btrfs supports transparent compression

Re: [PATCH v2 0/7] btrfs-progs: Support for BG_TREE feature

2019-10-21 Thread Qu Wenruo
On 2019/10/21 下午11:44, David Sterba wrote: > On Sat, Oct 19, 2019 at 08:04:51AM +0800, Qu Wenruo wrote: >> That's wonderful. >> Although I guess my patchset should provide the hint of where to modify >> the code, since there are only a limited number of places we modify >> block group item. > >

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

2019-10-21 Thread Anand Jain
On 10/21/19 9:43 PM, David Sterba wrote: On Tue, Oct 15, 2019 at 11:29:34AM +0800, Anand Jain wrote: I was thinking there might be some common code between the sub-commands in btrfs-progs now or in future, and if the printf() due to verbose is required in one sub-command and the same

Re: MD RAID 5/6 vs BTRFS RAID 5/6

2019-10-21 Thread Zygo Blaxell
On Mon, Oct 21, 2019 at 05:27:54PM +0200, Edmund Urbani wrote: > On 10/16/19 9:42 PM, Zygo Blaxell wrote: > > > > For raid5 I'd choose btrfs -draid5 -mraid1 over mdadm raid5 > > sometimes--even with the write hole, I'd expect smaller average data > > losses than mdadm raid5 + write hole mitigation

Re: [RFC PATCH v2 2/5] fs: add RWF_ENCODED for reading/writing compressed data

2019-10-21 Thread Omar Sandoval
On Mon, Oct 21, 2019 at 11:28:06AM -0700, Darrick J. Wong wrote: > On Tue, Oct 15, 2019 at 11:42:40AM -0700, Omar Sandoval wrote: > > From: Omar Sandoval > > > > Btrfs supports transparent compression: data written by the user can be > > compressed when written to disk and decompressed when read

Re: [RFC PATCH v2 0/5] fs: interface for directly reading/writing compressed data

2019-10-21 Thread Omar Sandoval
On Mon, Oct 21, 2019 at 10:05:01AM +1100, Dave Chinner wrote: > On Tue, Oct 15, 2019 at 11:42:38AM -0700, Omar Sandoval wrote: > > From: Omar Sandoval > > > > Hello, > > > > This series adds an API for reading compressed data on a filesystem > > without decompressing it as well as support for wr

Re: [RFC PATCH v2 2/5] fs: add RWF_ENCODED for reading/writing compressed data

2019-10-21 Thread Darrick J. Wong
On Tue, Oct 22, 2019 at 05:38:31AM +1100, Aleksa Sarai wrote: > On 2019-10-21, Darrick J. Wong wrote: > > On Tue, Oct 15, 2019 at 11:42:40AM -0700, Omar Sandoval wrote: > > > From: Omar Sandoval > > > > > > Btrfs supports transparent compression: data written by the user can be > > > compressed

Re: [PATCH man-pages] Document encoded I/O

2019-10-21 Thread Omar Sandoval
On Mon, Oct 21, 2019 at 09:18:13AM +0300, Amir Goldstein wrote: > CC: Ted > > What ever happened to read/write ext4 encrypted data API? > https://marc.info/?l=linux-ext4&m=145030599010416&w=2 > > Can we learn anything from the ext4 experience to improve > the new proposed API? I wasn't aware of

Re: [RFC PATCH v2 2/5] fs: add RWF_ENCODED for reading/writing compressed data

2019-10-21 Thread Aleksa Sarai
On 2019-10-21, Darrick J. Wong wrote: > On Tue, Oct 15, 2019 at 11:42:40AM -0700, Omar Sandoval wrote: > > From: Omar Sandoval > > > > Btrfs supports transparent compression: data written by the user can be > > compressed when written to disk and decompressed when read back. > > However, we'd li

Re: [RFC PATCH v2 2/5] fs: add RWF_ENCODED for reading/writing compressed data

2019-10-21 Thread Darrick J. Wong
On Tue, Oct 15, 2019 at 11:42:40AM -0700, Omar Sandoval wrote: > From: Omar Sandoval > > Btrfs supports transparent compression: data written by the user can be > compressed when written to disk and decompressed when read back. > However, we'd like to add an interface to write pre-compressed data

Re: [RFC PATCH v2 5/5] btrfs: implement RWF_ENCODED writes

2019-10-21 Thread Omar Sandoval
On Mon, Oct 21, 2019 at 03:14:52PM +0200, David Sterba wrote: > On Fri, Oct 18, 2019 at 03:55:13PM -0700, Omar Sandoval wrote: > > > > + nr_pages = (disk_num_bytes + PAGE_SIZE - 1) >> PAGE_SHIFT; > > > > > > nit: nr_pages = DIV_ROUND_UP(disk_num_bytes, PAGE_SIZE) > > > > disk_num_bytes is a

[PATCH 3/4] btrfs-progs: add blake2b support

2019-10-21 Thread David Sterba
Add definition, crypto wrappers and support to mkfs for blake2 for checksumming. There are 2 aliases either blake2 or blake2b. Signed-off-by: David Sterba --- cmds/inspect-dump-super.c | 1 + crypto/hash.c | 12 crypto/hash.h | 1 + ctree.c

[PATCH 3/4] btrfs-progs: add blake2b reference implementation

2019-10-21 Thread David Sterba
Upstream commit 997fa5ba1e14b52c554fb03ce39e579e6f27b90c, git repository: git://github.com/BLAKE2/BLAKE2 The reference implemetation added in this patch is unchanged and will be modified only to compile in current code base and with minimal other modifications in case of future sync with upstream

More checksumming algorithms for btrfs

2019-10-21 Thread David Sterba
The work to add more checksums is nearly finished, we're now in a good state to let interested users do some testing and benchmarking. New hashes: xxhash64, sha256, blake2b-256 Quick start: git://github.com/kdave/btrfs-devel preview/checksums-5 (build with CRYPTO_BLAKE2B=m) git://github.c

[PATCH 2/2] btrfs: add blake2b to checksumming algorithms

2019-10-21 Thread David Sterba
Add blake2b (with 256 bit digest) to the list of possible checksumming algorithms used by BTRFS. Signed-off-by: David Sterba --- fs/btrfs/ctree.c| 2 ++ fs/btrfs/disk-io.c | 1 + fs/btrfs/super.c| 1 + include/uapi/linux/btrfs_tree.h | 1 + 4 files ch

[PATCH 1/2] btrfs: add member for a specific checksum driver

2019-10-21 Thread David Sterba
Currently all the checksum algorithms generate a fixed size digest size and we use it. The on-disk format can hold up to BTRFS_CSUM_SIZE bytes and BLAKE2b produces digest of 512 bits by default. We can't do that and will use the blake2b-256, this needs to be passed to the crypto API. Separate tha

[PATCH 0/2 + 0/2] Add BLAKE2 checksumming support

2019-10-21 Thread David Sterba
The two patches apply on top of Johaness' series adding SHA256. To make it actually work the patch adding BLAKE2 to kernel is needed. You can find it here (v5) https://patchwork.kernel.org/patch/11188109/ . WARNING: This is for testing only! All in one can be pulled from git://github.com/kdave

Re: [RFC PATCH 00/14] btrfs-progs: global-verbose option

2019-10-21 Thread David Sterba
On Mon, Oct 21, 2019 at 06:01:08PM +0800, Anand Jain wrote: > This patch set brings --verbose option to the top level btrfs command, > such as 'btrfs --verbose'. With this we don't have to add or remember > verbose option at the sub-commands level. > > As there are already verbose options to 11 su

Re: [PATCH 0/3] btrfs-progs: Add check and repair for invalid inode generation

2019-10-21 Thread Ferry Toth
Op 20-10-2019 om 16:24 schreef Ferry Toth: Op 20-10-2019 om 16:11 schreef Qu Wenruo: On 2019/10/20 下午9:29, Ferry Toth wrote: Op 20-10-2019 om 15:15 schreef Qu WenRuo: On 2019/10/20 下午9:04, Ferry Toth wrote: Op 20-10-2019 om 02:51 schreef Qu Wenruo: On 2019/10/20 上午8:26, Qu Wenruo wr

Re: [PATCH v3 00/10] btrfs-progs: image: Enhancement with new data dump feature

2019-10-21 Thread David Sterba
On Wed, Sep 25, 2019 at 08:13:46PM +0800, Qu Wenruo wrote: > This patchset includes the following features: > > - Small fixes to improve btrfs-image error report > * Output error message for chunk tree build error > * Fix error output to show correct return value > Patch 1 and 2. > > - Redu

Re: [PATCH v2 0/7] btrfs-progs: Support for BG_TREE feature

2019-10-21 Thread David Sterba
On Sat, Oct 19, 2019 at 08:04:51AM +0800, Qu Wenruo wrote: > That's wonderful. > Although I guess my patchset should provide the hint of where to modify > the code, since there are only a limited number of places we modify > block group item. I indeed started at your patchset and grepped fro BG_TR

Re: [PATCH v3] tools/lib/traceevent, perf tools: Handle %pU format correctly

2019-10-21 Thread Steven Rostedt
On Mon, 21 Oct 2019 22:30:37 +0800 Qu Wenruo wrote: > > How do you read it in English? > > How about mathematics interval? > > i in [1, 4]. > > It looks way easier and simpler no matter what language you speak. But C doesn't accept that syntax ;-) -- Steve

Re: MD RAID 5/6 vs BTRFS RAID 5/6

2019-10-21 Thread Edmund Urbani
On 10/16/19 9:42 PM, Zygo Blaxell wrote: > > For raid5 I'd choose btrfs -draid5 -mraid1 over mdadm raid5 > sometimes--even with the write hole, I'd expect smaller average data > losses than mdadm raid5 + write hole mitigation due to the way disk > failure modes are distributed. What about the wr

Re: [PATCH v3 0/7] btrfs-progs: Support for BG_TREE feature

2019-10-21 Thread David Sterba
On Thu, Oct 10, 2019 at 02:41:49PM +0800, Qu Wenruo wrote: > This patchset can be fetched from github: > https://github.com/adam900710/btrfs-progs/tree/bg_tree > Which is based on v5.2.2 tag. > > This patchset provides the needed user space infrastructure for BG_TREE > feature. > > Since it's an

Re: [PATCH v2 1/2] btrfs-progs: warn users about the possible dangers of check --repair

2019-10-21 Thread David Sterba
On Fri, Oct 18, 2019 at 01:16:03PM +0200, Johannes Thumshirn wrote: > The manual page of btrfsck clearly states 'btrfs check --repair' is a > dangerous operation. > > Although this warning is in place users do not read the manual page and/or > are used to the behaviour of fsck utilities which repa

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

2019-10-21 Thread David Sterba
On Fri, Oct 11, 2019 at 10:07:16AM +0800, Qu Wenruo wrote: > > > 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 base

Re: "BUG: kernel NULL pointer dereference," when unmounting filesystem hitted by enospc error

2019-10-21 Thread Johannes Thumshirn
On 21/10/2019 11:17, Johannes Thumshirn wrote: [...] >> - >> $ cat run-btrfs-test >> modprobe -iv zram num_devices=8 >> udevadm trigger >> sync >> zramctl /dev/zram0 -s 8G && \ >> zramctl /dev/zram1 -s 8G && \ >> zramctl /dev/zram2 -s 4G && \ >> zramctl /dev/zram3 -s 4G && \ >> zramctl /dev/zra

Re: [PATCH v3] tools/lib/traceevent, perf tools: Handle %pU format correctly

2019-10-21 Thread Qu Wenruo
On 2019/10/21 下午10:24, Steven Rostedt wrote: > On Mon, 21 Oct 2019 22:03:21 +0800 > Qu Wenruo wrote: > >> On 2019/10/21 下午9:56, Steven Rostedt wrote: >>> On Mon, 21 Oct 2019 17:47:30 +0800 >>> Qu Wenruo wrote: >>> +static void print_uuid_arg(struct trace_seq *s, void *data, int size, >

Re: [PATCH v3] tools/lib/traceevent, perf tools: Handle %pU format correctly

2019-10-21 Thread Steven Rostedt
On Mon, 21 Oct 2019 22:03:21 +0800 Qu Wenruo wrote: > On 2019/10/21 下午9:56, Steven Rostedt wrote: > > On Mon, 21 Oct 2019 17:47:30 +0800 > > Qu Wenruo wrote: > > > >> +static void print_uuid_arg(struct trace_seq *s, void *data, int size, > >> + struct tep_event *event, str

Re: [PATCH v3] tools/lib/traceevent, perf tools: Handle %pU format correctly

2019-10-21 Thread Qu Wenruo
On 2019/10/21 下午9:56, Steven Rostedt wrote: > On Mon, 21 Oct 2019 17:47:30 +0800 > Qu Wenruo wrote: > >> +static void print_uuid_arg(struct trace_seq *s, void *data, int size, >> + struct tep_event *event, struct tep_print_arg *arg) >> +{ >> +unsigned char *buf; >> +

Re: first it froze, now the (btrfs) root fs won't mount ...

2019-10-21 Thread Austin S. Hemmelgarn
On 2019-10-21 09:02, Christian Pernegger wrote: [Please CC me, I'm not on the list.] Am Mo., 21. Okt. 2019 um 13:47 Uhr schrieb Austin S. Hemmelgarn : I've [worked with fs clones] like this dozens of times on single-device volumes with exactly zero issues. Thank you, I have taken precautions

Re: [PATCH v3] tools/lib/traceevent, perf tools: Handle %pU format correctly

2019-10-21 Thread Steven Rostedt
On Mon, 21 Oct 2019 17:47:30 +0800 Qu Wenruo wrote: > +static void print_uuid_arg(struct trace_seq *s, void *data, int size, > +struct tep_event *event, struct tep_print_arg *arg) > +{ > + unsigned char *buf; > + int i; > + > + if (arg->type != TEP_PRINT_FIELD)

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

2019-10-21 Thread David Sterba
On Tue, Oct 15, 2019 at 11:29:34AM +0800, Anand Jain wrote: > I was thinking there might be some common code between the > sub-commands in btrfs-progs now or in future, and if the printf() > due to verbose is required in one sub-command and the same printf() > due to verbose is not required

Re: [PATCH 0/4] Small coding style cleanups

2019-10-21 Thread David Sterba
On Fri, Oct 18, 2019 at 11:58:19AM +0200, Johannes Thumshirn wrote: > Here are some minor coding style cleanups which I think are neat as they make > some functions a bit easier to read. > > None of these patches is really needed though. > > The patches have no regressions with regrads to the bas

Re: first it froze, now the (btrfs) root fs won't mount ...

2019-10-21 Thread Qu Wenruo
On 2019/10/21 下午9:02, Christian Pernegger wrote: > [Please CC me, I'm not on the list.] > > Am Mo., 21. Okt. 2019 um 13:47 Uhr schrieb Austin S. Hemmelgarn > : >> I've [worked with fs clones] like this dozens of times on single-device >> volumes with exactly zero issues. > > Thank you, I have

Re: [PATCH 1/4] btrfs: reduce indentation in lock_stripe_add

2019-10-21 Thread David Sterba
On Fri, Oct 18, 2019 at 11:58:20AM +0200, Johannes Thumshirn wrote: > - /* can we steal this cached rbio's pages? */ > + /* can we steal this cached rbio's pages? */ > + /* no merging, put us on the tail of the plug list, our rbio > + * wil

Re: [PATCH -next] btrfs: Make init_tree_roots static

2019-10-21 Thread David Sterba
On Fri, Oct 18, 2019 at 03:09:58PM +0300, Nikolay Borisov wrote: > > > On 18.10.19 г. 15:06 ч., YueHaibing wrote: > > Fix sparse warning: > > > > fs/btrfs/disk-io.c:2534:12: warning: > > symbol 'init_tree_roots' was not declared. Should it be static? > > > > Reported-by: Hulk Robot > > Signed

Re: [RFC PATCH v2 5/5] btrfs: implement RWF_ENCODED writes

2019-10-21 Thread David Sterba
On Fri, Oct 18, 2019 at 03:55:13PM -0700, Omar Sandoval wrote: > > > + nr_pages = (disk_num_bytes + PAGE_SIZE - 1) >> PAGE_SHIFT; > > > > nit: nr_pages = DIV_ROUND_UP(disk_num_bytes, PAGE_SIZE) > > disk_num_bytes is a u64, so that would expand to a 64-bit division. The > compiler is probably smar

HOW ARE YOU

2019-10-21 Thread Nayef Abu Sakran
Do you receive the mail i send to you?

Re: Lots of btrfs_dump_space_info in kernel log

2019-10-21 Thread David Sterba
On Mon, Oct 21, 2019 at 12:58:12PM +0200, Patrik Lundquist wrote: > I'm running Debian Testing with kernel 5.2.17-1. Five disk raid1 with > at least 393.01GiB unallocated on each disk. No device errors. No > kernel WARNINGs or ERRORs. > > BTRFS info (device dm-1): enabling auto defrag > BTRFS info

Re: first it froze, now the (btrfs) root fs won't mount ...

2019-10-21 Thread Christian Pernegger
[Please CC me, I'm not on the list.] Am Mo., 21. Okt. 2019 um 13:47 Uhr schrieb Austin S. Hemmelgarn : > I've [worked with fs clones] like this dozens of times on single-device > volumes with exactly zero issues. Thank you, I have taken precautions, but it does seem to work fine. > There are ac

Re: [PATCH v2] btrfs-progs: small fixes/cleanup in Documentation

2019-10-21 Thread Merlin Büge
On Mon, 21 Oct 2019 14:30:50 +0200 David Sterba wrote: ... > I've merged the patch as-is, thank. The 'ditto' spelling is probably > more widely used in english texts. 'dtto' is in sources and thus not > visible to wide audience so we can live with that. Thank you! -- Merlin Büge

Re: [PATCH 1/4] btrfs: reduce indentation in lock_stripe_add

2019-10-21 Thread Nikolay Borisov
On 18.10.19 г. 12:58 ч., Johannes Thumshirn wrote: > In lock_stripe_add() we're traversing the stripe hash list and check if > the current list element's raid_map equals is equal to the raid bio's > raid_map. If both are equal we continue processing. > > If we'd check for inequality instead of

Re: [PATCH 0/4] Small coding style cleanups

2019-10-21 Thread Johannes Thumshirn
On 21/10/2019 14:32, Nikolay Borisov wrote: > > > On 21.10.19 г. 11:06 ч., Johannes Thumshirn wrote: >> On 18/10/2019 14:02, Nikolay Borisov wrote: >> [...] >> >>> Patches 2-4 LGTM you can add, : >> >> What's wrong with 1/4? > > Nothing per-se but it looked ugly and my brain refused to make sens

Re: [PATCH 0/4] Small coding style cleanups

2019-10-21 Thread Nikolay Borisov
On 21.10.19 г. 11:06 ч., Johannes Thumshirn wrote: > On 18/10/2019 14:02, Nikolay Borisov wrote: > [...] > >> Patches 2-4 LGTM you can add, : > > What's wrong with 1/4? Nothing per-se but it looked ugly and my brain refused to make sense of it so I haven't really reviewed it :) . > > >

Re: [PATCH v2] btrfs-progs: small fixes/cleanup in Documentation

2019-10-21 Thread David Sterba
On Fri, Oct 18, 2019 at 06:23:31PM +0200, Merlin Büge wrote: > > > On Fri, 18 Oct 2019 18:14:33 +0200 > Merlin Büge wrote: > ... > > diff --git a/Documentation/btrfs-man5.asciidoc > > b/Documentation/btrfs-man5.asciidoc > > index 6a1a04b7..ee6010fe 100644 > > --- a/Documentation/btrfs-man5.asci

Btrfs progs release 5.3

2019-10-21 Thread David Sterba
Hi, btrfs-progs version 5.3 have been released. There are some changes that fit the major release time, like changing default tree traversal for dump-tree, new CI integration and documentation generation. There's preparatory work for the checksums that will be in 5.5 and we decided to release ker

Re: first it froze, now the (btrfs) root fs won't mount ...

2019-10-21 Thread Austin S. Hemmelgarn
On 2019-10-21 06:47, Christian Pernegger wrote: [Please CC me, I'm not on the list.] Am So., 20. Okt. 2019 um 12:28 Uhr schrieb Qu Wenruo : Question: Can I work with the mounted backup image on the machine that also contains the original disc? I vaguely recall something about btrfs really not l

Lots of btrfs_dump_space_info in kernel log

2019-10-21 Thread Patrik Lundquist
I'm running Debian Testing with kernel 5.2.17-1. Five disk raid1 with at least 393.01GiB unallocated on each disk. No device errors. No kernel WARNINGs or ERRORs. BTRFS info (device dm-1): enabling auto defrag BTRFS info (device dm-1): using free space tree BTRFS info (device dm-1): has skinny ext

Re: first it froze, now the (btrfs) root fs won't mount ...

2019-10-21 Thread Qu Wenruo
On 2019/10/21 下午6:47, Christian Pernegger wrote: > [Please CC me, I'm not on the list.] > > Am So., 20. Okt. 2019 um 12:28 Uhr schrieb Qu Wenruo : >>> Question: Can I work with the mounted backup image on the machine that >>> also contains the original disc? I vaguely recall something about >>>

Re: first it froze, now the (btrfs) root fs won't mount ...

2019-10-21 Thread Christian Pernegger
[Please CC me, I'm not on the list.] Am So., 20. Okt. 2019 um 12:28 Uhr schrieb Qu Wenruo : > > Question: Can I work with the mounted backup image on the machine that > > also contains the original disc? I vaguely recall something about > > btrfs really not liking clones. > > If your fs only conta

[RFC PATCH 11/14] btrfs-progs: migrate inspect-internal inode-resolve to global verbose

2019-10-21 Thread Anand Jain
Command btrfs inspect-internal inode-resolve provides verbose option at the sub-command level, this patch makes it enable-able by using the global --verbose option. Suggested-by: David Sterba Signed-off-by: Anand Jain --- cmds/inspect.c | 15 --- 1 file changed, 8 insertions(+), 7 d

[RFC PATCH 13/14] btrfs-progs: refactor btrfs_scan_devices() to accept verbose argument

2019-10-21 Thread Anand Jain
Function btrfs_scan_devices() is being used by commands such as 'btrfs filesystem' and 'btrfs device', by having the verbose argument in the btrfs_scan_devices() we can control which threads to show the verbose when verbose is enabled by the global verbose option. So add an option %verbose to btrf

[RFC PATCH 12/14] btrfs-progs: migrate inspect-internal logical-resolve to global verbose

2019-10-21 Thread Anand Jain
Command btrfs inspect-internal logical-resolve provides local verbose option this patch makes it enable-able by using the global --verbose option. Suggested-by: David Sterba Signed-off-by: Anand Jain --- cmds/inspect.c | 25 +++-- 1 file changed, 11 insertions(+), 14 deletio

[RFC PATCH 14/14] btrfs-progs: enable verbose for btrfs device scan

2019-10-21 Thread Anand Jain
Enable verbose output for the device scan only through the global verbose option. For example: ./btrfs --verbose device scan Scanning for Btrfs filesystems registered: /dev/sda1 registered: /dev/sda2 registered: /dev/sda3 registered: /dev/sda5 registered: /dev/sda6 Signed-off-by: Anand Jain ---

[RFC PATCH 01/14] btrfs-progs: add global verbose helper functions

2019-10-21 Thread Anand Jain
The idea is to use the global --verbose command option to show verbose output from the sub-commands. This patch adds a global bool variable, %global_verbose, to transpire the verbose requisites to the sub-command level. And provides pr_verbose() helper function to log the verbose messages. Suggest

[RFC PATCH 04/14] btrfs-progs: migrate btrfs balance start to global verbose

2019-10-21 Thread Anand Jain
Make sure the sub command balance start calls verbose when the global verbose is set and vise versa. Suggested-by: David Sterba Signed-off-by: Anand Jain --- cmds/balance.c | 22 +++--- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/cmds/balance.c b/cmds/balance

[RFC PATCH 05/14] btrfs-progs: migrate balance status to global verbose

2019-10-21 Thread Anand Jain
Make sure top level verbose option can enable the blalance status subcommand's verbose option. Suggested-by: David Sterba Signed-off-by: Anand Jain --- cmds/balance.c | 7 +++ 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/cmds/balance.c b/cmds/balance.c index 7e84efd6a80d..d

[RFC PATCH 06/14] btrfs-progs: fix help, show long option in balance start and status

2019-10-21 Thread Anand Jain
btrfs balance start|status support both short and long option -v|--verbose however failed to show it in its --help. This patch fixes the --help. Signed-off-by: Anand Jain --- cmds/balance.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmds/balance.c b/cmds/balance.c in

[RFC PATCH 00/14] btrfs-progs: global-verbose option

2019-10-21 Thread Anand Jain
This patch set brings --verbose option to the top level btrfs command, such as 'btrfs --verbose'. With this we don't have to add or remember verbose option at the sub-commands level. As there are already verbose options to 11 sub-commands as listed below [1][2]. So the top level --verbose option h

[RFC PATCH 02/14] btrfs-progs: migrate subvolume delete to global verbose

2019-10-21 Thread Anand Jain
btrfs subvolume delete already supports verbose at the sub-command level, this patch restores same verbose which can be either enabled by the sub-command or from the top level command. Suggested-by: David Sterba Signed-off-by: Anand Jain --- cmds/subvolume.c | 35 +--

[RFC PATCH 10/14] btrfs-progs: migrate restore to global verbose

2019-10-21 Thread Anand Jain
Command btrfs restore provides local verbose option, this patch makes it enable-able by using the global --verbose option as well. Suggested-by: David Sterba Signed-off-by: Anand Jain --- cmds/restore.c | 69 ++ 1 file changed, 31 insertio

[RFC PATCH 07/14] btrfs-progs: migrate rescue chunk-recover to global verbose

2019-10-21 Thread Anand Jain
Now with this patch the btrfs rescue chunk-recover can display verbose output either at the sub-command level or at the top level. For example 'btrfs --verbose rescue chunk-recover <>' or 'btrfs rescue chunk-recover -v <>'. Suggested-by: David Sterba Signed-off-by: Anand Jain --- cmds/rescue.c

[RFC PATCH 03/14] btrfs-progs: migrate filesystem defragment to global verbose

2019-10-21 Thread Anand Jain
btrfs filesystem deframent already supports local sub-command verbose option, enable the same when the global verbose option is set. And as well make sure the same remains enabled at the local level. Suggested-by: David Sterba Signed-off-by: Anand Jain --- cmds/filesystem.c | 25 +++

[RFC PATCH 08/14] btrfs-progs: migrate rescue super-recover to global verbose

2019-10-21 Thread Anand Jain
Now with this patch 'btrfs rescue super-recover' can show verbose output either by the top level --verbose option or by the sub-command -v option. Suggested-by: David Sterba Signed-off-by: Anand Jain --- cmds/rescue.c | 9 - 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/

[RFC PATCH 09/14] btrfs-progs: restore: delete unreachable code

2019-10-21 Thread Anand Jain
Maximum value of %verbose is 1 when %verbose is enabled using 'btrfs restore -v ', and the code under the condition %verbose > 1 is never reached. So delete them. Signed-off-by: Anand Jain --- cmds/restore.c | 17 - 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/

Re: [PATCH] btrfs: Do not check for PagePrivate twice

2019-10-21 Thread Filipe Manana
On Sat, Oct 19, 2019 at 10:05 AM Goldwyn Rodrigues wrote: > > From: Goldwyn Rodrigues > > We are checking PagePrivate twice, once with lock and once without. > Perform the check only once. Have you checked if there's some performance degradation after removing the check? My guess is it's there t

Re: [PATCH 1/3] btrfs-progs: utils-lib: Use error() to replace fprintf(stderr, "ERROR: ")

2019-10-21 Thread Johannes Thumshirn
Looks good, 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 36809, AG Nürnberg) Geschäftsführe

[PATCH v3] tools/lib/traceevent, perf tools: Handle %pU format correctly

2019-10-21 Thread Qu Wenruo
[BUG] For btrfs related events, there is a field for fsid, but perf never parse it correctly. # perf trace -e btrfs:qgroup_meta_convert xfs_io -f -c "pwrite 0 4k" \ /mnt/btrfs/file1 0.000 xfs_io/77915 btrfs:qgroup_meta_reserve:(nil)U: refroot=5(FS_TREE) type=0x0 diff=2

[PATCH 3/3] btrfs-progs: check: Introduce optional argument for -b|--backup

2019-10-21 Thread Qu Wenruo
Add an optional argument, for -b|--backup. This optional argument allow user to specify the generation difference to search for the best backup root. The value values are: -3, -2, -1. To co-operate with this change, the following modifications are made: - Man page and help string update - New

[PATCH 2/3] btrfs-progs: disk-io: Handle backup root more correctly

2019-10-21 Thread Qu Wenruo
Current backup root handling has extra check on super generation: static int find_best_backup_root(struct btrfs_super_block *super) { u64 orig_gen = btrfs_super_generation(super); ... if (btrfs_backup_tree_root_gen(backup) != orig_gen && btrfs_backup_tre

[PATCH 0/3] btrfs-progs: check: Introduce optional argument for -b|--backup

2019-10-21 Thread Qu Wenruo
Before this patchset, if we want to use backup roots, it's only possible to let btrfs-check to automatically choose the backup. If user want to use a specified backup, it can only use -r|--tree-root option along with backup roots dump from "btrfs ins dump-super". This patchset will introduce opti

[PATCH 1/3] btrfs-progs: utils-lib: Use error() to replace fprintf(stderr, "ERROR: ")

2019-10-21 Thread Qu Wenruo
This saves several lines of code. Signed-off-by: Qu Wenruo --- utils-lib.c | 8 +++- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/utils-lib.c b/utils-lib.c index c2b6097f5df9..0202dd7677f0 100644 --- a/utils-lib.c +++ b/utils-lib.c @@ -23,8 +23,7 @@ u64 arg_strtou64(const ch

Re: "BUG: kernel NULL pointer dereference," when unmounting filesystem hitted by enospc error

2019-10-21 Thread Johannes Thumshirn
On 19/10/2019 21:29, Peter Hjalmarsson wrote: Hi Peter, Thanks for the report. > While trying to reproduce another problem I have seen with BTRFS while > running balance and raid6 I hit an issue resulting in: > BUG: kernel NULL pointer dereference, address: 02ce > > I created a scri

Re: [PATCH 0/4] Small coding style cleanups

2019-10-21 Thread Johannes Thumshirn
On 18/10/2019 14:02, Nikolay Borisov wrote: [...] > Patches 2-4 LGTM you can add, : What's wrong with 1/4? -- Johannes ThumshirnSUSE Labs Filesystems jthumsh...@suse.de+49 911 74053 689 SUSE Software Solutions Germany GmbH Maxfeldstr