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

2016-10-17 Thread Wang Xiaoguang
hi, On 10/14/2016 09:59 PM, Holger Hoffstätte wrote: On 10/06/16 04:51, Wang Xiaoguang wrote: When testing btrfs compression, sometimes we got ENOSPC error, though fs still has much free space, xfstests generic/171, generic/172, generic/173, generic/174, generic/175 can reveal this bug in my

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

2016-10-17 Thread Divya Indi
Add a new subcommand to btrfs inspect-internal btrfs inspect-internal bg_analysis Gives information about all the block groups. Signed-off-by: Divya Indi Reviewed-by: Ashish Samant Reviewed-by: Liu Bo --- cmds-inspect.c

[PATCH 1/3] btrfs-progs: Generic functions to retrieve chunks and their bg info

2016-10-17 Thread Divya Indi
An efficient alternative to retrieving block groups: get_chunks(): Walk the chunk tree to retrieve the chunks. get_bg_info(): For each retrieved chunk, lookup an exact match of block group in the extent tree. Signed-off-by: Divya Indi Reviewed-by: Ashish Samant

btrfs-progs: Add 2 new subcommands to inspect-internal

2016-10-17 Thread Divya Indi
These patches aim to add 2 new subcommands that: -> provide information about block groups -> help to decide whether balance can reduce the no. of data block groups and if it can, provides the block group object id for "-dvrange" [PATCH 1/3] btrfs-progs: Generic functions to retrieve chunks and

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

2016-10-17 Thread Divya Indi
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). Signed-off-by: Divya Indi Reviewed-by: Ashish Samant Reviewed-by:

Recovering from disk failure (RAID5)

2016-10-17 Thread Komu Kadze
Hi, I have a BTRFS setup with 8 HDD stripped with RAID5. I know its mark as experimental, as it has problem with power failures. I decided to give it a shot. Last night one of the disks in the array failed, the OS decided to remount the FS into read-only mode. The data was still accessible. I

Re: btrfs bio linked list corruption.

2016-10-17 Thread Chris Mason
On Sat, Oct 15, 2016 at 08:42:40PM -0400, Dave Jones wrote: On Thu, Oct 13, 2016 at 05:18:46PM -0400, Chris Mason wrote: > > > > .. and of course the first thing that happens is a completely different > > > > btrfs trace.. > > > > > > > > > > > > WARNING: CPU: 1 PID: 21706 at

[PATCH 4/4] btrfs: qgroup: Fix qgroup data leaking by using subtree tracing

2016-10-17 Thread Qu Wenruo
Commit 62b99540a1d91e464 (btrfs: relocation: Fix leaking qgroups numbers on data extents) only fixes the problem partly. The previous fix is to trace all new data extents at transaction commit time when balance finishes. However balance is not done in a large transaction, every path replacement

[PATCH 2/4] btrfs: qgroup: Rename functions to make it follow reserve,trace,account steps

2016-10-17 Thread Qu Wenruo
Rename btrfs_qgroup_insert_dirty_extent(_nolock) to btrfs_qgroup_trace_extent(_nolock), according to the new reserve/trace/account naming schema. Signed-off-by: Qu Wenruo --- fs/btrfs/delayed-ref.c | 2 +- fs/btrfs/extent-tree.c | 6 +++---

[PATCH 3/4] btrfs: Expoert and move leaf/subtree qgroup helpers to qgroup.c

2016-10-17 Thread Qu Wenruo
Move account_shared_subtree() to qgroup.c and rename it to btrfs_qgroup_trace_subtree(). Do the same thing for account_leaf_items() and rename it to btrfs_qgroup_trace_leaf_items(). Since all these functions are only for qgroup, move them to qgroup.c and export them is more appropriate.

[PATCH 1/4] btrfs: qgroup: Add comments explaining how btrfs qgroup works

2016-10-17 Thread Qu Wenruo
Add explain how btrfs qgroup works. Qgroup is split into 3 main phrases: 1) Reserve To ensure qgroup doesn't exceed its limit 2) Trace To info qgroup to trace which extent 3) Account Calculate qgroup number change for each traced extent. This should save quite some time for new

[PATCH 0/4] Qgroup comment enhance and balance fix

2016-10-17 Thread Qu Wenruo
The patchset does the following things: 1) Enhance comment for qgroup, rename 2 functions Explain the how qgroup works, so new developers won't waste too much time digging into the boring codes. The qgroup work flow is split into 3 main phrases: Reverse, Trace, Account. And rename

Re: [PATCH 1/3] btrfs-progs: Generic functions to retrieve chunks and their bg info

2016-10-17 Thread Qu Wenruo
At 10/18/2016 08:35 AM, Divya Indi wrote: An efficient alternative to retrieving block groups: get_chunks(): Walk the chunk tree to retrieve the chunks. get_bg_info(): For each retrieved chunk, lookup an exact match of block group in the extent tree. Signed-off-by: Divya Indi

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

2016-10-17 Thread Qu Wenruo
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 add a new subcommand just for that. Why

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

2016-10-17 Thread Qu Wenruo
At 10/18/2016 08:35 AM, Divya Indi wrote: Add a new subcommand to btrfs inspect-internal btrfs inspect-internal bg_analysis Gives information about all the block groups. Signed-off-by: Divya Indi Reviewed-by: Ashish Samant Reviewed-by: Liu

[PATCH 2/2] man2/ioctl_fideduperange.2: clarify operation some more

2016-10-17 Thread Darrick J. Wong
Clarify the behavior of the dedupe ioctl. Signed-off-by: Darrick J. Wong --- man2/ioctl_ficlonerange.2 |2 +- man2/ioctl_fideduperange.2 | 26 ++ 2 files changed, 23 insertions(+), 5 deletions(-) diff --git a/man2/ioctl_ficlonerange.2

[PATCH 1/2] man2/fallocate.2: document behavior with shared blocks

2016-10-17 Thread Darrick J. Wong
Add a blurb to the fallocate manpage explaining that the fallocate command with the UNSHARE mode flag may use CoW to unshare blocks to guarantee that a disk write won't fail with ENOSPC. Signed-off-by: Darrick J. Wong --- man2/fallocate.2 | 10 ++ 1 file

Re: Monitoring Btrfs

2016-10-17 Thread Anand Jain
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 how are you planning to monitor a disk

Re: speed up cp --reflink=always

2016-10-17 Thread Duncan
Stefan Priebe - Profihost AG posted on Mon, 17 Oct 2016 08:50:37 +0200 as excerpted: > Am 17.10.2016 um 03:50 schrieb Qu Wenruo: >> At 10/17/2016 02:54 AM, Stefan Priebe - Profihost AG wrote: >>> Am 16.10.2016 um 00:37 schrieb Hans van Kranenburg: Hi, On 10/15/2016 10:49 PM, Stefan

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

2016-10-17 Thread Roman Mamedov
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 inode", > > @@ -702,6 +814,8 @@ const struct

Re: What are "parent" and "parent_uuid" in "btrfs sub list"?

2016-10-17 Thread Hans van Kranenburg
On 10/17/2016 06:53 PM, Andrei Borzenkov wrote: > I try to understand how to build a tree of snapshots (i.e. - which > subvolume was used to snapshot/clone other subvolume). What is the > correct way to determine it? In particular, "btrfs sub list -p" always > prints something for "parent

Re: Monitoring Btrfs

2016-10-17 Thread Zygo Blaxell
On Mon, Oct 17, 2016 at 06:44:14PM +0200, Stefan Malte Schumacher wrote: > Hello > > I would like to monitor my btrfs-filesystem for missing drives. On > Debian mdadm uses a script in /etc/cron.daily, which calls mdadm and > sends an email if anything is wrong with the array. I would like to do >

Re: Monitoring Btrfs

2016-10-17 Thread Kyle Manna
On Mon, Oct 17, 2016 at 9:44 AM, Stefan Malte Schumacher wrote: > Hello > > I would like to monitor my btrfs-filesystem for missing drives. On > Debian mdadm uses a script in /etc/cron.daily, which calls mdadm and > sends an email if anything is wrong with the

Re: [PATCH 2/3] misc: fix fallocate commands that need the unshare switch

2016-10-17 Thread Darrick J. Wong
On Sat, Oct 15, 2016 at 11:18:37PM -0700, Christoph Hellwig wrote: > On Sat, Oct 15, 2016 at 10:03:03AM -0700, Christoph Hellwig wrote: > > The poster child would be btrfs, and I would have added some output > > here if btrfs support in xfstests wasn't completely broken at this > > point. > > > >

Re: speed up cp --reflink=always

2016-10-17 Thread Stefan Priebe - Profihost AG
Am 17.10.2016 um 03:50 schrieb Qu Wenruo: > At 10/17/2016 02:54 AM, Stefan Priebe - Profihost AG wrote: >> Am 16.10.2016 um 00:37 schrieb Hans van Kranenburg: >>> Hi, >>> >>> On 10/15/2016 10:49 PM, Stefan Priebe - Profihost AG wrote: cp --reflink=always takes sometimes very long. (i.e.

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

2016-10-17 Thread David Sterba
On Wed, Oct 12, 2016 at 11:12:42AM +0800, Wang Xiaoguang wrote: > hi, > > Stefan often reports enospc error in his servers when having btrfs > compression > enabled. Now he has applied these 2 patches to run and no enospc error > occurs > for more than 6 days, it seems they are useful :) > >

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

2016-10-17 Thread David Sterba
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 based on for-next? I'm' going to do less

Re: [PATCH] Btrfs: fix BUG_ON in btrfs_mark_buffer_dirty

2016-10-17 Thread David Sterba
On Thu, Oct 13, 2016 at 09:47:11AM +0100, Filipe Manana wrote: > > Since the crash is similar to the call chains from Jeff's report, > > ie. > > btrfs_del_csums > > -> btrfs_search_slot > > -> btrfs_cow_block > > -> btrfs_mark_buffer_dirty > > > > I just wonder that whether

Re: [PATCH] btrfs: make file clone aware of fatal signals

2016-10-17 Thread David Sterba
On Thu, Oct 13, 2016 at 09:23:39AM +0800, Wang Xiaoguang wrote: > Indeed this just make the behavior similar to xfs when process has > fatal signals pending, and it'll make fstests/generic/298 happy. > > Signed-off-by: Wang Xiaoguang Reviewed-by: David Sterba

Re: [PATCH] btrfs: assign error values to the correct bio structs

2016-10-17 Thread David Sterba
On Mon, Oct 17, 2016 at 09:20:25AM +0800, Junjie Mao wrote: > Fixes: 4246a0b63bd8 ("block: add a bi_error field to struct bio") > > Signed-off-by: Junjie Mao Ack, but please resend it with CC: sta...@vger.kernel.org # 4.3+ -- To unsubscribe from this list: send the line

Re: [PATCH] Btrfs: fix BUG_ON in btrfs_mark_buffer_dirty

2016-10-17 Thread Liu Bo
On Mon, Oct 17, 2016 at 03:00:25PM +0200, David Sterba wrote: > On Thu, Oct 13, 2016 at 09:47:11AM +0100, Filipe Manana wrote: > > > Since the crash is similar to the call chains from Jeff's report, > > > ie. > > > btrfs_del_csums > > > -> btrfs_search_slot > > > -> btrfs_cow_block > > >

[GIT PULL] Send fix for 4.9

2016-10-17 Thread fdmanana
From: Filipe Manana Hi Chris, please pull the following send fix for the 4.9 kernel. Doing snapshots while balance is ongoing can result in file extent items whose only difference between snapshots is their bytenr, which got replaced by the relocation process, and the inode

Monitoring Btrfs

2016-10-17 Thread Stefan Malte Schumacher
Hello I would like to monitor my btrfs-filesystem for missing drives. On Debian mdadm uses a script in /etc/cron.daily, which calls mdadm and sends an email if anything is wrong with the array. I would like to do the same with btrfs. In my first attempt I grepped and cut the information from

What are "parent" and "parent_uuid" in "btrfs sub list"?

2016-10-17 Thread Andrei Borzenkov
I try to understand how to build a tree of snapshots (i.e. - which subvolume was used to snapshot/clone other subvolume). What is the correct way to determine it? In particular, "btrfs sub list -p" always prints something for "parent snapshot", while btrfs sub list -q" only prints parent_uuid for

Re: Monitoring Btrfs

2016-10-17 Thread Austin S. Hemmelgarn
On 2016-10-17 12:44, Stefan Malte Schumacher wrote: Hello I would like to monitor my btrfs-filesystem for missing drives. On Debian mdadm uses a script in /etc/cron.daily, which calls mdadm and sends an email if anything is wrong with the array. I would like to do the same with btrfs. In my

Re: Monitoring Btrfs

2016-10-17 Thread Chris Murphy
May be better to use /sys/fs/btrfs//devices to find the device to monitor, and then monitor them with blktrace - maybe there's some courser granularity available there, I'm not sure. The thing is, as far as Btrfs alone is concerned, a drive can be "bad" and you're effectively degraded, while the

RE: raid6 file system in a bad state

2016-10-17 Thread Jason D. Michaelson
I've been following that thread. It's been my fear. I'm in the process of doing a restore of what I can get off of it so that i can re-create the file system with raid1 which, if i'm reading that thread correctly doesn't suffer at all from the rmw problems extant in the raid5/6 code at the