[PATCH RFC] btrfs: self heal from SB fail

2017-12-07 Thread Anand Jain
-EXPERIMENTAL- As of now when primary SB fails we won't self heal and would fail mount, this is an experimental patch which thinks why not go and read backup copy. Signed-off-by: Anand Jain --- fs/btrfs/disk-io.c | 8 +++- fs/btrfs/volumes.c | 10 +++--- 2 files

Re: [PATCH v4 72/73] xfs: Convert mru cache to XArray

2017-12-07 Thread Dave Chinner
On Fri, Dec 08, 2017 at 01:45:52PM +0900, Byungchul Park wrote: > On Fri, Dec 08, 2017 at 09:22:16AM +1100, Dave Chinner wrote: > > On Thu, Dec 07, 2017 at 11:06:34AM -0500, Theodore Ts'o wrote: > > > On Wed, Dec 06, 2017 at 06:06:48AM -0800, Matthew Wilcox wrote: > > > > > Unfortunately for you,

Re: [PATCH] Btrfs : send, truncate first to enhance many small files

2017-12-07 Thread Qu Wenruo
On 2017年12月08日 14:29, robbieko wrote: > Hi Filipe David Manana, > > I'm sorry to reply so late, your patch is good for me. > Will you submit this patch to the upstream? > In addition, you mentioned other optimization, Can you share it? > > I have another case, find_extent_clone will be too

Re: [PATCH] Btrfs : send, truncate first to enhance many small files

2017-12-07 Thread robbieko
Hi Filipe David Manana, I'm sorry to reply so late, your patch is good for me. Will you submit this patch to the upstream? In addition, you mentioned other optimization, Can you share it? I have another case, find_extent_clone will be too slow when there is too much backref in the big file. 1G

Re: [PATCH v4 72/73] xfs: Convert mru cache to XArray

2017-12-07 Thread Byungchul Park
On Fri, Dec 08, 2017 at 09:22:16AM +1100, Dave Chinner wrote: > On Thu, Dec 07, 2017 at 11:06:34AM -0500, Theodore Ts'o wrote: > > On Wed, Dec 06, 2017 at 06:06:48AM -0800, Matthew Wilcox wrote: > > > > Unfortunately for you, I don't find arguments along the lines of > > > > "lockdep will save us"

Re: [PATCH v5 0/3] Add cli and ioctl to deregister devices

2017-12-07 Thread Duncan
Anand Jain posted on Fri, 08 Dec 2017 08:51:43 +0800 as excerpted: > On 12/07/2017 10:52 PM, Austin S. Hemmelgarn wrote: >> On 2017-12-07 09:36, Anand Jain wrote: >>> Add ability to deregister a or all devices. I have named this sub cmd >>> as deregister, but I am open to your suggestions. >>

Re: [PATCH v5 0/3] Add cli and ioctl to deregister devices

2017-12-07 Thread Anand Jain
On 12/07/2017 10:52 PM, Austin S. Hemmelgarn wrote: On 2017-12-07 09:36, Anand Jain wrote: Add ability to deregister a or all devices. I have named this sub cmd as deregister, but I am open to your suggestions. Being a bit picky here, but from the perspective of a native speaker of American

Re: Lockdep is less useful than it was

2017-12-07 Thread Dave Chinner
On Thu, Dec 07, 2017 at 02:38:03PM -0800, Matthew Wilcox wrote: > On Thu, Dec 07, 2017 at 11:06:34AM -0500, Theodore Ts'o wrote: > > The problem is that if it has too many false positives --- and it's > > gotten *way* worse with the completion callback "feature", people will > > just stop using

Re: Lockdep is less useful than it was

2017-12-07 Thread Matthew Wilcox
On Thu, Dec 07, 2017 at 02:38:03PM -0800, Matthew Wilcox wrote: > You need to get LOCKDEP_CROSSRELEASE off. I'd revert patches > e26f34a407aec9c65bce2bc0c838fabe4f051fc6 and > b483cf3bc249d7af706390efa63d6671e80d1c09 Oops. I meant to revert 2dcd5adfb7401b762ddbe4b86dcacc2f3de6b97b. Or you could

Lockdep is less useful than it was

2017-12-07 Thread Matthew Wilcox
On Thu, Dec 07, 2017 at 11:06:34AM -0500, Theodore Ts'o wrote: > The problem is that if it has too many false positives --- and it's > gotten *way* worse with the completion callback "feature", people will > just stop using Lockdep as being too annyoing and a waste of developer > time when trying

Re: [PATCH v4 72/73] xfs: Convert mru cache to XArray

2017-12-07 Thread Dave Chinner
On Thu, Dec 07, 2017 at 11:06:34AM -0500, Theodore Ts'o wrote: > On Wed, Dec 06, 2017 at 06:06:48AM -0800, Matthew Wilcox wrote: > > > Unfortunately for you, I don't find arguments along the lines of > > > "lockdep will save us" at all convincing. lockdep already throws > > > too many false

Re: [PATCH 0/1] btrfs-progs: docs: annual typo, clarity, & grammar review & fixups

2017-12-07 Thread David Sterba
On Sat, Oct 21, 2017 at 08:00:45PM -0400, Nicholas D Steeves wrote: > I've marked the parts the require review like this: This paragraph > explains something but something is opaque (EDIT: reason why > it's unclear or needs to be updated). Here is what I found this > year

Re: [PATCH 1/2] btrfs-progs: convert: Fix a bug in rollback check which overwrite return value

2017-12-07 Thread David Sterba
On Wed, Nov 29, 2017 at 09:48:05PM +0800, Qu Wenruo wrote: > Commit 1170ac307900 ("btrfs-progs: convert: Introduce function to check if > convert image is able to be rolled back") reworked rollback check > condition, by checking 1:1 mapping of each file extent. > > The idea itself has nothing

Re: [PATCH 0/9] Remaining part of mkfs --rootdir rework

2017-12-07 Thread David Sterba
On Wed, Nov 29, 2017 at 05:15:55PM +0800, Qu Wenruo wrote: > Qu Wenruo (9): > btrfs-progs: mkfs: Cleanup temporary chunks before filling rootdir > btrfs-progs: mkfs: Don't use custom chunk allocator for rootdir > btrfs-progs: mkfs/rootdir: Use over-reserve method to make size > estimate

[PATCH 0/4] Cleanups for extent_page_data

2017-12-07 Thread David Sterba
David Sterba (4): btrfs: merge two flush_write_bio helpers btrfs: sink flush_fn to extent_write_cache_pages btrfs: sink writepage parameter to extent_write_cache_pages btrfs: unify extent_page_data type passed as void fs/btrfs/extent_io.c | 35 +-- 1 file

[PATCH 1/4] btrfs: merge two flush_write_bio helpers

2017-12-07 Thread David Sterba
flush_epd_write_bio is same as flush_write_bio, no point having two such functions. Merge them to flush_write_bio. The 'noinline' attribute is removed as it does not have any meaning. Signed-off-by: David Sterba --- fs/btrfs/extent_io.c | 19 --- 1 file

[PATCH 3/4] btrfs: sink writepage parameter to extent_write_cache_pages

2017-12-07 Thread David Sterba
The function extent_write_cache_pages is modelled after write_cache_pages which is a generic interface and the writepage parameter makes sense there. In btrfs we know exactly which callback we're going to use, so we can pass it directly. Signed-off-by: David Sterba ---

[PATCH 2/4] btrfs: sink flush_fn to extent_write_cache_pages

2017-12-07 Thread David Sterba
All callers pass the same value flush_write_bio. Signed-off-by: David Sterba --- fs/btrfs/extent_io.c | 10 -- 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/fs/btrfs/extent_io.c b/fs/btrfs/extent_io.c index fd1a2ff1e96d..35f4869a90d5 100644 ---

[PATCH 4/4] btrfs: unify extent_page_data type passed as void

2017-12-07 Thread David Sterba
Functions called from extent_write_cache_pages used void* as generic callback data, but all of them convert it to extent_page_data, or use it directly. Signed-off-by: David Sterba --- fs/btrfs/extent_io.c | 17 +++-- 1 file changed, 7 insertions(+), 10 deletions(-)

Re: [PATCH v4 72/73] xfs: Convert mru cache to XArray

2017-12-07 Thread Theodore Ts'o
On Wed, Dec 06, 2017 at 06:06:48AM -0800, Matthew Wilcox wrote: > > Unfortunately for you, I don't find arguments along the lines of > > "lockdep will save us" at all convincing. lockdep already throws > > too many false positives to be useful as a tool that reliably and > > accurately points out

Re: [PATCH] btrfs: tree-checker: use %zu format string for size_t

2017-12-07 Thread David Sterba
On Thu, Dec 07, 2017 at 08:32:04AM +0800, Qu Wenruo wrote: > > > On 2017年12月06日 22:18, Arnd Bergmann wrote: > > The return value of sizeof() is of type size_t, so we must print it > > using the %z format modifier rather than %l to avoid this warning > > on some architectures: > > > >

Re: [PATCH v5 0/3] Add cli and ioctl to deregister devices

2017-12-07 Thread Austin S. Hemmelgarn
On 2017-12-07 09:36, Anand Jain wrote: Add ability to deregister a or all devices. I have named this sub cmd as deregister, but I am open to your suggestions. Being a bit picky here, but from the perspective of a native speaker of American English, I would say that 'deregister' sounds rather

[PATCH v5 1/2] btrfs-progs: add cli to deregister a device

2017-12-07 Thread Anand Jain
This patch adds btrfs device deregister so that an already registered device (through scan) can be deregistered. This change is compatible with older kernel without the ioctl BTRFS_IOC_PURGE_DEV it shall report 'Inappropriate ioctl for device'. Signed-off-by: Anand Jain

[PATCH v5 2/2] btrfs-progs: add feature to deregister all devices

2017-12-07 Thread Anand Jain
This patch adds default no option to deregister all unmounted devices in the kernel at once. For example: btrfs device deregister Signed-off-by: Anand Jain --- v1-4: NA. v5: New patch in v5. cmds-device.c | 31 +-- ioctl.h | 6 +-

[PATCH v5 3/3] btrfs: add feature to deregister all unmounted devices

2017-12-07 Thread Anand Jain
This adds a feature to remove all registered/scanned devices, which are not mounted or it got staled by some means. Signed-off-by: Anand Jain Suggested-by: David Sterba --- v2-4: Does not exist. fs/btrfs/super.c | 7 ++-

[PATCH v5 2/3] btrfs: introduce feature to deregister a btrfs device

2017-12-07 Thread Anand Jain
Support for a new command is being added here: btrfs dev deregister Which shall undo the effects of the command btrfs dev scan This cli/ioctl is needed as there is no way to continue to mount in degraded mode if the device is already scanned, which is required to recover from the split brain

[PATCH v5 1/3] btrfs: add function to device list delete

2017-12-07 Thread Anand Jain
We need device delete from the dev_list so create a new function. New instead of refactor of btrfs_free_stale_device() because, btrfs_free_stale_device() doesn't hold device_list_mutex which is actually needed here. Signed-off-by: Anand Jain --- v1: title of this patch

[PATCH v5 0/3] Add cli and ioctl to deregister devices

2017-12-07 Thread Anand Jain
Add ability to deregister a or all devices. I have named this sub cmd as deregister, but I am open to your suggestions. Further I am using /dev/btrfs-control and struct btrfs_ioctl_vol_args for now, just similar to other ioctls in super.c including btrfs dev scan, if rather it makes sense to use

Re: [RFC] Improve subvolume usability for a normal user

2017-12-07 Thread Hugo Mills
On Thu, Dec 07, 2017 at 07:21:46AM -0500, Austin S. Hemmelgarn wrote: > On 2017-12-07 06:55, Duncan wrote: > >Misono, Tomohiro posted on Thu, 07 Dec 2017 16:15:47 +0900 as excerpted: > > > >>On 2017/12/07 11:56, Duncan wrote: > >>>Austin S. Hemmelgarn posted on Wed, 06 Dec 2017 07:39:56 -0500 as >

Re: [RFC] Improve subvolume usability for a normal user

2017-12-07 Thread Austin S. Hemmelgarn
On 2017-12-07 06:55, Duncan wrote: Misono, Tomohiro posted on Thu, 07 Dec 2017 16:15:47 +0900 as excerpted: On 2017/12/07 11:56, Duncan wrote: Austin S. Hemmelgarn posted on Wed, 06 Dec 2017 07:39:56 -0500 as excerpted: Somewhat OT, but the only operation that's remotely 'instant' is

[RFC PATCH] btrfs: Handle btrfs_set_extent_delalloc failure in relocate_file_extent_cluster

2017-12-07 Thread Nikolay Borisov
Signed-off-by: Nikolay Borisov --- Hello, THis is rfc since I'm not entirely sure the cleanup sequence currently is sufficient so ideas are welcome. I have the feeling we need to do something with the page: * SetPageError * ClearPageUptodate * Something else?

Re: [PATCH] btrfs/057: Fix test case to work on 64K page size

2017-12-07 Thread Harish
Sure will work on this. Thanks. Harish On 12/06/2017 01:16 PM, Qu Wenruo wrote: On 2017年12月06日 15:35, Eryu Guan wrote: On Wed, Dec 06, 2017 at 12:15:45PM +0530, Harish wrote: On platforms with a page size greater than 4Kb, at the moment btrfs doesn't support a node/leaf size smaller than

Re: [PATCH v2] btrfs-progs: Replace usage of list_for_each with list_for_each_entry

2017-12-07 Thread Qu Wenruo
On 2017年12月07日 17:10, Nikolay Borisov wrote: > There are a couple of places where instead of the more succinct > list_for_each_entry the code uses list_for_each. This results in > slightly more code with no additional benefit as well as no > coherent pattern. This patch makes the code uniform.

[PATCH v2] btrfs-progs: Replace usage of list_for_each with list_for_each_entry

2017-12-07 Thread Nikolay Borisov
There are a couple of places where instead of the more succinct list_for_each_entry the code uses list_for_each. This results in slightly more code with no additional benefit as well as no coherent pattern. This patch makes the code uniform. No functional changes Signed-off-by: Nikolay Borisov

Re: [PATCH] btrfs: tree-checker: use %zu format string for size_t

2017-12-07 Thread Arnd Bergmann
On Thu, Dec 7, 2017 at 1:32 AM, Qu Wenruo wrote: > > > On 2017年12月06日 22:18, Arnd Bergmann wrote: >> The return value of sizeof() is of type size_t, so we must print it >> using the %z format modifier rather than %l to avoid this warning >> on some architectures: >> >>