[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] Re: [PATCH] virtio-9p: fix build on !CONFIG_UTIMENSAT v2
From: |
Chris Wright |
Subject: |
[Qemu-devel] Re: [PATCH] virtio-9p: fix build on !CONFIG_UTIMENSAT v2 |
Date: |
Sat, 13 Nov 2010 21:58:22 -0800 |
User-agent: |
Mutt/1.5.20 (2009-08-17) |
* Hidetoshi Seto (address@hidden) wrote:
> + /*
> + * Fallback: use utimes() instead of utimensat().
> + * See commit 74bc02b2d2272dc88fb98d43e631eb154717f517 for known problem.
> + */
> + struct timeval tv[2];
> + int i;
> +
> + for (i = 0; i < 2; i++) {
> + if (times[i].tv_nsec == UTIME_OMIT || times[i].tv_nsec == UTIME_NOW)
> {
> + tv[i].tv_sec = 0;
> + tv[i].tv_usec = 0;
I don't think this is accurate in either case. It will set the
atime, mtime, or both to 0.
For UTIME_NOW (in both) we'd simply pass NULL to utimes(2). For
UTIME_OMIT (in both) we'd simply skip the call to utimes(2) altogether.
The harder part is a mixed mode (i.e. the truncate fix mentioned in the
above commit). I think the only way to handle UTIME_NOW in one is to
call gettimeofday (or clock_gettime for better resolution) to find out
what current time is. And for UTIME_OMIT call stat to find out what the
current setting is and reset to that value. Both of those cases can
possibly zero out the extra precision (providing only seconds
resolution).
thanks,
-chris
- Re: [Qemu-devel] qemu-kvm build issue on RHEL5.1, Chris Wright, 2010/11/04
- Re: [Qemu-devel] qemu-kvm build issue on RHEL5.1, Hidetoshi Seto, 2010/11/05
- [Qemu-devel] [PATCH] virtio-9p: fix build on !CONFIG_UTIMENSAT v2, Hidetoshi Seto, 2010/11/05
- Re: [Qemu-devel] [PATCH] virtio-9p: fix build on !CONFIG_UTIMENSAT v2, M. Mohan Kumar, 2010/11/08
- [Qemu-devel] Re: [PATCH] virtio-9p: fix build on !CONFIG_UTIMENSAT v2,
Chris Wright <=
- Re: [Qemu-devel] Re: [PATCH] virtio-9p: fix build on !CONFIG_UTIMENSAT v2, Hidetoshi Seto, 2010/11/14
- [Qemu-devel] [PATCH v3] virtio-9p: fix build on !CONFIG_UTIMENSAT, Hidetoshi Seto, 2010/11/14
- [Qemu-devel] Re: [PATCH v3] virtio-9p: fix build on !CONFIG_UTIMENSAT, Chris Wright, 2010/11/14
- [Qemu-devel] Re: [PATCH v3] virtio-9p: fix build on !CONFIG_UTIMENSAT, M. Mohan Kumar, 2010/11/15
- Re: [Qemu-devel] [PATCH v3] virtio-9p: fix build on !CONFIG_UTIMENSAT, Anthony Liguori, 2010/11/21
- Re: [Qemu-devel] [PATCH v3] virtio-9p: fix build on !CONFIG_UTIMENSAT, Jes Sorensen, 2010/11/22