summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorguenther <guenther@openbsd.org>2014-05-07 02:57:41 +0000
committerguenther <guenther@openbsd.org>2014-05-07 02:57:41 +0000
commit3d0bcde7f730627c688fcaacf4c7ddbd676fe658 (patch)
treec482357f66cabf6f3a8e54d526b93ecaa8bd61b5
parentpass daemon_flags to nsd-control when used to check/reload/stop nsd, (diff)
downloadwireguard-openbsd-3d0bcde7f730627c688fcaacf4c7ddbd676fe658.tar.xz
wireguard-openbsd-3d0bcde7f730627c688fcaacf4c7ddbd676fe658.zip
Fix ext2fs atime and mtime handling that I broke from an airport
lounge after n2k14. Prototype patch from zhuk@ ok zhuk@ krw@ tedu@
Diffstat (limited to '')
-rw-r--r--sys/ufs/ufs/inode.h10
1 files changed, 8 insertions, 2 deletions
diff --git a/sys/ufs/ufs/inode.h b/sys/ufs/ufs/inode.h
index 8acfa30893e..d7989992237 100644
--- a/sys/ufs/ufs/inode.h
+++ b/sys/ufs/ufs/inode.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: inode.h,v 1.44 2014/04/14 22:25:40 beck Exp $ */
+/* $OpenBSD: inode.h,v 1.45 2014/05/07 02:57:41 guenther Exp $ */
/* $NetBSD: inode.h,v 1.8 1995/06/15 23:22:50 cgd Exp $ */
/*
@@ -316,8 +316,14 @@ struct indir {
#define EXT2FS_ITIMES(ip) do { \
if ((ip)->i_flag & (IN_ACCESS | IN_CHANGE | IN_UPDATE)) { \
(ip)->i_flag |= IN_MODIFIED; \
- if ((ip)->i_flag & IN_CHANGE) \
+ if ((ip)->i_flag & IN_ACCESS) \
+ (ip)->i_e2fs_atime = time_second; \
+ if ((ip)->i_flag & IN_UPDATE) \
+ (ip)->i_e2fs_mtime = time_second; \
+ if ((ip)->i_flag & IN_CHANGE) { \
(ip)->i_e2fs_ctime = time_second; \
+ (ip)->i_modrev++; \
+ } \
(ip)->i_flag &= ~(IN_ACCESS | IN_CHANGE | IN_UPDATE); \
} \
} while (0)