Linux Btrfs filesystem development
 help / color / mirror / Atom feed
* [PATCH] revert btrfs-progs: do a separate probe for _transient_ replacing device
@ 2014-10-29 10:51 Anand Jain
  2014-10-29 11:41 ` Gui Hecheng
  2014-10-30  4:43 ` [PATCH v2] " Anand Jain
  0 siblings, 2 replies; 4+ messages in thread
From: Anand Jain @ 2014-10-29 10:51 UTC (permalink / raw)
  To: dsterba; +Cc: linux-btrfs

There is a compatibility issue with older kernel with the progs commit id as below.

05cd2907557ba627cfb86e60b214ea6228613a84

So as of now writing to revert the above commit id.
The brewing sysfs interface would help to fix the impending issue, which is
seed device would fail show in 'btrfs fi show' output of a sprout device.

Signed-off-by: Anand Jain <anand.jain@oracle.com>
---
 utils.c | 19 +------------------
 1 file changed, 1 insertion(+), 18 deletions(-)

diff --git a/utils.c b/utils.c
index a8691fe..1d1cc77 100644
--- a/utils.c
+++ b/utils.c
@@ -1869,29 +1869,12 @@ int get_fs_info(char *path, struct btrfs_ioctl_fs_info_args *fi_args,
 	if (!fi_args->num_devices)
 		goto out;
 
-	/*
-	 * with kernel patch
-	 * btrfs: ioctl BTRFS_IOC_FS_INFO and BTRFS_IOC_DEV_INFO miss-matched with slots
-	 * the kernel now returns total_devices which does not include
-	 * replacing device if running.
-	 * As we need to get dev info of the replace device if it is running,
-	 * so just add one to fi_args->num_devices.
-	 */
-
-	di_args = *di_ret = malloc((fi_args->num_devices + 1) * sizeof(*di_args));
+	di_args = *di_ret = malloc((fi_args->num_devices) * sizeof(*di_args));
 	if (!di_args) {
 		ret = -errno;
 		goto out;
 	}
 
-	/* get the replace target device if it is there */
-	ret = get_device_info(fd, i, &di_args[ndevs]);
-	if (!ret) {
-		ndevs++;
-		fi_args->num_devices++;
-	}
-	i++;
-
 	for (; i <= fi_args->max_id; ++i) {
 		BUG_ON(ndevs >= fi_args->num_devices);
 		ret = get_device_info(fd, i, &di_args[ndevs]);
-- 
2.0.0.153.g79dcccc


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] revert btrfs-progs: do a separate probe for _transient_ replacing device
  2014-10-29 10:51 [PATCH] revert btrfs-progs: do a separate probe for _transient_ replacing device Anand Jain
@ 2014-10-29 11:41 ` Gui Hecheng
  2014-10-30  4:06   ` Anand Jain
  2014-10-30  4:43 ` [PATCH v2] " Anand Jain
  1 sibling, 1 reply; 4+ messages in thread
From: Gui Hecheng @ 2014-10-29 11:41 UTC (permalink / raw)
  To: Anand Jain; +Cc: dsterba, linux-btrfs

On Wed, 2014-10-29 at 18:51 +0800, Anand Jain wrote:
> There is a compatibility issue with older kernel with the progs commit id as below.
> 
> 05cd2907557ba627cfb86e60b214ea6228613a84

Which tree does this commit id belongs to?
I can't find it anywhere?

> So as of now writing to revert the above commit id.
> The brewing sysfs interface would help to fix the impending issue, which is
> seed device would fail show in 'btrfs fi show' output of a sprout device.
> 
> Signed-off-by: Anand Jain <anand.jain@oracle.com>
> ---
>  utils.c | 19 +------------------
>  1 file changed, 1 insertion(+), 18 deletions(-)
> 
> diff --git a/utils.c b/utils.c
> index a8691fe..1d1cc77 100644
> --- a/utils.c
> +++ b/utils.c
> @@ -1869,29 +1869,12 @@ int get_fs_info(char *path, struct btrfs_ioctl_fs_info_args *fi_args,
>  	if (!fi_args->num_devices)
>  		goto out;
>  
> -	/*
> -	 * with kernel patch
> -	 * btrfs: ioctl BTRFS_IOC_FS_INFO and BTRFS_IOC_DEV_INFO miss-matched with slots
> -	 * the kernel now returns total_devices which does not include
> -	 * replacing device if running.
> -	 * As we need to get dev info of the replace device if it is running,
> -	 * so just add one to fi_args->num_devices.
> -	 */
> -
> -	di_args = *di_ret = malloc((fi_args->num_devices + 1) * sizeof(*di_args));
> +	di_args = *di_ret = malloc((fi_args->num_devices) * sizeof(*di_args));
>  	if (!di_args) {
>  		ret = -errno;
>  		goto out;
>  	}
>  
> -	/* get the replace target device if it is there */
> -	ret = get_device_info(fd, i, &di_args[ndevs]);
> -	if (!ret) {
> -		ndevs++;
> -		fi_args->num_devices++;
> -	}
> -	i++;
> -
>  	for (; i <= fi_args->max_id; ++i) {
>  		BUG_ON(ndevs >= fi_args->num_devices);
>  		ret = get_device_info(fd, i, &di_args[ndevs]);



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] revert btrfs-progs: do a separate probe for _transient_ replacing device
  2014-10-29 11:41 ` Gui Hecheng
@ 2014-10-30  4:06   ` Anand Jain
  0 siblings, 0 replies; 4+ messages in thread
From: Anand Jain @ 2014-10-30  4:06 UTC (permalink / raw)
  To: Gui Hecheng; +Cc: dsterba, linux-btrfs




  my ws commit ids have changed may be when I was to trying nail down an
  issue some time back. Thanks. V2. is out.


On 10/29/2014 07:41 PM, Gui Hecheng wrote:
> On Wed, 2014-10-29 at 18:51 +0800, Anand Jain wrote:
>> There is a compatibility issue with older kernel with the progs commit id as below.
>>
>> 05cd2907557ba627cfb86e60b214ea6228613a84
>
> Which tree does this commit id belongs to?
> I can't find it anywhere?
>
>> So as of now writing to revert the above commit id.
>> The brewing sysfs interface would help to fix the impending issue, which is
>> seed device would fail show in 'btrfs fi show' output of a sprout device.
>>
>> Signed-off-by: Anand Jain <anand.jain@oracle.com>
>> ---
>>   utils.c | 19 +------------------
>>   1 file changed, 1 insertion(+), 18 deletions(-)
>>
>> diff --git a/utils.c b/utils.c
>> index a8691fe..1d1cc77 100644
>> --- a/utils.c
>> +++ b/utils.c
>> @@ -1869,29 +1869,12 @@ int get_fs_info(char *path, struct btrfs_ioctl_fs_info_args *fi_args,
>>   	if (!fi_args->num_devices)
>>   		goto out;
>>
>> -	/*
>> -	 * with kernel patch
>> -	 * btrfs: ioctl BTRFS_IOC_FS_INFO and BTRFS_IOC_DEV_INFO miss-matched with slots
>> -	 * the kernel now returns total_devices which does not include
>> -	 * replacing device if running.
>> -	 * As we need to get dev info of the replace device if it is running,
>> -	 * so just add one to fi_args->num_devices.
>> -	 */
>> -
>> -	di_args = *di_ret = malloc((fi_args->num_devices + 1) * sizeof(*di_args));
>> +	di_args = *di_ret = malloc((fi_args->num_devices) * sizeof(*di_args));
>>   	if (!di_args) {
>>   		ret = -errno;
>>   		goto out;
>>   	}
>>
>> -	/* get the replace target device if it is there */
>> -	ret = get_device_info(fd, i, &di_args[ndevs]);
>> -	if (!ret) {
>> -		ndevs++;
>> -		fi_args->num_devices++;
>> -	}
>> -	i++;
>> -
>>   	for (; i <= fi_args->max_id; ++i) {
>>   		BUG_ON(ndevs >= fi_args->num_devices);
>>   		ret = get_device_info(fd, i, &di_args[ndevs]);
>
>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH v2] revert btrfs-progs: do a separate probe for _transient_ replacing device
  2014-10-29 10:51 [PATCH] revert btrfs-progs: do a separate probe for _transient_ replacing device Anand Jain
  2014-10-29 11:41 ` Gui Hecheng
@ 2014-10-30  4:43 ` Anand Jain
  1 sibling, 0 replies; 4+ messages in thread
From: Anand Jain @ 2014-10-30  4:43 UTC (permalink / raw)
  To: linux-btrfs

There is a compatibility issue with older kernel with the progs commit id as below.

d0588bfa479409b2a0f6243f894338a01a56221a
btrfs-progs: do a separate probe for _transient_ replacing device

So as of now writing to revert the above commit id.
The brewing sysfs interface would help to fix the impending issue, which is
seed device would fail show in 'btrfs fi show' output of a sprout device.

Signed-off-by: Anand Jain <anand.jain@oracle.com>
---
 v2: update commit with correct commit which this patch will revert

 utils.c | 19 +------------------
 1 file changed, 1 insertion(+), 18 deletions(-)

diff --git a/utils.c b/utils.c
index a8691fe..1d1cc77 100644
--- a/utils.c
+++ b/utils.c
@@ -1869,29 +1869,12 @@ int get_fs_info(char *path, struct btrfs_ioctl_fs_info_args *fi_args,
 	if (!fi_args->num_devices)
 		goto out;
 
-	/*
-	 * with kernel patch
-	 * btrfs: ioctl BTRFS_IOC_FS_INFO and BTRFS_IOC_DEV_INFO miss-matched with slots
-	 * the kernel now returns total_devices which does not include
-	 * replacing device if running.
-	 * As we need to get dev info of the replace device if it is running,
-	 * so just add one to fi_args->num_devices.
-	 */
-
-	di_args = *di_ret = malloc((fi_args->num_devices + 1) * sizeof(*di_args));
+	di_args = *di_ret = malloc((fi_args->num_devices) * sizeof(*di_args));
 	if (!di_args) {
 		ret = -errno;
 		goto out;
 	}
 
-	/* get the replace target device if it is there */
-	ret = get_device_info(fd, i, &di_args[ndevs]);
-	if (!ret) {
-		ndevs++;
-		fi_args->num_devices++;
-	}
-	i++;
-
 	for (; i <= fi_args->max_id; ++i) {
 		BUG_ON(ndevs >= fi_args->num_devices);
 		ret = get_device_info(fd, i, &di_args[ndevs]);
-- 
2.0.0.153.g79dcccc


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2014-10-30  4:02 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-10-29 10:51 [PATCH] revert btrfs-progs: do a separate probe for _transient_ replacing device Anand Jain
2014-10-29 11:41 ` Gui Hecheng
2014-10-30  4:06   ` Anand Jain
2014-10-30  4:43 ` [PATCH v2] " Anand Jain

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox