This patch adds cli
btrfs device forget [dev]
to remove the given device structure in the kernel if the device
is unmounted. If no argument is given it shall remove all stale
(device which are not mounted) from the kernel.
Signed-off-by: Anand Jain
---
cmds-device.c | 58
like in split brain raid1.
. Running test cases which requires btrfs.ko-reload if the rootfs
is btrfs.
Signed-off-by: Anand Jain
---
fs/btrfs/super.c | 3 +++
fs/btrfs/volumes.c | 9 +
fs/btrfs/volumes.h | 1 +
include/uapi/linux/btrfs.h | 2 ++
4 files
-by: Nikolay Borisov
Signed-off-by: Anand Jain
---
Hi,
As it fixes the BUG_ON I have spun a new patch for this.
Instead of -EINVAL should we use ASSERT?
fs/btrfs/volumes.c | 27 ---
1 file changed, 20 insertions(+), 7 deletions(-)
diff --git a/fs/btrfs/volumes.c b/fs/btrfs
will be wrong.
Signed-off-by: Anand Jain
---
v3->v4: add comment and drop the inline (sorry missed it before)
v2->v3: update changelog with not so obvious balance and repalce
co-existance secnario
v1->v2: add comments
fs/btrfs/volumes.c | 38 --
1 file ch
On 07/30/2018 10:18 PM, Nikolay Borisov wrote:
On 25.07.2018 16:27, Anand Jain wrote:
test case btrfs/164 reported UAF..
[ 6712.084324] general protection fault: [#1] PREEMPT SMP
::
[ 6712.195423] btrfs_update_commit_device_size+0x75/0xf0 [btrfs]
[ 6712.201424
On 08/03/2018 02:36 PM, Anand Jain wrote:
On 07/31/2018 07:47 PM, Filipe Manana wrote:
On Tue, Jul 31, 2018 at 11:12 AM, Anand Jain
wrote:
On 07/27/2018 08:04 AM, Naohiro Aota wrote:
When btrfs hits error after modifying fs_devices in
btrfs_init_new_device
On 07/31/2018 07:47 PM, Filipe Manana wrote:
On Tue, Jul 31, 2018 at 11:12 AM, Anand Jain wrote:
On 07/27/2018 08:04 AM, Naohiro Aota wrote:
When btrfs hits error after modifying fs_devices in
btrfs_init_new_device() (such as btrfs_add_dev_item() returns error), it
leaves everything
On 08/02/2018 08:21 PM, David Sterba wrote:
On Thu, Aug 02, 2018 at 01:11:40PM +0300, Nikolay Borisov wrote:
On 2.08.2018 13:09, Anand Jain wrote:
When the replace is running the fs_devices::num_devices also includes
the replace device, however in some operations like device delete
On 08/01/2018 10:41 PM, David Sterba wrote:
On Thu, Jul 26, 2018 at 02:53:34PM +0800, Anand Jain wrote:
When the replace is running the fs_devices::num_devices also includes
the replace device, however in some operations like device delete and
balance it needs the actual num_devices without
will be wrong.
Signed-off-by: Anand Jain
---
v2->v3: update changelog with not so obvious balance and repalce
co-existance secnario
v1->v2: add comments
fs/btrfs/volumes.c | 32 ++--
1 file changed, 18 insertions(+), 14 deletions(-)
diff --git a/fs/btrfs/volumes.c b/fs
On 08/01/2018 10:29 PM, David Sterba wrote:
On Thu, Jul 26, 2018 at 02:53:32PM +0800, Anand Jain wrote:
From: Anand Jain
%fs_devices can be free-ed by btrfs_free_stale_devices() when the
close_fs_devices() drops fs_devices::opened to zero, but close_fs_devices
tries to access
On 07/27/2018 08:04 AM, Naohiro Aota wrote:
When btrfs hits error after modifying fs_devices in
btrfs_init_new_device() (such as btrfs_add_dev_item() returns error), it
leaves everything as is, but frees allocated btrfs_device. As a result,
fs_devices->devices and fs_devices->alloc_list
This patch adds cli
btrfs device forget [dev]
to remove the given device structure in the kernel if the device
is unmounted. If no argument is given it shall remove all stale
(device which are not mounted) from the kernel.
Signed-off-by: Anand Jain
---
cmds-device.c | 58
like in split brain raid1.
. Running test cases which requires btrfs.ko-reload if the rootfs
is btrfs.
Signed-off-by: Anand Jain
---
fs/btrfs/super.c | 3 +++
fs/btrfs/volumes.c | 9 +
fs/btrfs/volumes.h | 1 +
include/uapi/linux/btrfs.h | 2 ++
4 files
are in the specific patch.
Patch 1/2 is renamed from
[PATCH 1/2] btrfs: refactor btrfs_free_stale_device() to get device list
delete
to
[PATCH 1/2] btrfs: add function to device list delete
Adds cli and ioctl to forget a scanned device or forget all stale
devices in the kernel.
Anand Jain
Hi Ross,
Thanks for the report. I have analyzed it here [1] earlier and is
harmless since lockdep checks doesn't seem to account for the
difference in the lock time-space, there is similar fix in block
layer as well (which I am unable to pull the ref as of now, but
will try again). And
On 07/26/2018 11:25 PM, Filipe Manana wrote:
On Thu, Jul 26, 2018 at 12:32 PM, 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
.
Again, the devices are removed only if the relevant fsid aren't mounted.
Signed-off-by: Anand Jain
---
fs/btrfs/super.c | 3 +++
fs/btrfs/volumes.c | 9 +
fs/btrfs/volumes.h | 1 +
include/uapi/linux/btrfs.h | 2 ++
4 files changed, 15 insertions(+)
diff --git
This patch adds cli
btrfs device forget [dev]
to remove the given device structure in the kernel if the device
is unmounted. If no argument is given it shall remove all stale
(device which are not mounted) from the kernel.
Signed-off-by: Anand Jain
---
cmds-device.c | 58
from
[PATCH 1/2] btrfs: refactor btrfs_free_stale_device() to get device list
delete
to
[PATCH 1/2] btrfs: add function to device list delete
Adds cli and ioctl to forget a scanned device or forget all stale
devices in the kernel.
Anand Jain (1):
btrfs: introduce feature to forget
-by: Anand Jain
Reviewed-by: David Sterba
---
v3->v4: As we traverse through the seed device, fs_device gets updated with
the child seed fs_devices, so make sure we use the same fs_devices
pointer for the mutex_unlock as used for the mutex_lock.
v2->v3: Update chan
In this set:
v1->v2:
1/4 no changes.
2/4 no changes.
3/4 added new. Which shall replace the warn_on with bug_on. As the
redundency is after this check. So I decided to keep bug_on for now.
4/4 added comments that btrfs_num_devices() will get num_devices
excluding the repalce device.
Anand Jain
In preparation to add helper function to deduce the num_devices with
replace running, use bug_on instead of warn_on. In btrfs_rm_device()
the check for min devices happens in btrfs_check_raid_min_devices()
but its after its been decremented so a check here is better.
Signed-off-by: Anand Jain
From: Anand Jain
%fs_devices can be free-ed by btrfs_free_stale_devices() when the
close_fs_devices() drops fs_devices::opened to zero, but close_fs_devices
tries to access the %fs_devices again without the device_list_mutex.
Fix this by bringing the %fs_devices access
When the replace is running the fs_devices::num_devices also includes
the replace device, however in some operations like device delete and
balance it needs the actual num_devices without the repalce devices, so
now the function btrfs_num_devices() just provides that.
Signed-off-by: Anand Jain
ure btrfs_shrink_device() calls the last needed
btrfs_commit_transaction() before the return.
Signed-off-by: Anand Jain
---
I am bit skeptical about the condition when btrfs_commit_transaction()
fails, can you pls be wary about it when reviewing. Thanks.
Lu/David,
As this issues isn't reproducible at my
On 07/24/2018 07:01 PM, David Sterba wrote:
On Tue, Jul 24, 2018 at 05:28:03PM +0800, Lu Fengqi wrote:
I can't reproduce the issue. Do you reproduce consistently? and I
Sorry I've taken so long to reply.
There are four virtual machines with the different storage backend here.
And I can
On 07/23/2018 09:57 PM, David Sterba wrote:
On Fri, Jul 20, 2018 at 07:18:54PM +0800, Anand Jain wrote:
On 07/19/2018 07:53 PM, David Sterba wrote:
On Mon, Jul 16, 2018 at 10:58:11PM +0800, Anand Jain wrote:
When the replace is running the fs_devices::num_devices also includes
On 07/23/2018 10:01 PM, David Sterba wrote:
On Mon, Jul 16, 2018 at 10:58:10PM +0800, Anand Jain wrote:
In preparation to de-duplicate a section of code where we deduce the
num_devices, use warn instead of bug.
Signed-off-by: Anand Jain
---
fs/btrfs/volumes.c | 2 +-
1 file changed, 1
On 07/21/2018 02:01 PM, Lu Fengqi wrote:
On Tue, Jul 03, 2018 at 05:07:24PM +0800, Anand Jain wrote:
When a device is deleted, the btrfs_super_block::number_devices is
reduced by 1, but we do that after the commit transaction, so this
change did not made it to the disk and waits for the next
On 07/20/2018 09:34 AM, Anand Jain wrote:
On 07/19/2018 07:45 PM, David Sterba wrote:
On Mon, Jul 16, 2018 at 10:58:12PM +0800, Anand Jain wrote:
Move the section of the code which performs the check if the device is
indelible, move that into a helper function.
Signed-off-by: Anand Jain
On 07/19/2018 07:53 PM, David Sterba wrote:
On Mon, Jul 16, 2018 at 10:58:11PM +0800, Anand Jain wrote:
When the replace is running the fs_devices::num_devices also includes
the replace device, however in some operations like device delete and
balance it needs the actual num_devices without
On 07/20/2018 02:35 PM, Anand Jain wrote:
On 07/19/2018 08:31 PM, David Sterba wrote:
On Mon, Jul 16, 2018 at 10:58:08PM +0800, Anand Jain wrote:
When we add a device to the RO mounted seed device, it becomes a
RW sprout FS. The following steps are used to hold the seed and
sprout
Noted. Thanks Dan.
-Anand
On 07/19/2018 04:10 PM, Dan Carpenter wrote:
Hello Anand Jain,
The patch a6500c9ef8ac: "btrfs: add helper function check device
delete able" from Jul 10, 2018, leads to the following static checker
warning:
fs/btrfs/volumes.c:1871 btrfs_device_d
On 07/19/2018 08:31 PM, David Sterba wrote:
On Mon, Jul 16, 2018 at 10:58:08PM +0800, Anand Jain wrote:
When we add a device to the RO mounted seed device, it becomes a
RW sprout FS. The following steps are used to hold the seed and
sprout fs_devices.
(first two steps are not mandatory
On 07/19/2018 07:53 PM, David Sterba wrote:
On Mon, Jul 16, 2018 at 10:58:11PM +0800, Anand Jain wrote:
When the replace is running the fs_devices::num_devices also includes
the replace device, however in some operations like device delete and
balance it needs the actual num_devices without
patches.
Anand Jain (7):
1. btrfs: drop uuid_mutex in btrfs_free_extra_devids()
2. btrfs: fix race between free_stale_devices and close_fs_devices
3. btrfs: do device clone using the btrfs_scan_one_device
4. btrfs: use the assigned fs_devices instead of the dereference
5. btrfs: warn for num_devices
to device list delete
Adds cli and ioctl to forget a scanned device or forget all stale
devices in the kernel.
Anand Jain (1):
btrfs: introduce feature to forget a btrfs device
fs/btrfs/super.c | 3 +++
fs/btrfs/volumes.c | 9 +
fs/btrfs/volumes.h | 1 +
include
.
Again, the devices are removed only if the relevant fsid aren't mounted.
Signed-off-by: Anand Jain
---
fs/btrfs/super.c | 3 +++
fs/btrfs/volumes.c | 9 +
fs/btrfs/volumes.h | 1 +
include/uapi/linux/btrfs.h | 2 ++
4 files changed, 15 insertions(+)
diff --git
This patch adds cli
btrfs device forget [dev]
to remove the given device structure in the kernel if the device
is unmounted. If no argument is given it shall remove all stale
(device which are not mounted) from the kernel.
Signed-off-by: Anand Jain
---
cmds-device.c | 58
Please ignore this. There is a line of code which is un-commit.
I am sending this series again. Sorry for the noise.
Thanks, Anand
On 07/18/2018 11:07 AM, Anand Jain wrote:
v7:
Availalbe for pull from
btrfs-progs:
g...@github.com:asj/btrfs-progs.git forget
btrfs.ko:
g
to forget a scanned device or forget all stale
devices in the kernel.
Anand Jain (1):
btrfs: introduce feature to forget a btrfs device
fs/btrfs/super.c | 3 +++
fs/btrfs/volumes.c | 9 +
fs/btrfs/volumes.h | 1 +
include/uapi/linux/btrfs.h | 2 ++
4 files
This patch adds cli
btrfs device forget [dev]
to remove the given device structure in the kernel if the device
is unmounted. If no argument is given it shall remove all stale
(device which are not mounted) from the kernel.
Signed-off-by: Anand Jain
---
cmds-device.c | 58
.
Again, the devices are removed only if the relevant fsid aren't mounted.
Signed-off-by: Anand Jain
---
fs/btrfs/super.c | 3 +++
fs/btrfs/volumes.c | 9 +
fs/btrfs/volumes.h | 1 +
include/uapi/linux/btrfs.h | 2 ++
4 files changed, 15 insertions(+)
diff --git
::
@@ -1561,12 +1564,15 @@ static struct dentry *btrfs_mount_root(struct
file_system_type *fs_type,
goto error_fs_info;
}
- error = btrfs_scan_one_device(device_name, mode, fs_type, _devices);
- if (error) {
+ device =
On 07/16/2018 10:58 PM, Anand Jain wrote:
As the last set if the pull wasn't integrated due to its pending
review corrections. Here, I have done them (not much except for adding
comments and function renames) and so sending it again. Also
this set clubs other independent patches which
On 07/16/2018 10:18 PM, Anand Jain wrote:
Rename btrfs_parse_early_options() to btrfs_parse_device_options(). As
btrfs_parse_early_options() parses the -o device options and scan the
device provided. So this rename specifies its action. Also the function
name is inline
Move the section of the code which performs the check if the device is
indelible, move that into a helper function.
Signed-off-by: Anand Jain
---
v1->v2: Rename function to btrfs_get_device_for_delete(), thanks
Nikolay.
fs/btrfs/volumes.c |
When the replace is running the fs_devices::num_devices also includes
the replace device, however in some operations like device delete and
balance it needs the actual num_devices without the repalce devices, so
now the function btrfs_num_devices() just provides that.
Signed-off-by: Anand Jain
We have assigned the %fs_info->fs_devices in %fs_devices as its not
modified just use it for the mutex_lock().
Signed-off-by: Anand Jain
---
I don't see this in the ML at all, I remember sending this. Anyway
I am marking this as V1.
fs/btrfs/volumes.c | 4 ++--
1 file changed, 2 inserti
In preparation to de-duplicate a section of code where we deduce the
num_devices, use warn instead of bug.
Signed-off-by: Anand Jain
---
fs/btrfs/volumes.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c
index 7f4973fc2b52
ice remains scanned after the
sprouting. So use the btrfs_scan_one_device() code instead. And do it
at the end of the sprouting.
Signed-off-by: Anand Jain
---
fs/btrfs/volumes.c | 21 -
1 file changed, 12 insertions(+), 9 deletions(-)
diff --git a/fs/btrfs/volumes.c b/fs/bt
-by: Anand Jain
Reviewed-by: David Sterba
---
v3->v4: As we traverse through the seed device, fs_device gets updated with
the child seed fs_devices, so make sure we use the same fs_devices
pointer for the mutex_unlock as used for the mutex_lock.
v2->v3: Update chan
From: Anand Jain
%fs_devices can be free-ed by btrfs_free_stale_devices() when the
close_fs_devices() drops fs_devices::opened to zero, but close_fs_devices
tries to access the %fs_devices again without the device_list_mutex.
Fix this by bringing the %fs_devices access
of the individual patches in its change list.
And most of it still remains at v1.
This can also be pulled from:
g...@github.com:asj/btrfs-devel.git misc-next-for-kdave-16jul
Anand Jain (7):
btrfs: drop uuid_mutex in btrfs_free_extra_devids()
btrfs: fix race between free_stale_devices
On 05/29/2018 07:19 PM, David Sterba wrote:
On Tue, May 29, 2018 at 01:40:34PM +0800, Anand Jain wrote:
v3->v4: As we traverse through the seed device, fs_device gets
updated with
the child seed fs_devices, so make sure we use the same fs_devices
pointer for the mutex_unl
-by: Anand Jain
---
fs/btrfs/super.c | 14 +++---
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/fs/btrfs/super.c b/fs/btrfs/super.c
index 9d340f8d3457..9dc56d3eaa66 100644
--- a/fs/btrfs/super.c
+++ b/fs/btrfs/super.c
@@ -465,9 +465,9 @@ int btrfs_parse_options(struct
.
btrfs_mount_root
-> btrfs_parse_early_options
->btrfs_scan_one_device
So, there is no necessary to pass fs_devices from btrfs_mount_root,
use a local variable in btrfs_parse_early_options is enough.
Signed-off-by: Gu Jinxiang
Reviewed-by: Anand Jain
---
Changel
On 07/13/2018 07:17 PM, Nikolay Borisov wrote:
On 13.07.2018 14:17, Anand Jain wrote:
On 07/12/2018 03:31 PM, Nikolay Borisov wrote:
On 10.07.2018 21:22, Anand Jain wrote:
When the replace is running the fs_devices::num_devices also includes
the replace device, however in some
On 07/13/2018 07:28 PM, Nikolay Borisov wrote:
On 13.07.2018 14:27, Anand Jain wrote:
On 07/12/2018 03:43 PM, Nikolay Borisov wrote:
On 10.07.2018 21:22, Anand Jain wrote:
Move the section of the code which performs the check if the device is
indelible, move that into a helper
On 07/12/2018 03:43 PM, Nikolay Borisov wrote:
On 10.07.2018 21:22, Anand Jain wrote:
Move the section of the code which performs the check if the device is
indelible, move that into a helper function.
Signed-off-by: Anand Jain
---
fs/btrfs/volumes.c | 49
On 07/12/2018 03:31 PM, Nikolay Borisov wrote:
On 10.07.2018 21:22, Anand Jain wrote:
When the replace is running the fs_devices::num_devices also includes
the replace device, however in some operations like device delete and
balance it needs the actual num_devices without the repalce
On 07/12/2018 03:13 PM, Nikolay Borisov wrote:
On 10.07.2018 21:22, Anand Jain wrote:
In preparation to de-duplicate a section of code where we deduce the
num_devices, use warn instead of bug.
Signed-off-by: Anand Jain
---
fs/btrfs/volumes.c | 2 +-
1 file changed, 1 insertion(+), 1
On 07/13/2018 01:39 PM, Qu Wenruo wrote:
On 2018年07月13日 13:32, Anand Jain wrote:
But if you are planning to
record and start at transaction [14] then its an overkill because
transaction [19 and [20] are already in the disk.
Yes, I'm doing it overkilled.
Ah. Ok
But if you are planning to
record and start at transaction [14] then its an overkill because
transaction [19 and [20] are already in the disk.
Yes, I'm doing it overkilled.
Ah. Ok.
But it's already much better than scrub all block groups (my original plan).
That's true.
On 07/12/2018 08:59 PM, Qu Wenruo wrote:
On 2018年07月12日 20:33, Anand Jain wrote:
On 07/12/2018 01:43 PM, Qu Wenruo wrote:
On 2018年07月11日 15:50, Anand Jain wrote:
BTRFS Volume operations, Device Lists and Locks all in one page:
Devices are managed in two contexts, the scan context
On 07/12/2018 01:43 PM, Qu Wenruo wrote:
On 2018年07月11日 15:50, Anand Jain wrote:
BTRFS Volume operations, Device Lists and Locks all in one page:
Devices are managed in two contexts, the scan context and the mounted
context. In scan context the threads originate from the btrfs_control
On 07/11/2018 09:22 AM, Gu Jinxiang wrote:
Instead of pointer to btrfs_fs_devices as an arg in
btrfs_scan_one_device, better to make it as a return value.
Yep this was in the list to fix. However I didn't like the idea
to return the btrfs_fs_devices pointer, instead return the
btrfs_device
.
btrfs_mount_root
-> btrfs_parse_early_options
->btrfs_scan_one_device
So, there is no necessary to pass fs_devices from btrfs_mount_root,
use a local variable in btrfs_parse_early_options is enough.
Signed-off-by: Gu Jinxiang
Other than two nit below.
Reviewed-by:
Hi David,
Here I have put together a set of volume related patches which were
sent to the ML as independent patches earlier. These have been
reviewed and tested. Please pull.
g...@github.com:asj/btrfs-devel.git misc-next-for-kdave
-
[Anand:2]
6049bd5e9694 btrfs: add helper
BTRFS Volume operations, Device Lists and Locks all in one page:
Devices are managed in two contexts, the scan context and the mounted
context. In scan context the threads originate from the btrfs_control
ioctl and in the mounted context the threads originates from the mount
point ioctl.
Hi,
I can reproduce the below circular locking warning [1] using the test
case btrfs/161. It can also be reproduced with 4.1 kernel so its not
due to any of the recent patches.
And this warning is unreasonable too .. here is why.
From [1], Thread #0 is when mounting the sprout device, and
ice remains scanned after the
sprouting. So use the btrfs_scan_one_device() code instead. And do it
at the end of the sprouting.
Signed-off-by: Anand Jain
---
fs/btrfs/volumes.c | 21 -
1 file changed, 12 insertions(+), 9 deletions(-)
diff --git a/fs/btrfs/volumes.c b/fs/bt
#syz test: https://github.com/asj/btrfs-devel.git misc-next
On 06/06/2018 09:17 PM, syzbot wrote:
Hello,
syzbot found the following crash on:
HEAD commit: af6c5d5e01ad Merge branch 'for-4.18' of
git://git.kernel.o..
git tree: upstream
console output:
#syz test: git://g...@github.com:asj/btrfs-devel.git misc-next
On 06/06/2018 09:17 PM, syzbot wrote:
Hello,
syzbot found the following crash on:
HEAD commit: af6c5d5e01ad Merge branch 'for-4.18' of
git://git.kernel.o..
git tree: upstream
console output:
ice remains scanned after the
sprouting. So use the btrfs_scan_one_device() code instead. And do it
at the end of the sprouting.
Signed-off-by: Anand Jain
---
As I don't this patch in the ML. I am sending this again, with no
change.
fs/btrfs/volumes.c | 21 -
1 file changed,
In preparation to de-duplicate a section of code where we deduce the
num_devices, use warn instead of bug.
Signed-off-by: Anand Jain
---
fs/btrfs/volumes.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c
index eb78bb8d1108
Move the section of the code which performs the check if the device is
indelible, move that into a helper function.
Signed-off-by: Anand Jain
---
fs/btrfs/volumes.c | 49 ++---
1 file changed, 30 insertions(+), 19 deletions(-)
diff --git a/fs/btrfs
When the replace is running the fs_devices::num_devices also includes
the replace device, however in some operations like device delete and
balance it needs the actual num_devices without the repalce devices, so
now the function btrfs_num_devices() just provides that.
Signed-off-by: Anand Jain
On 07/10/2018 06:41 PM, David Sterba wrote:
On Mon, Jul 09, 2018 at 04:33:52PM +0800, Anand Jain wrote:
No functional change, bring the clone of fs_devices and its
operations closer, so that it indicates its purpose.
Also add a comment to indicate why we clone the fs_devices.
Signed-off
We have assigned the %fs_info->fs_devices in %fs_devices as its not
modified just use it for the mutex_lock().
Signed-off-by: Anand Jain
---
fs/btrfs/volumes.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c
index 0e92969b1
No functional change, bring the clone of fs_devices and its
operations closer, so that it indicates its purpose.
Also add a comment to indicate why we clone the fs_devices.
Signed-off-by: Anand Jain
---
fs/btrfs/volumes.c | 13 -
1 file changed, 8 insertions(+), 5 deletions
This test case verifies if the device ready return success after the
device delete.
Signed-off-by: Anand Jain
---
v1->v2: use _run_btrfs_util_prog instead of open coding it.
tests/btrfs/168 | 68 +
tests/btrfs/168.out | 2 ++
tests/bt
On 07/06/2018 12:40 PM, Eryu Guan wrote:
On Tue, Jul 03, 2018 at 04:47:53PM +0800, Anand Jain wrote:
This test case verifies if the device ready return success after the
device delete.
Signed-off-by: Anand Jain
Looks fine to me overall, but I may need some helps from btrfs folks
+ceb2606025ec1cc34...@syzkaller.appspotmail.com
Signed-off-by: David Sterba
As I said, the fsids concurrency scan/mount are coming up on top these
patches so..
Reviewed-by: Anand Jain
Thanks, Anand
---
fs/btrfs/super.c | 12 ++--
1 file changed, 6 insertions(+), 6 deletions
in the meantime.
Signed-off-by: David Sterba
Reviewed-by: Anand Jain
Thanks, Anand
---
fs/btrfs/super.c | 2 ++
fs/btrfs/volumes.c | 4 ++--
2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/fs/btrfs/super.c b/fs/btrfs/super.c
index 735402ed3154..ee82d02f5453 100644
--- a/fs/btrfs
Signed-off-by: David Sterba
Reviewed-by: Anand Jain
Thanks, Anand
---
fs/btrfs/super.c | 30 ++
1 file changed, 14 insertions(+), 16 deletions(-)
diff --git a/fs/btrfs/super.c b/fs/btrfs/super.c
index e3324ddf2777..1780eb41f203 100644
--- a/fs/btrfs/super.c
+++ b
On 06/21/2018 01:51 AM, David Sterba wrote:
Prepartory work to fix race between mount and device scan.
btrfs_parse_early_options calls the device scan from mount and we'll
need to let mount completely manage the critical section.
Signed-off-by: David Sterba
Reviewed-by: Anand Jain
.
Signed-off-by: David Sterba
Reviewed-by: Anand Jain
Thanks, Anand
---
fs/btrfs/super.c | 12 +++-
fs/btrfs/volumes.c | 4 ++--
2 files changed, 13 insertions(+), 3 deletions(-)
diff --git a/fs/btrfs/super.c b/fs/btrfs/super.c
index 81107ad49f3a..735402ed3154 100644
--- a/fs
On 06/21/2018 01:51 AM, David Sterba wrote:
The stale device list removal needs to be protected by device_list_mutex
too as this could delete from the list and could race with another list
modification and cause crash.
The device needs to be fully initialized before it's added to the list
so
es::opened to be consistent with
other users of that item.
CC: Anand Jain
Signed-off-by: David Sterba
I am optimize the uuid_mutex for fsids concurrency on top these set of
patches, so.
Reviewed-by: Anand Jain
Thanks, Anand
---
fs/btrfs/volumes.c | 2 ++
1 file changed, 2 insertion
commit transaction.
Also align the local variable declarations in the function
btrfs_rm_dev_item()
Delete a todo comment about transient inconsistent state
Signed-off-by: Anand Jain
---
v1->v2:
Delete a todo comment
Refactor btrfs_rm_dev_item to use trans->fs_info and drop fs_info in
the ar
updating its corresponding on-disk
btrfs_super_block::number_devices value.
Signed-off-by: Anand Jain
---
v1->v2: no change
fs/btrfs/volumes.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c
index 8b34af7c217c..b5a60ab37a1c 100644
--- a/fs/bt
On 07/03/2018 01:56 PM, Nikolay Borisov wrote:
On 3.07.2018 08:12, Anand Jain wrote:
When a device is deleted, the btrfs_super_block::number_devices is
reduced by 1, but we do that after the commit transaction, so this
change did not made it to the disk and waits for the next commit
This test case verifies if the device ready return success after the
device delete.
Signed-off-by: Anand Jain
---
tests/btrfs/168 | 68 +
tests/btrfs/168.out | 2 ++
tests/btrfs/group | 1 +
3 files changed, 71 insertions(+)
create
There is only one usage of the declared devices variable, instead
use its value directly.
Signed-off-by: Anand Jain
---
fs/btrfs/volumes.c | 5 +
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c
index f7fa0ea26e9c..124bd8728c37 100644
There are many instances of the %fs_info->fs_devices pointer
de-reference, so declare a %fs_devices pointer instead.
Signed-off-by: Anand Jain
---
fs/btrfs/volumes.c | 42 +-
1 file changed, 21 insertions(+), 21 deletions(-)
diff --git a/fs/bt
updating its corresponding on-disk
btrfs_super_block::number_devices value.
Signed-off-by: Anand Jain
---
fs/btrfs/volumes.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c
index 5bd6f3a40f9c..6b807b166ca3 100644
--- a/fs/btrfs/volumes.c
+++ b/fs
commit transaction.
Signed-off-by: Anand Jain
---
fs/btrfs/volumes.c | 38 ++
1 file changed, 18 insertions(+), 20 deletions(-)
diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c
index 6b807b166ca3..18cd73703951 100644
--- a/fs/btrfs/volumes.c
+++ b/fs/btrfs/vol
On 06/29/2018 08:06 PM, David Sterba wrote:
On Tue, Jun 26, 2018 at 10:42:32PM +0800, Anand Jain wrote:
Last version of the proposed fix is to extend the uuid_mutex over the
whole mount callback and use it around calls to btrfs_scan_one_device.
That way we'll be sure the mount will always
201 - 300 of 3004 matches
Mail list logo