Re: [PATCH] btrfs-progs: ins: Add v2 ioctl support in logical-resolve

2018-07-18 Thread Lu Fengqi
On Thu, Jul 19, 2018 at 01:51:59PM +0800, Qu Wenruo wrote: > > >On 2018年07月19日 13:15, Misono Tomohiro wrote: >> Add -i (ignore offset) option to logical-resolve command >> to show how BTRFS_IOC_LOGICAL_INO_V2 ioctl works >> (returns every ref to the extent of given logical address). >> >>

Re: [PATCH] btrfs-progs: ins: Add v2 ioctl support in logical-resolve

2018-07-18 Thread Qu Wenruo
On 2018年07月19日 13:15, Misono Tomohiro wrote: > Add -i (ignore offset) option to logical-resolve command > to show how BTRFS_IOC_LOGICAL_INO_V2 ioctl works > (returns every ref to the extent of given logical address). > > [Example] > $ mkfs.btrfs -f $DEV > $ mount $DEV /mnt > > $ dd

[PATCH] btrfs-progs: ins: Add v2 ioctl support in logical-resolve

2018-07-18 Thread Misono Tomohiro
Add -i (ignore offset) option to logical-resolve command to show how BTRFS_IOC_LOGICAL_INO_V2 ioctl works (returns every ref to the extent of given logical address). [Example] $ mkfs.btrfs -f $DEV $ mount $DEV /mnt $ dd if=/dev/urandom of=/mnt/file bs=4k count=100 # split above extent $ dd

Re: btrfs check (not lowmem) and OOM-like hangs (4.17.6)

2018-07-18 Thread Marc MERLIN
On Wed, Jul 18, 2018 at 10:42:21PM +0300, Andrei Borzenkov wrote: > > Any help from other experienced developers would definitely help to > > solve why memory of 'btrfs check' is not swapped out or why OOM killer > > is not triggered. > > Almost all used memory is marked as "active" and active

Re: Healthy amount of free space?

2018-07-18 Thread Chris Murphy
Related on XFS list. https://www.spinics.net/lists/linux-xfs/msg20722.html -- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html

Re: Healthy amount of free space?

2018-07-18 Thread Chris Murphy
On Wed, Jul 18, 2018 at 12:01 PM, Austin S. Hemmelgarn wrote: > On 2018-07-18 13:40, Chris Murphy wrote: >> >> On Wed, Jul 18, 2018 at 11:14 AM, Chris Murphy >> wrote: >> >>> I don't know for sure, but based on the addresses reported before and >>> after dd for the fallocated tmp file, it looks

Re: [PATCH 0/4] 3- and 4- copy RAID1

2018-07-18 Thread Goffredo Baroncelli
On 07/18/2018 09:20 AM, Duncan wrote: > Goffredo Baroncelli posted on Wed, 18 Jul 2018 07:59:52 +0200 as > excerpted: > >> On 07/17/2018 11:12 PM, Duncan wrote: >>> Goffredo Baroncelli posted on Mon, 16 Jul 2018 20:29:46 +0200 as >>> excerpted: >>> On 07/15/2018 04:37 PM, waxhead wrote: >>>

Re: btrfs check (not lowmem) and OOM-like hangs (4.17.6)

2018-07-18 Thread Andrei Borzenkov
18.07.2018 03:05, Qu Wenruo пишет: > > > On 2018年07月18日 04:59, Marc MERLIN wrote: >> Ok, I did more testing. Qu is right that btrfs check does not crash the >> kernel. >> It just takes all the memory until linux hangs everywhere, and somehow (no >> idea why) >> the OOM killer never triggers.

Re: Healthy amount of free space?

2018-07-18 Thread Austin S. Hemmelgarn
On 2018-07-18 13:40, Chris Murphy wrote: On Wed, Jul 18, 2018 at 11:14 AM, Chris Murphy wrote: I don't know for sure, but based on the addresses reported before and after dd for the fallocated tmp file, it looks like Btrfs is not using the originally fallocated addresses for dd. So maybe it

Re: Healthy amount of free space?

2018-07-18 Thread Chris Murphy
On Wed, Jul 18, 2018 at 11:14 AM, Chris Murphy wrote: > I don't know for sure, but based on the addresses reported before and > after dd for the fallocated tmp file, it looks like Btrfs is not using > the originally fallocated addresses for dd. So maybe it is COWing into > new blocks, but is

Re: Healthy amount of free space?

2018-07-18 Thread Chris Murphy
On Wed, Jul 18, 2018 at 11:06 AM, Austin S. Hemmelgarn wrote: > On 2018-07-18 13:04, Chris Murphy wrote: >> >> On Wed, Jul 18, 2018 at 7:30 AM, Austin S. Hemmelgarn >> wrote: >> >>> >>> I'm not sure. In this particular case, this will fail on BTRFS for any X >>> larger than just short of one

Re: Healthy amount of free space?

2018-07-18 Thread Chris Murphy
On Wed, Jul 18, 2018 at 7:30 AM, Austin S. Hemmelgarn wrote: > > I'm not sure. In this particular case, this will fail on BTRFS for any X > larger than just short of one third of the total free space. I would expect > it to fail for any X larger than just short of half instead. I'm confused.

Re: [PATCH] btrfs-progs: btrfs_close_devices(): only fsync() if device->writeable

2018-07-18 Thread David Sterba
On Wed, Jun 06, 2018 at 02:30:41AM -0400, james harvey wrote: > Prevent unnecessary error from failing fsync(), if opened read only. > > Performed 'grep "writeable = " *.h *.c' to make sure there were no odd > situations where fsync() might still be desired here. They're all straight- > forward.

Re: [PATCH v2 2/3] btrfs-progs: map-logical: Use btrfs_next_extent_item()

2018-07-18 Thread David Sterba
On Thu, Jun 07, 2018 at 03:20:02AM -0400, james harvey wrote: > btrfs_next_extent_item() looks for BTRFS_EXTENT_ITEM_KEY and > BTRFS_METADATA_KEY, > which are the types we're looking for. > > Signed-off-by: James Harvey Applied, thanks. -- To unsubscribe from this list: send the line

Re: [PATCH 00/19] qgroup unused parameter cleanup

2018-07-18 Thread David Sterba
On Wed, Jul 18, 2018 at 02:45:23PM +0800, Lu Fengqi wrote: > The transaction handler can provide fs_info, so we can fetch fs_info or > quota_root(indirectly) from trans. Just remove the redundant parameter > from qgroup functions. Added to misc-next now, thanks. -- To unsubscribe from this list:

Re: Healthy amount of free space?

2018-07-18 Thread Austin S. Hemmelgarn
On 2018-07-18 09:07, Chris Murphy wrote: On Wed, Jul 18, 2018 at 6:35 AM, Austin S. Hemmelgarn wrote: If you're doing a training presentation, it may be worth mentioning that preallocation with fallocate() does not behave the same on BTRFS as it does on other filesystems. For example, the

Re: Healthy amount of free space?

2018-07-18 Thread Chris Murphy
On Wed, Jul 18, 2018 at 6:35 AM, Austin S. Hemmelgarn wrote: > If you're doing a training presentation, it may be worth mentioning that > preallocation with fallocate() does not behave the same on BTRFS as it does > on other filesystems. For example, the following sequence of commands: > >

Re: [PATCH 0/4] 3- and 4- copy RAID1

2018-07-18 Thread Hugo Mills
On Wed, Jul 18, 2018 at 08:39:48AM +, Duncan wrote: > Duncan posted on Wed, 18 Jul 2018 07:20:09 + as excerpted: > > >> As implemented in BTRFS, raid1 doesn't have striping. > > > > The argument is that because there's only two copies, on multi-device > > btrfs raid1 with 4+ devices of

Re: [PATCH 0/4] 3- and 4- copy RAID1

2018-07-18 Thread Austin S. Hemmelgarn
On 2018-07-18 03:20, Duncan wrote: Goffredo Baroncelli posted on Wed, 18 Jul 2018 07:59:52 +0200 as excerpted: On 07/17/2018 11:12 PM, Duncan wrote: Goffredo Baroncelli posted on Mon, 16 Jul 2018 20:29:46 +0200 as excerpted: On 07/15/2018 04:37 PM, waxhead wrote: Striping and

Re: [PATCH 0/4] 3- and 4- copy RAID1

2018-07-18 Thread Austin S. Hemmelgarn
On 2018-07-18 04:39, Duncan wrote: Duncan posted on Wed, 18 Jul 2018 07:20:09 + as excerpted: As implemented in BTRFS, raid1 doesn't have striping. The argument is that because there's only two copies, on multi-device btrfs raid1 with 4+ devices of equal size so chunk allocations tend to

Re: Healthy amount of free space?

2018-07-18 Thread Austin S. Hemmelgarn
On 2018-07-17 13:54, Martin Steigerwald wrote: Nikolay Borisov - 17.07.18, 10:16: On 17.07.2018 11:02, Martin Steigerwald wrote: Nikolay Borisov - 17.07.18, 09:20: On 16.07.2018 23:58, Wolf wrote: Greetings, I would like to ask what what is healthy amount of free space to keep on each device

Re: [PATCH 0/4] 3- and 4- copy RAID1

2018-07-18 Thread Duncan
Duncan posted on Wed, 18 Jul 2018 07:20:09 + as excerpted: >> As implemented in BTRFS, raid1 doesn't have striping. > > The argument is that because there's only two copies, on multi-device > btrfs raid1 with 4+ devices of equal size so chunk allocations tend to > alternate device pairs,

[PATCH v2 13/19] btrfs: qgroup: Drop fs_info parameter from btrfs_qgroup_trace_extent

2018-07-18 Thread Lu Fengqi
It can be fetched from the transaction handle. In addition, remove the WARN_ON(trans == NULL) because there shouldn't hit this condition. Signed-off-by: Lu Fengqi --- v2: Remove the WARN_ON(trans == NULL) suggested by Qu Wenruo. fs/btrfs/qgroup.c | 15 ++- fs/btrfs/qgroup.h |

Re: [PATCH 13/19] btrfs: qgroup: Drop fs_info parameter from btrfs_qgroup_trace_extent

2018-07-18 Thread Qu Wenruo
On 2018年07月18日 15:54, Lu Fengqi wrote: > On Wed, Jul 18, 2018 at 02:58:06PM +0800, Qu Wenruo wrote: >> >> >> On 2018年07月18日 14:45, Lu Fengqi wrote: >>> It can be fetched from the transaction handle. >>> >>> Signed-off-by: Lu Fengqi >>> --- >>> fs/btrfs/qgroup.c | 13 ++--- >>>

Re: [PATCH 13/19] btrfs: qgroup: Drop fs_info parameter from btrfs_qgroup_trace_extent

2018-07-18 Thread Lu Fengqi
On Wed, Jul 18, 2018 at 02:58:06PM +0800, Qu Wenruo wrote: > > >On 2018年07月18日 14:45, Lu Fengqi wrote: >> It can be fetched from the transaction handle. >> >> Signed-off-by: Lu Fengqi >> --- >> fs/btrfs/qgroup.c | 13 ++--- >> fs/btrfs/qgroup.h | 5 ++--- >> fs/btrfs/tree-log.c |

Re: [PATCH 0/4] 3- and 4- copy RAID1

2018-07-18 Thread Duncan
Goffredo Baroncelli posted on Wed, 18 Jul 2018 07:59:52 +0200 as excerpted: > On 07/17/2018 11:12 PM, Duncan wrote: >> Goffredo Baroncelli posted on Mon, 16 Jul 2018 20:29:46 +0200 as >> excerpted: >> >>> On 07/15/2018 04:37 PM, waxhead wrote: >> >>> Striping and mirroring/pairing are

Re: [PATCH 00/19] qgroup unused parameter cleanup

2018-07-18 Thread Qu Wenruo
On 2018年07月18日 14:45, Lu Fengqi wrote: > The transaction handler can provide fs_info, so we can fetch fs_info or > quota_root(indirectly) from trans. Just remove the redundant parameter > from qgroup functions. > > No functional change. The whole serious looks pretty good. Although for some

Re: [PATCH 13/19] btrfs: qgroup: Drop fs_info parameter from btrfs_qgroup_trace_extent

2018-07-18 Thread Qu Wenruo
On 2018年07月18日 14:45, Lu Fengqi wrote: > It can be fetched from the transaction handle. > > Signed-off-by: Lu Fengqi > --- > fs/btrfs/qgroup.c | 13 ++--- > fs/btrfs/qgroup.h | 5 ++--- > fs/btrfs/tree-log.c | 2 +- > 3 files changed, 9 insertions(+), 11 deletions(-) > > diff

[PATCH 15/19] btrfs: qgroup: Drop root parameter from btrfs_qgroup_trace_subtree

2018-07-18 Thread Lu Fengqi
The fs_info can be fetched from the transaction handle directly. Signed-off-by: Lu Fengqi --- fs/btrfs/extent-tree.c | 2 +- fs/btrfs/qgroup.c | 3 +-- fs/btrfs/qgroup.h | 1 - fs/btrfs/relocation.c | 5 ++--- 4 files changed, 4 insertions(+), 7 deletions(-) diff --git

[PATCH 06/19] btrfs: qgroup: Drop quota_root and fs_info parameters from update_qgroup_status_item

2018-07-18 Thread Lu Fengqi
They can be fetched from the transaction handle. Signed-off-by: Lu Fengqi --- fs/btrfs/qgroup.c | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/fs/btrfs/qgroup.c b/fs/btrfs/qgroup.c index d405b09ca6db..73608075db4e 100644 --- a/fs/btrfs/qgroup.c +++

[PATCH 04/19] btrfs: qgroup: Drop root parameter from update_qgroup_limit_item

2018-07-18 Thread Lu Fengqi
It can be fetched from the transaction handle. Signed-off-by: Lu Fengqi --- fs/btrfs/qgroup.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/fs/btrfs/qgroup.c b/fs/btrfs/qgroup.c index 6eb65a0e912e..763bcb3f24da 100644 --- a/fs/btrfs/qgroup.c +++

[PATCH 14/19] btrfs: qgroup: Drop fs_info parameter from btrfs_qgroup_trace_leaf_items

2018-07-18 Thread Lu Fengqi
It can be fetched from the transaction handle. Signed-off-by: Lu Fengqi --- fs/btrfs/extent-tree.c | 2 +- fs/btrfs/qgroup.c | 8 fs/btrfs/qgroup.h | 1 - 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c index

[PATCH 02/19] btrfs: qgroup: Drop quota_root parameter from del_qgroup_relation_item

2018-07-18 Thread Lu Fengqi
It can be fetched from the transaction handle. Signed-off-by: Lu Fengqi --- fs/btrfs/qgroup.c | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/fs/btrfs/qgroup.c b/fs/btrfs/qgroup.c index 489f0ff8036e..4c852ded1d52 100644 --- a/fs/btrfs/qgroup.c +++

[PATCH 12/19] btrfs: qgroup: Drop fs_info parameter from btrfs_limit_qgroup

2018-07-18 Thread Lu Fengqi
It can be fetched from the transaction handle. Signed-off-by: Lu Fengqi --- fs/btrfs/ioctl.c | 3 +-- fs/btrfs/qgroup.c | 4 ++-- fs/btrfs/qgroup.h | 3 +-- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c index 25bb192a3775..a92f07831627

[PATCH 11/19] btrfs: qgroup: Drop fs_info parameter from btrfs_remove_qgroup

2018-07-18 Thread Lu Fengqi
It can be fetched from the transaction handle. Signed-off-by: Lu Fengqi --- fs/btrfs/ioctl.c | 3 +-- fs/btrfs/qgroup.c | 4 ++-- fs/btrfs/qgroup.h | 3 +-- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c index ef0cdbdae98a..25bb192a3775

[PATCH 10/19] btrfs: qgroup: Drop fs_info parameter from btrfs_create_qgroup

2018-07-18 Thread Lu Fengqi
It can be fetched from the transaction handle. Signed-off-by: Lu Fengqi --- fs/btrfs/ioctl.c | 2 +- fs/btrfs/qgroup.c | 4 ++-- fs/btrfs/qgroup.h | 3 +-- fs/btrfs/tests/qgroup-tests.c | 4 ++-- 4 files changed, 6 insertions(+), 7 deletions(-) diff --git

[PATCH 13/19] btrfs: qgroup: Drop fs_info parameter from btrfs_qgroup_trace_extent

2018-07-18 Thread Lu Fengqi
It can be fetched from the transaction handle. Signed-off-by: Lu Fengqi --- fs/btrfs/qgroup.c | 13 ++--- fs/btrfs/qgroup.h | 5 ++--- fs/btrfs/tree-log.c | 2 +- 3 files changed, 9 insertions(+), 11 deletions(-) diff --git a/fs/btrfs/qgroup.c b/fs/btrfs/qgroup.c index

[PATCH 18/19] btrfs: qgroup: Drop fs_info parameter from btrfs_qgroup_inherit

2018-07-18 Thread Lu Fengqi
It can be fetched from the transaction handle. Signed-off-by: Lu Fengqi --- fs/btrfs/ioctl.c | 2 +- fs/btrfs/qgroup.c | 6 +++--- fs/btrfs/qgroup.h | 5 ++--- fs/btrfs/transaction.c | 3 +-- 4 files changed, 7 insertions(+), 9 deletions(-) diff --git a/fs/btrfs/ioctl.c

[PATCH 03/19] btrfs: qgroup: Drop quota_root parameter from del_qgroup_item

2018-07-18 Thread Lu Fengqi
It can be fetched from the transaction handle. Signed-off-by: Lu Fengqi --- fs/btrfs/qgroup.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/fs/btrfs/qgroup.c b/fs/btrfs/qgroup.c index 4c852ded1d52..6eb65a0e912e 100644 --- a/fs/btrfs/qgroup.c +++ b/fs/btrfs/qgroup.c

[PATCH 00/19] qgroup unused parameter cleanup

2018-07-18 Thread Lu Fengqi
The transaction handler can provide fs_info, so we can fetch fs_info or quota_root(indirectly) from trans. Just remove the redundant parameter from qgroup functions. No functional change. Lu Fengqi (19): btrfs: qgroup: Drop quota_root parameter from add_qgroup_relation_item btrfs: qgroup:

[PATCH 19/19] btrfs: qgroup: Drop fs_info parameter from qgroup_rescan_leaf

2018-07-18 Thread Lu Fengqi
It can be fetched from the transaction handle. Signed-off-by: Lu Fengqi --- fs/btrfs/qgroup.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/fs/btrfs/qgroup.c b/fs/btrfs/qgroup.c index 98eb2e314030..941fb06ff28b 100644 --- a/fs/btrfs/qgroup.c +++ b/fs/btrfs/qgroup.c

[PATCH 17/19] btrfs: qgroup: Drop fs_info parameter from btrfs_run_qgroups

2018-07-18 Thread Lu Fengqi
It can be fetched from the transaction handle. Signed-off-by: Lu Fengqi --- fs/btrfs/ioctl.c | 2 +- fs/btrfs/qgroup.c | 4 ++-- fs/btrfs/qgroup.h | 3 +-- fs/btrfs/transaction.c | 2 +- 4 files changed, 5 insertions(+), 6 deletions(-) diff --git a/fs/btrfs/ioctl.c

[PATCH 16/19] btrfs: qgroup: Drop fs_info parameter from btrfs_qgroup_account_extent

2018-07-18 Thread Lu Fengqi
It can be fetched from the transaction handle. Signed-off-by: Lu Fengqi --- fs/btrfs/qgroup.c | 20 ++-- fs/btrfs/qgroup.h | 8 +++- fs/btrfs/tests/qgroup-tests.c | 20 ++-- 3 files changed, 23 insertions(+), 25 deletions(-) diff

[PATCH 01/19] btrfs: qgroup: Drop quota_root parameter from add_qgroup_relation_item

2018-07-18 Thread Lu Fengqi
It can be fetched from the transaction handle. Signed-off-by: Lu Fengqi --- fs/btrfs/qgroup.c | 18 +- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/fs/btrfs/qgroup.c b/fs/btrfs/qgroup.c index 06e0e9b39340..489f0ff8036e 100644 --- a/fs/btrfs/qgroup.c +++

[PATCH 09/19] btrfs: qgroup: Drop fs_info parameter from btrfs_del_qgroup_relation

2018-07-18 Thread Lu Fengqi
It can be fetched from the transaction handle. Signed-off-by: Lu Fengqi --- fs/btrfs/ioctl.c | 3 +-- fs/btrfs/qgroup.c | 5 +++-- fs/btrfs/qgroup.h | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c index b8e3c1c3519e..15a9f9b9d8bc

[PATCH 08/19] btrfs: qgroup: Drop fs_info parameter from __del_qgroup_relation

2018-07-18 Thread Lu Fengqi
It can be fetched from the transaction handle. Signed-off-by: Lu Fengqi --- fs/btrfs/qgroup.c | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/fs/btrfs/qgroup.c b/fs/btrfs/qgroup.c index 9e709a01bfaa..51e43dbedbbc 100644 --- a/fs/btrfs/qgroup.c +++

[PATCH 05/19] btrfs: qgroup: Drop root parameter from update_qgroup_info_item

2018-07-18 Thread Lu Fengqi
It can be fetched from the transaction handle. Signed-off-by: Lu Fengqi --- fs/btrfs/qgroup.c | 9 + 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/fs/btrfs/qgroup.c b/fs/btrfs/qgroup.c index 763bcb3f24da..d405b09ca6db 100644 --- a/fs/btrfs/qgroup.c +++

[PATCH 07/19] btrfs: qgroup: Drop fs_info parameter from btrfs_add_qgroup_relation

2018-07-18 Thread Lu Fengqi
It can be fetched from the transaction handle. Signed-off-by: Lu Fengqi --- fs/btrfs/ioctl.c | 3 +-- fs/btrfs/qgroup.c | 5 +++-- fs/btrfs/qgroup.h | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c index 3f7b6fc6febf..b8e3c1c3519e

Re: [PATCH 0/4] 3- and 4- copy RAID1

2018-07-18 Thread Goffredo Baroncelli
On 07/17/2018 11:12 PM, Duncan wrote: > Goffredo Baroncelli posted on Mon, 16 Jul 2018 20:29:46 +0200 as > excerpted: > >> On 07/15/2018 04:37 PM, waxhead wrote: > >> Striping and mirroring/pairing are orthogonal properties; mirror and >> parity are mutually exclusive. > > I can't agree. I