lkml.org 
[lkml]   [2011]   [Mar]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH] SUNRPC: svc_register error overwritten in next iteration
From
Date

On Mar 14, 2011, at 6:36 PM, J. Bruce Fields wrote:

> On Sat, Mar 12, 2011 at 02:27:35PM +0100, roel wrote:
>> The break is in the inner loop, the svc_register() error is overwritten
>> in the next iteration. Only the error in the last iteration is returned.
>>
>> Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
>> ---
>> net/sunrpc/svc.c | 2 ++
>> 1 files changed, 2 insertions(+), 0 deletions(-)
>>
>> Is this needed?
>>
>> diff --git a/net/sunrpc/svc.c b/net/sunrpc/svc.c
>> index 08e05a8..5fd08c0 100644
>> --- a/net/sunrpc/svc.c
>> +++ b/net/sunrpc/svc.c
>> @@ -889,6 +889,8 @@ int svc_register(const struct svc_serv *serv, const int family,
>> if (error < 0)
>> break;
>
> May as well just "goto out" or "return error" here?
>
> But: aren't we missing some cleanup? If we succesfully register one
> program then fail at a second one, don't we need to unregister the
> first?

Right. I don't understand what is the intended effect here (of the original code): Best effort registration, or "all or none"?

> --b.
>
>> }
>> + if (error < 0)
>> + break;
>> }
>>
>> return error;
> --
> 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

--
Chuck Lever
chuck[dot]lever[at]oracle[dot]com






\
 
 \ /
  Last update: 2011-03-15 16:47    [from the cache]
©2003-2014 Jasper Spaans. hosted at Digital Ocean