Re: btrfs-progs - failed btrfs replace on RAID1 seems to have left things in a wrong state

2017-11-30 Thread Duncan
Eric Mesa posted on Thu, 30 Nov 2017 07:43:59 -0500 as excerpted: > Hello, > > Not sure if this is a reportable bug, so I figured I'd start on the > mailing list and then report a bug if it is a bug and not user error. > > Here is the original state of a RAID1 in which I wanted to replace the >

[PATCH] Btrfs: use struct completion in scrub_submit_raid56_bio_wait

2017-11-30 Thread Liu Bo
This changes to use struct completion directly and removes 'struct scrub_bio_ret' along with the code using it. This struct is used to get the return value from bio, but the caller can access bio to get the return value directly and is holding a reference on bio so that it won't go away underneath

[PATCH RESEND] btrfs: ignore return from btrfs_open_one_device()

2017-11-30 Thread Anand Jain
Test case like btrfs-progs test-misc/012 can recreate the same fsid with different number of struct btrfs_fs_devices::total_devices. And the previous device which is in the kernel device list is stale now, but as we don't clean the kernel device list, and in the mount context, it really ends up rea

Re: [PATCH 2/4] btrfs: SETFLAGS ioctl: use helper for compression type conversion

2017-11-30 Thread Anand Jain
On 12/01/2017 12:09 AM, David Sterba wrote: Signed-off-by: David Sterba --- fs/btrfs/ioctl.c | 10 -- 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c index e8adebc8c1b0..c41c259d9283 100644 --- a/fs/btrfs/ioctl.c +++ b/fs/btrfs/ioctl

Re: [PATCH 1/4] btrfs: compression: add helper for type to string conversion

2017-11-30 Thread Anand Jain
On 12/01/2017 12:09 AM, David Sterba wrote: There are several places opencoding this conversion, add a helper now that we have 3 compression algorithms. Signed-off-by: David Sterba --- fs/btrfs/compression.c | 15 +++ fs/btrfs/compression.h | 2 ++ 2 files changed, 17 inserti

Re: [PATCH 0/7] retry write on error

2017-11-30 Thread Liu Bo
On Wed, Nov 29, 2017 at 05:47:08PM +0100, David Sterba wrote: > On Wed, Nov 29, 2017 at 12:09:29PM +0800, Anand Jain wrote: > > On 11/29/2017 07:41 AM, p...@btrfs.list.sabi.co.uk wrote: > > If the underlying protocal doesn't support retry and there > > are some transient errors happening

Re: [PATCH v7 1/5] add infrastructure for tagging functions as error injectable

2017-11-30 Thread Josef Bacik
On Wed, Nov 29, 2017 at 05:59:39PM +0100, Daniel Borkmann wrote: > On 11/28/2017 09:02 PM, Josef Bacik wrote: > > On Tue, Nov 28, 2017 at 11:58:41AM -0700, Jonathan Corbet wrote: > >> On Wed, 22 Nov 2017 16:23:30 -0500 > >> Josef Bacik wrote: > >>> From: Josef Bacik > >>> > >>> Using BPF we can o

Re: [PATCH v2 3/3] btrfs-progs: fi defrag: extend -c to drop nocompress flag on files

2017-11-30 Thread David Sterba
On Wed, Nov 29, 2017 at 09:54:01AM +0800, Su Yue wrote: > On 11/29/2017 12:07 AM, David Sterba wrote: > > On Tue, Nov 28, 2017 at 05:14:50PM +0800, Su Yue wrote: > >> Now, files which have nocompress flag also will be defraged > >> with compression. However, nocompress flag is still existed > >> an

Re: [PATCH 1/5] btrfs-progs: Add location check when process share_data_ref item

2017-11-30 Thread David Sterba
On Thu, Nov 30, 2017 at 02:55:49PM +0800, Qu Wenruo wrote: > > > On 2017年11月29日 03:02, David Sterba wrote: > > On Fri, Nov 24, 2017 at 06:41:28PM +0800, Gu Jinxiang wrote: > >> The following test failed becasuse share_data_ref be added into > >> extent_cache when deal with root tree node. > > >

Re: [PATCH] btrfs: don't bug_on with enomem in __clear_state_bit

2017-11-30 Thread David Sterba
On Fri, Nov 10, 2017 at 09:38:01AM +0200, Nikolay Borisov wrote: > On 9.11.2017 19:53, Josef Bacik wrote: > > From: Josef Bacik > > > > Since we're allocating under atomic we could every easily enomem, so if > > that's the case and we can block then loop around and try to allocate > > the preall

Re: [PATCH][v2] btrfs: don't bug_on with enomem in __clear_state_bit

2017-11-30 Thread David Sterba
On Fri, Nov 10, 2017 at 10:13:40AM -0500, Josef Bacik wrote: > From: Josef Bacik > > Since we're allocating under atomic we could every easily enomem, so if > that's the case and we can block then loop around and try to allocate > the prealloc not under a lock. > > We also saw this happen during

Re: [PATCHSET v2] cgroup, writeback, btrfs: make sure btrfs issues metadata IOs from the root cgroup

2017-11-30 Thread Chris Mason
On 11/30/2017 12:23 PM, David Sterba wrote: On Wed, Nov 29, 2017 at 01:38:26PM -0500, Chris Mason wrote: On 11/29/2017 12:05 PM, Tejun Heo wrote: On Wed, Nov 29, 2017 at 09:03:30AM -0800, Tejun Heo wrote: Hello, On Wed, Nov 29, 2017 at 05:56:08PM +0100, Jan Kara wrote: What has happened wi

Re: [PATCH] btrfs: drop btrfs_device::can_discard to query directly

2017-11-30 Thread David Sterba
On Wed, Nov 29, 2017 at 01:53:29PM +0200, Nikolay Borisov wrote: > > > On 29.11.2017 12:53, Anand Jain wrote: > > We can query the bdev directly when needed at btrfs_discard_extent() > > so drop btrfs_device::can_discard. > > > > Signed-off-by: Anand Jain > > Suggested-by: Nikolay Borisov > >

Re: [PATCHSET v2] cgroup, writeback, btrfs: make sure btrfs issues metadata IOs from the root cgroup

2017-11-30 Thread David Sterba
On Wed, Nov 29, 2017 at 01:38:26PM -0500, Chris Mason wrote: > On 11/29/2017 12:05 PM, Tejun Heo wrote: > > On Wed, Nov 29, 2017 at 09:03:30AM -0800, Tejun Heo wrote: > >> Hello, > >> > >> On Wed, Nov 29, 2017 at 05:56:08PM +0100, Jan Kara wrote: > >>> What has happened with this patch set? > >> >

[PATCH 3/4] btrfs: prop: use common helper for type to string conversion

2017-11-30 Thread David Sterba
Use the helper for conversion, keep the semantics. Signed-off-by: David Sterba --- fs/btrfs/props.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/fs/btrfs/props.c b/fs/btrfs/props.c index c39a940d0c75..b30a056963ab 100644 --- a/fs/btrfs/props.c +++ b/fs/btrfs/props.c

[PATCH 4/4] btrfs: show options: use helper to convert compression type string

2017-11-30 Thread David Sterba
Use the helper, if the COMPRESS option is set, the result is always defined and not empty. Signed-off-by: David Sterba --- fs/btrfs/super.c | 9 ++--- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/fs/btrfs/super.c b/fs/btrfs/super.c index 3d0813b17e9c..febe67a37f8a 100644 ---

[PATCH 1/4] btrfs: compression: add helper for type to string conversion

2017-11-30 Thread David Sterba
There are several places opencoding this conversion, add a helper now that we have 3 compression algorithms. Signed-off-by: David Sterba --- fs/btrfs/compression.c | 15 +++ fs/btrfs/compression.h | 2 ++ 2 files changed, 17 insertions(+) diff --git a/fs/btrfs/compression.c b/fs/bt

[PATCH 2/4] btrfs: SETFLAGS ioctl: use helper for compression type conversion

2017-11-30 Thread David Sterba
Signed-off-by: David Sterba --- fs/btrfs/ioctl.c | 10 -- 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c index e8adebc8c1b0..c41c259d9283 100644 --- a/fs/btrfs/ioctl.c +++ b/fs/btrfs/ioctl.c @@ -307,12 +307,10 @@ static int btrfs_ioctl_se

[PATCH 0/4] Minor compression cleanups

2017-11-30 Thread David Sterba
Factor opencoded switches for compression algos to helpers. David Sterba (4): btrfs: compression: add helper for type to string conversion btrfs: SETFLAGS ioctl: use helper for compression type conversion btrfs: prop: use common helper for type to string conversion btrfs: show options: use

Re: [PATCH] btrfs: make function update_share_count static

2017-11-30 Thread David Sterba
On Thu, Nov 30, 2017 at 12:14:47PM +, Colin King wrote: > From: Colin Ian King > > The function update_share_count is local to the source and does > not need to be in global scope, so make it static. > > Cleans up sparse warning: > fs/btrfs/backref.c:219:6: warning: symbol 'update_share_coun

Re: [PATCH v2 03/11] lib: make the fprop batch size a multiple of PAGE_SIZE

2017-11-30 Thread David Sterba
On Wed, Nov 29, 2017 at 06:04:43PM +0100, Jan Kara wrote: > On Wed 22-11-17 16:15:58, Josef Bacik wrote: > > From: Josef Bacik > > > > We are converting the writeback counters to use bytes instead of pages, > > so we need to make the batch size for the percpu modifications align > > properly with

Re: [GIT PULL] Btrfs fixes for 4.15-rc2

2017-11-30 Thread David Sterba
On Wed, Nov 29, 2017 at 02:31:24PM -0800, Linus Torvalds wrote: > On Wed, Nov 29, 2017 at 11:28 AM, David Sterba wrote: > > > > With signed tag: for-4.15-rc2-tag > > > > git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux.git for-4.15-rc2 > > Oh, please actually ask me to pull the signed

btrfs-progs - failed btrfs replace on RAID1 seems to have left things in a wrong state

2017-11-30 Thread Eric Mesa
Hello, Not sure if this is a reportable bug, so I figured I'd start on the mailing list and then report a bug if it is a bug and not user error. Here is the original state of a RAID1 in which I wanted to replace the smaller drive (except the /dev/sdX was different): btrfs filesystem show

[PATCH] btrfs: make function update_share_count static

2017-11-30 Thread Colin King
From: Colin Ian King The function update_share_count is local to the source and does not need to be in global scope, so make it static. Cleans up sparse warning: fs/btrfs/backref.c:219:6: warning: symbol 'update_share_count' was not declared. Should it be static? Signed-off-by: Colin Ian King

Re: [PATCH v2 1/3] btrfs-progs: fi usage: change warning message more appropriately

2017-11-30 Thread Qu Wenruo
On 2017年11月30日 16:29, Misono, Tomohiro wrote: > "fi usage" shows the warning "RAID5/6 numbers will be incorrect" when > runnning without root privilege even if raid5/6 is not used. What > happens is it cannot get the per device profile usage info, so change > the message more appropriately. > >

[PATCH v2 1/3] btrfs-progs: fi usage: change warning message more appropriately

2017-11-30 Thread Misono, Tomohiro
"fi usage" shows the warning "RAID5/6 numbers will be incorrect" when runnning without root privilege even if raid5/6 is not used. What happens is it cannot get the per device profile usage info, so change the message more appropriately. Signed-off-by: Tomohiro Misono --- v1 -> v2: fix not to sp

Re: [PATCH 1/3] btrfs-progs: fi usage: change warning message more appropriately

2017-11-30 Thread Misono, Tomohiro
On 2017/11/30 16:59, Qu Wenruo wrote: > > > On 2017年11月30日 15:52, Misono, Tomohiro wrote: >> "fi usage" shows the warning "RAID5/6 numbers will be incorrect" when >> runnning without root privilege even if raid5/6 is not used. What >> happens is it cannot get the per device profile usage info, s

Re: [PATCH 2/3] btrfs-progs: fi usage: change to output more info without root privilege

2017-11-30 Thread Qu Wenruo
On 2017年11月30日 15:52, Misono, Tomohiro wrote: > Although per device usage cannot be shown without root privilege, > per profile usage can be shown. > > To achieve this, we just basically need to remove the check of nullness > of chunkinfo in print_filesystem_usage_by_chunk(), because other > fun

Re: [PATCH 3/3] btrfs-progs: fi usage: cleanup unneccessary permission error check

2017-11-30 Thread Qu Wenruo
On 2017年11月30日 15:53, Misono, Tomohiro wrote: > Since BTRFS_IOC_FS_INFO does not require root privilege, there is no > need to check EPERM error. > > Signed-off-by: Tomohiro Misono Reviewed-by: Qu Wenruo Thanks, Qu > --- > cmds-fi-usage.c | 7 --- > 1 file changed, 7 deletions(-) > > d

Re: [PATCH 1/3] btrfs-progs: fi usage: change warning message more appropriately

2017-11-30 Thread Qu Wenruo
On 2017年11月30日 15:52, Misono, Tomohiro wrote: > "fi usage" shows the warning "RAID5/6 numbers will be incorrect" when > runnning without root privilege even if raid5/6 is not used. What > happens is it cannot get the per device profile usage info, so change > the message more appropriately. > >