[PATCH] filesystem show need to read from the kernel

2013-05-10 Thread Anand Jain
is given, structure of all present filesystems is shown -K list both mounted and unmounted/stale btrfs as per kernel -k list mounted btrfs as known to the kernel. - Anand Jain (1): btrfs: add framework to read fs info and dev info from the kernel fs/btrfs/super.c | 87

[PATCH] btrfs-progs: add framework to read fs info and dev info from the kernel

2013-05-10 Thread Anand Jain
the kernel Signed-off-by: Anand Jain anand.j...@oracle.com --- cmds-filesystem.c | 92 ++-- ioctl.h | 60 - utils.c | 153 ++ utils.h | 2 + 4 files changed, 303 insertions

[PATCH] btrfs: add framework to read fs info and dev info from the kernel

2013-05-10 Thread Anand Jain
information and its device information. Also the frame work provided here is easily extensible to retrieve any other structure as future needs. Signed-off-by: Anand Jain anand.j...@oracle.com --- fs/btrfs/super.c | 87 ++ fs/btrfs/volumes.c | 86

[PATCH v3] btrfs: device delete to get errors from the kernel

2013-05-17 Thread Anand Jain
: introduce error codes for the device mgmt usage v1: adds a parameter in the ioctl arg struct to carry the error string Signed-off-by: Anand Jain anand.j...@oracle.com --- fs/btrfs/ioctl.c | 22 +++--- fs/btrfs/volumes.c | 26 +++--- include

[PATCH v3] btrfs-progs: device delete to get errors from the kernel

2013-05-17 Thread Anand Jain
: introduce error codes for the device mgmt usage v1: add another parameter to the ioctl arg structure to carry the error string Signed-off-by: Anand Jain anand.j...@oracle.com --- cmds-device.c | 10 -- ioctl.h | 43 ++- 2 files changed, 50

[PATCH 0/4] a structure for the disks scan for btrfs

2013-05-17 Thread Anand Jain
it would congregate btrfs-disk scans at the function scan_devs_for_btrfs, adds /dev/mapper to be used to scan for btrfs, and updates its calling functions and few bug fixes. Anand Jain (4): btrfs-progs: replace filesystem show --all-devices with -d option btrfs-progs: label option in btrfs

[PATCH 2/4] btrfs-progs: label option in btrfs filesystem show is not coded

2013-05-17 Thread Anand Jain
So update the usage and man page Signed-off-by: Anand Jain anand.j...@oracle.com --- cmds-filesystem.c | 2 +- man/btrfs.8.in| 8 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/cmds-filesystem.c b/cmds-filesystem.c index 6ba27ad..470de31 100644 --- a/cmds

[PATCH 4/4] btrfs-progs: btrfs_scan_for_fsid doesn't need all the arguments

2013-05-17 Thread Anand Jain
btrfs_scan_for_fsid uses only one argument run_ioctl out of 3 so remove the rest two of them and also update to use the new function scan_devs_for_btrfs Signed-off-by: Anand Jain anand.j...@oracle.com --- btrfs-find-root.c | 2 +- disk-io.c | 2 +- utils.c | 12

[PATCH 3/4] btrfs-progs: use /dev/mapper to find the btrfs disks

2013-05-17 Thread Anand Jain
to be consistent with them. This patch uses the /dev/mapper on top of scanning /proc/partitions and updates paths with /dev/mapper paths where available (which takes care if some of the disks is under blacklist). Signed-off-by: Anand Jain anand.j...@oracle.com --- cmds-device.c | 50

[PATCH 1/4] btrfs-progs: replace filesystem show --all-devices with -d option

2013-05-17 Thread Anand Jain
The btrfs fi show --all-devices is odd man out as compared to the rest of the command line options with in btrfs-progs. So match it with the btrfs-progs symantics Signed-off-by: Anand Jain anand.j...@oracle.com --- cmds-filesystem.c | 18 ++ man/btrfs.8.in| 6 +++--- 2 files

Re: [PATCH 0/4] a structure for the disks scan for btrfs

2013-05-17 Thread anand jain
On 17/05/2013 19:21, Gabriel de Perthuis wrote: On Fri, 17 May 2013 18:54:38 +0800, Anand Jain wrote: The idea was to introduce /dev/mapper to find for btrfs disk, However I found first we need to congregate the disk scan procedure at a function so it would help to consistently tune it across

Re: panic BTRFS error (device sdp) in __btrfs_inc_extent_ref:1935: Object already exists [Linux 3.8.4]

2013-05-21 Thread anand jain
This is fixed with patch [PATCH] Btrfs: compare relevant parts of delayed tree refs in 3.9 upgrade should help. On 21/05/2013 16:37, Joeri Vanthienen wrote: Hi all, I tried to replace a failed device in a btrfs filesystem on Linux kernel 3.8.4. After adding a new harddisk (/dev/sdf) to

[PATCH 0/6 v2] btrfs-progs: a structure for the disks scan for btrfs

2013-05-29 Thread Anand Jain
/dev/mapper/mpathbp1 [1118885.474077] device fsid 0a62-ad84-4d80-842a-dd9c1c60bf51 devid 2 transid 103 /dev/mapper/mpathd [1118885.474133] device fsid 0a62-ad84-4d80-842a-dd9c1c60bf51 devid 1 transid 103 /dev/mapper/mpathe - Anand Jain (6): btrfs-progs: btrfs_scan_for_fsid doesn't

[PATCH 1/6 v2] btrfs-progs: btrfs_scan_for_fsid doesn't need all the arguments

2013-05-29 Thread Anand Jain
btrfs_scan_for_fsid uses only one argument run_ioctl out of 3 so remove the rest two of them Signed-off-by: Anand Jain anand.j...@oracle.com --- btrfs-find-root.c | 2 +- disk-io.c | 2 +- utils.c | 5 ++--- utils.h | 3 +-- 4 files changed, 5 insertions(+), 7

[PATCH 2/6 v2] btrfs-progs: label option in btrfs filesystem show is not coded

2013-05-29 Thread Anand Jain
appears to be a cut and paste error Signed-off-by: Anand Jain anand.j...@oracle.com --- cmds-filesystem.c | 2 +- man/btrfs.8.in| 8 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/cmds-filesystem.c b/cmds-filesystem.c index f41a72a..c6a7100 100644 --- a/cmds

[PATCH 3/6 v2] btrfs-progs: update device scan usage

2013-05-29 Thread Anand Jain
the btrfs device scan usage does not publish --all-devices option so add it Signed-off-by: Anand Jain anand.j...@oracle.com --- cmds-device.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmds-device.c b/cmds-device.c index 41e79d3..d25159b 100644 --- a/cmds-device.c +++ b

[PATCH 4/6 v2] btrfs-progs: congregate dev scan

2013-05-29 Thread Anand Jain
tweaking it. the patch which recommends to use /dev/mapper will also need it thanks Signed-off-by: Anand Jain anand.j...@oracle.com --- cmds-device.c | 11 +++ cmds-filesystem.c | 9 +++-- utils.c | 18 ++ utils.h | 5 - 4 files changed, 28

[PATCH 6/6 v2] btrfs-progs: scan /dev/mapper in filesystem show and device scan

2013-05-29 Thread Anand Jain
1 size 15.00GB used 2.04GB path /dev/mapper/mpathbp1 In the long run I want the usage of /dev/mapper path along with /proc/partitions be the default option to scan for the btrfs devs. /proc/partitions must be scanned as well because to include the mapper blacklisted devs. Signed-off-by: Anand

[PATCH 5/6 v2] btrfs-progs: btrfs_scan_one_dir not to skip links when /dev/mapper is provided

2013-05-29 Thread Anand Jain
to scan /dev/mapper we want to avoid skipping links otherwise we would be left with nothing. This patch just adds the check if we are scanning devs ONLY under /dev/mapper if when so it will not skip links Thanks Signed-off-by: Anand Jain anand.j...@oracle.com --- utils.c | 8 ++-- 1 file changed

[PATCH 4/6 v3] btrfs-progs: congregate dev scan

2013-05-31 Thread Anand Jain
tweaking it. the patch which recommends to use /dev/mapper will also need it v3: bring in btrfs_scan_for_fsid to use scan_for_btrfs thanks Signed-off-by: Anand Jain anand.j...@oracle.com --- cmds-device.c | 11 +++ cmds-filesystem.c | 9 +++-- utils.c | 22

[PATCH 1/9] btrfs-progs: btrfs_scan_for_fsid doesn't need all the arguments

2013-06-10 Thread Anand Jain
btrfs_scan_for_fsid uses only one argument run_ioctl out of 3 so remove the rest two of them Signed-off-by: Anand Jain anand.j...@oracle.com --- btrfs-find-root.c | 2 +- disk-io.c | 2 +- utils.c | 5 ++--- utils.h | 3 +-- 4 files changed, 5 insertions(+), 7

[PATCH 0/9] btrfs-progs: coalesce of patches

2013-06-10 Thread Anand Jain
/dev/mapper/mpathe - Anand Jain (9): btrfs-progs: btrfs_scan_for_fsid doesn't need all the arguments btrfs-progs: label option in btrfs filesystem show is not coded btrfs-progs: update device scan usage btrfs-progs: congregate dev scan btrfs-progs: btrfs_scan_one_dir not to skip links

[PATCH 6/9 v2] btrfs-progs: scan /dev/mapper in filesystem show and device scan

2013-06-10 Thread Anand Jain
1 size 15.00GB used 2.04GB path /dev/mapper/mpathbp1 In the long run I want the usage of /dev/mapper path along with /proc/partitions be the default option to scan for the btrfs devs. /proc/partitions must be scanned as well because to include the mapper blacklisted devs. Signed-off-by: Anand

[PATCH 5/9 v2] btrfs-progs: btrfs_scan_one_dir not to skip links when /dev/mapper is provided

2013-06-10 Thread Anand Jain
to scan /dev/mapper we want to avoid skipping links otherwise we would be left with nothing. This patch just adds the check if we are scanning devs ONLY under /dev/mapper if when so it will not skip links Thanks Signed-off-by: Anand Jain anand.j...@oracle.com --- utils.c | 8 ++-- 1 file changed

[PATCH 2/9 v2] btrfs-progs: label option in btrfs filesystem show is not coded

2013-06-10 Thread Anand Jain
appears to be a cut and paste error Signed-off-by: Anand Jain anand.j...@oracle.com --- cmds-filesystem.c | 2 +- man/btrfs.8.in| 8 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/cmds-filesystem.c b/cmds-filesystem.c index f41a72a..c6a7100 100644 --- a/cmds

[PATCH 4/9 v3] btrfs-progs: congregate dev scan

2013-06-10 Thread Anand Jain
tweaking it. the patch which recommends to use /dev/mapper will also need it v3: bring in btrfs_scan_for_fsid to use scan_for_btrfs thanks Signed-off-by: Anand Jain anand.j...@oracle.com --- cmds-device.c | 11 +++ cmds-filesystem.c | 9 +++-- utils.c | 22

[PATCH 3/9 v2] btrfs-progs: update device scan usage

2013-06-10 Thread Anand Jain
the btrfs device scan usage does not publish --all-devices option so add it Signed-off-by: Anand Jain anand.j...@oracle.com --- cmds-device.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmds-device.c b/cmds-device.c index 41e79d3..d25159b 100644 --- a/cmds-device.c +++ b

[PATCH 7/9 v3] btrfs-progs: device delete to get errors from the kernel

2013-06-10 Thread Anand Jain
: introduce error codes for the device mgmt usage v1: add another parameter to the ioctl arg structure to carry the error string Signed-off-by: Anand Jain anand.j...@oracle.com --- cmds-device.c | 10 -- ioctl.h | 43 ++- 2 files changed, 50

[PATCH 9/9 v2] btrfs-progs: introduce btrfs filesystem show --kernel

2013-06-10 Thread Anand Jain
-by: Anand Jain anand.j...@oracle.com --- cmds-filesystem.c | 7 +- ctree.h | 1 - ioctl.h | 64 ++ utils.c | 244 ++ utils.h | 4 + volumes.c | 20 - volumes.h | 3

[PATCH 2/2 v2] btrfs: add framework to read fs info and dev info from the kernel

2013-06-10 Thread Anand Jain
information and its device information. Also the frame work provided here is easily extensible to retrieve any other structure as future needs. v1-v2: .code optimized .get the device generation number as well, so that btrfs-progs could print using print_one_uuid Signed-off-by: Anand Jain anand.j

[PATCH 0/2] btrfs: coalesce of patches

2013-06-10 Thread Anand Jain
Anand Jain (2): btrfs: device delete to get errors from the kernel btrfs: add framework to read fs info and dev info from the kernel fs/btrfs/ioctl.c | 22 fs/btrfs/super.c | 100 +--- fs/btrfs/volumes.c | 125

Re: [PATCH 2/2 v2] btrfs: add framework to read fs info and dev info from the kernel

2013-06-11 Thread anand jain
On 06/11/2013 03:40 AM, Josef Bacik wrote: On Mon, Jun 10, 2013 at 08:59:15AM -0600, Anand Jain wrote: This adds two ioctl BTRFS_IOC_GET_FSIDS and BTRFS_IOC_GET_DEVS which reads the btrfs_fs_devices and btrfs_device structure from the kernel respectively. The information in these structure

Re: [PATCH 1/9] btrfs-progs: btrfs_scan_for_fsid doesn't need all the arguments

2013-06-11 Thread anand jain
On 06/11/2013 04:00 AM, Eric Sandeen wrote: On 6/10/13 9:56 AM, Anand Jain wrote: btrfs_scan_for_fsid uses only one argument run_ioctl out of 3 so remove the rest two of them and run_ioctl is only ever '1' (and it's completely unobvious at the call point what '1' means

Re: [PATCH 2/2 v2] btrfs: add framework to read fs info and dev info from the kernel

2013-06-11 Thread anand jain
On 06/11/2013 04:30 AM, Zach Brown wrote: On Mon, Jun 10, 2013 at 10:59:15PM +0800, Anand Jain wrote: This adds two ioctl BTRFS_IOC_GET_FSIDS and BTRFS_IOC_GET_DEVS which reads the btrfs_fs_devices and btrfs_device structure from the kernel respectively. Why not just use sysfs to export

btrfs-progs and btrfs code similar why ?

2013-06-12 Thread Anand Jain
Per wiki an idea seems to maintain same code (probably as much as possible) between btrfs-progs and btrfs There must have been a/few critical advantage, but what are they ? Thanks, Anand -- To unsubscribe from this list: send the line unsubscribe linux-btrfs in the body of a message

Re: btrfs-progs and btrfs code similar why ?

2013-06-13 Thread Anand Jain
Because they work with the same on-disk structures, and need to perform many of the same tasks. So using the same code base means bugs get fixed once, features get written once, there is built-in consistency, more coverage, etc. yes. Thanks Eric. - Anand -- To unsubscribe from this list:

Re: [PATCH 2/2 v2] btrfs: add framework to read fs info and dev info from the kernel

2013-06-21 Thread Anand Jain
TREE_SEARCH ioctl doesn't help in this case the dev item don't provide all the info that btrfs-progs might need in the long run (and even the current needs). Thanks, Anand On 06/11/2013 10:24 PM, Josef Bacik wrote: On Mon, Jun 10, 2013 at 08:59:15AM -0600, Anand Jain wrote: This adds two

[PATCH 2/2 v3] btrfs: obtain used_bytes in BTRFS_IOC_FS_INFO ioctl

2013-06-21 Thread Anand Jain
the kernel Signed-off-by: Anand Jain anand.j...@oracle.com --- fs/btrfs/ioctl.c | 16 ++-- include/uapi/linux/btrfs.h | 3 ++- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c index 0e7bcc5..082c9fc 100644 --- a/fs/btrfs

[PATCH 08/13 v2] btrfs-progs: get_label_mounted to return label instead of print

2013-06-21 Thread Anand Jain
This would help to reuse the function v1-v2: removed static and updated .h file, in a preparation work for the following patch Signed-off-by: Anand Jain anand.j...@oracle.com --- utils.c | 18 +- utils.h | 1 + 2 files changed, 14 insertions(+), 5 deletions(-) diff

[PATCH 10/13] btrfs-progs: move out print in cmd_df to another function

2013-06-21 Thread Anand Jain
This is a prepatory work for the following btrfs fi show command fixes. So that we have a function get_df to get the fs sizes. Signed-off-by: Anand Jain anand.j...@oracle.com --- cmds-filesystem.c | 146 +- 1 file changed, 79 insertions(+), 67

[PATCH 11/13] btrfs-progs: get string for the group profile and type

2013-06-21 Thread Anand Jain
Code can be well reused and this is the prepatory work for the patch following this. Signed-off-by: Anand Jain anand.j...@oracle.com --- cmds-filesystem.c | 83 --- ctree.h | 11 2 files changed, 59 insertions(+), 35

[PATCH 09/13] btrfs-progs: function to release a specific fsid from the list

2013-06-21 Thread Anand Jain
this is preparatory so that fsid found in the kernel can be added Signed-off-by: Anand Jain anand.j...@oracle.com --- volumes.c | 20 +++- volumes.h | 3 +++ 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/volumes.c b/volumes.c index aa1c3dd..81904c6 100644

[PATCH 00/13] Introduce show --kernel

2013-06-21 Thread Anand Jain
. btrfs-progs: function to release a specific fsid from the list btrfs-progs: move out print in cmd_df to another function btrfs-progs: get string for the group profile and type btrfs-progs: obtain used_bytes in BTRFS_IOC_FS_INFO ioctl Anand Jain (13): btrfs-progs: btrfs_scan_for_fsid doesn't

[PATCH 13/13 v3] btrfs-progs: introduce btrfs filesystem show --kernel

2013-06-21 Thread Anand Jain
optimized to remove redundancy Signed-off-by: Anand Jain anand.j...@oracle.com --- cmds-filesystem.c | 44 volumes.c | 28 volumes.h | 2 ++ 3 files changed, 70 insertions(+), 4 deletions(-) diff --git

[PATCH 12/13] btrfs-progs: obtain used_bytes in BTRFS_IOC_FS_INFO ioctl

2013-06-21 Thread Anand Jain
Signed-off-by: Anand Jain anand.j...@oracle.com --- ioctl.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ioctl.h b/ioctl.h index a40a4a1..d035201 100644 --- a/ioctl.h +++ b/ioctl.h @@ -169,7 +169,8 @@ struct btrfs_ioctl_fs_info_args { __u64 max_id

Re: [PATCH 2/2 v3] btrfs: obtain used_bytes in BTRFS_IOC_FS_INFO ioctl

2013-06-24 Thread Anand Jain
On 06/25/2013 01:03 AM, Josef Bacik wrote: On Fri, Jun 21, 2013 at 03:32:28PM +0800, Anand Jain wrote: btrfs-progs has to read fs info from the kernel to read the latest info instead of reading it from the disks, which generally is a stale info after certain critical operation. getting

Re: [PATCH 12/13] btrfs-progs: obtain used_bytes in BTRFS_IOC_FS_INFO ioctl

2013-06-25 Thread Anand Jain
kindly ignore this patch, the feature now is implemented without adding any _new_ ioctl or _new_ parameters. Thanks, Anand On 06/21/2013 03:58 PM, Anand Jain wrote: btrfs-progs has to read fs info from the kernel to read the latest info instead of reading it from the disks, which generally

[PATCH 12/12 v4] btrfs-progs: introduce btrfs filesystem show --kernel

2013-06-25 Thread Anand Jain
: this patch also depends on path 9/13 to 12/13 also sent here. v1-v2: code optimized to remove redundancy Signed-off-by: Anand Jain anand.j...@oracle.com merg Signed-off-by: Anand Jain anand.j...@oracle.com --- cmds-filesystem.c | 166

Re: [PATCH] xfstests: fix btrfs/264 to not use the scratch dev pool

2013-06-26 Thread Anand Jain
Reviewed-by: Anand Jain anand.j...@oracle.com On 06/26/2013 11:52 PM, Josef Bacik wrote: This test doesn't need the scratch dev pool and it also doesn't call _require_scratch_dev_pool, so just kick out the scratch dev pool part of the test. Thanks, Signed-off-by: Josef Bacik jba

[bug] mount is successful when check --repair is running

2013-06-26 Thread Anand Jain
Per code it appears that btrfs check doesn't use the EXCL open which means mount can be successful when the check is running. 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: [PATCH] xfstests: fix SCRATCH_DEV_POOL mount/umount issues

2013-06-27 Thread Anand Jain
On 06/27/2013 09:57 AM, Josef Bacik wrote: If you use the SCRATCH_DEV_POOL for btrfs you will end up with the command line like this mkfs.btrfs $SCRATCH_DEV_POOL $SCRATCH_DEV and btrfs does this thing where it makes the lowest valued device id show up in /proc/mounts no matter which device

Re: [PATCH] xfstests: fix btrfs/265 so it actually works V2

2013-06-28 Thread Anand Jain
Looks good. But. Since there is repeated calls to mkfs, -f option might be mandatory. and 265 is indeed working before. You need to re-phrase the title to the fixes you are bringing in. Reviewed-by: Anand Jain anand.j...@oracle.com On 06/28/2013 01:49 AM, Josef Bacik wrote

Re: [PATCH 3/3] Btrfs-progs: remove unused code

2013-07-01 Thread Anand Jain
good catch. Reviewed-by: Anand Jain anand.j...@oracle.com On 06/30/2013 07:51 PM, Filipe David Borba Manana wrote: The uuid_unparse() call in btrfs_scan_one_device() was a no-op. Signed-off-by: Filipe David Borba Manana fdman...@gmail.com --- volumes.c |2 -- 1 file changed, 2

Re: [PATCH] btrfs-progs: avoid memory leak in btrfs_close_devices

2013-07-02 Thread Anand Jain
further, you need to free device-label as well. static int device_list_add(const char *path, struct btrfs_super_block *disk_super, u64 devid, struct btrfs_fs_devices **fs_devices_ret) { :: device-label = kstrdup(disk_super-label,

Re: [PATCH] btrfs-progs: avoid memory leak in btrfs_close_devices

2013-07-02 Thread Anand Jain
revamp this patch to the bug here, based feedback(s). (my new patch-set doesn't have to call device_list_fini() any more, so this patch is kind of void now). Thanks, Anand On 07/03/2013 01:01 PM, Anand Jain wrote: further, you need to free device-label as well. static int

Re: [PATCH 03/12] Btrfs-progs: Don't free the devices when close the ctree

2013-07-07 Thread Anand Jain
btrfs_close_devices() should reset fs_devices-latest_bdev and fs_devices-lowest_bdev as well they hold fd of the open dev in the list which is being closed. On 07/03/2013 09:25 PM, Miao Xie wrote: Some commands(such as btrfs-convert) access the devices again after we close the ctree, so

[PATCH 13/13] btrfs-progs: fix memory leaks of device_list_add()

2013-07-08 Thread Anand Jain
-by: Anand Jain anand.j...@oracle.com --- cmds-device.c |4 +++ cmds-filesystem.c | 11 - cmds-replace.c|2 + cmds-scrub.c |3 ++ disk-io.c |1 + mkfs.c|1 + utils.h |1 + volumes.c | 56

Re: [PATCH] Btrfs-progs: fix memory leak in open_file_or_dir()

2013-07-09 Thread Anand Jain
Thanks. Reviewed-by: Anand Jain anand.j...@oracle.com On 07/10/2013 07:01 AM, Wang Shilong wrote: From: Wang Shilong wangsl.f...@cn.fujitsu.com After calling opendir() successfully, closedir() should be also called to free memory. Otherwise, memory leak happens. Signed-off-by: Wang

Re: [PATCH] Btrfs-progs: update usage message for cmds-restore

2013-07-09 Thread Anand Jain
Thanks. - btrfs restore [options] device, + btrfs restore [options] device path | btrfs restore -l device, should this be rather... btrfs restore [options] device path | -l device, Thanks Anand -- To unsubscribe from this list: send the line unsubscribe linux-btrfs in the

Re: [PATCH] Btrfs-progs: fix memory leak in open_file_or_dir()

2013-07-14 Thread anand jain
(dirstream); We have to closedir only when fd 0. Thanks, Anand On 10/07/2013 11:43, Anand Jain wrote: Thanks. Reviewed-by: Anand Jain anand.j...@oracle.com On 07/10/2013 07:01 AM, Wang Shilong wrote: From: Wang Shilong wangsl.f...@cn.fujitsu.com After calling opendir() successfully

[PATCH] From: Wang Shilong wangsl.f...@cn.fujitsu.com

2013-07-14 Thread Anand Jain
After calling opendir() successfully, closedir() should be also called to free memory. Otherwise, memory leak happens. Signed-off-by: Anand Jain anand.j...@oracle.com Signed-off-by: Wang Shilong wangsl.f...@cn.fujitsu.com Reviewed-by: Anand Jain anand.j...@oracle.com --- utils.c |6 -- 1

Re: [PATCH v2] Btrfs-progs: fix memory leak in open_file_or_dir()

2013-07-14 Thread anand jain
, closedir() should be also called to free memory. Otherwise, memory leak happens. Signed-off-by: Anand Jain anand.j...@oracle.com Signed-off-by: Wang Shilong wangsl.f...@cn.fujitsu.com Reviewed-by: Anand Jain anand.j...@oracle.com --- utils.c |6 -- 1 files changed, 4 insertions(+), 2

Re: [PATCH 13/13] btrfs-progs: fix memory leaks of device_list_add()

2013-07-14 Thread Anand Jain
A complete fix for the memory leak caused by device_list_add() is more complicated than initial idea and so sorry that I have to pull back this patch as well. The main reason- There are uncoordinated scan for btrfs which would result in doing the same thing multiple times.

Re: [PATCH 03/12] Btrfs-progs: Don't free the devices when close the ctree

2013-07-14 Thread Anand Jain
I am sending a patch to fix the the memory leak. So its fine if this patch just address the close issue. This is more complicated than initially thought and it isn't ready. As explained in the other thread. Thanks, Anand -- To unsubscribe from this list: send the line unsubscribe

[PATCH 00/11 v2 (resend)] btrfs-progs: coalesce of patches

2013-07-14 Thread Anand Jain
(These changes were needed as part of show --kernel support, with out introducing new ioctl) Anand Jain (11): btrfs-progs: btrfs_scan_for_fsid doesn't need all the arguments btrfs-progs: label option in btrfs filesystem show is not coded btrfs-progs: update device scan usage btrfs-progs

[PATCH 01/11] btrfs-progs: btrfs_scan_for_fsid doesn't need all the arguments

2013-07-14 Thread Anand Jain
btrfs_scan_for_fsid uses only one argument run_ioctl out of 3 so remove the rest two of them Signed-off-by: Anand Jain anand.j...@oracle.com --- btrfs-find-root.c |2 +- disk-io.c |2 +- utils.c |5 ++--- utils.h |3 +-- 4 files changed, 5 insertions

[PATCH 02/11] btrfs-progs: label option in btrfs filesystem show is not coded

2013-07-14 Thread Anand Jain
Signed-off-by: Anand Jain anand.j...@oracle.com --- cmds-filesystem.c |2 +- man/btrfs.8.in|8 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/cmds-filesystem.c b/cmds-filesystem.c index 222e458..a1a8830 100644 --- a/cmds-filesystem.c +++ b/cmds-filesystem.c

[PATCH 03/11] btrfs-progs: update device scan usage

2013-07-14 Thread Anand Jain
the btrfs device scan usage didnt publish --all-devices option so add it Signed-off-by: Anand Jain anand.j...@oracle.com --- cmds-device.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/cmds-device.c b/cmds-device.c index 9e7328b..c94fcd5 100644 --- a/cmds-device.c

[PATCH 08/11] btrfs-progs: get_label_mounted to return label instead of print

2013-07-14 Thread Anand Jain
This would help to reuse the function v1-v2: removed static and updated .h file, in a preparation work for the following patch Signed-off-by: Anand Jain anand.j...@oracle.com --- utils.c | 18 +- utils.h |1 + 2 files changed, 14 insertions(+), 5 deletions(-) diff

[PATCH 04/11] btrfs-progs: congregate dev scan

2013-07-14 Thread Anand Jain
tweaking it. the patch which recommends to use /dev/mapper will also need it v3: bring in btrfs_scan_for_fsid to use scan_for_btrfs thanks Signed-off-by: Anand Jain anand.j...@oracle.com --- cmds-device.c | 11 +++ cmds-filesystem.c |9 +++-- utils.c | 22

[PATCH 10/11] btrfs-progs: get string for the group profile and type

2013-07-14 Thread Anand Jain
Code can be well reused and this is the prepatory work for the patch following this. Signed-off-by: Anand Jain anand.j...@oracle.com --- cmds-filesystem.c | 83 ++-- ctree.h | 11 +++ 2 files changed, 59 insertions(+), 35

[PATCH 07/11] btrfs-progs: device delete to get errors from the kernel

2013-07-14 Thread Anand Jain
: introduce error codes for the device mgmt usage v1: add another parameter to the ioctl arg structure to carry the error string Signed-off-by: Anand Jain anand.j...@oracle.com --- cmds-device.c | 10 -- ioctl.h | 43 ++- 2 files changed

[PATCH 11/11] btrfs-progs: introduce btrfs filesystem show --kernel

2013-07-14 Thread Anand Jain
optimized to remove redundancy Signed-off-by: Anand Jain anand.j...@oracle.com --- cmds-filesystem.c | 162 ++-- 1 files changed, 155 insertions(+), 7 deletions(-) diff --git a/cmds-filesystem.c b/cmds-filesystem.c index 5225db0..148192a 100644

[PATCH 06/11] btrfs-progs: scan /dev/mapper in filesystem show and device scan

2013-07-14 Thread Anand Jain
.) Signed-off-by: Anand Jain anand.j...@oracle.com --- cmds-device.c |8 +++- cmds-filesystem.c |7 +-- man/btrfs.8.in| 11 ++- utils.c |3 +++ utils.h |5 +++-- 5 files changed, 24 insertions(+), 10 deletions(-) diff --git a/cmds-device.c b

[PATCH 09/11] btrfs-progs: move out print in cmd_df to another function

2013-07-14 Thread Anand Jain
This is a prepatory work for the following btrfs fi show command fixes. So that we have a function get_df to get the fs sizes. Signed-off-by: Anand Jain anand.j...@oracle.com --- cmds-filesystem.c | 96 +++-- 1 files changed, 56 insertions(+), 40

[PATCH 2/2] btrfs-progs: close_all_devices() declared in multiple files

2013-07-14 Thread Anand Jain
close_all_devices() is declared once in disk-io.c and again in btrfs-find-root.c I see no reasons or is there any ? This patch will fix it. Signed-off-by: Anand Jain anand.j...@oracle.com --- btrfs-find-root.c | 17 + disk-io.c |3 +-- disk-io.h |1 + 3

[PATCH 1/2] btrfs-progs: fix the long lines

2013-07-14 Thread Anand Jain
trivial: cmds-replace.c contains long lines fix it Signed-off-by: Anand Jain anand.j...@oracle.com --- cmds-replace.c | 17 ++--- 1 files changed, 10 insertions(+), 7 deletions(-) diff --git a/cmds-replace.c b/cmds-replace.c index 6397bb5..c68986a 100644 --- a/cmds-replace.c +++ b

[PATCH 0/2] btrfs-progs: misc trivial fixes

2013-07-14 Thread Anand Jain
Anand Jain (2): btrfs-progs: fix the long lines btrfs-progs: close_all_devices() declared in multiple files btrfs-find-root.c | 17 + cmds-replace.c| 17 ++--- disk-io.c |3 +-- disk-io.h |1 + 4 files changed, 13 insertions(+), 25

[PATCH] btrfs-progs: close_all_devices() in btrfs-find-root.c does nothing

2013-07-15 Thread Anand Jain
close_all_devices() is declared once in disk-io.c and again in btrfs-find-root.c. The one in latter is completely useless so delete it. This patch will fix it. Signed-off-by: Anand Jain anand.j...@oracle.com --- btrfs-find-root.c | 17 + disk-io.c |3 +-- disk-io.h

Re: [PATCH 1/2] btrfs-progs: fix the long lines

2013-07-16 Thread Anand Jain
. Thanks Anand On 07/15/2013 10:06 PM, Eric Sandeen wrote: On 7/15/13 12:35 AM, Anand Jain wrote: trivial: cmds-replace.c contains long lines fix it I realize that this is total bikeshedding, so you can take or leave it, but: One downside to this is that it makes it a little harder to grep

[bug] label cli hangs until balance is completed

2013-07-17 Thread Anand Jain
'btrfs fi label /btrfs' will hang until balance is completed. (and probably even set label would hang). This is because we are trying to hold volume_mutex lock which balance will hold during its tenure. --- static int btrfs_ioctl_get_fslabel(struct file *file, void __user *arg) ::

[PATCH] btrfs: fix get set label blocking against balance

2013-07-18 Thread Anand Jain
hung This patch will use mutex uuid_mutex. which is defined in volume.c, and so it is moved to volume.h as well. also this patch will add a bit of optimization within the btrfs_ioctl_get_falabel() function. Signed-off-by: Anand Jain anand.j...@oracle.com --- fs/btrfs/ioctl.c | 16

Re: [PATCH] btrfs: fix get set label blocking against balance

2013-07-19 Thread Anand Jain
Instead the spinlock super_lock looks appropriate for protecting concurrent access to the label field of fs_info-super_copy. In btrfs_ioctl_set_fslabel() make sure to only hold the spinlock for the copy operation, not while calling the transaction functions. Oh yeah ! fs_info-super_lock is

[PATCH v2] btrfs: fix get set label blocking against balance

2013-07-19 Thread Anand Jain
hung also this patch will add a bit of optimization within the btrfs_ioctl_get_falabel() function. v1-v2: use fs_info-super_lock instead of uuid_mutex Signed-off-by: Anand Jain anand.j...@oracle.com --- fs/btrfs/ioctl.c | 16 ++-- 1 file changed, 10 insertions(+), 6 deletions

[PATCH 2/2] btrfs: btrfs_rm_device() should zero mirror SB as well

2013-07-25 Thread Anand Jain
mounted: /btrfs Group profile: metadata: single data: single Total devices 1 FS bytes used 28.00KiB devid1 size 2.00GiB used 20.00MiB path /dev/sdb - Signed-off-by: Anand Jain anand.j...@oracle.com --- fs/btrfs/volumes.c | 30

[PATCH 1/2] btrfs: use BTRFS_SUPER_INFO_SIZE macro at btrfs_read_dev_super()

2013-07-25 Thread Anand Jain
Signed-off-by: Anand Jain anand.j...@oracle.com --- fs/btrfs/disk-io.c |6 -- 1 files changed, 4 insertions(+), 2 deletions(-) diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c index dfe6864..de5884f 100644 --- a/fs/btrfs/disk-io.c +++ b/fs/btrfs/disk-io.c @@ -2982,9 +2982,11

[PATCH 0/6]

2013-07-25 Thread Anand Jain
The below patch set is on top of, git://repo.or.cz/btrfs-progs-unstable/devel.git integration-20130710 and is for your kind review coment and integration Thanks Anand Jain (6): btrfs-progs: close_all_devices() in btrfs-find-root.c does nothing btrfs-progs: let user know that devid can

[PATCH 1/6] btrfs-progs: close_all_devices() in btrfs-find-root.c does nothing

2013-07-25 Thread Anand Jain
close_all_devices() is declared once in disk-io.c and again in btrfs-find-root.c. The one in latter is completely useless so delete it. This patch will fix it. Signed-off-by: Anand Jain anand.j...@oracle.com --- btrfs-find-root.c | 17 + disk-io.c |3 +-- disk-io.h

[PATCH 3/6] btrfs-progs: cmd_start_replace() to use test_dev_for_mkfs()

2013-07-25 Thread Anand Jain
test_dev_for_mkfs() is a common place where we check if a device is fit for the btrfs use. cmd_start_replace() should make use of test_dev_for_mkfs(), and here the test_dev_for_mkfs() is further enhanced to fit the cmd_start_replace() needs. Thanks Signed-off-by: Anand Jain anand.j...@oracle.com

[PATCH 5/6] btrfs-progs: avoid write to the disk before sure to create fs

2013-07-25 Thread Anand Jain
- Signed-off-by: Anand Jain anand.j...@oracle.com --- mkfs.c | 104 +-- utils.c | 41 + utils.h |2 + 3 files changed, 84 insertions(+), 63 deletions(-) diff --git a/mkfs.c b/mkfs.c index 66f558a

[PATCH 4/6] btrfs-progs: mkfs.c overwrites fd without appropriate close

2013-07-25 Thread Anand Jain
Signed-off-by: Anand Jain anand.j...@oracle.com --- mkfs.c |3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/mkfs.c b/mkfs.c index 60f906c..66f558a 100644 --- a/mkfs.c +++ b/mkfs.c @@ -1570,6 +1570,8 @@ int main(int ac, char **av) * occur by the following

[PATCH 2/6] btrfs-progs: let user know that devid can be used if path is missing

2013-07-25 Thread Anand Jain
/dev/sdc /dev/sde /btrfs Error: Unable to open device '/dev/sdc' Try using the devid instead of the path --- Signed-off-by: Anand Jain anand.j...@oracle.com --- cmds-replace.c |1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/cmds-replace.c b/cmds-replace.c index

[PATCH 6/6] btrfs-progs: don't have to report ENOMEDIUM error during open

2013-07-25 Thread Anand Jain
when we scan /proc/partitions the cdrom is scanned as well, and we don't have to report ENOMEDIUM errors against it. Signed-off-by: Anand Jain anand.j...@oracle.com --- utils.c |5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-) diff --git a/utils.c b/utils.c index 4aeea9c..638cef0

[bug] balance BUG at fs/btrfs/relocation.c:886

2013-07-31 Thread Anand Jain
3.11.0-rc3+ -- [ 225.586356] kernel BUG at fs/btrfs/relocation.c:886! [ 225.586362] invalid opcode: [#1] SMP :: [ 225.586431] Call Trace: [ 225.586440] [a0055cd1] ? btree_read_extent_buffer_pages.clone.4+0xd1/0x120 [btrfs] [ 225.586447] [a00a9123]

Re: [PATCH 00/11 v2 (resend)] btrfs-progs: coalesce of patches

2013-08-06 Thread anand jain
On 06/08/2013 01:36, David Sterba wrote: On Mon, Jul 15, 2013 at 01:30:46PM +0800, Anand Jain wrote: Anand Jain (11): btrfs-progs: btrfs_scan_for_fsid doesn't need all the arguments btrfs-progs: label option in btrfs filesystem show is not coded btrfs-progs: update device scan usage

Re: [PATCH 1/2] btrfs-progs: introduce command namespace for development features

2013-08-06 Thread Anand Jain
Further there is benefit of having newer subcommands in the master branch - it gets visibility. However if we are trying to solve the problem of it not being end user ready then there can be a warning message about it when the user uses it or sees it. I see some of online shops tagging

[PATCH 2/3] btrfs-progs: cmd_start_replace() to use test_dev_for_mkfs()

2013-08-07 Thread Anand Jain
test_dev_for_mkfs() is a common place where we check if a device is fit for the btrfs use. cmd_start_replace() should make use of test_dev_for_mkfs(), and here the test_dev_for_mkfs() is further enhanced to fit the cmd_start_replace() needs. Thanks Signed-off-by: Anand Jain anand.j...@oracle.com

[PATCH 3/3] btrfs-progs: avoid write to the disk before sure to create fs

2013-08-07 Thread Anand Jain
- Signed-off-by: Anand Jain anand.j...@oracle.com --- mkfs.c | 104 +-- utils.c | 41 + utils.h |2 + 3 files changed, 84 insertions(+), 63 deletions(-) diff --git a/mkfs.c b/mkfs.c index 6325c1f

[PATCH 1/3] btrfs-progs: let user know that devid can be used if path is missing

2013-08-07 Thread Anand Jain
When the device disappear the path goes missing, and that will be the one of the reason that user will replace the device. The devid of the missing btrfs device can be obtained using the new cli option btrfs fi show --kernel (coming soon) And which can be used in the replace command. ---

[PATCH 0/3 resend]

2013-08-07 Thread Anand Jain
Anand Jain (3): btrfs-progs: let user know that devid can be used if path is missing btrfs-progs: cmd_start_replace() to use test_dev_for_mkfs() btrfs-progs: avoid write to the disk before sure to create fs cmds-replace.c | 33 +++--- mkfs.c | 104

  1   2   3   4   5   6   7   8   9   10   >