Re: btrfs space used issue

2018-02-27 Thread vinayak hegde
I ran full defragement and balance both, but didnt help. My created and accounting usage files are matching the du -sh output. But I am not getting why btrfs internals use so much extra space. My worry is, will get no space error earlier than I expect. Is it expected with btrfs internal that it

Re: incremental send/receive ERROR: cannot find parent subvolume

2018-02-27 Thread Andrei Borzenkov
27.02.2018 01:54, Emil.s пишет: > Hello, > > I'm trying to restore a subvolume from a backup, but I'm failing when > I try to setup the replication chain again. > > Previously I had disk A and B, where I was sending snapshots from A to > B using "send -c /disk_a/1 /disk_a/2 | receive /disk_b"

Re: [PATCH v2 14/27] libbtrfsutil: add btrfs_util_deleted_subvolumes()

2018-02-27 Thread Misono, Tomohiro
On 2018/02/24 8:33, Omar Sandoval wrote: > On Fri, Feb 23, 2018 at 11:12:56AM +0900, Misono, Tomohiro wrote: >> >> On 2018/02/16 4:04, Omar Sandoval wrote: >>> From: Omar Sandoval >>> >>> Signed-off-by: Omar Sandoval >>> --- >>> libbtrfsutil/btrfsutil.h

[PATCH] Btrfs: dev-replace: skip prealloc extents when copy nocow pages

2018-02-27 Thread Liu Bo
It doens't make sense to process prealloc extents as pages will be filled with zero when reading prealloc extents. Signed-off-by: Liu Bo --- fs/btrfs/scrub.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/fs/btrfs/scrub.c b/fs/btrfs/scrub.c index

Re: [PATCH 1/1] btrfs: introduce feature to forget a btrfs device

2018-02-27 Thread Liu Bo
On Thu, Jan 11, 2018 at 09:25:50AM +0800, Anand Jain wrote: > Support for a new command 'btrfs dev forget [dev]' is proposed here, > to undo the effects of 'btrfs dev scan [dev]'. For this purpose, > this patch proposes to use ioctl #5 as it was empty. > IOW(BTRFS_IOCTL_MAGIC, 5, ..) > This

Re: [PATCH 1/4] btrfs-progs: check: Check data csum for all copies

2018-02-27 Thread Su Yue
On 02/27/2018 06:31 PM, Qu Wenruo wrote: On 2018年02月27日 18:01, Su Yue wrote: On 02/27/2018 05:12 PM, Qu Wenruo wrote: Original --check-data-csum option will skip the extra copy if the first copy matches csum. Since offline scrub (with recoverability report) is still out-of-tree, at

Re: [PATCH v2 00/27] btrfs-progs: introduce libbtrfsutil, "btrfs-progs as a library"

2018-02-27 Thread Omar Sandoval
On Tue, Feb 27, 2018 at 04:04:28PM +0100, David Sterba wrote: > On Mon, Feb 26, 2018 at 03:36:41PM -0800, Omar Sandoval wrote: > > On Fri, Feb 23, 2018 at 09:28:42PM +0100, David Sterba wrote: > > > On Wed, Feb 21, 2018 at 10:50:32AM -0800, Omar Sandoval wrote: > > > > On Wed, Feb 21, 2018 at

Re: [PATCH 1/1] btrfs: fix NPD when target device is missing

2018-02-27 Thread David Sterba
On Sat, Feb 24, 2018 at 10:07:33PM +0800, Anand Jain wrote: > >> IP: btrfs_destroy_dev_replace_tgtdev+0x43/0xf0 [btrfs] > >> Call Trace: > >> btrfs_dev_replace_cancel+0x15f/0x180 [btrfs] > >> btrfs_ioctl+0x2216/0x2590 [btrfs] > >> do_vfs_ioctl+0x625/0x650 > >> SyS_ioctl+0x4e/0x80 > >>

Re: Please update the BTRFS status page

2018-02-27 Thread David Sterba
On Sat, Feb 24, 2018 at 03:05:48AM +0100, waxhead wrote: > The latest released kernel is 4.15 Updated. There's one pending ack for the degraded mount that's still mostly-ok but IMHO it's been fixed in 4.14 so it'll be OK. -- To unsubscribe from this list: send the line "unsubscribe linux-btrfs"

Re: [PATCH v3] btrfs: verify max_inline mount parameter

2018-02-27 Thread David Sterba
On Mon, Feb 26, 2018 at 10:47:04AM +0800, Anand Jain wrote: > We aren't verifying the parameter passed to the max_inline mount option. > So we won't fail the mount if a junk value is specified, for example, > -o max_inline=abc. This patch checks if input is valid. > > Signed-off-by: Anand Jain

[PATCH 1/3] btrfs: Remove redundant comment from btrfs_search_forward

2018-02-27 Thread Nikolay Borisov
This function always sets keep_locks to 1 and saves the old value of keep_locks which is restored at the end. So there is no way it can be called without keep_locks being set. Remove comment imposing redundant requirement on callers. Signed-off-by: Nikolay Borisov ---

[PATCH 3/3] btrfs: Remove root argument from btrfs_log_dentry_safe

2018-02-27 Thread Nikolay Borisov
Now that nothing uses the root arg of btrfs_log_dentry_safe it can be safely removed. No functional changes. Signed-off-by: Nikolay Borisov --- fs/btrfs/file.c | 2 +- fs/btrfs/tree-log.c | 2 +- fs/btrfs/tree-log.h | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-)

[PATCH 2/3] btrfs: Remove root arg from btrfs_log_inode_parent

2018-02-27 Thread Nikolay Borisov
btrfs_log_inode_parent is called from 2 places (btrfs_log_dentry_safe and btrfs_log_new_name) both of which pass inode->root as the root argument and the inode itself. Remove the redundant root argument and get a reference to the root directly from the inode, also remove redundant root !=

Re: [PATCH v2 00/27] btrfs-progs: introduce libbtrfsutil, "btrfs-progs as a library"

2018-02-27 Thread David Sterba
On Mon, Feb 26, 2018 at 03:36:41PM -0800, Omar Sandoval wrote: > On Fri, Feb 23, 2018 at 09:28:42PM +0100, David Sterba wrote: > > On Wed, Feb 21, 2018 at 10:50:32AM -0800, Omar Sandoval wrote: > > > On Wed, Feb 21, 2018 at 04:13:38PM +0100, David Sterba wrote: > > > > On Tue, Feb 20, 2018 at

Re: [PATCH 0/4] Minor xattr handler cleanups

2018-02-27 Thread Nikolay Borisov
On 27.02.2018 16:48, David Sterba wrote: > Renames, declearation updates. > > David Sterba (4): > btrfs: drop underscores from exported xattr functions > btrfs: drop extern from function declarations > btrfs: adjust return type of btrfs_getxattr > btrfs: move btrfs_listxattr prototype

[PATCH 2/4] btrfs: drop extern from function declarations

2018-02-27 Thread David Sterba
Extern for functions does not make any difference, there are only a few so let's remove them before it's too late. Signed-off-by: David Sterba --- fs/btrfs/extent_io.h | 4 ++-- fs/btrfs/xattr.h | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git

[PATCH 3/4] btrfs: adjust return type of btrfs_getxattr

2018-02-27 Thread David Sterba
The xattr_handler::get prototype returns int, use it. The only ssize_t exception is the per-inode listxattr handler. Signed-off-by: David Sterba --- fs/btrfs/xattr.c | 2 +- fs/btrfs/xattr.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git

[PATCH 0/4] Minor xattr handler cleanups

2018-02-27 Thread David Sterba
Renames, declearation updates. David Sterba (4): btrfs: drop underscores from exported xattr functions btrfs: drop extern from function declarations btrfs: adjust return type of btrfs_getxattr btrfs: move btrfs_listxattr prototype to xattr.h fs/btrfs/acl.c | 6 +++---

[PATCH 1/4] btrfs: drop underscores from exported xattr functions

2018-02-27 Thread David Sterba
Signed-off-by: David Sterba --- fs/btrfs/acl.c | 6 +++--- fs/btrfs/props.c | 6 +++--- fs/btrfs/xattr.c | 12 ++-- fs/btrfs/xattr.h | 4 ++-- 4 files changed, 14 insertions(+), 14 deletions(-) diff --git a/fs/btrfs/acl.c b/fs/btrfs/acl.c index

[PATCH 4/4] btrfs: move btrfs_listxattr prototype to xattr.h

2018-02-27 Thread David Sterba
There's a proper header for xattr handlers. Signed-off-by: David Sterba --- fs/btrfs/ctree.h | 3 --- fs/btrfs/xattr.h | 1 + 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/fs/btrfs/ctree.h b/fs/btrfs/ctree.h index 1a462ab85c49..736ba2805d03 100644 ---

Re: btrfs space used issue

2018-02-27 Thread Austin S. Hemmelgarn
On 2018-02-27 08:09, vinayak hegde wrote: I am using btrfs, But I am seeing du -sh and df -h showing huge size difference on ssd. mount: /dev/drbd1 on /dc/fileunifier.datacache type btrfs (rw,noatime,nodiratime,flushoncommit,discard,nospace_cache,recovery,commit=5,subvolid=5,subvol=/) du -sh

btrfs space used issue

2018-02-27 Thread vinayak hegde
I am using btrfs, But I am seeing du -sh and df -h showing huge size difference on ssd. mount: /dev/drbd1 on /dc/fileunifier.datacache type btrfs (rw,noatime,nodiratime,flushoncommit,discard,nospace_cache,recovery,commit=5,subvolid=5,subvol=/) du -sh /dc/fileunifier.datacache/ - 331G df -h

Re: [PATCH 1/4] btrfs-progs: check: Check data csum for all copies

2018-02-27 Thread Qu Wenruo
On 2018年02月27日 19:09, Nikolay Borisov wrote: > > > On 27.02.2018 12:31, Qu Wenruo wrote: >> >> >> On 2018年02月27日 18:01, Su Yue wrote: >>> >>> >>> On 02/27/2018 05:12 PM, Qu Wenruo wrote: Original --check-data-csum option will skip the extra copy if the first copy matches csum.

Re: [PATCH 1/4] btrfs-progs: check: Check data csum for all copies

2018-02-27 Thread Nikolay Borisov
On 27.02.2018 12:31, Qu Wenruo wrote: > > > On 2018年02月27日 18:01, Su Yue wrote: >> >> >> On 02/27/2018 05:12 PM, Qu Wenruo wrote: >>> Original --check-data-csum option will skip the extra copy if the first >>> copy matches csum. >>> >>> Since offline scrub (with recoverability report) is still

Re: [PATCH 1/4] btrfs-progs: check: Check data csum for all copies

2018-02-27 Thread Qu Wenruo
On 2018年02月27日 18:01, Su Yue wrote: > > > On 02/27/2018 05:12 PM, Qu Wenruo wrote: >> Original --check-data-csum option will skip the extra copy if the first >> copy matches csum. >> >> Since offline scrub (with recoverability report) is still out-of-tree, at >> least enhance --check-data-csum

[PATCH] btrfs-progs: check/lowmem: Fix the incorrect error message of check_extent_data_item

2018-02-27 Thread Lu Fengqi
Instead of the disk_bytenr and disk_num_bytes of the extent_item which the file extent references, we should output the objectid and offset of the file extent. Fixes: b0d360b541f0 ("btrfs-progs: check: introduce function to check data backref in extent tree") Signed-off-by: Lu Fengqi

Re: [PATCH 1/4] btrfs-progs: check: Check data csum for all copies

2018-02-27 Thread Su Yue
On 02/27/2018 05:12 PM, Qu Wenruo wrote: Original --check-data-csum option will skip the extra copy if the first copy matches csum. Since offline scrub (with recoverability report) is still out-of-tree, at least enhance --check-data-csum option to handle multiple copies. Signed-off-by: Qu

[PATCH 1/4] btrfs-progs: check: Check data csum for all copies

2018-02-27 Thread Qu Wenruo
Original --check-data-csum option will skip the extra copy if the first copy matches csum. Since offline scrub (with recoverability report) is still out-of-tree, at least enhance --check-data-csum option to handle multiple copies. Signed-off-by: Qu Wenruo --- check/main.c | 65

[PATCH 4/4] btrfs-progs: check: Distingusih csum checking output for --check-data-csum

2018-02-27 Thread Qu Wenruo
No matter --check-data-csum is passed or not, btrfs check will always output message like "checking csum". This message could be a little confusing, change it according to --check-data-csum option. Signed-off-by: Qu Wenruo --- check/main.c | 6 +- 1 file changed, 5

[PATCH 3/4] btrfs-progs: check: Continue check even csum error is found

2018-02-27 Thread Qu Wenruo
Since data csum is not a fatal error compared to fs/extent trees, continue check. Signed-off-by: Qu Wenruo --- check/main.c | 10 ++ 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/check/main.c b/check/main.c index 15b3c402c9f5..22a78273be15 100644 ---

[PATCH 2/4] btrfs-progs: check: Fix data csum check return value

2018-02-27 Thread Qu Wenruo
When --check-data-csum option found csum mismatch, btrfs check still return 0. Fix it so log-replay could automatically pause when found csum error. Signed-off-by: Qu Wenruo --- check/main.c | 16 +++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git

[PATCH 0/4] btrfs check --check-data-csum enhancement for

2018-02-27 Thread Qu Wenruo
Log-writes tool from Josef exposed btrfs data corruption. Although still digging, at least enhance --check-data-csum option so that log-replay --check can stop exactly at the point where btrfs data get corrupted, instead of manually checking the output. Qu Wenruo (4): btrfs-progs: check: Check