All of lore.kernel.org
 help / color / mirror / Atom feed
From: Hidetoshi Seto <seto.hidetoshi@jp.fujitsu.com>
To: Philipp Hahn <hahn@univention.de>
Cc: kvm@vger.kernel.org
Subject: Re: [PATCH v4] virtio-9p: fix build on !CONFIG_UTIMENSAT
Date: Thu, 18 Nov 2010 18:05:59 +0900	[thread overview]
Message-ID: <4CE4EC77.6030105@jp.fujitsu.com> (raw)
In-Reply-To: <201011180928.16981.hahn@univention.de>

(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


  reply	other threads:[~2010-11-18  9:06 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-11-18  0:41 [PATCH v4] virtio-9p: fix build on !CONFIG_UTIMENSAT Hidetoshi Seto
2010-11-18  0:41 ` [Qemu-devel] " Hidetoshi Seto
2010-11-18  8:02 ` Jes Sorensen
2010-11-18  8:02   ` [Qemu-devel] " Jes Sorensen
2010-11-18  8:48   ` Hidetoshi Seto
2010-11-18  8:48     ` [Qemu-devel] " Hidetoshi Seto
2010-11-18  9:09     ` Jes Sorensen
2010-11-18  9:09       ` [Qemu-devel] " Jes Sorensen
2010-11-18  8:28 ` Philipp Hahn
2010-11-18  9:05   ` Hidetoshi Seto [this message]
2010-11-18 13:12     ` Philipp Hahn

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4CE4EC77.6030105@jp.fujitsu.com \
    --to=seto.hidetoshi@jp.fujitsu.com \
    --cc=hahn@univention.de \
    --cc=kvm@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.