Re: [RFC PATCH 2/3] btrfs-progs: kernel based default features for mkfs

2015-10-21 Thread Anand Jain
Hi, more details about this RFC as below.. So a user with old kernel won't be able to create a filesystem with newer feature forever. Thats not true. Here below is an example of the problem and fix in action. Maybe the user are just making btrfs for his or her newer kernel? Yes. Tha

[PATCH 1/1] btrfs-progs: fix uninitialized copy of btrfs_fs_devices list

2015-10-21 Thread Anand Jain
alloc instead of malloc. Signed-off-by: Anand Jain --- cmds-filesystem.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmds-filesystem.c b/cmds-filesystem.c index 3663734..4d3a9a4 100644 --- a/cmds-filesystem.c +++ b/cmds-filesystem.c @@ -685,7 +685,7 @@ stati

[PATCH] btrfs-progs: fix missing init dev list head for dev_list

2015-10-21 Thread Anand Jain
--- utils.c | 1 + 1 file changed, 1 insertion(+) diff --git a/utils.c b/utils.c index f1e3248..b754686 100644 --- a/utils.c +++ b/utils.c @@ -763,6 +763,7 @@ int btrfs_add_to_fsid(struct btrfs_trans_handle *trans, if (!device->name) goto err_nomem; + INIT_LIST_HEA

Re: [RFC PATCH 2/3] btrfs-progs: kernel based default features for mkfs

2015-10-26 Thread Anand Jain
Thanks Jeff for the comments. On 10/23/2015 11:24 PM, Jeff Mahoney wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 10/21/15 4:45 AM, Anand Jain wrote: mkfs from latest btrfs-progs will enable latest default features, and if the kernel is down-rev and does not support a latest default

Re: [PATCH 4/5] btrfs: Allow barrier_all_devices to do per-chunk device check

2015-10-30 Thread Anand Jain
Qu, We shouldn't mark FS readonly when chunks are degradable. As below. Thanks, Anand diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c index 39a2d57..dbb2483 100644 --- a/fs/btrfs/disk-io.c +++ b/fs/btrfs/disk-io.c @@ -3530,7 +3530,7 @@ static int write_all_supers(struct btrfs_root *r

Re: [PATCH 4/5] btrfs: Allow barrier_all_devices to do per-chunk device check

2015-10-30 Thread Anand Jain
On 10/30/2015 07:41 PM, Qu Wenruo wrote: 在 2015年10月30日 16:32, Anand Jain 写道: Qu, We shouldn't mark FS readonly when chunks are degradable. As below. Thanks, Anand diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c index 39a2d57..dbb2483 100644 --- a/fs/btrfs/disk-io.c +++

Re: Crash during mount -o degraded, kernel BUG at fs/btrfs/extent_io.c:2044

2015-11-01 Thread Anand Jain
This is misleading, these error messages might make one think that the 4th drive is bad and has to be replaced, which would reduce the redundancy to the minimum because it's the second drive that's actually bad. following RFC will solve the misleading part of the problem.. [RFC PATCH] Bt

Re: [PATCH 1/3] btrfs-progs: cmds-device: use warning/error for error message

2015-11-09 Thread Anand Jain
Hi Zhao, Hope you could do this/apply on top of patch set "Introduce device delete by devid" I vaguely remember that patchset as well did some cleanups in this part of the code. Thanks, Anand On 11/09/2015 05:59 PM, Zhao Lei wrote: Switch to common warning()/error() for cmds-device.c. S

[PATCH 02/15] btrfs: Do per-chunk check for mount time check

2015-11-09 Thread Anand Jain
7;s not OK to mount it as degraded. Reported-by: Zhao Lei Reported-by: Anand Jain Signed-off-by: Qu Wenruo [Btrfs: use btrfs_error instead of btrfs_err during mount] Signed-off-by: Anand Jain --- fs/btrfs/disk-io.c | 18 ++ 1 file changed, 10 insertions(+), 8 deletions(-) di

[PATCH 12/15] btrfs: support btrfs dev scan for spare device

2015-11-09 Thread Anand Jain
When the user or system calls the BTRFS_IOC_SCAN_DEV, ioctl this patch will make sure it is added to the device list and set it as spare. This operation will be same when BTRFS_IOC_DEVICES_READY as well since BTRFS_IOC_DEVICES_READY ioctl has been doing that by legacy. Signed-off-by: Anand Jain

[PATCH 07/15] btrfs: introduce device dynamic state transition to offline or failed

2015-11-09 Thread Anand Jain
against the failing device and 4) a device in the multi device btrfs may go offline from the system (but as of now in in some system config btrfs gets unmounted in this context, which is not a correct behavior) Signed-off-by: Anand Jain --- fs/btrfs/volumes.c | 148

[PATCH 08/15] btrfs: check device for critical errors and mark failed

2015-11-09 Thread Anand Jain
Write and Flush errors are considered as critical errors, upon which the device will be brought offline and marked as failed. Write and Flush errors are identified using device error statistics. Signed-off-by: Anand Jain --- fs/btrfs/disk-io.c | 43

[PATCH 05/15] btrfs: optimize btrfs_check_degradable() for calls outside of barrier

2015-11-09 Thread Anand Jain
Signed-off-by: Anand Jain --- fs/btrfs/disk-io.c | 8 +++- fs/btrfs/volumes.c | 2 -- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c index 958c2a6..d3303f9 100644 --- a/fs/btrfs/disk-io.c +++ b/fs/btrfs/disk-io.c @@ -3428,6 +3428,7

[PATCH 11/15] btrfs: add check not to mount a spare device

2015-11-09 Thread Anand Jain
Spare devices can be scanned but shouldn't be mountable. Signed-off-by: Anand Jain --- fs/btrfs/disk-io.c | 8 1 file changed, 8 insertions(+) diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c index 38e0385..3662c0a 100644 --- a/fs/btrfs/disk-io.c +++ b/fs/btrfs/disk

[PATCH 14/15] btrfs: introduce helper functions to perform hot replace

2015-11-09 Thread Anand Jain
replace, in the long run I hope both the codes to be merged. Signed-off-by: Anand Jain --- fs/btrfs/dev-replace.c | 116 + fs/btrfs/dev-replace.h | 1 + 2 files changed, 117 insertions(+) diff --git a/fs/btrfs/dev-replace.c b/fs/btrfs/dev-replace.c

[PATCH 00/15] btrfs: Hot spare and Auto replace

2015-11-09 Thread Anand Jain
see below stale kmem cache during module unload. Which I am digging. -- BUG btrfs_path (Not tainted): Objects remaining in btrfs_path on kmem_cache_close() -- Anand Jain (10): btrfs: optimize btrfs_check_degradable() for calls outside of barrier btrfs: introduce device dynamic state tran

[PATCH 04/15] btrfs: Allow barrier_all_devices to do per-chunk device check

2015-11-09 Thread Anand Jain
From: Qu Wenruo The last user of num_tolerated_disk_barrier_failures is barrier_all_devices(). But it's can be easily changed to new per-chunk degradable check framework. Now btrfs_device will have two extra members, representing send/wait error, set at write_dev_flush() time. And then check it

[PATCH 06/15] btrfs: Cleanup num_tolerated_disk_barrier_failures

2015-11-09 Thread Anand Jain
From: Qu Wenruo As we use per-chunk degradable check, now the global num_tolerated_disk_barrier_failures is of no use. So cleanup it. Signed-off-by: Qu Wenruo [Btrfs: resolve conflict to apply 'btrfs: Cleanup num_tolerated_disk_barrier_failures'] Signed-off-by: Anand Jain ---

[PATCH 13/15] btrfs: provide framework to get and put a spare device

2015-11-09 Thread Anand Jain
This adds functions to get and put a spare device from the list. So that hot repace code can pick a spare device when needed. Signed-off-by: Anand Jain --- fs/btrfs/super.c | 9 + fs/btrfs/volumes.c | 37 + fs/btrfs/volumes.h | 2 ++ 3 files

[PATCH 10/15] btrfs: introduce BTRFS_FEATURE_INCOMPAT_SPARE_DEV

2015-11-09 Thread Anand Jain
Add BTRFS_FEATURE_INCOMPAT_SPARE_DEV (400) flag to identify a spare device. Along with this it checks in the mount context that a spare device will fail to mount. As spare devices aren't mountable. Signed-off-by: Anand Jain --- fs/btrfs/ctree.h | 4 +++- 1 file changed, 3 insertions(

[PATCH 09/15] btrfs: block incompatible optional features at scan

2015-11-09 Thread Anand Jain
es at scan. Which means the original block at open_ctee() won't reach in case of device with unsupported feature. But I am leaving that code as it is. without deleting. Signed-off-by: Anand Jain --- fs/btrfs/volumes.c | 11 +++ 1 file changed, 11 insertions(+) diff --git a/fs/btrfs/v

[PATCH 03/15] btrfs: Do per-chunk degraded check for remount

2015-11-09 Thread Anand Jain
From: Qu Wenruo Just the same for mount time check, use new btrfs_check_degraded() to do per chunk check. Signed-off-by: Qu Wenruo Btrfs: use btrfs_error instead of btrfs_err during remount Signed-off-by: Anand Jain --- fs/btrfs/super.c | 11 +++ 1 file changed, 7 insertions(+), 4

[PATCH 15/15] btrfs: check for failed device and hot replace

2015-11-09 Thread Anand Jain
This patch creates casualty_kthread to check for the failed devices, and triggers device replace. Signed-off-by: Anand Jain --- fs/btrfs/ctree.h | 1 + fs/btrfs/disk-io.c | 67 ++ fs/btrfs/transaction.c | 3 ++- 3 files changed, 70

[PATCH 01/15] btrfs: Introduce a new function to check if all chunks a OK for degraded mount

2015-11-09 Thread Anand Jain
From: Qu Wenruo Introduce a new function, btrfs_check_degradable(), to judge if all chunks in btrfs is OK for degraded mount. It provides the new basis for accurate btrfs mount/remount and even runtime degraded mount check other than old one-size-fit-all method. Signed-off-by: Qu Wenruo --- f

[PATCH 1/4] btrfs-progs: Introduce BTRFS_FEATURE_INCOMPAT_SPARE_DEV SB flags

2015-11-09 Thread Anand Jain
Signed-off-by: Anand Jain --- btrfs-show-super.c | 3 ++- ctree.h| 4 +++- volumes.c | 4 volumes.h | 2 ++ 4 files changed, 11 insertions(+), 2 deletions(-) diff --git a/btrfs-show-super.c b/btrfs-show-super.c index 27414c8..d9626cd 100644 --- a/btrfs-show

[PATCH 2/4] btrfs-progs: Introduce btrfs spare subcommand

2015-11-09 Thread Anand Jain
Signed-off-by: Anand Jain --- Android.mk | 2 +- Makefile.in | 2 +- btrfs.c | 1 + cmds-spare.c | 291 +++ commands.h | 2 + 5 files changed, 296 insertions(+), 2 deletions(-) create mode 100644 cmds-spare.c diff --git

[PATCH 0/4] btrfs-progs: Hot spare and Auto replace

2015-11-09 Thread Anand Jain
Depends on the kernel patch set [PATCH 00/15] btrfs: Hot spare and Auto replace This is btrfs-progs side of the patch set. Anand Jain (4): btrfs-progs: Introduce BTRFS_FEATURE_INCOMPAT_SPARE_DEV SB flags btrfs-progs: Introduce btrfs spare subcommand btrfs-progs: add fi show for spare

[PATCH 3/4] btrfs-progs: add fi show for spare

2015-11-09 Thread Anand Jain
Signed-off-by: Anand Jain --- cmds-filesystem.c | 4 1 file changed, 4 insertions(+) diff --git a/cmds-filesystem.c b/cmds-filesystem.c index 4d3a9a4..11d0406 100644 --- a/cmds-filesystem.c +++ b/cmds-filesystem.c @@ -353,6 +353,9 @@ static void print_one_uuid(struct btrfs_fs_devices

[PATCH 4/4] btrfs-progs: add global spare device list to filesystem show

2015-11-09 Thread Anand Jain
2 size 2.00GiB used 417.50MiB path /dev/sdd Global spare device size 3.00GiB path /dev/sde btrfs-progs v4.2.3-12-gb5f4b68 Signed-off-by: Anand Jain --- cmds-filesystem.c | 5 + utils.h | 1 + 2 files changed, 6 insertions(+) diff --git a/cmds-filesystem.c b/cmds

Re: [PATCH 00/15] btrfs: Hot spare and Auto replace

2015-11-13 Thread Anand Jain
Thanks for the comments. Sorry for the delay. Trying to find out if there is any pending concerns... Hopefully, per-filesystem hot-spares will be a high priority too, as that type of usage is pretty much required for many enterprise type uses, although that doesn't need to be the same code

Re: [PATCH 00/15] btrfs: Hot spare and Auto replace

2015-11-13 Thread Anand Jain
Thanks for the comments. Let's take the following example: 1) 2 RAID1 + 1 spare (A + B) + C 2) 3 RAID1 (A + B + C) At least in normal operation case, case 1) makes device C useless, and Yes. For case 2), we can just relocate and recover the bad chunks in B. It it should only

Re: [PATCH 00/15] btrfs: Hot spare and Auto replace

2015-11-13 Thread Anand Jain
Thanks for comments. On 11/13/2015 03:21 AM, Goffredo Baroncelli wrote: On 2015-11-09 11:56, Anand Jain wrote: These set of patches provides btrfs hot spare and auto replace support for you review and comments. Hi Anand, is there any reason to put this kind of logic in the kernel space ? I

Re: [PATCH 00/15] btrfs: Hot spare and Auto replace

2015-11-13 Thread Anand Jain
Thanks for commenting. I'm sorry but I didn't quite see the benefit of a spare device. Aside from what Duncan said (and I happen to agree with him), there is also the fact that hot-spares are (at least traditionally in most RAID systems) usually used with RAID5 or RAID6 (or some other parity

Re: [PATCH 00/15] btrfs: Hot spare and Auto replace

2015-11-16 Thread Anand Jain
On 11/16/2015 09:41 PM, Austin S Hemmelgarn wrote: On 2015-11-09 05:56, Anand Jain wrote: These set of patches provides btrfs hot spare and auto replace support for you review and comments. First, here below are the simple example steps to configure the same: Add a spare device: btrfs

Re: [PATCH for 4.4] btrfs: fix rcu warning during device replace

2015-11-20 Thread Anand Jain
Thanks David. Checked other places it seems to be fine. My oversight on the rcu usage part. Thanks. Reviewed-by: Anand Jain On 11/19/2015 06:35 PM, David Sterba wrote: The test btrfs/011 triggers a rcu warning === [ INFO: suspicious RCU usage. ] 4.4.0-rc1

[PATCH v2 4/5] btrfs-progs: kernel based default features for btrfs-convert

2015-11-23 Thread Anand Jain
btrfs-convert convert FS with latest default features enabled, and if the kernel is down-rev and does not support a latest feature then mount fails, as expected. This patch disables default features based on the running kernel. Signed-off-by: Anand Jain --- v2: Check if sysfs tells what

[PATCH v2 3/5] btrfs-progs: kernel based default features for mkfs

2015-11-23 Thread Anand Jain
Mkfs from latest btrfs-progs will enable latest default features, and if the kernel is down-rev and does not support a latest default feature then mount fails, as expected. This patch disables default features based on the running kernel. Signed-off-by: Anand Jain --- v2: Check if sysfs tells

[PATCH 5/5] btrfs-progs: add warning when we fail to read sysfs or version

2015-11-23 Thread Anand Jain
Signed-off-by: Anand Jain --- btrfs-convert.c | 10 +- mkfs.c | 8 +++- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/btrfs-convert.c b/btrfs-convert.c index 52ea12a..b0a998b 100644 --- a/btrfs-convert.c +++ b/btrfs-convert.c @@ -2898,14 +2898,22 @@ int

[PATCH v2 1/5] btrfs-progs: introduce framework to check kernel supported features

2015-11-23 Thread Anand Jain
will be the minimum kernel version needed to use the feature. Further, for features supported later than 3.14 this list can still be updated, so it serves as a repository which can be displayed for easy reference. Signed-off-by: Anand Jain --- v2: Check for condition that what happens when we fail

[PATCH v2 2/5] btrfs-progs: add framework to check features supported by sysfs

2015-11-23 Thread Anand Jain
This adds a framework to check the /sys/fs/btrfs/features for the list of supported features by the btrfs kernel. Which I hope by using it the mkfs and btrfs-convert could tune to set features as supported by the running kernel. Signed-off-by: Anand Jain --- utils.c | 66

[PATCH v2 0/5] Make btrfs-progs really compatible with any kernel version

2015-11-23 Thread Anand Jain
I hope all the concerns from the review comments are addressed. Anand Jain (5): btrfs-progs: introduce framework to check kernel supported features btrfs-progs: add framework to check features supported by sysfs btrfs-progs: kernel based default features for mkfs btrfs-progs: kernel based

Re: [PATCH v2 0/5] Make btrfs-progs really compatible with any kernel version

2015-11-24 Thread Anand Jain
s -O as-per-kernel=3.2 mkfs.btrfs -O as-per-kernel=4.0 mkfs.btrfs -O as-per-kernel=x.x (anything) And only those features that are supported until version x.x (mainline) will be enabled by default unless user want to over default totally by using -O . Thanks, Anand Anand Jain wrote: Btrfs-progs

Re: [PATCH v2 0/5] Make btrfs-progs really compatible with any kernel version

2015-11-24 Thread Anand Jain
David Sterba wrote: On Mon, Nov 23, 2015 at 08:56:13PM +0800, Anand Jain wrote: Btrfs-progs is a tool for the btrfs kernel and we hope latest btrfs-progs be compatible w any set of older/newer kernels. So far mkfs.btrfs and btrfs-convert sets the default features, for eg, skinny-metadata

[PATCH v3 1/5] btrfs-progs: introduce framework to check kernel supported features

2015-11-25 Thread Anand Jain
will be the minimum kernel version needed to use the feature. Further, for features supported later than 3.14 this list can still be updated, so it serves as a repository which can be displayed for easy reference. Signed-off-by: Anand Jain --- v3: Mike pointed out that mixed-bg was from version

[PATCH 5/7] btrfs-progs: introduce framework version to features

2015-11-25 Thread Anand Jain
As discussed in the mailing list this provides a framework to introduce the feature where mkfs and btrfs-convert can set the default features as per the given mainline kernel version. Suggested-by: David Sterba Signed-off-by: Anand Jain --- utils.c | 23 +++ utils.h | 1

[PATCH 1/7] btrfs-progs: show the version for -O list-all

2015-11-25 Thread Anand Jain
extended format (0x80, 3.9) skinny-metadata - reduced-size metadata extent refs (0x100, 3.10, default) no-holes- no explicit hole extents for files (0x200, 3.14) Signed-off-by: Anand Jain --- utils.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/utils.c b/utils.c

[PATCH 6/7] btrfs-progs: add -O comp= option for mkfs.btrfs

2015-11-25 Thread Anand Jain
This provides default feature set by version, for mkfs.btrfs through the new option '-O comp=|', where x.y.z is the minimum kernel version that should be supported. Signed-off-by: Anand Jain --- mkfs.c | 24 ++-- 1 file changed, 22 insertions(+), 2 deletions(-) di

[PATCH 0/7] Let user specify the kernel version for features

2015-11-25 Thread Anand Jain
vides the -O comp= for mkfs.btrfs and btrfs-convert respectively Thanks, Anand Anand Jain (7): btrfs-progs: show the version for -O list-all btrfs-progs: add kernel alias for each of the features in the list btrfs-progs: make is_numerical non static btrfs-progs: check for numeric

[PATCH 2/7] btrfs-progs: add kernel alias for each of the features in the list

2015-11-25 Thread Anand Jain
We should have maintained feature's name same across progs UI and sysfs UI. For example, progs mixed-bg is /sys/fs/btrfs/features/mixed_groups in sysfs. As these are already released and is UIs, there is nothing much can be done about it, except for creating the alias and making it aware. Add kern

[PATCH 7/7] btrfs-progs: add -O comp= option for btrfs-convert

2015-11-25 Thread Anand Jain
User may want to convert the FS to a minimum kernel version. As they may need to use btrfs on a set of known kernel versions. And have the disk layout compatible. Signed-off-by: Anand Jain --- btrfs-convert.c | 21 + 1 file changed, 21 insertions(+) diff --git a/btrfs

[PATCH 4/7] btrfs-progs: check for numerical in version_to_code()

2015-11-25 Thread Anand Jain
As the version is now being passed by user it should be checked if its numerical. We didn't need this before as version wasn't passed by used. So this is not a bug fix. Signed-off-by: Anand Jain --- utils.c | 10 +++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a

[PATCH 3/7] btrfs-progs: make is_numerical non static

2015-11-25 Thread Anand Jain
Signed-off-by: Anand Jain --- cmds-replace.c | 11 --- utils.c| 11 +++ utils.h| 1 + 3 files changed, 12 insertions(+), 11 deletions(-) diff --git a/cmds-replace.c b/cmds-replace.c index 9ab8438..86162b6 100644 --- a/cmds-replace.c +++ b/cmds-replace.c

[PATCH V1.1 2/7] btrfs-progs: add kernel alias for each of the features in the list

2015-11-25 Thread Anand Jain
- no explicit hole extents for files (0x200, 3.14) Signed-off-by: Anand Jain --- V1.1 add signed-off-by utils.c | 13 +++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/utils.c b/utils.c index 0163915..6d2675d 100644 --- a/utils.c +++ b/utils.c @@ -648,17 +648,26 @@

Re: [PATCH 2/7] btrfs-progs: add kernel alias for each of the features in the list

2015-11-25 Thread Anand Jain
Liu Bo wrote: On Wed, Nov 25, 2015 at 08:08:15PM +0800, Anand Jain wrote: We should have maintained feature's name same across progs UI and sysfs UI. For example, progs mixed-bg is /sys/fs/btrfs/features/mixed_groups in sysfs. As these are already released and is UIs, there is nothing

Re: [PATCH 0/7] Let user specify the kernel version for features

2015-11-25 Thread Anand Jain
On 11/26/2015 10:02 AM, Qu Wenruo wrote: Anand Jain wrote on 2015/11/25 20:08 +0800: Sometimes users may want to have a btrfs to be supported on multiple kernel version. A simple example, USB drive can be used with multiple system running different kernel versions. Or in a data center a SAN

Re: [PATCH 0/7] Let user specify the kernel version for features

2015-11-26 Thread Anand Jain
ls handle such kernel mismatch, or do they? Thanks, Qu First of all to let user know what features was supported at what kernel version. Patch 1/7 updates -O list-all which will list the feature with version. As we didn't maintain the sysfs and progs feature names consistent, so to avoid conf

Re: [PATCH 0/7] Let user specify the kernel version for features

2015-11-26 Thread Anand Jain
Hope we are in sync on.. 1. The term auto that you are using here refs to 'Progs default-features being updated at the _run time_'. 2. In the long run, mostly it would be: progs-version > LTS-kernel-version (for the reason that user would need fsck,tools.. etc) With the new -O comp= optio

Re: [PATCH 0/7] Let user specify the kernel version for features

2015-11-27 Thread Anand Jain
I meant, it can be done in packaging level and it's much easier to do. Its all about trade off, and there is no right or wrong, so is tough to arrive at a conclusion even before this was implemented. Below are the choices considered, now putting in the order of least suitable to most su

Re: How to detect / notify when a raid drive fails?

2015-11-27 Thread Anand Jain
On 11/27/2015 01:30 PM, Duncan wrote: Ian Kelling posted on Thu, 26 Nov 2015 21:14:57 -0800 as excerpted: I'd like to run "mail" when a btrfs raid drive fails, but I don't know how to detect that a drive has failed. It don't see it in any docs. Otherwise I assume I would never know until enou

Re: [PATCH 0/7] Let user specify the kernel version for features

2015-11-29 Thread Anand Jain
(Most of the technical reasoning were already discussed so I won't repeat them here). And jolting for new technical reasons finds only these.. What if the fs is not only for kernel to mount, but also a boot partition for grub? Do you need to check the grub2 version? Check if this is a /boo

potential btrfs-progs clean up

2015-11-29 Thread Anand Jain
(this is a different topic, updated the subject) Totally agree with this point. Too many non-sense in btrfs-progs codes copied from kernel, and due to lack of update, it's very buggy now. Just check volume.c for allocating data chunk. Which functions in volume.c in particular ? Thanks, An

[RFC] Btrfs device and pool management (wip)

2015-11-29 Thread Anand Jain
Data center systems are generally aligned with the RAS (Reliability, Availability and Serviceability) attributes. When it comes to Storage, RAS applies even more because its matter of trust. In this context, one of the primary area that a typical volume manager should be well teste

[RFC] Btrfs device and pool management (wip)

2015-11-30 Thread Anand Jain
(fixed alignment) Data center systems are generally aligned with the RAS (Reliability, Availability and Serviceability) attributes. When it comes to Storage, RAS applies even more because its matter of trust. In this context, one of the primary area that a typical volume manager sh

Re: How to detect / notify when a raid drive fails?

2015-11-30 Thread Anand Jain
On 11/28/2015 01:19 AM, Christoph Anton Mitterer wrote: On Fri, 2015-11-27 at 17:16 +0800, Anand Jain wrote: I understand as a user, a full md/lvm set of features are important to begin operations using btrfs and we don't have it yet. I have to blame it on the priority list. W

Re: [PATCH v2 0/5] Make btrfs-progs really compatible with any kernel version

2015-12-04 Thread Anand Jain
David, the possibility of unloaded module that would remove the access to sysfs, as you point out. Kindly note, the patch below made /dev/btrfs-control a static node, - commit 578454ff7eab61d13a26b568f99a89a2c9edc881 Author: Kay Sievers Date: Thu May 20 18:07:20 2010 +0200 driver cor

Re: Ideas to do custom operation just after mount?

2015-12-20 Thread Anand Jain
BTW, any good idea for btrfs to do such operation like enabling/disabling some minor features? Especially when it can be set on individual file/dirs. Features like incoming write time deduplication, is designed to be enabled/disabled for individual file/dirs, so it's not a quite good idea to u

[PATCH 1/1] Btrfs: fix unused members in struct btrfs_root

2015-01-12 Thread Anand Jain
There isn't any real use of following members of struct btrfs_root so delete them. struct kobject root_kobj; struct completion kobj_unregister; struct mutex objectid_mutex; Signed-off-by: Anand Jain --- fs/btrfs/ctree.h | 4 fs/btrfs/disk-io.c | 3 --- fs/btrfs/inode-map.c | 2

Re: [PATCH 1/1] Btrfs: fix unused members in struct btrfs_root

2015-01-12 Thread Anand Jain
Anand Jain wrote: There isn't any real use of following members of struct btrfs_root so delete them. struct kobject root_kobj; struct completion kobj_unregister; struct mutex objectid_mutex; Signed-off-by: Anand Jain --- fs/btrfs/ctree.h | 4 fs/btrfs/disk-io.c | 3 --- fs/b

[PATCH 1/1 v2] Btrfs: fix unused members in struct btrfs_root

2015-01-12 Thread Anand Jain
There isn't any real use of following members of struct btrfs_root so delete them. struct kobject root_kobj; struct completion kobj_unregister; Signed-off-by: Anand Jain --- v2: accepts Filipe comment and commit update fs/btrfs/ctree.h | 2 -- fs/btrfs/disk-io.c | 2 -- 2 files chang

[PATCH 1/1] Btrfs: move super_kobj and device_dir_kobj from fs_info to btrfs_fs_devices

2015-01-19 Thread Anand Jain
even the life cycle of them. Changes are internal only. And to ensure the same, this path has been tested with various device operations and, checking and comparing the sysfs kobjects and attributes with sysfs kobject and attributes with out this patch, and they remain same. Signed-off-by: Anand

Re: [PATCH v2] xfstests: btrfs: fix up 001.out

2015-01-20 Thread Anand Jain
Dave, On 01/21/2015 12:26 PM, Dave Chinner wrote: On Fri, Jan 02, 2015 at 09:04:29PM +0800, Anand Jain wrote: The subvol delete output has changed with btrfs-progs -Delete subvolume 'SCRATCH_MNT/snap' +Delete subvolume (no-commit): 'SCRATCH_MNT/snap' so fix 001

replace seed/sprout hangs (regression ?)

2015-01-22 Thread Anand Jain
The following test case hangs as of now, but as I remember Fujitsu had sent a patch to fix this, a long time back. Can't find now, any idea. ? Test case: add a spout device replace seed / sprout device hangs at: (btrfs_reada_wait+0x4d/0xb0) Thanks, Anand -- To unsubscribe from thi

RE: [PATCH 1/1] Btrfs: move super_kobj and device_dir_kobj from fs_info to btrfs_fs_devices

2015-01-24 Thread Anand Jain
Recently i found that, the original code with out this patch has a bug during kobject clean up, which is prominent with this patch, i am digging more. Just an early headsup. Thxs. Anand. Sent from my Sony Xperia™ smartphone Anand Jain wrote >This patch will provide a framework

Re: [PATCH 2/2 RESEND] btrfs: introduce shrinker for rb_tree that keeps valid btrfs_devices

2015-01-26 Thread Anand Jain
I think we won't need this patch. the coming sysfs changes will have entry point to handle missing devices/FSID. (inspired by md). That will be much cleaner to trigger the clean up based on the device FS changes. The proposed fix in this Patch, can it handle things like when customer decides to

[PATCH 1/1] Btrfs: btrfs_release_super_kobj() should clean up the kobject data

2015-01-26 Thread Anand Jain
ne(fs_info); + ret = btrfs_sysfs_add_one(fs_info); + if (ret) { + pr_err("BTRFS: failed to init sysfs interface: %d\n", ret); + goto fail_block_groups; + } cleaning up the unregistered kobject fixes this. Signed-off-by: Anand Jain --- fs/btrfs/sy

Re: [PATCH 1/1] Btrfs: move super_kobj and device_dir_kobj from fs_info to btrfs_fs_devices

2015-01-26 Thread Anand Jain
This patch needs [PATCH 1/1] Btrfs: btrfs_release_super_kobj() should clean up the kobject data further, I am planning to clean up and split below patch to show the enhancements and fix-ups separately. Will send V2 soon. Thanks. Anand On 01/20/2015 12:02 AM, Anand Jain wrote: This

[PATCH 04/12] Btrfs: sysfs: fix, kobject pointer clean up needed after kobject release

2015-02-01 Thread Anand Jain
ret = btrfs_sysfs_add_one(fs_info); + if (ret) { + pr_err("BTRFS: failed to init sysfs interface: %d\n", ret); + goto fail_block_groups; + } Signed-off-by: Anand Jain --- fs/btrfs/sysfs.c | 1 + 1 file changed, 1 insertion(+) diff --git a/fs/btrfs/sysfs.c b/fs/

[PATCH 01/12] Btrfs: sysfs: fix, btrfs_release_super_kobj() should to clean up the kobject data

2015-02-01 Thread Anand Jain
err("BTRFS: failed to init sysfs interface: %d\n", ret); + goto fail_block_groups; + } cleaning up the unregistered kobject fixes this. Signed-off-by: Anand Jain --- fs/btrfs/sysfs.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/fs/btrfs/sysfs.c b/fs/btrfs/s

[PATCH 00/12] provide frame work so that sysfs attributs from the fs_devices can be added

2015-02-01 Thread Anand Jain
sysfs kobjects and attributes with sysfs kobject and attributes with out this patch, and they remain same. These test cases are added to the progs as test-btrfs-devmgt.sh, its patch is below as well. Anand Jain (12): Btrfs: sysfs: fix, btrfs_release_super_kobj() should to clean up the kobject

[PATCH 02/12] Btrfs: sysfs: fix, fs_info kobject_unregister has init_completion() twice

2015-02-01 Thread Anand Jain
kobject_unregister is to handle the release of the kobject, its completion init is being called in btrfs_sysfs_add_one(), so we don't have to do the same in the open_ctree() again. Signed-off-by: Anand Jain --- fs/btrfs/disk-io.c | 1 - 1 file changed, 1 deletion(-) diff --git a/fs/btrfs

[PATCH 07/12] Btrfs: sysfs: rename __btrfs_sysfs_remove_one to btrfs_sysfs_remove_fsid

2015-02-01 Thread Anand Jain
Signed-off-by: Anand Jain --- fs/btrfs/sysfs.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/fs/btrfs/sysfs.c b/fs/btrfs/sysfs.c index c3e7f06..c923e8b 100644 --- a/fs/btrfs/sysfs.c +++ b/fs/btrfs/sysfs.c @@ -508,7 +508,7 @@ static int addrm_unknown_feature_attrs

[PATCH 11/12] Btrfs: sysfs: move super_kobj and device_dir_kobj from fs_info to btrfs_fs_devices

2015-02-01 Thread Anand Jain
even the life cycle of them. Changes are internal only. And to ensure the same, this path has been tested with various device operations and, checking and comparing the sysfs kobjects and attributes with sysfs kobject and attributes with out this patch, and they remain same. Signed-off-by: Anand

[PATCH 03/12] Btrfs: sysfs: fix, undo sysfs device links

2015-02-01 Thread Anand Jain
Theoritically need to remove the device links attributes, but since its entire device kobject was removed, so there wasn't any issue of about it. Just do it nicely. Signed-off-by: Anand Jain --- fs/btrfs/sysfs.c | 17 + 1 file changed, 17 insertions(+) diff --git a/fs/

[PATCH 09/12] Btrfs: sysfs: let default_attrs be separate from the kset

2015-02-01 Thread Anand Jain
As of now btrfs_attrs are provided using the default_attrs through the kset. Separate them and create the default_attrs using the sysfs_create_files instead. By doing this we will have the flexibility that device discovery thread could create fsid kobject. Signed-off-by: Anand Jain --- fs/btrfs

[PATCH 10/12] Btrfs: sysfs: separate device kobject and its attribute creation

2015-02-01 Thread Anand Jain
Separate device kobject and its attribute creation so that device kobject can be created from the device discovery thread. Signed-off-by: Anand Jain --- fs/btrfs/sysfs.c | 21 +++-- 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/fs/btrfs/sysfs.c b/fs/btrfs

[PATCH 05/12] Btrfc: sysfs: fix, check if device_dir_kobj is init before destroy

2015-02-01 Thread Anand Jain
Since the failure code in the btrfs_sysfs_add_one() can call btrfs_sysfs_remove_one() even before device_dir_kobj has been created we need to check if its null. Signed-off-by: Anand Jain --- fs/btrfs/sysfs.c | 10 ++ 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/fs/btrfs

[PATCH 06/12] Btrfs: sysfs: reorder the kobject creations

2015-02-01 Thread Anand Jain
. fsid devices features unknown features (dynamic features) And hence the btrfs_sysfs_remove_one() will follow the same in reverse order. and the device kobject destroy now can be moved into the function __btrfs_sysfs_remove_one() Signed-off-by: Anand Jain --- fs/btrfs/sysfs.c | 23

[PATCH 08/12] Btrfs: sysfs: introduce function btrfs_sysfs_add_fsid() to create sysfs fsid

2015-02-01 Thread Anand Jain
We need it in a seperate function so that it can be called from the device discovery thread as well. Signed-off-by: Anand Jain --- fs/btrfs/sysfs.c | 15 ++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/fs/btrfs/sysfs.c b/fs/btrfs/sysfs.c index c923e8b..f42d8fd

[PATCH 12/12] Btrfs: sysfs: add pointer to access fs_info from fs_devices

2015-02-01 Thread Anand Jain
adds fs_info pointer with struct btrfs_fs_devices. Signed-off-by: Anand Jain --- fs/btrfs/sysfs.c | 4 fs/btrfs/volumes.h | 1 + 2 files changed, 5 insertions(+) diff --git a/fs/btrfs/sysfs.c b/fs/btrfs/sysfs.c index ac15fbb..4b5bac6 100644 --- a/fs/btrfs/sysfs.c +++ b/fs/btrfs/sysfs.c

[PATCH] Btrfs-progs: add regression tests for sysfs contents during btrfs device management

2015-02-01 Thread Anand Jain
Signed-off-by: Anand Jain --- tests/test-btrfs-devmgt.sh | 863 + 1 file changed, 863 insertions(+) create mode 100755 tests/test-btrfs-devmgt.sh diff --git a/tests/test-btrfs-devmgt.sh b/tests/test-btrfs-devmgt.sh new file mode 100755 index 000

[PATCH 2/4] Btrfs-progs: adds simple to use seed test for test-btrfs-devmgt.sh

2015-02-08 Thread Anand Jain
Signed-off-by: Anand Jain --- tests/test-btrfs-devmgt.sh | 76 +- 1 file changed, 75 insertions(+), 1 deletion(-) diff --git a/tests/test-btrfs-devmgt.sh b/tests/test-btrfs-devmgt.sh index 2f75200..5facbdb 100755 --- a/tests/test-btrfs-devmgt.sh +++ b

[PATCH 4/4] Btrfs-progs: test-btrfs-devmgt.sh have a safe defaults

2015-02-08 Thread Anand Jain
After I burnt my fingers by testing on non test disks, decided to have a safe defaults Signed-off-by: Anand Jain --- tests/test-btrfs-devmgt.sh | 36 +++- 1 file changed, 15 insertions(+), 21 deletions(-) diff --git a/tests/test-btrfs-devmgt.sh b/tests/test

[PATCH 3/4] Btrfs-progs: test-btrfs-devmgt.sh support if btrfs is root fs

2015-02-08 Thread Anand Jain
Signed-off-by: Anand Jain --- tests/test-btrfs-devmgt.sh | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tests/test-btrfs-devmgt.sh b/tests/test-btrfs-devmgt.sh index 5facbdb..55bc877 100755 --- a/tests/test-btrfs-devmgt.sh +++ b/tests/test-btrfs-devmgt.sh @@ -96,6

[PATCH 0/4 v2] test-btrfs-devmgt.sh

2015-02-08 Thread Anand Jain
simple controllable test script to exercise btrfs devices and at the same time collect sysfs (optional) to test for regression. v1->v2: add some clean ups Anand Jain (4): Btrfs-progs: add regression tests for sysfs contents during btrfs device management Btrfs-progs: adds simple to

[PATCH 1/4] Btrfs-progs: add regression tests for sysfs contents during btrfs device management

2015-02-08 Thread Anand Jain
Signed-off-by: Anand Jain --- tests/test-btrfs-devmgt.sh | 863 + 1 file changed, 863 insertions(+) create mode 100755 tests/test-btrfs-devmgt.sh diff --git a/tests/test-btrfs-devmgt.sh b/tests/test-btrfs-devmgt.sh new file mode 100755 index 000

[PATCH 1/1] export symbol kobject_move()

2015-02-08 Thread Anand Jain
drivers/cpufreq/cpufreq.c is already using this function. And now btrfs needs it as well. export symbol kobject_move(). --- lib/kobject.c | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/kobject.c b/lib/kobject.c index 58751bb..e055c06 100644 --- a/lib/kobject.c +++ b/lib/kobject.c @@ -548,

[PATCH 00/24 V2] provide frame work so that sysfs attributs from the fs_devices can be added

2015-02-08 Thread Anand Jain
and the related frame work changes . the patches 1 to 12 has no changes from the previous submit Anand Jain (24): Btrfs: sysfs: fix, btrfs_release_super_kobj() should to clean up the kobject data Btrfs: sysfs: fix, fs_info kobject_unregister has init_completion() twice Btrfs: sysfs:

[PATCH 01/24] Btrfs: sysfs: fix, btrfs_release_super_kobj() should to clean up the kobject data

2015-02-08 Thread Anand Jain
From: Anand Jain The following test case fails indicating that, thread tried to init an initialized object. kernel: [232104.016513] kobject (880006c1c980): tried to init an initialized object, something is seriously wrong. btrfs_sysfs_remove_one() self test code: open_tree

[PATCH 04/24] Btrfs: sysfs: fix, kobject pointer clean up needed after kobject release

2015-02-08 Thread Anand Jain
From: Anand Jain The sysfs clean up self test like in the below code fails, since fs_info->device_dir_kobject still points to its stale kobject. Reseting this pointer will help to fix this. open_ctree() { ret = btrfs_sysfs_add_one(fs_info); :: + btrfs_sysfs_remove_one(fs_i

[PATCH 08/24] Btrfs: sysfs: introduce function btrfs_sysfs_add_fsid() to create sysfs fsid

2015-02-08 Thread Anand Jain
From: Anand Jain We need it in a seperate function so that it can be called from the device discovery thread as well. Signed-off-by: Anand Jain --- fs/btrfs/sysfs.c | 15 ++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/fs/btrfs/sysfs.c b/fs/btrfs/sysfs.c index

<    4   5   6   7   8   9   10   11   12   13   >