[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: |
Jim Meyering |
Subject: |
Re: [PATCH] utimens.c: work around (Xen-related?) kernel bug |
Date: |
Thu, 05 Jun 2008 08:46:58 +0200 |
Paul Eggert <address@hidden> wrote:
> 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.
Looks good. Thanks!
I've pushed that.