[redhat-lspp] RE: [IPSEC] flow: Cache negative results

Joy Latten latten at austin.ibm.com
Tue Jan 16 19:40:45 UTC 2007


>> > > We jump to the fail without releasing the lock.
>> > > Instead of a "fail", how about just breaking from the loop
>> > > and falling through to release lock and return...
>> >
>> > Sure. That should work too. Thanks.
>>
>> Also, you would have to make sure pol is set to NULL
>> in this case.
>
>I see lspp63 could use the following patch that does the
>above:
>
>--- linux-2.6.18.i386.old/net/xfrm/xfrm_policy.c	2007-01-16
>10:36:23.000000000 -0600
>+++ linux-2.6.18.i386/net/xfrm/xfrm_policy.c	2007-01-16
>10:36:59.000000000 -0600
>@@ -627,9 +627,11 @@ static int xfrm_policy_lookup(struct flo
> 				xfrm_pol_hold(pol);
> 				break;
> 			} else if (ret == -ESRCH)
>-					ret = 0;
>-			else
>+				ret = 0;
>+			else {
>+				pol = NULL;
> 				break;
>+			}
> 		}
> 	}
> 	read_unlock_bh(&xfrm_policy_lock);

Yes! I agree. This looks good to me. 

Regards,
Joy




More information about the redhat-lspp mailing list