Re: 5.11.0: open ctree failed: devide total_bytes should be at most X but found Y

2021-02-23 Thread Johannes Thumshirn
On 22/02/2021 21:07, Steven Davies wrote: [+CC Anand ] > Booted my system with kernel 5.11.0 vanilla with the first time and received > this: > > BTRFS info (device nvme0n1p2): has skinny extents > BTRFS error (device nvme0n1p2): device total_bytes should be at most > 964757028864 but found >

Re: 5.11.0: open ctree failed: devide total_bytes should be at most X but found Y

2021-02-23 Thread Johannes Thumshirn
On 23/02/2021 10:13, Johannes Thumshirn wrote: > On 22/02/2021 21:07, Steven Davies wrote: > > [+CC Anand ] > >> Booted my system with kernel 5.11.0 vanilla with the first time and received >> this: >> >> BTRFS info (device nvme0n1p2): has skinny extents >> BTRFS error (device nvme0n1p2): device

[PATCH 1/3] btrfs: fix race between memory mapped writes and fsync

2021-02-23 Thread fdmanana
From: Filipe Manana When doing an fsync we flush all delalloc, lock the inode (vfs lock), flush any new delalloc that might have been created before taking the lock and then wait either for the ordered extents to complete or just for the writeback to complete (depending on whether the full sync f

[PATCH 2/3] btrfs: fix race between marking inode needs to be logged and log syncing

2021-02-23 Thread fdmanana
From: Filipe Manana We have a race between marking that an inode needs to be logged, either at btrfs_set_inode_last_trans() or at btrfs_page_mkwrite(), and between btrfs_sync_log(). The following steps describe how the race happens. 1) We are at transaction N; 2) Inode I was previously fsynced

[PATCH 3/3] btrfs: remove stale comment and logic from btrfs_inode_in_log()

2021-02-23 Thread fdmanana
From: Filipe Manana Currently btrfs_inode_in_log() checks the list of modified extents of the inode, and has a comment mentioning why, as it used to be necessary to make sure if we did something like the following: mmap write range A mmap write range B msync range A (ranged fsync) msync

[PATCH 0/3] btrfs: fix a couple races between fsync and other code

2021-02-23 Thread fdmanana
From: Filipe Manana The first patch fixes a race between fsync and memory mapped writes, which can result in corruptions. The second one fixes a different race that in practice should be "impossible" to happen, but in case it's triggered somehow, results in not logging an inode when it has new ex

[PATCH] btrfs: Unlock extents in btrfs_zero_range in case of errors

2021-02-23 Thread Nikolay Borisov
If btrfs_qgroup_reserve_data returns an error (i.e quota limit reached) the handling logic directly goes to the 'out' label without first unlocking the extent range between lockstart, lockend. This results in deadlocks as processes try to lock the same extent. Fixes: a7f8b1c2ac21 ("btrfs: file: re

Re: [PATCH] btrfs: Unlock extents in btrfs_zero_range in case of errors

2021-02-23 Thread Qu Wenruo
On 2021/2/23 下午9:20, Nikolay Borisov wrote: If btrfs_qgroup_reserve_data returns an error (i.e quota limit reached) the handling logic directly goes to the 'out' label without first unlocking the extent range between lockstart, lockend. This results in deadlocks as processes try to lock the sa

Re: [PATCH 1/4] btrfs: add ioctl BTRFS_IOC_DEV_PROPERTIES.

2021-02-23 Thread David Sterba
On Mon, Feb 22, 2021 at 10:19:06PM +0100, Goffredo Baroncelli wrote: > From: Goffredo Baroncelli > > This ioctl is a base for returning / setting information from / to the > fields of the btrfs_dev_item object. Please don't add a new ioctl for properties, they're using the xattr as interface al

Re: [PATCH] btrfs: Unlock extents in btrfs_zero_range in case of errors

2021-02-23 Thread David Sterba
On Tue, Feb 23, 2021 at 03:20:42PM +0200, Nikolay Borisov wrote: > If btrfs_qgroup_reserve_data returns an error (i.e quota limit reached) > the handling logic directly goes to the 'out' label without first > unlocking the extent range between lockstart, lockend. This results in > deadlocks as proc

Re: 5.11.0: open ctree failed: devide total_bytes should be at most X but found Y

2021-02-23 Thread David Sterba
On Tue, Feb 23, 2021 at 09:43:04AM +, Johannes Thumshirn wrote: > On 23/02/2021 10:13, Johannes Thumshirn wrote: > > On 22/02/2021 21:07, Steven Davies wrote: > > > > [+CC Anand ] > > > >> Booted my system with kernel 5.11.0 vanilla with the first time and > >> received this: > >> > >> BTRFS

Re: btrfs receive started to fail constantly for a subvolume

2021-02-23 Thread Cerem Cem ASLAN
Thanks for the info. I upgraded the kernel to 5.10.0-0.bpo.3-amd64. Filipe Manana , 15 Şub 2021 Pzt, 14:09 tarihinde şunu yazdı: > > On Sat, Feb 13, 2021 at 3:09 PM Cerem Cem ASLAN wrote: > > > > Basically I'm using btrbk to create snapshots on main disk (MMM) and > > send them 2 distinct disks (

Re: Recovering Btrfs from a freak failure of the disk controller

2021-02-23 Thread Josef Bacik
On 2/22/21 11:03 PM, Neal Gompa wrote: On Mon, Feb 22, 2021 at 2:34 PM Josef Bacik wrote: On 2/21/21 1:27 PM, Neal Gompa wrote: On Wed, Feb 17, 2021 at 11:44 AM Josef Bacik wrote: On 2/17/21 11:29 AM, Neal Gompa wrote: On Wed, Feb 17, 2021 at 9:59 AM Josef Bacik wrote: On 2/17/21 9:50

All files are damaged after btrfs restore

2021-02-23 Thread Sebastian Roller
Hello all. Sorry for asking here directly, but I'm in a desperate situation and out of options. I have a 72 TB btrfs filesystem which functions as a backup drive. After a recent controller hardware failure while the backup was running, both original and backup fs were severely damaged. Kernel vers

[PATCH] btrfs: Add simple stress test when qgroup limits are reached

2021-02-23 Thread Nikolay Borisov
This test uncovered 2 deadlocks with qgroups when their limit was reached. Signed-off-by: Nikolay Borisov --- tests/btrfs/231 | 72 + tests/btrfs/231.out | 2 ++ tests/btrfs/group | 1 + 3 files changed, 75 insertions(+) create mode 100755 tes

Re: 5.11.0: open ctree failed: devide total_bytes should be at most X but found Y

2021-02-23 Thread Steven Davies
On 2021-02-23 14:30, David Sterba wrote: On Tue, Feb 23, 2021 at 09:43:04AM +, Johannes Thumshirn wrote: On 23/02/2021 10:13, Johannes Thumshirn wrote: > On 22/02/2021 21:07, Steven Davies wrote: > > [+CC Anand ] > >> Booted my system with kernel 5.11.0 vanilla with the first time and receiv

Re: 5.11.0: open ctree failed: devide total_bytes should be at most X but found Y

2021-02-23 Thread Johannes Thumshirn
On 23/02/2021 18:20, Steven Davies wrote: > On 2021-02-23 14:30, David Sterba wrote: >> On Tue, Feb 23, 2021 at 09:43:04AM +, Johannes Thumshirn wrote: >>> On 23/02/2021 10:13, Johannes Thumshirn wrote: On 22/02/2021 21:07, Steven Davies wrote: [+CC Anand ] > Booted my s

Re: [PATCH 1/4] btrfs: add ioctl BTRFS_IOC_DEV_PROPERTIES.

2021-02-23 Thread Goffredo Baroncelli
On 2/23/21 2:53 PM, David Sterba wrote: On Mon, Feb 22, 2021 at 10:19:06PM +0100, Goffredo Baroncelli wrote: From: Goffredo Baroncelli This ioctl is a base for returning / setting information from / to the fields of the btrfs_dev_item object. Hi David, Please don't add a new ioctl for pr

Re: [PATCH 1/4] btrfs: add ioctl BTRFS_IOC_DEV_PROPERTIES.

2021-02-23 Thread Goffredo Baroncelli
I resend it because I made a little mess with the quotation On 2/23/21 6:59 PM, Goffredo Baroncelli wrote: On 2/23/21 2:53 PM, David Sterba wrote: On Mon, Feb 22, 2021 at 10:19:06PM +0100, Goffredo Baroncelli wrote: From: Goffredo Baroncelli This ioctl is a base for returning / setting infor

Re: [PATCH 1/4] btrfs: add ioctl BTRFS_IOC_DEV_PROPERTIES.

2021-02-23 Thread Goffredo Baroncelli
. And when submitting patch, we suggest to use '--base' as documented in https://git-scm.com/docs/git-format-patch] url: https://github.com/0day-ci/linux/commits/Goffredo-Baroncelli/btrfs-add-ioctl-BTRFS_IOC_DEV_PROPERTIES/20210223-062001 base: https://git.kernel.org/pub/scm/linux/

[PATCH] btrfs: fix spurious free_space_tree remount warning

2021-02-23 Thread Boris Burkov
The intended logic of the check is to catch cases where the desired free_space_tree setting doesn't match the mounted setting, and the remount is anything but ro->rw. However, it makes the mistake of checking equality on a masked integer (btrfs_test_opt) against a boolean (btrfs_fs_compat_ro). If

Re: [PATCH] btrfs: fix spurious free_space_tree remount warning

2021-02-23 Thread Nikolay Borisov
On 23.02.21 г. 20:22 ч., Boris Burkov wrote: > The intended logic of the check is to catch cases where the desired > free_space_tree setting doesn't match the mounted setting, and the > remount is anything but ro->rw. However, it makes the mistake of > checking equality on a masked integer (btrf

Re: 5.11.0: open ctree failed: devide total_bytes should be at most X but found Y

2021-02-23 Thread Anand Jain
On 24/02/2021 01:35, Johannes Thumshirn wrote: On 23/02/2021 18:20, Steven Davies wrote: On 2021-02-23 14:30, David Sterba wrote: On Tue, Feb 23, 2021 at 09:43:04AM +, Johannes Thumshirn wrote: On 23/02/2021 10:13, Johannes Thumshirn wrote: On 22/02/2021 21:07, Steven Davies wrote: [+

Re: [PATCH 1/4] btrfs: add ioctl BTRFS_IOC_DEV_PROPERTIES.

2021-02-23 Thread Anand Jain
On 23/02/2021 21:53, David Sterba wrote: On Mon, Feb 22, 2021 at 10:19:06PM +0100, Goffredo Baroncelli wrote: From: Goffredo Baroncelli This ioctl is a base for returning / setting information from / to the fields of the btrfs_dev_item object. Please don't add a new ioctl for properties, th