[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] utimens.c: work around (Xen-related?) kernel bug
From: |
Paul Eggert |
Subject: |
Re: [PATCH] utimens.c: work around (Xen-related?) kernel bug |
Date: |
Wed, 04 Jun 2008 15:19:15 -0700 |
User-agent: |
Gnus/5.11 (Gnus v5.11) Emacs/22.2 (gnu/linux) |
Jim Meyering <address@hidden> writes:
> + if (result == 280)
> + result = 0;
Ouch. I suppose there's no help for it; we need a runtime check to
work around that kernel bug. The bug has been reported only for Linux
kernels, right? If so, I suggest the following alternative:
#ifdef __linux__
/* Work around what might be a kernel bug:
http://bugzilla.redhat.com/442352
http://bugzilla.redhat.com/449910
It appears that utimensat can mistakenly return 280 rather
than 0 to indicate success.
FIXME: remove in 2010 or whenever the offending kernels
are no longer in common use. */
if (0 < result)
result = 0;
#endif
This won't cause any difference in behavior on working Linux kernels,
but is more likely to catch minor variants of the broken Linux
kernels. Also, it should generate faster code on all Linux kernels.
Finally, it doesn't penalize code non-Linux kernels.