All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ctl: should return NULL when dmsetup fail in find_dm_name
@ 2013-03-11 12:06 fanchaoting
  2013-03-25  9:34 ` Benny Halevy
  0 siblings, 1 reply; 3+ messages in thread
From: fanchaoting @ 2013-03-11 12:06 UTC (permalink / raw)
  To: bhalevy; +Cc: linux-nfs@vger.kernel.org

when dmsetup fail in find_dm_name, it should return NULL,if don't
do it. it will cause core dump in get_dm when do free(name).

Signed-off-by: fanchaoting<fanchaoting@cn.fujitsu.com>

---
 ctl.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/ctl.c b/ctl.c
index 2071b0e..0ac1c44 100644
--- a/ctl.c
+++ b/ctl.c
@@ -489,7 +489,7 @@ find_dm_name(int major, int minor)
        if (((fd = get_output("/sbin/dmsetup", argv)) == -1) ||
            ((fp = fdopen(fd, "r")) == NULL)) {
                printf("%s: get_output/fdopen failed\n", __func__);
-               return;
+               return NULL;
        }
        while (fgets(buf, sizeof (buf), fp) != NULL) {
                t = __token_init(buf, '\t');
--
1.7.1


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

* Re: [PATCH] ctl: should return NULL when dmsetup fail in find_dm_name
  2013-03-11 12:06 [PATCH] ctl: should return NULL when dmsetup fail in find_dm_name fanchaoting
@ 2013-03-25  9:34 ` Benny Halevy
  2013-03-25 10:03   ` fanchaoting
  0 siblings, 1 reply; 3+ messages in thread
From: Benny Halevy @ 2013-03-25  9:34 UTC (permalink / raw)
  To: fanchaoting; +Cc: linux-nfs@vger.kernel.org

On 2013-03-11 14:06, fanchaoting wrote:
> when dmsetup fail in find_dm_name, it should return NULL,if don't
> do it. it will cause core dump in get_dm when do free(name).

Thanks, but what version are you using?
This was already fixed here:
http://git.linux-nfs.org/?p=bhalevy/pnfsd-block-ctl.git;a=commitdiff;h=9082efe1dc12248e530d4200d7150a286abea922

Please update to the latest version
git://linux-nfs.org/~bhalevy/pnfsd-block-ctl.git

Benny

> 
> Signed-off-by: fanchaoting<fanchaoting@cn.fujitsu.com>
> 
> ---
>  ctl.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/ctl.c b/ctl.c
> index 2071b0e..0ac1c44 100644
> --- a/ctl.c
> +++ b/ctl.c
> @@ -489,7 +489,7 @@ find_dm_name(int major, int minor)
>         if (((fd = get_output("/sbin/dmsetup", argv)) == -1) ||
>             ((fp = fdopen(fd, "r")) == NULL)) {
>                 printf("%s: get_output/fdopen failed\n", __func__);
> -               return;
> +               return NULL;
>         }
>         while (fgets(buf, sizeof (buf), fp) != NULL) {
>                 t = __token_init(buf, '\t');
> --
> 1.7.1
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 

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

* Re: [PATCH] ctl: should return NULL when dmsetup fail in find_dm_name
  2013-03-25  9:34 ` Benny Halevy
@ 2013-03-25 10:03   ` fanchaoting
  0 siblings, 0 replies; 3+ messages in thread
From: fanchaoting @ 2013-03-25 10:03 UTC (permalink / raw)
  To: Benny Halevy; +Cc: linux-nfs@vger.kernel.org

Benny Halevy 写道:
> On 2013-03-11 14:06, fanchaoting wrote:
>> when dmsetup fail in find_dm_name, it should return NULL,if don't
>> do it. it will cause core dump in get_dm when do free(name).
> 
> Thanks, but what version are you using?
> This was already fixed here:
> http://git.linux-nfs.org/?p=bhalevy/pnfsd-block-ctl.git;a=commitdiff;h=9082efe1dc12248e530d4200d7150a286abea922
> 
> Please update to the latest version
> git://linux-nfs.org/~bhalevy/pnfsd-block-ctl.git
> 

thanks for telling me .

> Benny
> 
>> Signed-off-by: fanchaoting<fanchaoting@cn.fujitsu.com>
>>
>> ---
>>  ctl.c |    2 +-
>>  1 files changed, 1 insertions(+), 1 deletions(-)
>>
>> diff --git a/ctl.c b/ctl.c
>> index 2071b0e..0ac1c44 100644
>> --- a/ctl.c
>> +++ b/ctl.c
>> @@ -489,7 +489,7 @@ find_dm_name(int major, int minor)
>>         if (((fd = get_output("/sbin/dmsetup", argv)) == -1) ||
>>             ((fp = fdopen(fd, "r")) == NULL)) {
>>                 printf("%s: get_output/fdopen failed\n", __func__);
>> -               return;
>> +               return NULL;
>>         }
>>         while (fgets(buf, sizeof (buf), fp) != NULL) {
>>                 t = __token_init(buf, '\t');
>> --
>> 1.7.1
>>
>> --
>> To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
>> the body of a message to majordomo@vger.kernel.org
>> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 
> 




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

end of thread, other threads:[~2013-03-25 10:02 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-03-11 12:06 [PATCH] ctl: should return NULL when dmsetup fail in find_dm_name fanchaoting
2013-03-25  9:34 ` Benny Halevy
2013-03-25 10:03   ` fanchaoting

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.