Re: [PATCH] btrfs-progs: tests: test mkfs.btrfs fails on small backing size thin provision device

2018-04-11 Thread Nikolay Borisov
On 11.04.2018 10:29, Qu Wenruo wrote: > > > On 2018年04月11日 15:28, Su Yue wrote: >> >> >> On 04/11/2018 03:05 PM, Qu Wenruo wrote: >>> >>> >>> On 2018年04月11日 15:03, Su Yue wrote: This tests is most similar to xfstests generic/405. It calls device mapper to create a thin provision

Re: [PATCH] btrfs-progs: tests: test mkfs.btrfs fails on small backing size thin provision device

2018-04-11 Thread Qu Wenruo
On 2018年04月11日 15:37, Nikolay Borisov wrote: > > > On 11.04.2018 10:29, Qu Wenruo wrote: >> >> >> On 2018年04月11日 15:28, Su Yue wrote: >>> >>> >>> On 04/11/2018 03:05 PM, Qu Wenruo wrote: On 2018年04月11日 15:03, Su Yue wrote: > This tests is most similar to xfstests

Re: [PATCH v2] btrfs: Fix race condition between delayed refs and blockgroup removal

2018-04-11 Thread Nikolay Borisov
On 11.04.2018 10:59, Nikolay Borisov wrote: > When the delayed refs for a head are all run, eventually > cleanup_ref_head is called which (in case of deletion) obtains a > reference for the relevant btrfs_space_info struct by querying the bg > for the range. This is problematic because when the

[PATCH] btrfs-progs: configure: check if xmlto exists at configure time

2018-04-11 Thread Misono Tomohiro
AC_PATH_PROG won't fail even if it fails to find command path. xmlto is required for document build and we should report error if it doesn't exist at configure time. Signed-off-by: Tomohiro Misono --- configure.ac | 6 +- 1 file changed, 5 insertions(+), 1

[PATCH v2] btrfs: Fix race condition between delayed refs and blockgroup removal

2018-04-11 Thread Nikolay Borisov
When the delayed refs for a head are all run, eventually cleanup_ref_head is called which (in case of deletion) obtains a reference for the relevant btrfs_space_info struct by querying the bg for the range. This is problematic because when the last extent of a bg is deleted a race window emerges

[PATCH 1/2] btrfs: print-tree: output enhancement

2018-04-11 Thread Qu Wenruo
This patch enhance the following things: - tree block header * add generation and owner output for node and leaf - node pointer generation output - allow btrfs_print_tree() to not follow nodes * just like btrfs-progs Please note that, although function btrfs_print_tree() is not called by

[PATCH 2/2] btrfs: print-tree: Add locking status output for debug build

2018-04-11 Thread Qu Wenruo
It's pretty handy if we can get debug output for locking status of an extent buffer, specially for race related debugging. So add the following output for btrfs_print_tree() and btrfs_print_leaf(): - refs - write_locks (as w:%u) - read_locks (as r:%u) - blocking_writers (as bw:%u) -

Re: [PATCH] btrfs: Fix race condition between delayed refs and blockgroup removal

2018-04-11 Thread Omar Sandoval
On Wed, Apr 11, 2018 at 10:04:49AM +0300, Nikolay Borisov wrote: > When the delayed refs for a head are all run, eventually > cleanup_ref_head is called which (in case of deletion) obtains a > reference for the relevant btrfs_space_info struct by querying the bg > for the range. This is

[PATCH v2.1 2/2] btrfs-progs: Use more loose open ctree flags for dump-tree and restore

2018-04-11 Thread Qu Wenruo
Corrupted extent tree (either the root node or leaf) can normally block us from open the fs. As normally open_ctree() has the following call chain: __open_ctree_fd() |- btrfs_setup_all_roots() |- btrfs_read_block_groups() And we will search block group items in extent tree. And

Re: [PATCH] btrfs-progs: configure: check if xmlto exists at configure time

2018-04-11 Thread Qu Wenruo
On 2018年04月11日 16:29, Misono Tomohiro wrote: > AC_PATH_PROG won't fail even if it fails to find command path. > xmlto is required for document build and we should report error > if it doesn't exist at configure time. > > Signed-off-by: Tomohiro Misono Looks

[PATCH v2 1/2] btrfs-progs: Rename OPEN_CTREE_FS_PARTIAL to OPEN_CTREE_TEMPORARY_SUPER

2018-04-11 Thread Qu Wenruo
The old flag OPEN_CTREE_FS_PARTIAL is in fact quite easy to be confused with OPEN_CTREE_PARTIAL, which allow btrfs-progs to open damaged filesystem (like corrupted extent/csum tree). However OPEN_CTREE_FS_PARTIAL, unlike its name, is just allowing btrfs-progs to open fs with temporary superblocks

[PATCH v2 2/2] btrfs-progs: Use more loose open ctree flags for dump-tree and restore

2018-04-11 Thread Qu Wenruo
Corrupted extent tree (either the root node or leaf) can normally block us from open the fs. As normally open_ctree() has the following call chain: __open_ctree_fd() |- btrfs_setup_all_roots() |- btrfs_read_block_groups() And we will search block group items in extent tree. And

Re: [PATCH] btrfs-progs: tests: test mkfs.btrfs fails on small backing size thin provision device

2018-04-11 Thread Qu Wenruo
On 2018年04月11日 15:28, Su Yue wrote: > > > On 04/11/2018 03:05 PM, Qu Wenruo wrote: >> >> >> On 2018年04月11日 15:03, Su Yue wrote: >>> This tests is most similar to xfstests generic/405. >>> It calls device mapper to create a thin provision device with small >>> backing size and big virtual size.

Re: [PATCH] btrfs-progs: tests: test mkfs.btrfs fails on small backing size thin provision device

2018-04-11 Thread Su Yue
On 04/11/2018 03:05 PM, Qu Wenruo wrote: On 2018年04月11日 15:03, Su Yue wrote: This tests is most similar to xfstests generic/405. It calls device mapper to create a thin provision device with small backing size and big virtual size. mkfs.btrfs should fail on such devices. This test should

Re: [PATCH 1/2] btrfs: Factor out read portion of btrfs_get_blocks_direct

2018-04-11 Thread Nikolay Borisov
On 10.04.2018 18:49, David Sterba wrote: > On Thu, Feb 22, 2018 at 06:12:13PM +0200, Nikolay Borisov wrote: >> Currently this function handles both the READ and WRITE dio cases. This >> is facilitated by a bunch of 'if' statements, a goto short-circuit >> statement and a very perverse aliasing

[PATCH v2 1/2] btrfs: Factor out read portion of btrfs_get_blocks_direct

2018-04-11 Thread Nikolay Borisov
Currently this function handles both the READ and WRITE dio cases. This is facilitated by a bunch of 'if' statements, a goto short-circuit statement and a very perverse aliasing of "!created"(READ) case by setting lockstart = lockend and checking for lockstart < lockend for detecting the write.

[PATCH v2 2/2] btrfs: Factor out write portion of btrfs_get_blocks_direct

2018-04-11 Thread Nikolay Borisov
Now that the read side is extracted into its own function, do the same to the write side. This leaves btrfs_get_blocks_direct_write with the sole purpose of handling common locking required. Also flip the condition in btrfs_get_blocks_direct_write so that the write case comes first and we check

[PATCH 2/2] btrfs-progs: make all programs and libraries optional

2018-04-11 Thread Omar Sandoval
From: Omar Sandoval We have a build system internally which only needs to build the libraries out of a repository, not any binaries. I looked at how this works with other projects, and the best example was util-linux, which makes it possible to enable or disable everything

[PATCH 1/2] btrfs-progs: remove stale dir-test and quick-test

2018-04-11 Thread Omar Sandoval
From: Omar Sandoval These don't build anymore and don't appear to be used for anything. Signed-off-by: Omar Sandoval --- Makefile | 10 +- dir-test.c | 518 --- quick-test.c | 226 -- 3

Re: [PATCH] btrfs: Fix race condition between delayed refs and blockgroup removal

2018-04-11 Thread Nikolay Borisov
On 11.04.2018 10:09, Omar Sandoval wrote: > On Wed, Apr 11, 2018 at 10:04:49AM +0300, Nikolay Borisov wrote: >> When the delayed refs for a head are all run, eventually >> cleanup_ref_head is called which (in case of deletion) obtains a >> reference for the relevant btrfs_space_info struct by

[PATCH 1/4] btrfs: Use while loop instead of labels in __endio_write_update_ordered

2018-04-11 Thread Nikolay Borisov
Currently __endio_write_update_ordered uses labels to implement what is essentially a simple while loop. This makes the code more cumbersome to follow than it actually has to be. No functional changes. No xfstest regressions were found during testing. Signed-off-by: Nikolay Borisov

[PATCH 2/4] btrfs: Fix lock release order

2018-04-11 Thread Nikolay Borisov
Locks should generally be released in the oppposite order they are acquired. Generally lock acquisiton ordering is used to ensure deadlocks don't happen. However, as becomes more complicated it's best to also maintain proper unlock order so as to avoid possible dead locks. This was found by code

[PATCH 3/4] btrfs: Consolidate error checking for btrfs_alloc_chunk

2018-04-11 Thread Nikolay Borisov
The second if is really a subcase of ret being less than 0. So introduce a generic if (ret < 0) check, and inside have another if which explicitly handles the -ENOSPC and any other errors. No functional changes. Signed-off-by: Nikolay Borisov --- fs/btrfs/extent-tree.c | 12

[PATCH 4/4] btrfs: Rewrite retry logic in do_chunk_alloc

2018-04-11 Thread Nikolay Borisov
do_chunk_alloc implements logic to detect whether there is currently pending chunk allocation (by means of space_info->chunk_alloc being set) and if so it loops around to the 'again' label. Additionally, based on the state of the space_info (e.g. whether it's full or not) and the return value of

error: redefinition of 'struct btrfs_ioctl_defrag_range_args

2018-04-11 Thread Ilan Schwarts
Hi While trying to compile my kernel module on suse 12.2 kernel 4.4.103-92.53-default I recieve the following warning: error: redefinition of 'struct btrfs_ioctl_defrag_range_args I see that struct is defined in 2 places: /lib/modules/4.4.103-92.53-default/source/fs/btrfs/ctree.h:1985:8

Re: [PATCH] btrfs.static: needs libbtrfsutil

2018-04-11 Thread David Sterba
On Tue, Apr 10, 2018 at 11:03:41PM +0300, Baruch Siach wrote: > Add libbtrfsutil objects to btrfs.static link command. This fixes static > build failure: > > utils.static.o: In function `parse_qgroupid': > utils.c:(.text.parse_qgroupid+0xb0): undefined reference to > `btrfs_util_is_subvolume' >

Re: [PATCH] btrfs-progs: configure: check if xmlto exists at configure time

2018-04-11 Thread David Sterba
On Wed, Apr 11, 2018 at 05:29:00PM +0900, Misono Tomohiro wrote: > AC_PATH_PROG won't fail even if it fails to find command path. > xmlto is required for document build and we should report error > if it doesn't exist at configure time. > > Signed-off-by: Tomohiro Misono

Re: [PATCH] btrfs-progs: tests: test mkfs.btrfs fails on small backing size thin provision device

2018-04-11 Thread David Sterba
On Wed, Apr 11, 2018 at 03:47:35PM +0800, Qu Wenruo wrote: > What about using lvm other than plain dmsetup to create thin provision > devices? > IIRC this should be much easier to implement, without all the linear > target hassles. > >>> > >>> Yes, doing it by LVM is more

Re: [PATCH] btrfs-progs: tests: test mkfs.btrfs fails on small backing size thin provision device

2018-04-11 Thread David Sterba
On Wed, Apr 11, 2018 at 03:03:30PM +0800, Su Yue wrote: > This tests is most similar to xfstests generic/405. > It calls device mapper to create a thin provision device with small > backing size and big virtual size. mkfs.btrfs should fail on such > devices. > > This test should pass after commit

btrfs fails to mount after power outage

2018-04-11 Thread Tom Vincent
My btrfs laptop had a power outage and failed to boot with "parent transid verify failed..." errors. (I have backups). I couldn't rw mount on a live disk, but could ro mount. I tried btrfs scrub and then btrfs check --repair to no avail. However, btrfs rescue zero-log _did_ work; the drive can be

Re: [PATCH v2 1/2] btrfs-progs: Rename OPEN_CTREE_FS_PARTIAL to OPEN_CTREE_TEMPORARY_SUPER

2018-04-11 Thread David Sterba
On Wed, Apr 11, 2018 at 03:29:35PM +0800, Qu Wenruo wrote: > The old flag OPEN_CTREE_FS_PARTIAL is in fact quite easy to be confused > with OPEN_CTREE_PARTIAL, which allow btrfs-progs to open damaged > filesystem (like corrupted extent/csum tree). > > However OPEN_CTREE_FS_PARTIAL, unlike its

Re: [PATCH v2] btrfs-progs: dump-super: Refactor print function and add extra check

2018-04-11 Thread Goffredo Baroncelli
On 04/11/2018 02:32 AM, Qu Wenruo wrote: [...] so to get rid of generate_tab_indent and indent_str >>> >>> And we need to call such functions in each helper macros, with >>> duplicated codes. >> >> Please look at the asm generated: even if the "source generated" by the >> expansion of the

Re: [PATCH v2] btrfs-progs: dump-super: Refactor print function and add extra check

2018-04-11 Thread Nikolay Borisov
On 11.04.2018 20:15, Goffredo Baroncelli wrote: > On 04/11/2018 02:32 AM, Qu Wenruo wrote: > [...] > so to get rid of generate_tab_indent and indent_str And we need to call such functions in each helper macros, with duplicated codes. >>> >>> Please look at the asm generated:

Re: [PATCH] Btrfs: do not abort transaction when failing to insert hole extent

2018-04-11 Thread Liu Bo
On Tue, Apr 10, 2018 at 5:12 AM, David Sterba wrote: > On Mon, Apr 09, 2018 at 06:23:14PM -0700, Liu Bo wrote: >> >>> As maybe_insert_hole is only called by btrfs_cont_expand here, which >> >>> means it's a really hole, I don't expect drop_extents would drop >> >>> anything, we

Re: btrfs fails to mount after power outage

2018-04-11 Thread Qu Wenruo
On 2018年04月11日 23:33, Tom Vincent wrote: > My btrfs laptop had a power outage and failed to boot with "parent > transid verify failed..." errors. (I have backups). Metadata corruption, again. I'm curious about what's the underlying disk? Is it plain physical device? Or have other layers like

Re: [PATCH] btrfs-progs: tests: test mkfs.btrfs fails on small backing size thin provision device

2018-04-11 Thread Su Yue
On 04/11/2018 11:41 PM, David Sterba wrote: On Wed, Apr 11, 2018 at 03:03:30PM +0800, Su Yue wrote: This tests is most similar to xfstests generic/405. It calls device mapper to create a thin provision device with small backing size and big virtual size. mkfs.btrfs should fail on such

Re: [PATCH v2 1/2] btrfs: Factor out read portion of btrfs_get_blocks_direct

2018-04-11 Thread Liu Bo
On Wed, Apr 11, 2018 at 12:54 AM, Nikolay Borisov wrote: > Currently this function handles both the READ and WRITE dio cases. This > is facilitated by a bunch of 'if' statements, a goto short-circuit > statement and a very perverse aliasing of "!created"(READ) case > by setting

Re: [PATCH v2] btrfs-progs: dump-super: Refactor print function and add extra check

2018-04-11 Thread Qu Wenruo
On 2018年04月12日 01:15, Goffredo Baroncelli wrote: > On 04/11/2018 02:32 AM, Qu Wenruo wrote: > [...] > so to get rid of generate_tab_indent and indent_str And we need to call such functions in each helper macros, with duplicated codes. >>> >>> Please look at the asm generated:

[PATCH 2/2] generic/427: used mixed mode for Btrfs

2018-04-11 Thread Omar Sandoval
From: Omar Sandoval This test creates a 256 MB filesystem and then writes a 200 MB file. With separate data and metadata, Btrfs will run out of data space since it needs to allocate some metadata space. Use mixed mode, which is the recommendation for smaller filesystems.

[PATCH 1/2] aio-dio-eof-race: handle aio pwrite errors and short reads

2018-04-11 Thread Omar Sandoval
From: Omar Sandoval generic/427 fails on Btrfs with a cryptic "pread: Success" message. This is because an aio pwrite fails with ENOSPC, so the file isn't as long as we expect it to be. Make sure we check the result of the aio writes and also print a more explicit message for

Re: [PATCH v2 10/10] btrfs: qgroup: Use independent and accurate per inode qgroup rsv

2018-04-11 Thread Omar Sandoval
On Wed, Apr 04, 2018 at 08:17:22PM +0800, Qu Wenruo wrote: > > > On 2018年04月04日 16:53, Nikolay Borisov wrote: > > > > > > On 3.04.2018 10:30, Qu Wenruo wrote: > >> Hi David, > >> > >> I didn't see this patch merged in your misc-next branch but only the > >> remaining patches. > >> > >>

Re: [PATCH 2/2] generic/427: used mixed mode for Btrfs

2018-04-11 Thread Dave Chinner
On Wed, Apr 11, 2018 at 04:47:30PM -0700, Omar Sandoval wrote: > From: Omar Sandoval > > This test creates a 256 MB filesystem and then writes a 200 MB file. > With separate data and metadata, Btrfs will run out of data space since > it needs to allocate some metadata space. Use

[PATCH v2] btrfs-progs: tests: test mkfs.btrfs fails on small backing size thin provision device

2018-04-11 Thread Su Yue
This tests is most similar to xfstests generic/405. It calls device mapper to create a thin provision device with small backing size and big virtual size. mkfs.btrfs should fail on such devices. This test should pass after commit e805b143a4fe ("btrfs-progs: mkfs: return nozero value on thin

Re: [PATCH 2/2] generic/427: used mixed mode for Btrfs

2018-04-11 Thread Omar Sandoval
On Thu, Apr 12, 2018 at 10:56:30AM +1000, Dave Chinner wrote: > On Wed, Apr 11, 2018 at 04:47:30PM -0700, Omar Sandoval wrote: > > From: Omar Sandoval > > > > This test creates a 256 MB filesystem and then writes a 200 MB file. > > With separate data and metadata, Btrfs will run

[PATCH] btrfs-progs: remove meaningless process

2018-04-11 Thread Gu Jinxiang
Variable do_wait is synchronized with the variable do_background, when if(do_background) is true, if(!do_wait) is also true, so parent process will goto out immediately. The following wait never be run. And if option -B is chosen, when do_background is 0 and do_wait is 1, there is no need to fork

[PATCH v2] btrfs-progs: remove meaningless process

2018-04-11 Thread Gu Jinxiang
Variable do_wait is synchronized with the variable do_background, when if(do_background) is true, if(!do_wait) is also true, so parent process will goto out immediately. The following wait never be run. And if option -B is chosen, when do_background is 0 and do_wait is 1, there is no need to fork

[PATCH] btrfs-progs: tests: test mkfs.btrfs fails on small backing size thin provision device

2018-04-11 Thread Su Yue
This tests is most similar to xfstests generic/405. It calls device mapper to create a thin provision device with small backing size and big virtual size. mkfs.btrfs should fail on such devices. This test should pass after commit e805b143a4fe ("btrfs-progs: mkfs: return nozero value on thin

[PATCH] btrfs: Fix race condition between delayed refs and blockgroup removal

2018-04-11 Thread Nikolay Borisov
When the delayed refs for a head are all run, eventually cleanup_ref_head is called which (in case of deletion) obtains a reference for the relevant btrfs_space_info struct by querying the bg for the range. This is problematic because when the last extent of a bg is deleted a race window emerges

Re: [PATCH] btrfs-progs: tests: test mkfs.btrfs fails on small backing size thin provision device

2018-04-11 Thread Qu Wenruo
On 2018年04月11日 15:03, Su Yue wrote: > This tests is most similar to xfstests generic/405. > It calls device mapper to create a thin provision device with small > backing size and big virtual size. mkfs.btrfs should fail on such > devices. > > This test should pass after commit e805b143a4fe >

[PATCH v2 2/2] common/rc: raise mixed mode threshold to 1GB

2018-04-11 Thread Omar Sandoval
From: Omar Sandoval generic/427 creates a 256 MB filesystem and then writes a 200 MB file, which fails on Btrfs if mixed mode is not enabled. Raise the threshold to 1GB, which is where we typically recommend mixed mode. Signed-off-by: Omar Sandoval ---

[PATCH v2 1/2] aio-dio-eof-race: handle aio pwrite errors and short reads

2018-04-11 Thread Omar Sandoval
From: Omar Sandoval generic/427 fails on Btrfs with a cryptic "pread: Success" message. This is because an aio pwrite fails with ENOSPC, so the file isn't as long as we expect it to be. Make sure we check the result of the aio writes and also print a more explicit message for

[PATCH 07/15] btrfs: cleanup btrfs_rm_device() promote fs_devices pointer

2018-04-11 Thread Anand Jain
This function uses fs_info::fs_devices number of time, however we declare and use it only at the end, instead do it in the beginning of the function and use it. Signed-off-by: Anand Jain --- fs/btrfs/volumes.c | 13 ++--- 1 file changed, 6 insertions(+), 7

[PATCH 10/15] btrfs: drop uuid_mutex in btrfs_free_extra_devids()

2018-04-11 Thread Anand Jain
btrfs_free_extra_devids() frees the orphan fsid::devid but its search is limited to btrfs_fs_devices::devices, so we dont need uuid_mutex. Signed-off-by: Anand Jain --- fs/btrfs/volumes.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/fs/btrfs/volumes.c

[PATCH 14/15] btrfs: drop uuid_mutex in btrfs_destroy_dev_replace_tgtdev()

2018-04-11 Thread Anand Jain
Delete the uuid_mutex lock here as this thread access the btrfs_fs_devices::devices only. And the device_list_mutex lock is already in place. Signed-off-by: Anand Jain --- fs/btrfs/volumes.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/fs/btrfs/volumes.c

[PATCH 02/15] btrfs: rename struct btrfs_fs_devices::list

2018-04-11 Thread Anand Jain
btrfs_fs_devices::list is the list of BTRFS fsid in the kernel, a generic name 'list' makes it's search very difficult, rename it to fs_list. Signed-off-by: Anand Jain --- fs/btrfs/sysfs.c | 2 +- fs/btrfs/volumes.c | 16 fs/btrfs/volumes.h | 2 +- 3

[PATCH 12/15] btrfs: drop uuid_mutex in close_fs_devices()

2018-04-11 Thread Anand Jain
close_fs_devices() closes devices of a given fsid, and it is limited to all the devices of a fsid, so we don't have to hold the global uuid_mutex, instead we need the device_list_mutex as the device state is being changed. Signed-off-by: Anand Jain --- fs/btrfs/volumes.c

[PATCH 08/15] btrfs: cleanup btrfs_rm_device() use cur_devices

2018-04-11 Thread Anand Jain
Instead of de-referencing the device->fs_devices use cur_devices which points to the same fs_devices. Signed-off-by: Anand Jain --- fs/btrfs/volumes.c | 13 + 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c

[PATCH 01/15] btrfs: optimize move uuid_mutex closer to the critical section

2018-04-11 Thread Anand Jain
Move uuid_mutex closer to the exclusion section. Signed-off-by: Anand Jain Reviewed-by: David Sterba --- fs/btrfs/volumes.c | 12 +--- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c index

[PATCH 06/15] btrfs: cleanup find_device() drop list_head pointer

2018-04-11 Thread Anand Jain
find_device() declares struct list_head *head pointer and used only once, instead just use it directly. Signed-off-by: Anand Jain --- fs/btrfs/volumes.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c index

[PATCH 13/15] btrfs: drop uuid_mutex in btrfs_dev_replace_finishing()

2018-04-11 Thread Anand Jain
btrfs_dev_replace_finish() updates devices (soruce and target) which are within the btrfs_fs_devices::devices or withint the cloned seed devices (btrfs_fs_devices::seed::devices), so we don't need the global uuid_mutex. Signed-off-by: Anand Jain --- fs/btrfs/dev-replace.c

[PATCH 09/15] btrfs: uuid_mutex in read_chunk_tree, add a comment

2018-04-11 Thread Anand Jain
read_chunk_tree() calls read_one_dev(), but for seed device we have to search the fs_uuids list, so we need the uuid_mutex. Add a comment comment, so that we can improve this part. Signed-off-by: Anand Jain --- fs/btrfs/volumes.c | 4 1 file changed, 4 insertions(+)

[PATCH 04/15] btrfs: rename __btrfs_close_devices to close_fs_devices

2018-04-11 Thread Anand Jain
__btrfs_close_devices() is un-exported, drop the __ prefix and rename it to close_fs_devices(). Signed-off-by: Anand Jain --- fs/btrfs/volumes.c | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c index

[PATCH 05/15] btrfs: rename __btrfs_open_devices to open_fs_devices

2018-04-11 Thread Anand Jain
__btrfs_open_devices() is un-exported drop __ prefix and rename it to open_fs_devices(). Signed-off-by: Anand Jain --- fs/btrfs/volumes.c | 7 +++ 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c index

[PATCH 15/15] btrfs: cleanup btrfs_destroy_dev_replace_tgtdev() localize btrfs_fs_devices

2018-04-11 Thread Anand Jain
Declare a local btrfs_fs_devices pointer to access the same, as there are more than one access to the pointer. Signed-off-by: Anand Jain --- fs/btrfs/volumes.c | 12 +++- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/fs/btrfs/volumes.c

[PATCH 03/15] btrfs: cleanup __btrfs_open_devices() drop head pointer

2018-04-11 Thread Anand Jain
__btrfs_open_devices() declares struct list_head *head, however head is used only once, instead use btrfs_fs_devices::devices directly. Signed-off-by: Anand Jain --- fs/btrfs/volumes.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git

[PATCH 11/15] btrfs: drop uuid_mutex in btrfs_open_devices()

2018-04-11 Thread Anand Jain
btrfs_open_devices() is using uuid_mutex, but as the btrfs_open_devices() is just limited to open all the devices under a given fsid, so we don't need uuid_mutex. Instead it should hold the device_list_mutex as it updated the status of the btrfs_fs_devices and btrfs_device of a fsid.

[PATCH 0/15] Review uuid_mutex usage

2018-04-11 Thread Anand Jain
uuid_mutex lock is not a per-fs lock but a global lock. The main aim of this patch-set is to critically review the usage of this lock, and delete the unnecessary once. By doing this we improve the concurrency of device operations across multiple btrfs filesystems is in the system. patch 1: Was

Re: [PATCH v2 2/2] common/rc: raise mixed mode threshold to 1GB

2018-04-11 Thread Dave Chinner
On Wed, Apr 11, 2018 at 10:07:29PM -0700, Omar Sandoval wrote: > From: Omar Sandoval > > generic/427 creates a 256 MB filesystem and then writes a 200 MB file, > which fails on Btrfs if mixed mode is not enabled. Raise the threshold > to 1GB, which is where we typically recommend