[PATCH v2 1/2] btrfs: Add WARN_ON for qgroup reserved underflow

2016-10-19 Thread Qu Wenruo
Goldwyn Rodrigues has exposed and fixed a bug which underflows btrfs qgroup reserved space, and leads to non-writable fs. This reminds us that we don't have enough underflow check for qgroup reserved space. For underflow case, we should not really underflow the numbers but warn and keeps qgroup

[PATCH 2/2] btrfs: Add trace point for qgroup reserved space

2016-10-19 Thread Qu Wenruo
Introduce the following trace points: qgroup_update_reserve qgroup_meta_reserve And modify the timing of btrfs_qgroup_free_delayed_ref() and btrfs_qgroup_release_data() events, to work with qgroup_update_reserve() event. Signed-off-by: Qu Wenruo --- fs/btrfs/qgroup.c

[PATCH v9.1 0/5] In-band de-duplication for btrfs-progs

2016-10-19 Thread Qu Wenruo
Patchset can be fetched from github: https://github.com/adam900710/btrfs-progs.git dedupe_latest Inband dedupe(in-memory backend only) ioctl support for btrfs-progs. User/reviewer/tester can still use previous btrfs-progs patchset to test, this update is just cleanuping unsupported functions,

[PATCH v13.1 00/14] Btrfs In-band De-duplication

2016-10-19 Thread Qu Wenruo
This patchset can be fetched from github: https://github.com/adam900710/linux.git wang_dedupe_latest This version is just another small update, rebased to Chris' for-linus-4.9 branch. Since preparation patch for sub-page size and inband dedupe is already merged, now it's quite easy to rebase.

Re: [PATCH 1/2] btrfs: Add WARN_ON for qgroup reserved underflow

2016-10-19 Thread Qu Wenruo
At 10/19/2016 10:31 PM, David Sterba wrote: On Fri, Sep 30, 2016 at 09:15:36AM +0800, Qu Wenruo wrote: While the reason why qgroup reserved space may underflow is still under investigation, such WARN_ON will help us to expose the bug more easily, and for end-user we can detect and avoid

Re: [PATCH 1/2] btrfs-progs: fsck: Add support to clear v1 free space cache.

2016-10-19 Thread Qu Wenruo
At 10/19/2016 11:13 PM, David Sterba wrote: On Thu, Oct 13, 2016 at 05:22:26PM +0800, Qu Wenruo wrote: Kernel clear_cache mount option will only rebuilt free space cache if used space of that chunk has changed. So it won't ensure any corrupted free space cache get cleared. So add a new

Re: Rust library for BTRFS

2016-10-19 Thread James Pharaoh
On 15/10/16 19:41, Hans van Kranenburg wrote: On 10/15/2016 04:31 PM, James Pharaoh wrote: >> I've basically reimplemented what I find in other tools because, as far as I can tell, there is no C library for BTRFS at this point. For code operating on an online filesystem, using the IOCTLs,

Re: Monitoring Btrfs

2016-10-19 Thread Stefan Malte Schumacher
Thanks to everybody for the help. I have been doing regular smart-tests for quite some time and I also let scrub run on a regular basis. I will use a simple shellscript witch inspects the output of "greps btrfs fi show" for lines containing "missing" and another which checks "btrfs dev stats" for

Re: Monitoring Btrfs

2016-10-19 Thread Anand Jain
On 10/19/16 21:33, Austin S. Hemmelgarn wrote: On 2016-10-19 09:06, Anand Jain wrote: On 10/19/16 19:15, Austin S. Hemmelgarn wrote: On 2016-10-18 17:36, Anand Jain wrote: I would like to monitor my btrfs-filesystem for missing drives. This is actually correct behavior, the

Re: Cross subvolume "cp --reflink"?

2016-10-19 Thread Noah Massey
On Wed, Oct 19, 2016 at 12:52 PM, Andrei Borzenkov wrote: > I get "Failed to clone: Invalid cross-device link". Is it expected? Yes, you cannot cross a MOUNTPOINT boundary with reflink. Or, for that matter, btrfs subvolume snapshot. > Basically this is (on openSUSE TW which

Re: [BUG] kernel BUG at fs/btrfs/extent_io.c:2062 (v4.2.0-rc8)

2016-10-19 Thread Dāvis Mosāns
Now when trying to read this one file on 4.8.2 [ 131.497595] [ cut here ] [ 131.499411] kernel BUG at fs/btrfs/extent_io.c:2315! [ 131.500786] invalid opcode: [#1] PREEMPT SMP [ 131.500786] Modules linked in: rpcsec_gss_krb5 auth_rpcgss oid_registry nfsv4

Re: bio linked list corruption.

2016-10-19 Thread Linus Torvalds
On Wed, Oct 19, 2016 at 10:09 AM, Philipp Hahn wrote: > > Nearly a month ago I reported also a "list_add corruption", but with 4.1.6: > > > That server rungs Samba4, which also is a heavy user of xattr. That one looks very

Re: bio linked list corruption.

2016-10-19 Thread Philipp Hahn
Hello, Am 19.10.2016 um 01:42 schrieb Chris Mason: > On Tue, Oct 18, 2016 at 04:39:22PM -0700, Linus Torvalds wrote: >> On Tue, Oct 18, 2016 at 4:31 PM, Chris Mason wrote: >>> >>> Jens, not sure if you saw the whole thread. This has triggered bad page >>> state errors, and also

Re: [PATCH 2/3] btrfs-progs: Add a command to show bg info

2016-10-19 Thread Divya Indi
On 10/17/2016 10:24 PM, Roman Mamedov wrote: On Tue, 18 Oct 2016 09:39:32 +0800 Qu Wenruo wrote: static const char * const cmd_inspect_inode_resolve_usage[] = { "btrfs inspect-internal inode-resolve [-v] ", "Get file system paths for the given

Re: btrfs partition fails to mount - kernel BUG at ../fs/btrfs/extent-tree.c:1872

2016-10-19 Thread Dāvis Mosāns
Happens for me too with 4.8.2 [ 1002.265296] BTRFS info (device vdb): disk space caching is enabled [ 1002.265299] BTRFS info (device vdb): has skinny extents [ 1002.952569] BTRFS info (device vdb): continuing balance [ 1003.079696] BTRFS info (device vdb): relocating block group 655951396864

Re: Cross subvolume "cp --reflink"?

2016-10-19 Thread Andrei Borzenkov
19.10.2016 20:04, Hugo Mills пишет: > On Wed, Oct 19, 2016 at 07:52:14PM +0300, Andrei Borzenkov wrote: >> I get "Failed to clone: Invalid cross-device link". Is it expected? >> Basically this is (on openSUSE TW which has root on subvolume) >> >> mount -o subvol=/ /dev/vda1 /mnt >> btrfs sub

Re: [PATCH 3/3] btrfs-progs: Add command to check if balance op is req

2016-10-19 Thread Divya Indi
On 10/17/2016 06:42 PM, Qu Wenruo wrote: At 10/18/2016 08:35 AM, Divya Indi wrote: Add new subcommand to btrfs inspect-internal btrfs inspect-internal balance_check Checks whether 'btrfs balance' can help creating more space (Only considers data block groups). I didn't think it's good to

Re: Cross subvolume "cp --reflink"?

2016-10-19 Thread Hugo Mills
On Wed, Oct 19, 2016 at 07:52:14PM +0300, Andrei Borzenkov wrote: > I get "Failed to clone: Invalid cross-device link". Is it expected? > Basically this is (on openSUSE TW which has root on subvolume) > > mount -o subvol=/ /dev/vda1 /mnt > btrfs sub create /mnt/var/cache > cp -a --reflink=always

Cross subvolume "cp --reflink"?

2016-10-19 Thread Andrei Borzenkov
I get "Failed to clone: Invalid cross-device link". Is it expected? Basically this is (on openSUSE TW which has root on subvolume) mount -o subvol=/ /dev/vda1 /mnt btrfs sub create /mnt/var/cache cp -a --reflink=always /var/cache/* /mnt/var/cache Kernel 4.7.5-1-default. -- To unsubscribe from

Re: [PATCH] btrfs: pass correct args to btrfs_async_run_delayed_refs()

2016-10-19 Thread David Sterba
On Wed, Oct 19, 2016 at 12:57:19PM +0800, Wang Xiaoguang wrote: > hi, > > On 10/18/2016 06:32 PM, Holger Hoffstätte wrote: > > On Tue, 18 Oct 2016 15:56:13 +0800, Wang Xiaoguang wrote: > > > >> In btrfs_truncate_inode_items()->btrfs_async_run_delayed_refs(), we > >> swap the arg2 and arg3

Re: [patch] Btrfs: remove some no-op casts

2016-10-19 Thread David Sterba
On Wed, Oct 12, 2016 at 11:33:21AM +0300, Dan Carpenter wrote: > We cast 0 to a u8 but then because of type promotion, it's immediately > cast to int back to int before we do a bitwise negate. The cast doesn't > matter in this case, the code works as intended. It causes a static > checker

Re: [PATCH 2/2] btrfs: fix false enospc for compression

2016-10-19 Thread David Sterba
On Mon, Oct 17, 2016 at 05:01:46PM +0800, Wang Xiaoguang wrote: > > [..] > >> int btrfs_set_extent_delalloc(struct inode *inode, u64 start, u64 end, > >> -struct extent_state **cached_state); > >> +struct extent_state **cached_state, int flag); >

Warning in __btrfs_free_extent due to -ENOENT backrefs

2016-10-19 Thread Nikolay Borisov
Hello, So I got the following warnings on one of my server: [361464.059606] [ cut here ] [361464.059831] WARNING: CPU: 6 PID: 7637 at fs/btrfs/extent-tree.c:6543 __btrfs_free_extent.isra.66+0x65c/0xcb0 [btrfs]() [361464.064134] CPU: 6 PID: 7637 Comm: btrfs-cleaner

Re: [PATCH 1/2] btrfs-progs: fsck: Add support to clear v1 free space cache.

2016-10-19 Thread David Sterba
On Thu, Oct 13, 2016 at 05:22:26PM +0800, Qu Wenruo wrote: > Kernel clear_cache mount option will only rebuilt free space cache if > used space of that chunk has changed. > > So it won't ensure any corrupted free space cache get cleared. > > So add a new option "--clear-space-cache v1|v2" to

Re: Monitoring Btrfs

2016-10-19 Thread Austin S. Hemmelgarn
On 2016-10-18 17:36, Anand Jain wrote: I would like to monitor my btrfs-filesystem for missing drives. This is actually correct behavior, the filesystem reports that it should have 6 devices, which is how it knows a device is missing. Missing - means missing at the time of mount. So

Re: Monitoring Btrfs

2016-10-19 Thread Austin S. Hemmelgarn
On 2016-10-19 09:06, Anand Jain wrote: On 10/19/16 19:15, Austin S. Hemmelgarn wrote: On 2016-10-18 17:36, Anand Jain wrote: I would like to monitor my btrfs-filesystem for missing drives. This is actually correct behavior, the filesystem reports that it should have 6 devices, which

Re: [PATCH 2/2] btrfs-progs: fsck-tests: Check if clear space cache works

2016-10-19 Thread David Sterba
On Thu, Oct 13, 2016 at 05:22:27PM +0800, Qu Wenruo wrote: > +check_prereq mkfs.btrfs > + > +setup_root_helper > +prepare_test_dev 1G > + > +tmp=$(mktemp) > +run_check $SUDO_HELPER $TOP/mkfs.btrfs -f $TEST_DEV > +run_check_mount_test_dev > + > +# Create files that takes at least 3 data chunks,

Re: [PATCH v2 1/3] btrfs-progs: send: remove unnecessary code

2016-10-19 Thread David Sterba
On Wed, Oct 19, 2016 at 12:45:57PM +0900, Tsutomu Itoh wrote: > Some unnecessary codes are deleted. > > - the setting of subvol is double. > - read only check was already done by previous loop. > > Signed-off-by: Tsutomu Itoh Applied, thanks. -- To unsubscribe from

Re: Monitoring Btrfs

2016-10-19 Thread Anand Jain
On 10/19/16 19:15, Austin S. Hemmelgarn wrote: On 2016-10-18 17:36, Anand Jain wrote: I would like to monitor my btrfs-filesystem for missing drives. This is actually correct behavior, the filesystem reports that it should have 6 devices, which is how it knows a device is missing.

Re: csum failed during copy/compare

2016-10-19 Thread Martin Dev
Fails on Antergos Linux 4.8.2-1-ARCH #1 SMP PREEMPT Mon Oct 17 08:11:46 CEST 2016 x86_64 GNU/Linux btrfs-progs v4.8.1 On Mon, Oct 10, 2016 at 10:05 PM, Chris Murphy wrote: > On Mon, Oct 10, 2016 at 12:42 PM, Roman Mamedov wrote: >> On Mon, 10 Oct 2016

Re: [PATCH 1/2] btrfs: Add WARN_ON for qgroup reserved underflow

2016-10-19 Thread David Sterba
On Fri, Sep 30, 2016 at 09:15:36AM +0800, Qu Wenruo wrote: > While the reason why qgroup reserved space may underflow is still under > investigation, such WARN_ON will help us to expose the bug more easily, > and for end-user we can detect and avoid underflow. > > Signed-off-by: Qu Wenruo

WARNING at extent-tree.c:6945 __btrfs_free_extent.isra.33+0x7d6/0xca0 (Linux 4.8.0)

2016-10-19 Thread Dāvis Mosāns
Basically on multi-disk btrfs partition few sectors on one HDD became unreadable and when trying to delete one folder on that filesystem I got this in log [12210.590339] WARNING: CPU: 4 PID: 3375 at /mnt/linux/fs/btrfs/extent-tree.c:6945 __btrfs_free_extent.isra.33+0x7d6/0xca0 [btrfs]

Re: [PATCH v13 00/15] Btrfs In-band De-duplication

2016-10-19 Thread Qu Wenruo
At 10/17/2016 10:30 PM, David Sterba wrote: On Thu, Sep 08, 2016 at 03:12:49PM +0800, Qu Wenruo wrote: This patchset can be fetched from github: https://github.com/adam900710/linux.git wang_dedupe_20160907 Can you please publish the patchset in a branch that does not change name and is not