[PATCH] #13594: Avoid race in nscd

Roland McGrath roland@hack.frob.com
Mon May 14 20:18:00 GMT 2012


> +/* Copyright (C) 1998-2012  Free Software Foundation, Inc.

Excess space here.

>   @@ -100,9 +99,27 @@ libc_freeres_fn (hst_map_free)

Looks like a pasting problem in the patch.

> +  while (__builtin_expect
> +	 (atomic_compare_and_exchange_val_acq (&__hst_map_handle.lock,
> +					       1, 0) != 0, 0))
> +    {
> +      /* XXX Best number of rounds?  */
> +      if (__builtin_expect (++cnt > 5, 0))
> +	return 0;

Why limit the rounds?  Is it even kosher to return zero here?
What effect does it have?

> -    return 0;
> +    retval =  0;

Excess space here.


Thanks,
Roland



More information about the Libc-alpha mailing list