From mboxrd@z Thu Jan 1 00:00:00 1970 From: Hidetoshi Seto Subject: Re: [PATCH v4] virtio-9p: fix build on !CONFIG_UTIMENSAT Date: Thu, 18 Nov 2010 18:05:59 +0900 Message-ID: <4CE4EC77.6030105@jp.fujitsu.com> References: <4CE47643.7030808@jp.fujitsu.com> <201011180928.16981.hahn@univention.de> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-2022-JP Content-Transfer-Encoding: 7bit Cc: kvm@vger.kernel.org To: Philipp Hahn Return-path: Received: from fgwmail6.fujitsu.co.jp ([192.51.44.36]:37399 "EHLO fgwmail6.fujitsu.co.jp" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755041Ab0KRJGW (ORCPT ); Thu, 18 Nov 2010 04:06:22 -0500 Received: from m5.gw.fujitsu.co.jp ([10.0.50.75]) by fgwmail6.fujitsu.co.jp (Fujitsu Gateway) with ESMTP id oAI96Ko7009404 for (envelope-from seto.hidetoshi@jp.fujitsu.com); Thu, 18 Nov 2010 18:06:20 +0900 Received: from smail (m5 [127.0.0.1]) by outgoing.m5.gw.fujitsu.co.jp (Postfix) with ESMTP id 4456D45DE58 for ; Thu, 18 Nov 2010 18:06:20 +0900 (JST) Received: from s5.gw.fujitsu.co.jp (s5.gw.fujitsu.co.jp [10.0.50.95]) by m5.gw.fujitsu.co.jp (Postfix) with ESMTP id C1CD245DE53 for ; Thu, 18 Nov 2010 18:06:19 +0900 (JST) Received: from s5.gw.fujitsu.co.jp (localhost.localdomain [127.0.0.1]) by s5.gw.fujitsu.co.jp (Postfix) with ESMTP id A4F32E18001 for ; Thu, 18 Nov 2010 18:06:17 +0900 (JST) Received: from m106.s.css.fujitsu.com (m106.s.css.fujitsu.com [10.249.87.106]) by s5.gw.fujitsu.co.jp (Postfix) with ESMTP id F1ED2E08007 for ; Thu, 18 Nov 2010 18:06:15 +0900 (JST) In-Reply-To: <201011180928.16981.hahn@univention.de> Sender: kvm-owner@vger.kernel.org List-ID: (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 > > 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