This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] #13594: Avoid race in nscd
- From: Roland McGrath <roland at hack dot frob dot com>
- To: Andreas Jaeger <aj at suse dot de>
- Cc: libc-alpha at sourceware dot org
- Date: Mon, 14 May 2012 13:17:56 -0700 (PDT)
- Subject: Re: [PATCH] #13594: Avoid race in nscd
- References: <4FB166E3.10808@suse.de>
> +/* 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