Re: [PATCH 2/4 v2] btrfs-progs: mechanism to fetch fsinfo from btrfs-control

2013-11-07 Thread Anand Jain
Thanks sent out v3. On 11/07/13 04:13 AM, Josef Bacik wrote: On Mon, Nov 04, 2013 at 11:45:43AM +0800, Anand Jain wrote: need fsinfo from btrfs-control that is when mount path is not known. current method of going through each mount points isn't efficient, and multiple subvol of a fsid could

[PATCH 2/3] btrfs-progs: fs show should handle if subvol(s) mounted v3

2013-11-07 Thread Anand Jain
as of now with out this patch user would see fsinfo per btrfs mount path but which mean multiple entry if more than one subvol is mounted of the same fsid. so this patch will handle that nicely. v3: accepts Josef suggested and fix git screwup v2: accepts Zach suggested Signed-off-by: Anand Jain

[PATCH 1/3] btrfs-progs: mechanism to fetch fsinfo from btrfs-control v3

2013-11-07 Thread Anand Jain
git screwup v2: commit reword Signed-off-by: Anand Jain anand.j...@oracle.com --- ioctl.h | 19 +++ utils.c | 76 +++ utils.h |1 + 3 files changed, 96 insertions(+), 0 deletions(-) diff --git a/ioctl.h b/ioctl.h index

Re: [PATCH 4/4] btrfs-progs: lblkid wouldn't find non mapper path input

2013-11-07 Thread Anand Jain
Done. On 11/07/13 04:20 AM, Josef Bacik wrote: On Mon, Nov 04, 2013 at 11:45:45AM +0800, Anand Jain wrote: A new test case when disk is unmounted and if the non mapper disk path is given as the argument to the btrfs filesystem showarg we still need this to work but lblkid will pull only

Re: [PATCH 3/4 v2] btrfs-progs: fs show should handle if subvol(s) mounted

2013-11-07 Thread Anand Jain
Thanks sent out v3 On 11/07/13 04:19 AM, Josef Bacik wrote: On Mon, Nov 04, 2013 at 11:45:44AM +0800, Anand Jain wrote: as of now with out this patch user would see fsinfo per btrfs mount path but which mean multiple entry if more than one subvol is mounted of the same fsid. so this patch

[PATCH 3/3] btrfs-progs: lblkid wouldn't find non mapper path input v3

2013-11-07 Thread Anand Jain
: accepts Josef suggested v2: accepts Josef suggested Signed-off-by: Anand Jain anand.j...@oracle.com --- cmds-filesystem.c | 59 +--- 1 files changed, 55 insertions(+), 4 deletions(-) diff --git a/cmds-filesystem.c b/cmds-filesystem.c index

[PATCH 1/3] btrfs-progs: mechanism to fetch fsinfo from btrfs-control v3

2013-11-07 Thread Anand Jain
git screwup v2: commit reword Signed-off-by: Anand Jain anand.j...@oracle.com --- ioctl.h | 19 +++ utils.c | 76 +++ utils.h |1 + 3 files changed, 96 insertions(+), 0 deletions(-) diff --git a/ioctl.h b/ioctl.h index

[PATCH 1/3] btrfs-progs: mechanism to fetch fsinfo from btrfs-control v4

2013-11-07 Thread Anand Jain
is heavily used in the btrfs-progs, it does full scan of all the disks in the system to confirm if a multi-disk btrfs is mounted it doesn't scalable well with few hundreds luns, check_mounted for sure needs a revamp. using this it can be done easily. which is planned. Signed-off-by: Anand Jain anand.j

Re: [PATCH 1/3] btrfs-progs: mechanism to fetch fsinfo from btrfs-control v3

2013-11-07 Thread Anand Jain
On 11/07/2013 06:04 PM, Stefan Behrens wrote: On Thu, 7 Nov 2013 18:01:41 +0800, Anand Jain wrote: + *out_fslist = malloc(sz); + if (*out_fslist == NULL) { + ret = -ENOMEM; + goto out; + } + memcpy(*out_fslist, fslist, sz); + ret = 0

[PATCH] btrfs: fix typo in the log message

2013-11-14 Thread Anand Jain
Signed-off-by: Anand Jain anand.j...@oracle.com --- fs/btrfs/dev-replace.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/fs/btrfs/dev-replace.c b/fs/btrfs/dev-replace.c index 3e41097..97fcb73 100644 --- a/fs/btrfs/dev-replace.c +++ b/fs/btrfs/dev-replace.c @@ -366,7

[PATCH] btrfs-progs: for mixed group check opt before default raid profile is enforced

2013-11-14 Thread Anand Jain
This fixes the regression introduced with the patch btrfs-progs: avoid write to the disk before sure to create fs what happened with this patch is it missed the check to see if the user has the option set before pushing the defaults. Signed-off-by: Anand Jain anand.j...@oracle.com

Re: Mixed and raid [was Re: BUG: btrfsRe: Does btrfs raid1 actually provide any resilience?]

2013-11-14 Thread Anand Jain
Hi G.Baroncelli, Lutz, Thanks for the test case and heads-up on this. The code missed the check if the user has provided the option before default profile for the mixed group (due to small vol) is enforced. I have sent out the following patch to fix it. [PATCH] btrfs-progs: for mixed

[PATCH v2] btrfs-progs: for mixed group check opt before default raid profile is enforced

2013-11-15 Thread Anand Jain
This fixes the regression introduced with the patch btrfs-progs: avoid write to the disk before sure to create fs what happened with this patch is it missed the check to see if the user has the option set before pushing the defaults. Signed-off-by: Anand Jain anand.j...@oracle.com --- v2

[PATCH v4 1/3] btrfs-progs: mechanism to fetch fsinfo from btrfs-control

2013-11-15 Thread Anand Jain
kernel patch btrfs: add framework to read fs info from btrfs-control Signed-off-by: Anand Jain anand.j...@oracle.com --- v5: edits commit message v4: bug fix and accepts Stefan suggested v3: accepts Josef suggested v2: commit reword ioctl.h | 19 utils.c | 75

[PATCH v4 2/3] btrfs-progs: fs show should handle if subvol(s) mounted

2013-11-15 Thread Anand Jain
as of now with out this patch user would see fsinfo per btrfs mount path but which mean multiple entry if more than one subvol is mounted of the same fsid. so this patch will handle that nicely. Signed-off-by: Anand Jain anand.j...@oracle.com --- v4: rebase on integration-20131114 v3: accepts

Re: btrfs fi show

2013-11-17 Thread Anand Jain
There is a fix for this (which David has integrated into the branch recently). This also needs the kernel side patch which is listed below. [PATCH v4 1/3] btrfs-progs: mechanism to fetch fsinfo from btrfs-control [PATCH v4 2/3] btrfs-progs: fs show should handle if subvol(s) mounted [PATCH

[PATCH] xfstests: btrfs/023: test if raids are actually created

2013-11-18 Thread Anand Jain
A test case to verify if the given raid option for the metadata and data are actually created. Signed-off-by: Anand Jain anand.j...@oracle.com --- tests/btrfs/023 | 91 +++ tests/btrfs/023.out |2 + tests/btrfs/group |1 + 3 files

Re: [PATCH] xfstests: btrfs/023: test if raids are actually created

2013-11-18 Thread Anand Jain
On 11/19/2013 05:50 AM, Eric Sandeen wrote: On 11/18/13, 2:26 AM, Anand Jain wrote: A test case to verify if the given raid option for the metadata and data are actually created. Signed-off-by: Anand Jain anand.j...@oracle.com --- tests/btrfs/023 | 91

[PATCH v2] xfstests: btrfs/023: test if raids are actually created

2013-11-18 Thread Anand Jain
A test case to verify if the given raid option for the metadata and data are actually created. Signed-off-by: Anand Jain anand.j...@oracle.com --- v2: a copied comment removed as Eric pointed out tests/btrfs/023 | 90 +++ tests/btrfs/023

[PATCH] xfstests: btrfs/023: test if raids are actually created

2013-11-18 Thread Anand Jain
A test case to verify if the given raid option for the metadata and data are actually created. Signed-off-by: Anand Jain anand.j...@oracle.com Reviewed-by: Eric Sandeen sand...@redhat.com --- v3: need to differentiate between RAID10 and RAID1 in the output, fixed the grep v2: a copied

[PATCH v5 2/3] btrfs-progs: fs show should handle if subvol(s) mounted

2013-11-20 Thread Anand Jain
as of now with out this patch user would see fsinfo per btrfs mount path but which mean multiple entry if more than one subvol is mounted of the same fsid. so this patch will handle that nicely. Signed-off-by: Anand Jain anand.j...@oracle.com --- v5: fixup missed mem free, thanks David v4

Re: [PATCH v4 2/3] btrfs-progs: fs show should handle if subvol(s) mounted

2013-11-20 Thread Anand Jain
On 11/20/2013 10:18 PM, David Sterba wrote: On Fri, Nov 15, 2013 at 07:25:34PM +0800, Anand Jain wrote: static int btrfs_scan_kernel(void *search) { - int ret = 0, fd; - FILE *f; - struct mntent *mnt; - struct btrfs_ioctl_fs_info_args fs_info_arg; - struct

Re: Nagios probe for btrfs RAID status?

2013-11-22 Thread Anand Jain
For example, would the command btrfs filesystem show --all-devices give a non-zero error status or some other clue if any of the devices are at risk? No there isn't any good way as of now. that's something to fix. Thanks, Anand -- To unsubscribe from this list: send the line

[PATCH] btrfs: scrub maintenance event should be recorded in the messages

2013-11-25 Thread Anand Jain
so to help problem understanding and solving Signed-off-by: Anand Jain anand.j...@oracle.com --- fs/btrfs/ioctl.c | 10 ++ 1 files changed, 10 insertions(+), 0 deletions(-) diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c index d237af8..ba980fb 100644 --- a/fs/btrfs/ioctl.c +++ b/fs

[PATCH v2] btrfs: scrub maintenance event should be recorded in the messages

2013-11-25 Thread Anand Jain
so to help problem understanding and solving Signed-off-by: Anand Jain anand.j...@oracle.com --- v2: log shoud be starting instead of started fs/btrfs/ioctl.c | 10 ++ 1 files changed, 10 insertions(+), 0 deletions(-) diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c index d237af8

Re: [PATCH v2] btrfs-progs: calculate disk space that a subvol could free

2013-11-28 Thread Anand Jain
If so, i don't think this should be implemented in user space, Btrfs quota implement such function in kernel space, but it also face a problem that deleting a subvolume will break space accounting(because subvolume deletion won't iterate the whole fs tree). Hi Alex, Wang. Thanks for

Re: [PATCH] btrfs-progs: add options to sync filesystem after subvol delete

2013-11-29 Thread Anand Jain
If the command with sync option finishes succesfully, the subvolume(s) deletion status is safely stored on the media. + if (sync_mode == 1) { + res = ioctl(fd, BTRFS_IOC_SYNC); + if (res 0) { + fprintf(stderr, +

[PATCH 2/3] btrfs-progs: fix backref after init-csum-tree

2013-12-01 Thread Anand Jain
mismatch on [29474816 16384] owner ref check failed [29474816 16384] Errors found in extent allocation tree or chunk allocation :: Signed-off-by: Anand Jain anand.j...@oracle.com --- cmds-check.c |6 ++ 1 files changed, 6 insertions(+), 0 deletions(-) diff --git a/cmds-check.c b/cmds

[PATCH 3/3] btrfs-progs: qgroup destroy says create failed

2013-12-01 Thread Anand Jain
Signed-off-by: Anand Jain anand.j...@oracle.com --- cmds-qgroup.c |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/cmds-qgroup.c b/cmds-qgroup.c index 5a393bd..957fbc9 100644 --- a/cmds-qgroup.c +++ b/cmds-qgroup.c @@ -99,8 +99,8 @@ static int qgroup_create(int create

[PATCH 1/3] btrfs-progs: Turning ON incompat isn't an error

2013-12-01 Thread Anand Jain
Signed-off-by: Anand Jain anand.j...@oracle.com --- mkfs.c |3 +-- 1 files changed, 1 insertions(+), 2 deletions(-) diff --git a/mkfs.c b/mkfs.c index de1beed..0843600 100644 --- a/mkfs.c +++ b/mkfs.c @@ -1196,8 +1196,7 @@ static void process_fs_features(u64 flags) for (i = 0; i

Re: [PATCH 2/3] btrfs-progs: fix backref after init-csum-tree

2013-12-01 Thread Anand Jain
Further this needs your review. How should be a complete use case of this init-csum-tree feature. mainly how do we expect this work in the real scenario. what problem does this solve. Thanks, Anand On 12/02/13 02:11 PM, Anand Jain wrote: btrfsck reports backref error after running init

Re: Updated btrfs-next

2013-12-12 Thread Anand Jain
Josef, I just updated and pushed btrfs-next, if it is missing something let me know. below two patches are missing, should it be re-based? let me know. [PATCH v2] btrfs: add framework to read fs info from btrfs-control btrfs-progs side of the patch is: [PATCH v4 1/3] btrfs-progs:

[PATCH 3/3] btrfs_progs: handle error in the btrfs_prepare_device

2013-12-16 Thread Anand Jain
this patch will handle the strerror reporting of the error instead of printing errno, and also replaced the BUG_ON with the error handling Signed-off-by: Anand Jain anand.j...@oracle.com --- cmds-device.c | 7 +++ cmds-replace.c | 10 -- mkfs.c | 9 - utils.c

[PATCH 1/3] btrfs_progs: don't replicate the stripe_len defines

2013-12-16 Thread Anand Jain
a clean up patch, the BTRFS_STRIPE_LEN is been duplicated across btrfs_progs, the kernel defines it in volume.h so do the same for progs. Signed-off-by: Anand Jain anand.j...@oracle.com --- btrfs-convert.c | 19 +-- chunk-recover.c | 1 - cmds-chunk.c| 1 - volumes.h

[PATCH 2/3] btrfs_progs: use stripe_len define here

2013-12-16 Thread Anand Jain
Signed-off-by: Anand Jain anand.j...@oracle.com --- btrfs-convert.c | 2 +- btrfs-image.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/btrfs-convert.c b/btrfs-convert.c index 65fe707..df20c15 100644 --- a/btrfs-convert.c +++ b/btrfs-convert.c @@ -1715,7 +1715,7

[PATCH v2 1/3] btrfs-progs: don't replicate the stripe_len defines

2013-12-16 Thread Anand Jain
a clean up patch, the BTRFS_STRIPE_LEN is been duplicated across btrfs-progs, the kernel defines it in volume.h so do the same for progs. Signed-off-by: Anand Jain anand.j...@oracle.com --- v2: commit update --- btrfs-convert.c | 19 +-- chunk-recover.c | 1 - cmds-chunk.c

[PATCH v2 2/3] btrfs-progs: use stripe_len define here

2013-12-16 Thread Anand Jain
Signed-off-by: Anand Jain anand.j...@oracle.com --- v2: commit update --- btrfs-convert.c | 2 +- btrfs-image.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/btrfs-convert.c b/btrfs-convert.c index 65fe707..df20c15 100644 --- a/btrfs-convert.c +++ b/btrfs-convert.c

[PATCH v2 3/3] btrfs-progs: handle error in the btrfs_prepare_device

2013-12-16 Thread Anand Jain
this patch will handle the strerror reporting of the error instead of printing errno, and also replaced the BUG_ON with the error handling Signed-off-by: Anand Jain anand.j...@oracle.com --- v2: commit update --- cmds-device.c | 7 +++ cmds-replace.c | 10 -- mkfs.c | 9

Re: [PATCH 3/3] btrfs_progs: handle error in the btrfs_prepare_device

2013-12-16 Thread Anand Jain
Thanks Wang. s/btrfs_progs/btrfs-progs? yeah. updated my script. + +zero_dev_error: +if (ret) { +ret 0 ? +fprintf(stderr, ERROR: failed to zero device start '%s' - %s\n, +file, strerror(-ret)) : +fprintf(stderr, ERROR:

Re: [PATCH v2 3/3] btrfs-progs: handle error in the btrfs_prepare_device

2013-12-17 Thread Anand Jain
+ ret = btrfs_prepare_device(fddstdev, dstdev, 1, dstdev_block_count, 0, +mixed, 0); close(fddstdev); + if (ret) + goto leave_with_error; fddstdev = -1; yeah moved this 3 lines up. thanks. You change the code

[PATCH v2 1/3] btrfs-progs: don't replicate the stripe_len defines

2013-12-17 Thread Anand Jain
a clean up patch, the BTRFS_STRIPE_LEN is been duplicated across btrfs-progs, the kernel defines it in volume.h so do the same for progs. Signed-off-by: Anand Jain anand.j...@oracle.com --- v2: commit update btrfs-convert.c | 19 +-- chunk-recover.c |1 - cmds-chunk.c

[PATCH v3 3/3] btrfs-progs: handle error in the btrfs_prepare_device

2013-12-17 Thread Anand Jain
this patch will handle the strerror reporting of the error instead of printing errno, and also replaced the BUG_ON with the error handling Signed-off-by: Anand Jain anand.j...@oracle.com --- v3: fix per Stefan review, update error message v2: commit update cmds-device.c |7 +++ cmds

[PATCH v3 2/3] btrfs-progs: use stripe_len define here

2013-12-17 Thread Anand Jain
Signed-off-by: Anand Jain anand.j...@oracle.com --- v3: volume.c needs BTRFS_STRIPE_LEN as well v2: commit update btrfs-convert.c |2 +- btrfs-image.c |2 +- volumes.c |2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/btrfs-convert.c b/btrfs-convert.c

Re: Btrfs RAID1 File System Grew Something Extra

2013-12-17 Thread Anand Jain
Garry, this is a known bug in mkfs.btrfs, the workaround for now is to run balance on FS having some data. so that unused group- profile will go away. HTH, Anand On 12/18/2013 10:03 AM, Garry T. Williams wrote: I have been using btrfs for my /home partition on my home machine for a few

[PATCH v4 3/3] btrfs-progs: handle error in the btrfs_prepare_device

2013-12-17 Thread Anand Jain
this patch will handle the strerror reporting of the error instead of printing errno, and also replaced the BUG_ON with the error handling Signed-off-by: Anand Jain anand.j...@oracle.com --- v4: replaced ? statement with proper if statement v3: fix per Stefan review, update error message v2

[PATCH] btrfs: fix the warning in prepare_pages

2013-12-18 Thread Anand Jain
would fix the below compile warning fs/btrfs/file.c: In function ‘prepare_pages’: fs/btrfs/file.c:1247: warning: ‘err’ may be used uninitialized in this function Signed-off-by: Anand Jain anand.j...@oracle.com --- fs/btrfs/file.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff

[PATCH v3] btrfs: add framework to read fs info from btrfs-control

2013-12-18 Thread Anand Jain
This adds ioctl BTRFS_IOC_GET_FSIDS which reads the fs info through the btrfs-control, needed to optimize heavily used btrfs-progs function check_mounted() plus few other minor uses. Signed-off-by: Anand Jain anand.j...@oracle.com --- v3: rebase and update commit v2: accepts Zach suggested

[PATCH] btrfs: ioctls would need unique id

2013-12-18 Thread Anand Jain
BTRFS_IOC_SET_FEATURES and BTRFS_IOC_GET_SUPPORTED_FEATURES conflicts with BTRFS_IOC_GET_FEATURES Signed-off-by: Anand Jain anand.j...@oracle.com --- include/uapi/linux/btrfs.h |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/include/uapi/linux/btrfs.h b/include/uapi

[PATCH] btrfs-progs: sync-up with newly introduced ioctl number

2013-12-18 Thread Anand Jain
for now the manual sync up of new ioctls introduced in the btrfs kernel. For which there wasn't any btrfs-progs patch. however we might have better idea for the long run. Signed-off-by: Anand Jain anand.j...@oracle.com --- ioctl.h |6 ++ 1 files changed, 6 insertions(+), 0 deletions

[PATCH v6] btrfs-progs: fs show should handle if subvol(s) mounted

2013-12-19 Thread Anand Jain
as of now with out this patch user would see fsinfo per btrfs mount path but which mean multiple entry if more than one subvol is mounted of the same fsid. so this patch will handle that nicely. Signed-off-by: Anand Jain anand.j...@oracle.com Signed-off-by: David Sterba dste...@suse.cz --- v6

[PATCH] btrfs-progs: test_skip_this_disk() isn't needed anymore

2013-12-26 Thread Anand Jain
add_seen_fsid() which was introduced lately will eliminate the mounted disks, so we don't need test_skip_this_disk() anymore Signed-off-by: Anand Jain anand.j...@oracle.com --- utils.c | 17 - 1 files changed, 0 insertions(+), 17 deletions(-) diff --git a/utils.c b/utils.c

[bug] its messy when missing device reappears after its been replaced in RAID1

2014-01-06 Thread Anand Jain
test case: disappear a disk then replace (RAID1) the disappeared disk and then make disappeared disk to reappear. mkfs.btrfs -f -m raid1 -d raid1 /dev/sdc /dev/sdd mount /dev/sdc /btrfs dd if=/dev/zero of=/btrfs/tf1 count=1 btrfs fi sync /btrfs --- devmgt[1] will help to attach or

[RFC PATCH] btrfs-progs: btrfsck operations should be exclusive

2014-01-13 Thread Anand Jain
From: Anand Jain anand.j...@oracle.com this patch will make btrfsck operations to open disk in exclusive mode, so that mount will fail when btrfsck is running Signed-off-by: Anand Jain anand.j...@oracle.com --- cmds-check.c | 3 ++- disk-io.c| 10 -- disk-io.h| 1 + volumes.c

[PATCH 2/2] xfstest: tests btrfs/006 fails with mixed-mode/small disks

2014-01-13 Thread Anand Jain
From: Anand Jain anand.j...@oracle.com as of now the script does not filter 0.00 size in the filesystem show output, which is the case in multi-disk mixed-mode (that is default group type for small disks) Signed-off-by: Anand Jain anand.j...@oracle.com --- common/filter | 6

[PATCH 1/2] xfstests: make btrfs/001.out in line with subvol delete output

2014-01-13 Thread Anand Jain
From: Anand Jain anand.j...@oracle.com btrfs/001 is failing as below btrfs-progs patch changed the output during subvol delete. Patch : btrfs-progs: add options to set commit mode after subvol delete so add it to the btrfs/001.out Signed-off-by: Anand Jain anand.j...@oracle.com --- tests/btrfs

Re: [PATCH 1/2] xfstests: make btrfs/001.out in line with subvol delete output

2014-01-13 Thread Anand Jain
)' Rather than add it, otherwise, people will fail this test if they use previous btrfs-progs…… Thanks, Wang From: Anand Jain anand.j...@oracle.com btrfs/001 is failing as below btrfs-progs patch changed the output during subvol delete. Patch : btrfs-progs: add options to set commit mode

[PATCH 1/2 v2] xfstests: make btrfs/001.out in line with subvol delete output

2014-01-13 Thread Anand Jain
From: Anand Jain anand.j...@oracle.com btrfs/001 is failing as the below btrfs-progs patch changed the output during subvol delete. Patch : btrfs-progs: add options to set commit mode after subvol delete adding it to the filter Signed-off-by: Anand Jain anand.j...@oracle.com --- v2: accepts

[PATCH 1/2] btrfs-progs: return non zero when label is not found

2014-01-14 Thread Anand Jain
btrfs filesystem show not-found-label should return non zero Signed-off-by: Anand Jain anand.j...@oracle.com --- cmds-filesystem.c | 12 +--- 1 files changed, 9 insertions(+), 3 deletions(-) diff --git a/cmds-filesystem.c b/cmds-filesystem.c index c50a65f..ee6cc84 100644 --- a/cmds

[PATCH 2/2] btrfs-progs: mid flight return leaks memory during filesystem show mnt

2014-01-14 Thread Anand Jain
since now handle_print()-print_one_fs() calls add_seen_fsid() the thread has to go through free_seen_fsid() Signed-off-by: Anand Jain anand.j...@oracle.com --- cmds-filesystem.c |5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-) diff --git a/cmds-filesystem.c b/cmds-filesystem.c

Re: [bug] its messy when missing device reappears after its been replaced in RAID1

2014-01-14 Thread Anand Jain
Hi Wang, I agree we use transid to find most proper device, but this check is not right. Here @found_transid is the most biggest generation, so a right candidate device's transid should be @found_tranid -1 (power off for example)or same as @found_transid. Anyway, i think the right way should

[PATCH v2] btrfs-progs: btrfsck operations should be exclusive

2014-01-14 Thread Anand Jain
this patch will make the btrfsck and btrfsck --repair to work in exclusive mode, by opening the device with the O_EXCL flag Signed-off-by: Anand Jain anand.j...@oracle.com --- v2: renamed OPEN_CTREE_O_EXCL to OPEN_CTREE_EXCLUSIVE, thanks David cmds-check.c | 3 ++- disk-io.c| 10

[RFC PATCH] btrfs: fix null pointer deference at btrfs_sysfs_add_one+0x105

2014-01-15 Thread Anand Jain
/devmgt.git Signed-off-by: Anand Jain anand.j...@oracle.com --- fs/btrfs/sysfs.c | 10 -- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/fs/btrfs/sysfs.c b/fs/btrfs/sysfs.c index ba94b27..f20bc1f 100644 --- a/fs/btrfs/sysfs.c +++ b/fs/btrfs/sysfs.c @@ -578,8 +578,14 @@ static

[PATCH 1/2 v3] xfstests: make btrfs/001.out in line with subvol delete output

2014-01-15 Thread Anand Jain
From: Anand Jain anand.j...@oracle.com btrfs/001 is failing as the below btrfs-progs patch changed the output during subvol delete. Patch : btrfs-progs: add options to set commit mode after subvol delete adding it to the filter Signed-off-by: Anand Jain anand.j...@oracle.com --- v3: takes

[PATCH] btrfs: undo sysfs when open_ctree() fails

2014-01-21 Thread Anand Jain
Signed-off-by: Anand Jain anand.j...@oracle.com --- fs/btrfs/disk-io.c | 11 +++ 1 files changed, 7 insertions(+), 4 deletions(-) diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c index 9850a51..66d02fe 100644 --- a/fs/btrfs/disk-io.c +++ b/fs/btrfs/disk-io.c @@ -2739,13 +2739,13

[PATCH] btrfs-progs: update INSTALL file

2014-01-21 Thread Anand Jain
with the changes that has happened since last time it was updated Signed-off-by: Anand Jain anand.j...@oracle.com --- INSTALL |6 ++ 1 files changed, 2 insertions(+), 4 deletions(-) diff --git a/INSTALL b/INSTALL index 8ead607..a86878a 100644 --- a/INSTALL +++ b/INSTALL @@ -12,7 +12,8

[PATCH] dump device list as seen by the kernel

2014-01-27 Thread Anand Jain
cases provides wrong a view (more on it later) as well. So here I wrote a code to dump fs_devices for the kernel, the implementation here uses ioctl rather than memory dumps, as we need this ioctl to fix btrfs subcommands as well. Anand Jain (1): btrfs: introduce BTRFS_IOC_GET_DEVS fs/btrfs

[PATCH] btrfs: introduce BTRFS_IOC_GET_DEVS

2014-01-27 Thread Anand Jain
to optimize some part of btrfs-progs, mainly the current btrfs filesystem show Signed-off-by: Anand Jain anand.j...@oracle.com --- fs/btrfs/super.c | 56 + fs/btrfs/volumes.c | 99 fs/btrfs/volumes.h |2

[PATCH] btrfs-progs: introduce btrfs-devlist

2014-01-27 Thread Anand Jain
This is a small (debug) program to dump the device list in the raw format from the btrfs kernel. here I use ioctl which was introduced in the below kernel patch btrfs: introduce BTRFS_IOC_GET_DEVS Signed-off-by: Anand Jain anand.j...@oracle.com --- .gitignore |1 + Makefile

Re: [PATCH] btrfs: introduce BTRFS_IOC_GET_DEVS

2014-01-27 Thread Anand Jain
On 01/27/2014 04:47 PM, Hugo Mills wrote: On Mon, Jan 27, 2014 at 04:52:50PM +0800, Anand Jain wrote: The user land progs needs a simple way to read the raw list of disks and its parameters as btrfs kernel understands it. This patch will introduce BTRFS_IOC_GET_DEVS which dumps every thing

Re: Monitoring for disk failures

2014-01-28 Thread Anand Jain
Alin, [bug] its messy when missing device reappears after its been replaced in RAID1 I am aware of it and working on it. I also reported a more critical bug earlier as below. [bug] its messy when missing device reappears after its been replaced in RAID1 We see IO errors when disk

Re: Monitoring for disk failures

2014-01-28 Thread Anand Jain
Without actually trying it here... I believe by default that'd update only when there was an I/O error. Did you try btrfs filesystem show --all-devices? That scans differently. That will show missing with its own probes but kernel does not know that disk is missing. If that doesn't

Re: [PATCH] btrfs-progs: update INSTALL file

2014-01-28 Thread Anand Jain
Yep. I had the same opinion as well but was hesitant to make wide changes unless understand the backaground. Now would try to re-write as a whole and review will help. Thanks, Anand On 01/28/2014 02:27 AM, David Sterba wrote: On Wed, Jan 22, 2014 at 02:19:37PM +0800, Anand Jain wrote

Re: [PATCH RFCv2] new ioctl TREE_SEARCH_V2

2014-01-28 Thread Anand Jain
You may have covered this but its not explicit. Could you write few lines on whats wrong with the current TREE SEARCH and how V2 is helping. Thanks, Anand On 01/27/2014 09:28 PM, Gerhard Heift wrote: This patch series adds a new ioctl TREE_SEARCH_V2 with which we could store the results

[PATCH v2] btrfs-progs: there is devid 0 when replace is running

2014-02-04 Thread Anand Jain
During disk replacement a new disk is temporarily added to the fs devlist with devid 0 and fs num_device is incremented by 1. However when progs reads the devlist it fail to obtain details of devid 0 because it doesn't query devid 0 at all. reproducer: btrfs rep start /dev/sdb /dev/sdf /btrfs

[PATCH] btrfs: looping across fs_devices isn't necessary

2014-02-05 Thread Anand Jain
btrfs_show_devname() is trying to know dev name with lowest devid for a given FSID, so looping across the FSID isn't necessary Signed-off-by: Anand Jain anand.j...@oracle.com --- fs/btrfs/super.c | 18 +++--- 1 files changed, 7 insertions(+), 11 deletions(-) diff --git a/fs/btrfs

[PATCH] btrfs-progs: fix typo in reported error

2014-02-05 Thread Anand Jain
Signed-off-by: Anand Jain anand.j...@oracle.com --- utils.c |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/utils.c b/utils.c index a045ffd..1e72b77 100644 --- a/utils.c +++ b/utils.c @@ -1340,7 +1340,7 @@ static int set_label_mounted(const char *mount_path, const

Re: [PATCH] btrfs: looping across fs_devices isn't necessary

2014-02-05 Thread Anand Jain
This patch was incomplete. Kindly ignore. Thanks, Anand On 02/05/14 08:57 PM, Anand Jain wrote: btrfs_show_devname() is trying to know dev name with lowest devid for a given FSID, so looping across the FSID isn't necessary Signed-off-by: Anand Jain anand.j...@oracle.com --- fs/btrfs

Re: device delete missing panic

2014-02-05 Thread Anand Jain
your test case is same as in the patch below and the panic was due to null bdev (which matches in your logs). [RFC PATCH] btrfs: fix null pointer deference at btrfs_sysfs_add_one+0x105 But in your logs below, there isn't a panic right ? wrong cut and paste ? or what did I miss? Thanks,

Re: device delete missing panic

2014-02-05 Thread Anand Jain
as I now can't mount (open_ctree failed) at around open_ctree failed message should help. 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

Re: device delete missing panic

2014-02-06 Thread Anand Jain
~ # mount -o degraded,recovery /pool Killed Feb 07 09:53:44 store03 kernel: BUG: unable to handle kernel NULL pointer dereference at 0050 Feb 07 09:53:44 store03 kernel: IP: [f834b7b7] btrfs_sysfs_add_one+0x1a7/0x280 [btrfs] Mostly the above Bug is fixed in the patch below..

Re: [PATCH 2/2] btrfs-progs: Add -p/--print-missing options for btrfs fi show

2014-02-07 Thread Anand Jain
Whats needed is more comprehensive btrfs fi show which shows the flags (including missing) per disk. And also show the FS/Raid status. Which I am working on. sorry -p feature would be covered by default in the coming revamp of btrfs fi show. Thanks, Anand On 02/07/2014 02:46 PM, Qu

Re: [PATCH 1/2] btrfs-progs: Add missing devices check for mounted btrfs.

2014-02-07 Thread Anand Jain
. But before the patch, btrfs-progs will not check whether device missing if given a mounted btrfs mountpoint/block device. This patch fixes the bug and will pass btrfs/003. Signed-off-by: Qu Wenruo quwen...@cn.fujitsu.com Cc: Anand Jain anand.j...@oracle.com --- cmds-filesystem.c | 12

Re: [PATCH] btrfs: introduce BTRFS_IOC_GET_DEVS

2014-02-07 Thread Anand Jain
Thanks for the comments. mainly here sysfs way defeats the purpose - debug as mentioned. Sysfs would/should show only mounted disks, the ioctl way doesn't have such a limitation (of course as I commented memory dump way would have been best choice but I got stuck with that approach if

btrfs multiple mounts stacked on the same mount point

2014-02-11 Thread Anand Jain
per mount(2) --- multiple mounts can be stacked on the same mount point. --- In this situation how could ioctl communicate (using mount point) with each FS stacked on the same mount point ? BTW I don't understand the need for multiple mounts on the same mount point ? Any idea. ?

Re: btrfs multiple mounts stacked on the same mount point

2014-02-11 Thread Anand Jain
Thanks. In the context of btrfs, what is the critical need of this feature ? OR what is that it can't do without this feature ? Thanks, Anand On 02/12/14 04:57 AM, Duncan wrote: Anand Jain posted on Tue, 11 Feb 2014 16:18:02 +0800 as excerpted: per mount(2) --- multiple

Re: What to do about df and btrfs fi df

2014-02-11 Thread Anand Jain
Most of the btrfs-progs output has to be (re)designed from the point of view of the end-user. Eg: 'btrfs su list /mnt', it could have been much better from the end user perspective (who does not have to look into the source code), of course it does make sense to the developers himself but

Re: btrfs multiple mounts stacked on the same mount point

2014-02-11 Thread Anand Jain
BTW, another (general) reason over-mounts are sometimes used is to deliberately obscure what's underneath. It's worth noting that anything with a file already open on the underlying filesystem still has access to that file after something else is mounted over top, and that fact is sometimes

[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 use

[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 anand.j...@oracle.com --- 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

[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 anand.j...@oracle.com --- 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

[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 anand.j...@oracle.com --- tests/test-btrfs-devmgt.sh | 36 +++- 1 file changed, 15 insertions(+), 21 deletions(-) diff --git a/tests/test-btrfs

[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 anand.j...@oracle.com --- 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

[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 @@

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

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

2015-01-19 Thread Anand Jain
and not 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 failing. Signed-off

Re: [PATCH 22/24] Btrfs: sysfs: don't fail seeding for the sake of sysfs kobject issue

2015-02-11 Thread Anand Jain
On 02/12/2015 02:40 AM, David Sterba wrote: On Mon, Feb 09, 2015 at 07:56:23AM +0800, Anand Jain wrote: Signed-off-by: Anand Jain anand.j...@oracle.com --- fs/btrfs/volumes.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c index

[PATCH] Btrfs-progs: fix compile failure

2015-02-17 Thread Anand Jain
-metadata.c:40: error: for each function it appears in.) make: *** [btrfs-search-metadata.o] Error 1 btrfs-search-metadata.c:fprintf(stderr, %s\n, BTRFS_BUILD_VERSION); Signed-off-by: Anand Jain anand.j...@oracle.com --- btrfs-search-metadata.c | 1 - 1 file changed, 1 deletion(-) diff --git

Re: [PATCH 23/24] Btrfs: sysfs: support seed devices in the sysfs layout

2015-02-17 Thread Anand Jain
? Thanks, Anand On 02/14/2015 01:51 AM, David Sterba wrote: On Thu, Feb 12, 2015 at 02:25:32PM +0800, Anand Jain wrote: Since we are on this topic: btrfs-progs shouldn't have had this patch: git log -p 2513077 - commit 2513077f2f830b4bc83d528bfb6979eb461918bd Author

[PATCH 1/1 V2] export symbol kobject_move()

2015-02-11 Thread Anand Jain
drivers/cpufreq/cpufreq.c is already using this function. And now btrfs needs it as well. export symbol kobject_move(). Signed-off-by: Anand Jain anand.j...@oracle.com --- v1-v2: Didn't notice there wasn't my signed-off, now added. Thanks Dave. lib/kobject.c | 1 + 1 file changed, 1 insertion

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