On 02/14/2018 10:19 PM, Tomasz Chmielewski wrote:
Just FYI, how dangerous running btrfs can be - we had a fatal,
unrecoverable MySQL corruption when btrfs decided to do one of these "I
have ~50 GB left, so let's do out of space (and corrupt some files at
the same time, ha ha!)".
Thanks
Use ASSERT to report logical error in cow_file_range(), also move
it a bit closer to when the num_bytes is derived.
Signed-off-by: Anand Jain <anand.j...@oracle.com>
---
v1->v2:
ASSERT logic changed. Thanks Nikolay.
fs/btrfs/inode.c | 4 +---
1 file changed, 1 insertion(+), 3
, delete it.
Signed-off-by: Anand Jain <anand.j...@oracle.com>
---
fs/btrfs/disk-io.c | 13 ---
fs/btrfs/volumes.c | 63 --
fs/btrfs/volumes.h | 1 -
3 files changed, 77 deletions(-)
diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/dis
Use ASSERT to report logical error in cow_file_range(), also move
it a bit closer to when the num_bytes is derived.
Signed-off-by: Anand Jain <anand.j...@oracle.com>
---
fs/btrfs/inode.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/fs/btrfs/inode.c b/fs/btrfs/i
This patch deletes local variable disk_num_bytes as its value
is same as num_bytes in the function cow_file_range().
Signed-off-by: Anand Jain <anand.j...@oracle.com>
---
v1->v2:
Fix conflict.
Removed Reviewed-by: David Sterba <dste...@suse.com>
as there is a conflict
Commit [1] removed the need to use btrfs_async_submit_limit(), so
delete it.
[1]
commit 736cd52e0c720103f52ab9da47b6cc3af6b083f6
Btrfs: remove nr_async_submits and async_submit_draining
Signed-off-by: Anand Jain <anand.j...@oracle.com>
---
fs/btrfs/disk-io.c | 8
fs/btrfs/dis
On 02/14/2018 12:28 AM, David Sterba wrote:
On Tue, Feb 13, 2018 at 05:49:50PM +0800, Anand Jain wrote:
We aren't verifying the parameter passed to the max_inline mount option,
so we won't report and fail the mount if a junk value is specified for
example, -o max_inline=abc.
This patch
On 02/14/2018 12:10 AM, David Sterba wrote:
On Tue, Feb 13, 2018 at 05:50:43PM +0800, Anand Jain wrote:
As -o subvolid mount option is an u64 manage it as %u for
token verifications, instead of %s.
Signed-off-by: Anand Jain <anand.j...@oracle.com>
---
fs/btrfs/super.
We have btrfs_fs_info::data_chunk_allocations and
btrfs_fs_info::metadata_ratio declared as unsigned which would
be unsinged int and kernel style prefers unsigned int over bare
unsigned. So this patch changes them to u32.
Signed-off-by: Anand Jain <anand.j...@oracle.com>
---
v1->v2: Upda
We aren't verifying the parameter passed to the subvolid mount option,
so we won't report and fail the mount if a junk value is specified for
example, -o subvolid=abc.
This patch verifies the subvolid option with match_u64.
Signed-off-by: Anand Jain <anand.j...@oracle.com>
---
v1->v
On 02/14/2018 01:55 AM, David Sterba wrote:
On Tue, Feb 13, 2018 at 06:27:13PM +0800, Anand Jain wrote:
On 02/13/2018 05:01 PM, Qu Wenruo wrote:
On 2018年02月13日 11:00, Anand Jain wrote:
Fixes the endianness bug in the fs_info::super_copy by using its
btrfs_set_super...() function to set
diff --git a/fs/btrfs/super.c b/fs/btrfs/super.c
index 02c7766e6849..8112619cac95 100644
--- a/fs/btrfs/super.c
+++ b/fs/btrfs/super.c
@@ -346,7 +346,7 @@ static const match_table_t tokens = {
{Opt_barrier, "barrier"},
{Opt_max_inline, "max_inline=%u"},
On 02/13/2018 05:01 PM, Qu Wenruo wrote:
On 2018年02月13日 11:00, Anand Jain wrote:
Fixes the endianness bug in the fs_info::super_copy by using its
btrfs_set_super...() function to set values in the SB, as these
functions manage the endianness compatibility nicely.
Signed-off-by: Anand Jain
As -o subvolid mount option is an u64 manage it as %u for
token verifications, instead of %s.
Signed-off-by: Anand Jain <anand.j...@oracle.com>
---
fs/btrfs/super.c | 23 ++-
1 file changed, 10 insertions(+), 13 deletions(-)
diff --git a/fs/btrfs/super.c b/fs/btrfs/s
As -o commit mount option is unsinged so manage it as %u
for token verifications, instead of %d.
Signed-off-by: Anand Jain <anand.j...@oracle.com>
---
fs/btrfs/ctree.h | 2 +-
fs/btrfs/super.c | 26 ++
2 files changed, 11 insertions(+), 17 deletions(-)
diff --gi
-o thread_pool is alway unsigned. Manage it that way all around.
Signed-off-by: Anand Jain <anand.j...@oracle.com>
---
fs/btrfs/ctree.h | 2 +-
fs/btrfs/disk-io.c | 4 ++--
fs/btrfs/super.c | 13 ++---
3 files changed, 9 insertions(+), 10 deletions(-)
diff --git a/fs/btrfs/c
As -o check_int_print_mask mount option is unsinged so manage it as %u
for token verifications, instead of %d.
Signed-off-by: Anand Jain <anand.j...@oracle.com>
---
fs/btrfs/super.c | 16 +---
1 file changed, 5 insertions(+), 11 deletions(-)
diff --git a/fs/btrfs/super.c b/fs
As -o metadata_ratio mount option is unsinged so manage it as %u for
token verifications, instead of %s.
Signed-off-by: Anand Jain <anand.j...@oracle.com>
---
fs/btrfs/super.c | 17 ++---
1 file changed, 6 insertions(+), 11 deletions(-)
diff --git a/fs/btrfs/super.c b/fs
Kernel style prefers "unsigned int " over "unsigned "
and "signed int " over "signed ".
Signed-off-by: Anand Jain <anand.j...@oracle.com>
---
fs/btrfs/ctree.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/fs/btrfs
-o alloc_start and -o subvolrootid are deprecated mount options,
comment them in the tokens list. And leave them as it is. No
functional changes.
Signed-off-by: Anand Jain <anand.j...@oracle.com>
---
fs/btrfs/super.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --gi
As of now btrfs_fs_info::max_line is u64, which can't be
larger than btrfs_fs_info::sectorsize which is defined as
u32, so make btrfs_fs_info::max_line u32,
Signed-off-by: Anand Jain <anand.j...@oracle.com>
---
v1->v2: Born in v2.
fs/btrfs/ctree.h | 2 +-
fs/btrfs/super.c | 8
We aren't verifying the parameter passed to the max_inline mount option,
so we won't report and fail the mount if a junk value is specified for
example, -o max_inline=abc.
This patch converts the max_inline option to %d and checks if it's a
number >= 0.
Signed-off-by: Anand Jain <a
On 02/13/2018 01:13 AM, David Sterba wrote:
On Mon, Feb 12, 2018 at 11:35:46PM +0800, Anand Jain wrote:
We aren't verifying the parameter passed to the max_inline mount option,
so we won't report and fail the mount if a junk value is specified for
example, -o max_inline=abc.
This patch
bss dec hex filename
1131090 82898 18992 1232980 12d054 fs/btrfs/btrfs.ko
Signed-off-by: Anand Jain <anand.j...@oracle.com>
---
fs/btrfs/extent_io.c | 5 -
fs/btrfs/extent_io.h | 5 -
2 files changed, 4 insertions(+), 6 deletions(-)
diff --git a/fs/btrfs/extent_io.c b/fs
On 02/13/2018 12:55 AM, David Sterba wrote:
On Mon, Feb 12, 2018 at 11:34:56PM +0800, Anand Jain wrote:
extent_buffer_uptodate() returns from test_bit() which is of
type bool, so update extent_buffer_uptodate() to it.
The return value of test_bit differes by architecture, there are several
We don't have to check if tgt_device is null and then delete
it, because there wouldn't be a case where tgt_device will
be null in a mounted context. If the replacement is already
canceled then we won't be here, since there is a switch above
to deviate.
Signed-off-by: Anand Jain <anan
For forensic investigations of issues, we would want to know
if and when the user cancels the replace.
Signed-off-by: Anand Jain <anand.j...@oracle.com>
---
v1->v2: use btrfs_dev_name() instead of rcu_str_deref()
as btrfs_dev_name() also provides "missing" string,
+
+ btrfs_info(fs_info, "dev_replace from %s (devid %llu) to %s canceled",
+ btrfs_dev_name(src_device), src_device->devid,
+ rcu_str_deref(tgt_device->name));
The behavior is quite good.
Although I'm wondering why for @src_device we use
Fixes the endianness bug in the fs_info::super_copy by using its
btrfs_set_super...() function to set values in the SB, as these
functions manage the endianness compatibility nicely.
Signed-off-by: Anand Jain <anand.j...@oracle.com>
---
v1->v2: Update change log. Update $Subject.
On 02/13/2018 12:34 AM, David Sterba wrote:
On Mon, Feb 12, 2018 at 11:37:49PM +0800, Anand Jain wrote:
We have btrfs_set_super...() to set the various values, so just use it.
Sorry but this is not "just use it", as it fixes an endianness bug and
should be documented in the
We have btrfs_set_super...() to set the various values, so just use it.
Signed-off-by: Anand Jain <anand.j...@oracle.com>
---
fs/btrfs/transaction.c | 20
1 file changed, 12 insertions(+), 8 deletions(-)
diff --git a/fs/btrfs/transaction.c b/fs/btrfs/transaction.c
extent_buffer_uptodate() returns from test_bit() which is of
type bool, so update extent_buffer_uptodate() to it.
Signed-off-by: Anand Jain <anand.j...@oracle.com>
---
fs/btrfs/extent_io.c | 2 +-
fs/btrfs/extent_io.h | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --gi
Remove __ which is for the special functions.
Signed-off-by: Anand Jain <anand.j...@oracle.com>
---
fs/btrfs/dev-replace.c | 2 +-
fs/btrfs/dev-replace.h | 2 +-
fs/btrfs/ioctl.c | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/fs/btrfs/dev-replace.c b/fs/btr
Current u64 return from btrfs_dev_replace_cancel() was probably done
to match the btrfs_ioctl_dev_replace_args::result. However as our
actual return value fits in int, and it further gets typecast to u64,
so just return int.
Signed-off-by: Anand Jain <anand.j...@oracle.com>
---
fs/btr
btrfs_dev_replace_cancel() calls __btrfs_dev_replace_cancel() for the
actual cancel so just code it.
Signed-off-by: Anand Jain <anand.j...@oracle.com>
---
fs/btrfs/dev-replace.c | 10 +-
fs/btrfs/dev-replace.h | 3 +--
fs/btrfs/ioctl.c | 3 ++-
3 files changed, 4 inse
btrfs_init_dev_replace_tgtdev_for_resume() initializes replace
target device in few simple steps, so do it at the parent function.
Moreover, there isn't any other caller so just open code it.
Signed-off-by: Anand Jain <anand.j...@oracle.com>
---
fs/btrfs/dev-replace.c | 10 --
fs
Anand Jain (3):
btrfs: open code btrfs_dev_replace_cancel()
btrfs: rename __btrfs_dev_replace_cancel()
btrfs: change the return arg type for btrfs_dev_replace_cancel()
fs/btrfs/dev-replace.c | 12 ++--
fs/btrfs/dev-replace.h | 3 +--
fs/btrfs/ioctl.c | 3 ++-
3 files
For forensic investigations of issues, we would want to know
if and when the user cancels the replace.
Signed-off-by: Anand Jain <anand.j...@oracle.com>
---
fs/btrfs/dev-replace.c | 7 +++
1 file changed, 7 insertions(+)
diff --git a/fs/btrfs/dev-replace.c b/fs/btrfs/dev-replace.c
We aren't verifying the parameter passed to the max_inline mount option,
so we won't report and fail the mount if a junk value is specified for
example, -o max_inline=abc.
This patch converts the max_inline option to %d and checks if it's a
number >= 0.
Signed-off-by: Anand Jain <a
dump-tree prints wrong sequence number and the flags numbers,
as we misplaced the printf args. This patch fixes it.
Signed-off-by: Anand Jain <anand.j...@oracle.com>
---
print-tree.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/print-tree.c b/print-tree.c
On 02/06/2018 07:15 AM, Liu Bo wrote:
Btrfs tries its best to tolerate write errors, but kind of silently
(except some messages in kernel log).
For raid1 and raid10, this is usually not a problem because there is a
copy as backup, while for parity based raid setup, i.e. raid5 and
raid6, the
ping ?
Thanks, Anand
--
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
So usually this should be functionality handled by the raid/san
controller I guess, > but given that btrfs is playing the role of a
controller here at what point are we drawing the line of not
implementing block-level functionality into the filesystem ?
Don't worry this is not invading
On 02/05/2018 02:38 PM, Anand Jain wrote:
On 02/03/2018 03:09 AM, Howard McLauchlan wrote:
Presently, failing a primary super block write but succeeding in at
least one super block write in general will appear to users as if
nothing important went wrong.
However, upon unmounting and re
On 02/03/2018 03:09 AM, Howard McLauchlan wrote:
Presently, failing a primary super block write but succeeding in at
least one super block write in general will appear to users as if
nothing important went wrong.
However, upon unmounting and re-mounting,
the file system will be in a rolled
On 02/01/2018 01:26 PM, Edmund Nadolski wrote:
On 1/31/18 7:36 AM, Anand Jain wrote:
On 01/31/2018 09:42 PM, Nikolay Borisov wrote:
So usually this should be functionality handled by the raid/san
controller I guess, > but given that btrfs is playing the role of a
controller here at w
On 01/31/2018 09:42 PM, Nikolay Borisov wrote:
So usually this should be functionality handled by the raid/san
controller I guess, > but given that btrfs is playing the role of a
controller here at what point are we drawing the line of not
implementing block-level functionality into the
On 01/31/2018 06:47 PM, Peter Becker wrote:
2018-01-31 10:01 GMT+01:00 Anand Jain <anand.j...@oracle.com>:
When a stripe is not present on the read optimized disk it will just
use the lower devid disk containing the stripe (instead of failing back
to the pid based rando
On 01/31/2018 05:54 PM, Nikolay Borisov wrote:
On 31.01.2018 11:28, Anand Jain wrote:
On 01/31/2018 04:38 PM, Nikolay Borisov wrote:
On 30.01.2018 08:30, Anand Jain wrote:
Adds the mount option:
mount -o read_mirror_policy=
To set the devid of the device which should be used
On 01/31/2018 04:38 PM, Nikolay Borisov wrote:
On 30.01.2018 08:30, Anand Jain wrote:
Adds the mount option:
mount -o read_mirror_policy=
To set the devid of the device which should be used for read. That
means all the normal reads will go to that particular device only.
This also
On 01/31/2018 04:06 PM, Nikolay Borisov wrote:
diff --git a/fs/btrfs/ctree.h b/fs/btrfs/ctree.h
index 1a462ab85c49..4759e988b0df 100644
--- a/fs/btrfs/ctree.h
+++ b/fs/btrfs/ctree.h
@@ -1100,6 +1100,8 @@ struct btrfs_fs_info {
spinlock_t ref_verify_lock;
struct rb_root
On 01/31/2018 03:51 PM, Peter Becker wrote:
A little question about mount -o read_mirror_policy=.
How would this work with RAID1 over 3 or 4 HDD's?
In particular, if the desired block is not available on device .
When a stripe is not present on the read optimized disk it will just
use the
Add opened device to the tail of dev_alloc_list instead of head, so that
it maintains the same order as dev_list.
Signed-off-by: Anand Jain <anand.j...@oracle.com>
---
fs/btrfs/volumes.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/fs/btrfs/volumes.c b/fs/btrfs/vol
o, I missed the context of degraded when writing this patch.
Thanks for the fix.
Reviewed-by: Anand Jain <anand.j...@oracle.com>
Thanks, Anand
---
fs/btrfs/extent-tree.c | 4
1 file changed, 4 insertions(+)
diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c
index 9
ducing
the missing chunk related problems more consistent. (More fixes of this
sort is coming up).
Anand Jain (2):
btrfs: fix device order consistency
btrfs: fix alloc device order consistency
fs/btrfs/volumes.c | 18 +-
1 file changed, 17 insertions(+), 1 deletion(-)
--
the devices are having and same
SB generation.
Signed-off-by: Anand Jain <anand.j...@oracle.com>
---
fs/btrfs/volumes.c | 16
1 file changed, 16 insertions(+)
diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c
index b5036bd69e6a..0109f370ad5b 100644
--- a/fs/btrfs/volumes.c
+static int device_sort(void *priv, struct list_head *a, struct list_head *b)
I'll rename that to devid_cmp as it's the comparator and not really a
sorting function.
Ok. I will make that change in v3.
Thanks,
Anand
--
To unsubscribe from this list: send the line "unsubscribe
On 01/30/2018 05:12 PM, Nikolay Borisov wrote:
On 30.01.2018 08:28, Anand Jain wrote:
Drop optimal argument from the function find_live_mirror()
as we can deduce it in the function itself.
Signed-off-by: Anand Jain <anand.j...@oracle.com>
---
fs/btrfs/volumes.c | 8
On 01/30/2018 03:40 PM, Qu Wenruo wrote:
Signed-off-by: Qu Wenruo <w...@suse.com>
Reviewed-by: Anand Jain <anand.j...@oracle.com>
Thanks, Anand
---
fs/btrfs/volumes.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/fs/btrfs/volumes.c b/fs/btrfs/vol
to define it as a normal
function.
This also makes later code re-use between kernel and btrfs-progs
easier.
Signed-off-by: Qu Wenruo <w...@suse.com>
Reviewed-by: Anand Jain <anand.j...@oracle.com>
Thanks, Anand
---
fs/btrfs/extent-tree.c | 26 ---
diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c
index e9c31b567a9c..6e1128aa29d6 100644
--- a/fs/btrfs/extent-tree.c
+++ b/fs/btrfs/extent-tree.c
@@ -7346,7 +7346,8 @@ wait_block_group_cache_done(struct
btrfs_block_group_cache *cache)
return ret;
}
-int
.
Signed-off-by: Anand Jain <anand.j...@oracle.com>
---
fs/btrfs/super.c | 21 +
fs/btrfs/volumes.c | 10 ++
fs/btrfs/volumes.h | 2 ++
3 files changed, 33 insertions(+)
diff --git a/fs/btrfs/super.c b/fs/btrfs/super.c
index dfe6b3c67df3..d3aad87e 100644
--- a/fs
$pid policy configurable from the mount option.
For example..
mount -o read_mirror_policy=pid (which is also default)
Signed-off-by: Anand Jain <anand.j...@oracle.com>
---
fs/btrfs/ctree.h | 2 ++
fs/btrfs/super.c | 10 ++
fs/btrfs/volumes.c | 8 +++-
fs/btrfs/volumes.
Drop optimal argument from the function find_live_mirror()
as we can deduce it in the function itself.
Signed-off-by: Anand Jain <anand.j...@oracle.com>
---
fs/btrfs/volumes.c | 8
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/fs/btrfs/volumes.c b/fs/btrfs/vol
:
[PATCH 0/2] Preparatory to add read_mirror mount option
Anand Jain (2):
btrfs: add mount option read_mirror_policy
btrfs: add read_mirror_policy parameter devid
fs/btrfs/ctree.h | 2 ++
fs/btrfs/super.c | 31 +++
fs/btrfs/volumes.c | 18 +-
fs
Adds cleanups to find_live_mirror(), so that we can add more
policy on how the read mirror device should be found.
Anand Jain (2):
btrfs: drop num argument from find_live_mirror()
btrfs: drop optimal argument from find_live_mirror()
fs/btrfs/volumes.c | 20 ++--
1 file
Obtain the stripes info from the map directly and so no need
to pass it as an argument.
Signed-off-by: Anand Jain <anand.j...@oracle.com>
---
fs/btrfs/volumes.c | 14 +++---
1 file changed, 11 insertions(+), 3 deletions(-)
diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c
TR_ERR(...))
Generated by: scripts/coccinelle/api/err_cast.cocci
Fixes: bf155c98d312 ("btrfs: get device pointer from device_list_add()")
CC: Anand Jain <anand.j...@oracle.com>
Signed-off-by: Fengguang Wu <fengguang...@intel.com>
Thanks for the fix, I'll fold it to
On 01/29/2018 03:01 PM, Nikolay Borisov wrote:
On 29.01.2018 04:38, Anand Jain wrote:
On 01/26/2018 09:20 PM, Nikolay Borisov wrote:
Commit 4fde46f0cc71 ("Btrfs: free the stale device") introduced
btrfs_free_stale_device which iterates the device lists for all
regist
.
The fix is to use 'break' when we know we are freeing the current
fs_devs.
No break is needed as we need to iterate all stale devices and delete
the found stale entry, so commit [1] used list_for_each_entry_safe()
and removed the break,
[1]
commit 38cf665d338fca33af4b16f9ec7cad6637fc0fec
Aut
by the
__btrfs_open_devices() and is based on the generation number again.
So this patch deletes btrfs_close_extra_devices() function and its calls
as there is no use of it.
Signed-off-by: Anand Jain <anand.j...@oracle.com>
---
fs/btrfs/disk-io.c | 13 ---
fs/btrfs/volumes.
nitpick:
typo in $subject.
Thanks, Anand
--
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
the devices are having and same
SB generation.
Signed-off-by: Anand Jain <anand.j...@oracle.com>
---
fs/btrfs/volumes.c | 16
1 file changed, 16 insertions(+)
diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c
index 03f2685a5018..98e41d286283 100644
--- a/fs/btrfs/volumes.c
ing
the missing chunk related problems more consistent. (More fixes of this
sort is coming up).
Anand Jain (2):
btrfs: fix device order consistency
btrfs: fix alloc device order consistency
fs/btrfs/volumes.c | 18 +-
1 file changed, 17 insertions(+), 1 deletion(-)
--
2.
rn.
Cleanup of device_list_add(), mainly in preparation to handle
reappearing missing device which its next reroll will be sent
separately.
*** BLURB HERE ***
Anand Jain (4):
btrfs: move pr_info into device_list_add
btrfs: set the total_devices in device_list_add()
btrfs: get device
As struct btrfs_disk_super is being passed, so it can get devid
the same way its parent does.
Signed-off-by: Anand Jain <anand.j...@oracle.com>
Reviewed-by: Josef Bacik <jba...@fb.com>
---
fs/btrfs/volumes.c | 8 +++-
1 file changed, 3 insertions(+), 5 deletions(-)
diff --gi
Instead of pointer to btrfs_fs_devices as an arg in device_list_add()
better to get pointer to btrfs_device as return value, then we have
both, pointer to btrfs_device and btrfs_fs_devices. btrfs_device is
needed to handle reappearing missing device.
Signed-off-by: Anand Jain <anan
There is no other parent for device_list_add() except for
btrfs_scan_one_device(), which would set btrfs_fs_devices::total_devices
if device_list_add is successful and this can be done with in
device_list_add() itself.
Signed-off-by: Anand Jain <anand.j...@oracle.com>
Reviewed-by: Josef
Commit 60999ca4b403 ("btrfs: make device scan less noisy")
adds return value 1 to device_list_add(), so that parent function can
call pr_info only when new device is added. Move the pr_info() part
into device_list_add() so that this function can be kept simple.
Signed-off-by: Anand Jai
On 01/20/2018 07:27 AM, David Sterba wrote:
On Thu, Jan 18, 2018 at 06:47:17PM +0100, David Sterba wrote:
On Thu, Jan 18, 2018 at 10:02:32PM +0800, Anand Jain wrote:
(Apply on top of my patchset
[PATCH v4 0/6] preparatory work to add device forget
for conflict free apply. They don't
From: Anand Jain <anand.j...@oracle.com>
First set the usual case that is writeable, then check
for any special case like a seed device or a rdonly device
and set the state appropriately.
Signed-off-by: Anand Jain <anand.j...@oracle.com>
---
v1->v2:
Add comments, and update c
Move uuid_mutex closer to the exclusion section.
Signed-off-by: Anand Jain <anand.j...@oracle.com>
Reviewed-by: David Sterba <dste...@suse.com>
---
v2->v2.1: updated the v2 reroll log below.
v1->v2:
Add received reviewed-by. Thxs.
Fix conflict on top of kdave misc-next.
From: Anand Jain <anand.j...@oracle.com>
First set the usual case that is writeable, then check
for any special case like a seed device or a rdonly device
and set the state appropriately.
Signed-off-by: Anand Jain <anand.j...@oracle.com>
---
v1->v2:
Add comment and commit log
Move uuid_mutex closer to the exclusion section.
Signed-off-by: Anand Jain <anand.j...@oracle.com>
Reviewed-by: David Sterba <dste...@suse.com>
---
v1->v1:
No change. Add received reviewed-by. Thxs.
fs/btrfs/volumes.c | 17 -
1 file changed, 8 insertions(
On 01/05/2018 10:09 PM, David Sterba wrote:
On Fri, Dec 15, 2017 at 03:40:14PM +0800, Anand Jain wrote:
No functional change. First set the usual case, writeable then check
for any special config.
Signed-off-by: Anand Jain <anand.j...@oracle.com>
---
fs/btrfs/volumes.c | 8 +++---
to cleanup() to umount SCRATCH_MNT by
011 itself.
Signed-off-by: Liu Bo <bo.li@oracle.com>
Reviewed-by: Anand Jain <anand.j...@oracle.com>
Tested-by: Anand Jain <anand.j...@oracle.com>
Thanks, Anand
---
tests/btrfs/011 | 1 +
1 file changed, 1 insertion(+)
diff --git a
There is no other parent for device_list_add() except for
btrfs_scan_one_device(), which would set btrfs_fs_devices::total_devices
if device_list_add is successful and this can be done with in
device_list_add() itself.
Signed-off-by: Anand Jain <anand.j...@oracle.com>
Reviewed-by: Josef
Instead of pointer to btrfs_fs_devices as an arg in device_list_add()
better to get pointer to btrfs_device as return value, then we have
both, pointer to btrfs_device and btrfs_fs_devices. btrfs_device is
needed to handle reappearing missing device.
Signed-off-by: Anand Jain <anan
As struct btrfs_disk_super is being passed, so it can get devid
the same way its parent does.
Signed-off-by: Anand Jain <anand.j...@oracle.com>
Reviewed-by: Josef Bacik <jba...@fb.com>
---
fs/btrfs/volumes.c | 8 +++-
1 file changed, 3 insertions(+), 5 deletions(-)
diff --gi
Commit 60999ca4b403 ("btrfs: make device scan less noisy")
adds return value 1 to device_list_add(), so that parent function can
call pr_info only when new device is added. Move the pr_info() part
into device_list_add() so that this function can be kept simple.
Signed-off-by: Anand Jai
l be sent
separately.
Anand Jain (4):
btrfs: move pr_info into device_list_add
btrfs: set the total_devices in device_list_add()
btrfs: get device pointer from device_list_add()
btrfs: drop devid as device_list_add() arg
fs/btrfs/volumes.c | 63 +++--
btrfs_device::name is null when we have missing device and
unmounted. So we still need to check for dev->name.
We can reuse the function btrfs_free_stale_device() to add feature
to forget a scanned device or all stale devices. So this patch set
proposes following changes to it.
Anand Jain (6):
There is no need to check for btrfs_fs_devices::seeding when we
have checked for btrfs_fs_devices::opened, because we can't sprout
without its seed FS being opened.
Signed-off-by: Anand Jain <anand.j...@oracle.com>
Reviewed-by: Josef Bacik <jba...@fb.com>
---
fs/btrfs/volumes.c |
From: Anand Jain <anand.j...@oracle.com>
The btrfs_free_stale_devices() is updated to match for the given
device path and delete it. (It searches for only unmounted list of
devices.) Also drop the comment about different path being used
for the same device, since now we will have cli to cle
From: Anand Jain <anand.j...@oracle.com>
This updates btrfs_free_stale_devices() helper function to delete all
unmouted devices, when arg is NULL.
Signed-off-by: Anand Jain <anand.j...@oracle.com>
Reviewed-by: Josef Bacik <jba...@fb.com>
---
fs/btrfs/volumes.c | 14
From: Anand Jain <anand.j...@oracle.com>
Let the list iterator iterate further and find other stale
devices and delete it. This is in preparation to add support
for user land request-able stale devices cleanup. Also rename
btrfs_free_stale_device() to btrfs_free_stale_devices().
Sign
We call btrfs_free_stale_device() only when we alloc a new
struct btrfs_device (ret=1), so move it closer to where we
alloc the new device. Also drop the comments.
Signed-off-by: Anand Jain <anand.j...@oracle.com>
Reviewed-by: Josef Bacik <jba...@fb.com>
---
fs/btrfs/volumes.c | 8
On 01/18/2018 04:32 PM, Nikolay Borisov wrote:
On 18.01.2018 04:32, Anand Jain wrote:
By maintaining the device order consistency it makes reproducing
the problem more consistent. So fix this by having the devices
Which problem is that ?
I noticed when trying to reproduce raid1 missed
r btrfs_scan_one_device() in
the path of device ready/scan ioctl.
Reviewed-by: Anand Jain <anand.j...@oracle.com>
Thanks, Anand
Signed-off-by: Tomohiro Misono <misono.tomoh...@jp.fujitsu.com>
---
fs/btrfs/super.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff
On 01/17/2018 04:30 PM, Misono, Tomohiro wrote:
On 2018/01/16 20:45, Anand Jain wrote:
On 01/16/2018 03:26 AM, David Sterba wrote:
On Fri, Jan 12, 2018 at 06:14:40PM +0800, Anand Jain wrote:
Misono,
This change is causing subsequent (subvol) mount to fail when device
option
601 - 700 of 3004 matches
Mail list logo