[PATCH] Btrfs: do not cache rbio pages if using raid6 recover

2018-01-12 Thread Liu Bo
Since raid6 recover tries all possible combinations of failed stripes, - when raid6 rebuild algorithm is used, i.e. raid6_datap_recov() and raid6_2data_recov(), it may change the in-memory content of failed stripes, if such a raid bio is cached, a later raid write rmw or recover can steal

[PATCH] Btrfs: raid56: iterate raid56 internal bio with bio_for_each_segment_all

2018-01-12 Thread Liu Bo
Bio iterated by set_bio_pages_uptodate() is raid56 internal one, so it will never be a BIO_CLONED bio, and since this is called by end_io functions, bio->bi_iter.bi_size is zero, we mustn't use bio_for_each_segment() as that is a no-op if bi_size is zero. Fixes:

[PATCH] fstests: common/rc: fix device still mounted error with SCRATCH_DEV_POOL

2018-01-12 Thread Liu Bo
One of btrfs tests, btrfs/011, uses SCRATCH_DEV_POOL and puts a non-SCRATCH_DEV device as the first one when doing mkfs, and this makes _require_scratch{_nocheck} fail to umount $SCRATCH_MNT since it checks mount point with SCRATCH_DEV only, and for sure it finds nothing to umount and the

Re: [PATCH bpf-next v5 0/5] Separate error injection table from kprobes

2018-01-12 Thread Alexei Starovoitov
On Sat, Jan 13, 2018 at 02:53:33AM +0900, Masami Hiramatsu wrote: > Hi, > > Here are the 5th version of patches to moving error injection > table from kprobes. This version fixes a bug and update > fail-function to support multiple function error injection. > > Here is the previous version: > >

Re: invalid files names, btrfs check can't repair it

2018-01-12 Thread Qu Wenruo
On 2018年01月13日 05:04, Sebastian Andrzej Siewior wrote: > Hi, > > so I had bad memory and before I realized it and removed it btrfs took some > damage. Now I have this: > > |ls -lh crap/ > |ls: cannot access 'crap/2f3f379b2a3d7499471edb74869efe-1948311.d': No such > file or directory > |ls:

Re: invalid files names, btrfs check can't repair it

2018-01-12 Thread Timofey Titovets
2018-01-13 0:04 GMT+03:00 Sebastian Andrzej Siewior : > Hi, > > so I had bad memory and before I realized it and removed it btrfs took some > damage. Now I have this: > > |ls -lh crap/ > |ls: cannot access 'crap/2f3f379b2a3d7499471edb74869efe-1948311.d': No such > file or

Re: [PATCHSET v5] blk-mq: reimplement timeout handling

2018-01-12 Thread Jens Axboe
On 1/12/18 2:19 PM, Bart Van Assche wrote: > On Fri, 2018-01-12 at 14:07 -0700, Jens Axboe wrote: >> You're really not making it easy for folks to run this :-) > > My hope is that the ib_srp and ib_srpt patches will be accepted upstream soon. > As long as these are not upstream, anyone who wants

Re: [PATCHSET v5] blk-mq: reimplement timeout handling

2018-01-12 Thread Laurence Oberman
On Fri, 2018-01-12 at 20:57 +, Bart Van Assche wrote: > On Tue, 2018-01-09 at 08:29 -0800, Tejun Heo wrote: > > Currently, blk-mq timeout path synchronizes against the usual > > issue/completion path using a complex scheme involving atomic > > bitflags, REQ_ATOM_*, memory barriers and subtle

Limit on the number of btrfs snapshots?

2018-01-12 Thread Daniel E. Shub
A couple of years ago I asked a question on the Unix and Linux Stack Exchange about the limit on the number of BTRFS snapshots: https://unix.stackexchange.com/q/140360/22724 Basically, I want to use something like snapper to take time based snapshots so that I can browse old versions of my data.

Re: [PATCHSET v5] blk-mq: reimplement timeout handling

2018-01-12 Thread Bart Van Assche
On Fri, 2018-01-12 at 14:07 -0700, Jens Axboe wrote: > You're really not making it easy for folks to run this :-) My hope is that the ib_srp and ib_srpt patches will be accepted upstream soon. As long as these are not upstream, anyone who wants to retrieve these patches is welcome to clone

Re: [PATCHSET v5] blk-mq: reimplement timeout handling

2018-01-12 Thread Jens Axboe
On 1/12/18 1:57 PM, Bart Van Assche wrote: > On Tue, 2018-01-09 at 08:29 -0800, Tejun Heo wrote: >> Currently, blk-mq timeout path synchronizes against the usual >> issue/completion path using a complex scheme involving atomic >> bitflags, REQ_ATOM_*, memory barriers and subtle memory coherence >>

invalid files names, btrfs check can't repair it

2018-01-12 Thread Sebastian Andrzej Siewior
Hi, so I had bad memory and before I realized it and removed it btrfs took some damage. Now I have this: |ls -lh crap/ |ls: cannot access 'crap/2f3f379b2a3d7499471edb74869efe-1948311.d': No such file or directory |ls: cannot access 'crap/454bf066ddfbf42e0f3b77ea71c82f-878732.o': No such file

Re: [PATCHSET v5] blk-mq: reimplement timeout handling

2018-01-12 Thread Bart Van Assche
On Tue, 2018-01-09 at 08:29 -0800, Tejun Heo wrote: > Currently, blk-mq timeout path synchronizes against the usual > issue/completion path using a complex scheme involving atomic > bitflags, REQ_ATOM_*, memory barriers and subtle memory coherence > rules. Unfortunatley, it contains quite a few

Re: btrfs subvolume mount with different options

2018-01-12 Thread Roman Mamedov
On Fri, 12 Jan 2018 17:49:38 + (GMT) "Konstantin V. Gavrilenko" wrote: > Hi list, > > just wondering whether it is possible to mount two subvolumes with different > mount options, i.e. > > | > |- /a defaults,compress-force=lza You can have use different

Re: [PATCH] btrfs: Streamline btrfs_delalloc_reserve_metadata initial operations

2018-01-12 Thread Edmund Nadolski
On 01/12/2018 07:21 AM, Nikolay Borisov wrote: > The behavior of btrfs_delalloc_reserve_metadata depends on whether > the inode we are allocating for is the freespace inode or not. As it > stands if we are the free node we set 'flush' and 'delalloc_lock' > variable to certain values. Subsequently

Re: btrfs subvolume mount with different options

2018-01-12 Thread Timofey Titovets
2018-01-12 20:49 GMT+03:00 Konstantin V. Gavrilenko : > Hi list, > > just wondering whether it is possible to mount two subvolumes with different > mount options, i.e. > > | > |- /a defaults,compress-force=lza > | > |- /b defaults,nodatacow > > > since, when both

Re: Recommendations for balancing as part of regular maintenance?

2018-01-12 Thread Austin S. Hemmelgarn
On 2018-01-12 14:26, Tom Worster wrote: On 12 Jan 2018, at 13:24, Austin S. Hemmelgarn wrote: OK, I've gotten a lot of good feedback on this, and the general consensus seems to be: * If we're going to recommend regular balance, we should explain how it actually helps things. * We should

Re: Recommendations for balancing as part of regular maintenance?

2018-01-12 Thread Tom Worster
On 12 Jan 2018, at 13:24, Austin S. Hemmelgarn wrote: OK, I've gotten a lot of good feedback on this, and the general consensus seems to be: * If we're going to recommend regular balance, we should explain how it actually helps things. * We should mention the performance interactions with

Re: Recommendations for balancing as part of regular maintenance?

2018-01-12 Thread Austin S. Hemmelgarn
On 2018-01-08 10:55, Austin S. Hemmelgarn wrote: So, for a while now I've been recommending small filtered balances to people as part of regular maintenance for BTRFS filesystems under the logic that it does help in some cases and can't really hurt (and if done right, is really inexpensive in

[PATCH bpf-next v5 3/5] error-injection: Separate error-injection from kprobe

2018-01-12 Thread Masami Hiramatsu
Since error-injection framework is not limited to be used by kprobes, nor bpf. Other kernel subsystems can use it freely for checking safeness of error-injection, e.g. livepatch, ftrace etc. So this separate error-injection framework from kprobes. Some differences has been made: - "kprobe" word

[PATCH bpf-next v5 5/5] error-injection: Support fault injection framework

2018-01-12 Thread Masami Hiramatsu
Support in-kernel fault-injection framework via debugfs. This allows you to inject a conditional error to specified function using debugfs interfaces. Here is the result of test script described in Documentation/fault-injection/fault-injection.txt === # ./test_fail_function.sh 1+0

btrfs subvolume mount with different options

2018-01-12 Thread Konstantin V. Gavrilenko
Hi list, just wondering whether it is possible to mount two subvolumes with different mount options, i.e. | |- /a defaults,compress-force=lza | |- /b defaults,nodatacow since, when both subvolumes are mounted, and when I change the option for one it is changed for all of them. thanks in

[PATCH bpf-next v5 4/5] error-injection: Add injectable error types

2018-01-12 Thread Masami Hiramatsu
Add injectable error types for each error-injectable function. One motivation of error injection test is to find software flaws, mistakes or mis-handlings of expectable errors. If we find such flaws by the test, that is a program bug, so we need to fix it. But if the tester miss input the error

[PATCH bpf-next v5 2/5] tracing/kprobe: bpf: Compare instruction pointer with original one

2018-01-12 Thread Masami Hiramatsu
Compare instruction pointer with original one on the stack instead using per-cpu bpf_kprobe_override flag. This patch also consolidates reset_current_kprobe() and preempt_enable_no_resched() blocks. Those can be done in one place. Signed-off-by: Masami Hiramatsu

[PATCH bpf-next v5 1/5] tracing/kprobe: bpf: Check error injectable event is on function entry

2018-01-12 Thread Masami Hiramatsu
Check whether error injectable event is on function entry or not. Currently it checks the event is ftrace-based kprobes or not, but that is wrong. It should check if the event is on the entry of target function. Since error injection will override a function to just return with modified return

[PATCH bpf-next v5 0/5] Separate error injection table from kprobes

2018-01-12 Thread Masami Hiramatsu
Hi, Here are the 5th version of patches to moving error injection table from kprobes. This version fixes a bug and update fail-function to support multiple function error injection. Here is the previous version: https://patchwork.ozlabs.org/cover/858663/ Changes in v5: - [3/5] Fix a bug that

Small btrfs corruptions on 4.14.13

2018-01-12 Thread Maciej Piechotka
Hi, Yesterday, after update to 4.14.13 from 4.14.12 I got a corruptions of btrfs. Each time transaction was aborted with error about something being already present. Unfortunatly as logs were on btrfs partition as well the only recovered part is: Jan 11 20:52:30 babylon5 kernel: BTRFS:

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

2018-01-12 Thread Colin King
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 branches") Signed-off-by: Colin Ian King

[PATCH] btrfs: remove stale reada_lock from device

2018-01-12 Thread David Sterba
We the global readahead lock in fs_info, the per-device has been unused since the initial commit 90519d66abbccc ("btrfs: state information for readahead"). Reported-by: Matthew Wilcox Signed-off-by: David Sterba --- fs/btrfs/volumes.h | 1 - 1 file

[PATCH] btrfs: Streamline btrfs_delalloc_reserve_metadata initial operations

2018-01-12 Thread Nikolay Borisov
The behavior of btrfs_delalloc_reserve_metadata depends on whether the inode we are allocating for is the freespace inode or not. As it stands if we are the free node we set 'flush' and 'delalloc_lock' variable to certain values. Subsequently we check the values of those vars and act accordingly.

Re: Unexpected raid1 behaviour

2018-01-12 Thread Dark Penguin
On 18/12/17 16:31, Austin S. Hemmelgarn wrote: > On 2017-12-16 14:50, Dark Penguin wrote: >> Could someone please point me towards some read about how btrfs handles >> multiple devices? Namely, kicking faulty devices and re-adding them. >> >> I've been using btrfs on single devices for a while,

Re: [PATCH v5 00/19] fs: rework and optimize i_version handling in filesystems

2018-01-12 Thread Jeff Layton
On Thu, 2018-01-11 at 12:23 -0800, Liu Bo wrote: > On Tue, Jan 09, 2018 at 09:10:40AM -0500, Jeff Layton wrote: > > From: Jeff Layton > > > > v5: > > - don't corrupt refcounts stashed in i_version of ext4 xattr inodes > > - add raw variants of inc and cmp functions, and have

Re: [PATCH v4 2/4] btrfs: cleanup btrfs_mount() using btrfs_mount_root()

2018-01-12 Thread Anand Jain
Misono, This change is causing subsequent (subvol) mount to fail when device option is specified. The simplest eg for failure is .. mkfs.btrfs -qf /dev/sdc /dev/sdb mount -o device=/dev/sdb /dev/sdc /btrfs mount -o device=/dev/sdb /dev/sdc /btrfs1 mount: /dev/sdc is already