[PATCH RFC] btrfs: clone: Flush data before doing clone

2018-08-27 Thread Qu Wenruo
Due to the limitation of btrfs_cross_ref_exist(), run_delalloc_nocow() can still fall back to CoW even only (unrelated) part of the preallocated extent is shared. This makes the follow case to do unnecessary CoW: # xfs_io -f -c "falloc 0 2M" $mnt/file # xfs_io -c "pwrite 0 1M" $mnt/file #

Re: [PATCH v2] btrfs: Always check nocow for quota enabled case to make sure we won't reserve unnecessary data space

2018-08-27 Thread Qu Wenruo
On 2018/8/24 下午4:09, Misono Tomohiro wrote: [snip] >> >> BTW, what's the possibility of such problem in your test environment? > > It's like one in several times. > It may depend on hardware performance? (the machine is not so fast), > > I also noticed following warning happens too (not always):

Re: Scrub aborts due to corrupt leaf

2018-08-27 Thread Chris Murphy
On Mon, Aug 27, 2018 at 8:12 PM, Larkin Lowrey wrote: > On 8/27/2018 12:46 AM, Qu Wenruo wrote: >> >> >>> The system uses ECC memory and edac-util has not reported any errors. >>> However, I will run a memtest anyway. >> >> So it should not be the memory problem. >> >> BTW, what's the current

Re: Scrub aborts due to corrupt leaf

2018-08-27 Thread Larkin Lowrey
On 8/27/2018 12:46 AM, Qu Wenruo wrote: The system uses ECC memory and edac-util has not reported any errors. However, I will run a memtest anyway. So it should not be the memory problem. BTW, what's the current generation of the fs? # btrfs inspect dump-super | grep generation The

Re: DRDY errors are not consistent with scrub results

2018-08-27 Thread Chris Murphy
On Mon, Aug 27, 2018 at 6:49 PM, Cerem Cem ASLAN wrote: > Thanks for your guidance, I'll get the device replaced first thing in > the morning. > > Here is balance results which I think resulted not too bad: > > sudo btrfs balance start /mnt/peynir/ > WARNING: > > Full balance without

Re: DRDY errors are not consistent with scrub results

2018-08-27 Thread Cerem Cem ASLAN
Thanks for your guidance, I'll get the device replaced first thing in the morning. Here is balance results which I think resulted not too bad: sudo btrfs balance start /mnt/peynir/ WARNING: Full balance without filters requested. This operation is very intense and takes

Re: DRDY errors are not consistent with scrub results

2018-08-27 Thread Chris Murphy
On Mon, Aug 27, 2018 at 6:38 PM, Chris Murphy wrote: >> Metadata,single: Size:8.00MiB, Used:0.00B >>/dev/mapper/master-root 8.00MiB >> >> Metadata,DUP: Size:2.00GiB, Used:562.08MiB >>/dev/mapper/master-root 4.00GiB >> >> System,single: Size:4.00MiB, Used:0.00B >>

Re: DRDY errors are not consistent with scrub results

2018-08-27 Thread Chris Murphy
On Mon, Aug 27, 2018 at 6:05 PM, Cerem Cem ASLAN wrote: > Note that I've directly received this reply, not by mail list. I'm not > sure this is intended or not. I intended to do Reply to All but somehow this doesn't always work out between the user and Gmail, I'm just gonna assume gmail is being

Re: btrfs-progs: btrfs-convert: unable to find block group for 0

2018-08-27 Thread Qu Wenruo
On 2018/8/28 上午6:33, Tucker Boniface wrote: > Hello, I am trying to convert an ext4 partition to btrfs using > btrfs-convert. I am running Arch Linux with kernel 4.18.5 and > btrfs-progs 4.17.1. The full error is inline below. > > -> # btrfs-convert /dev/sda1 > create btrfs filesystem: >

[RFC PATCH v2 1/6] fs: pass iocb to direct I/O get_block()

2018-08-27 Thread Omar Sandoval
From: Omar Sandoval Split out dio_get_block_t which is the same as get_block_t except that it takes the iocb as well, and update fs/direct-io.c and all callers to use it. This is preparation for replacing the use of bh->b_private in the direct I/O code with iocb->private. Signed-off-by: Omar

[RFC PATCH v2 4/6] fs: stop propagating bh->b_private for direct I/O

2018-08-27 Thread Omar Sandoval
From: Omar Sandoval Currently, the direct I/O code saves the value of bh->b_private set by the filesystem and passes it to the end_io callback. However, struct kiocb already has a ->private member which can be used for this purpose, with the added benefit of being available before get_block is

[RFC PATCH v2 6/6] Btrfs: stop abusing current->journal_info in btrfs_direct_IO()

2018-08-27 Thread Omar Sandoval
From: Omar Sandoval Now that we can pass around the struct btrfs_dio_data through the different callbacks generically, we don't need to shove it in current->journal_info. Signed-off-by: Omar Sandoval --- fs/btrfs/inode.c | 29 ++--- 1 file changed, 6 insertions(+), 23

[RFC PATCH v2 5/6] fs: pass iocb to direct I/O submit_io()

2018-08-27 Thread Omar Sandoval
From: Omar Sandoval Btrfs abuses current->journal_info in btrfs_direct_IO() in order to pass around some state to get_block() and submit_io(). However, iocb->private is free for Btrfs to use, we just need it passed to submit_io(). Btrfs is the only user of submit_io(), so this doesn't affect any

[RFC PATCH v2 3/6] ocfs2: use iocb->private instead of bh->b_private

2018-08-27 Thread Omar Sandoval
From: Omar Sandoval As part of simplifying all of the private data passed around for direct I/O, bh->b_private will no longer be passed to dio_iodone_t. Instead, filesystems should use iocb->private. ocfs2 already uses iocb->private for storing a couple of flag bits, but we can use it as a

[RFC PATCH v2 2/6] ext4: use iocb->private instead of bh->b_private

2018-08-27 Thread Omar Sandoval
From: Omar Sandoval As part of simplifying all of the private data passed around for direct I/O, bh->b_private will no longer be passed to dio_iodone_t. iocb is still available there, however, so convert ext4 to use it. Note that ext4_file_write_iter() also uses iocb->private, but

[RFC PATCH v2 0/6] Btrfs: stop abusing current->journal_info for direct I/O

2018-08-27 Thread Omar Sandoval
From: Omar Sandoval Hi, This is a different approach from v1 [1] of this series to stop abusing current->journal_info in Btrfs. This approach unifies everything to use iocb->private instead of map_bh->b_private. Patches 1 and 5 pass the iocb to a couple of callbacks which need it. Patches 2 and

corruption_errs

2018-08-27 Thread John Petrini
Hi List, I'm seeing corruption errors when running btrfs device stats but I'm not sure what that means exactly. I've just completed a full scrub and it reported no errors. I'm hoping someone here can enlighten me. Thanks! [/dev/sdd].write_io_errs 0 [/dev/sdd].read_io_errs0

DRDY errors are not consistent with scrub results

2018-08-27 Thread Cerem Cem ASLAN
Hi, I'm getting DRDY ERR messages which causes system crash on the server: # tail -n 40 /var/log/kern.log.1 Aug 24 21:04:55 aea3 kernel: [ 939.228059] lxc-bridge: port 5(vethI7JDHN) entered disabled state Aug 24 21:04:55 aea3 kernel: [ 939.300602] eth0: renamed from vethQ5Y2OF Aug 24 21:04:55

btrfs-progs: btrfs-convert: unable to find block group for 0

2018-08-27 Thread Tucker Boniface
Hello, I am trying to convert an ext4 partition to btrfs using btrfs-convert. I am running Arch Linux with kernel 4.18.5 and btrfs-progs 4.17.1. The full error is inline below. -> # btrfs-convert /dev/sda1 create btrfs filesystem: blocksize: 4096 nodesize: 16384

BTRFS support per-subvolume compression, isn't it?

2018-08-27 Thread Eugene Bright
Greetings! BTRFS wiki says there is no per-subvolume compression option [1]. At the same time next command allow me to set properties per-subvolume: btrfs property set /volume compression zstd Corresponding get command shows distinct properties for every subvolume. Should wiki be