(2010/11/18 17:28), Philipp Hahn wrote:
> Hello,
> 
> Am Donnerstag 18 November 2010 01:41:39 schrieb Hidetoshi Seto:
>> This patch introduce a fallback mechanism for old systems that do not
>> support utimensat().  This fix build failure with following warnings:
> 
>> +#ifdef CONFIG_UTIMENSAT
>> +    return utimensat(dirfd, path, times, flags);
>> +#else
>> +    /* Fallback: use utimes() instead of utimensat() */
> 
> Since we also had a problem with utimestat() some time ago with Samba
> <http://lists.samba.org/archive/samba-technical/2010-November/074613.html>
> I'd like to comment on that:
> 
> Your have to be careful about compile-time-detection and runtime-detection: 
> If 
> you later run your utimestat()-enabled binary on an older kernel not 
> supporting that syscall, you get -1 as the return-value and errno=ENOSYS. So 
> even if you detected utimesatat() during compile-time, please always provide 
> a fallback for run-time.
> This is less important for people compiling there own version of kvm, but is 
> essential for Linux distributions, since people often run newer kvm versions 
> on older kernels.

Hum, you have a good point.

Well, then I'll change it like:

-#ifdef CONFIG_UTIMENSAT
-    return utimensat(dirfd, path, times, flags);
-#else
+    {
+        int ret = utimensat(dirfd, path, times, flags);
+        if (ret != -1 || errno != ENOSYS) {
+            return ret;
+        }
+    }


Thanks,
H.Seto

--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to