When renaming a file, we have to modify the mtime of the directory holding

it, not the mtime of the file itself.  This fixes the problems exposed when
unpacking software under a tmpfs and trying to build it because dependencies
were not calculated properly (e.g. autoconf 2.60 as reported by tls@).
This commit is contained in:
jmmv 2006-10-30 15:09:47 +00:00
parent 286dc06fc6
commit 2185c98874
2 changed files with 6 additions and 6 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: tmpfs_subr.c,v 1.24 2006/10/12 01:32:14 christos Exp $ */
/* $NetBSD: tmpfs_subr.c,v 1.25 2006/10/30 15:09:47 jmmv Exp $ */
/*
* Copyright (c) 2005, 2006 The NetBSD Foundation, Inc.
@ -42,7 +42,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: tmpfs_subr.c,v 1.24 2006/10/12 01:32:14 christos Exp $");
__KERNEL_RCSID(0, "$NetBSD: tmpfs_subr.c,v 1.25 2006/10/30 15:09:47 jmmv Exp $");
#include <sys/param.h>
#include <sys/dirent.h>
@ -1231,7 +1231,6 @@ tmpfs_itimes(struct vnode *vp, const struct timespec *acc,
if ((node->tn_status & (TMPFS_NODE_ACCESSED | TMPFS_NODE_MODIFIED |
TMPFS_NODE_CHANGED)) == 0)
return;
getnanotime(&now);
if (node->tn_status & TMPFS_NODE_ACCESSED) {
if (acc == NULL)
@ -1241,6 +1240,7 @@ tmpfs_itimes(struct vnode *vp, const struct timespec *acc,
if (node->tn_status & TMPFS_NODE_MODIFIED) {
if (mod == NULL)
mod = &now;
//printf("vp %p, setting mtime to %ld\n", vp, mod->tv_sec);
node->tn_mtime = *mod;
}
if (node->tn_status & TMPFS_NODE_CHANGED)

View File

@ -1,4 +1,4 @@
/* $NetBSD: tmpfs_vnops.c,v 1.25 2006/07/23 22:06:10 ad Exp $ */
/* $NetBSD: tmpfs_vnops.c,v 1.26 2006/10/30 15:09:47 jmmv Exp $ */
/*
* Copyright (c) 2005, 2006 The NetBSD Foundation, Inc.
@ -42,7 +42,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: tmpfs_vnops.c,v 1.25 2006/07/23 22:06:10 ad Exp $");
__KERNEL_RCSID(0, "$NetBSD: tmpfs_vnops.c,v 1.26 2006/10/30 15:09:47 jmmv Exp $");
#include <sys/param.h>
#include <sys/dirent.h>
@ -928,7 +928,7 @@ tmpfs_rename(void *v)
memcpy(newname, tcnp->cn_nameptr, tcnp->cn_namelen);
de->td_name = newname;
fnode->tn_status |= TMPFS_NODE_MODIFIED;
tdnode->tn_status |= TMPFS_NODE_MODIFIED;
}
/* If we are overwriting an entry, we have to remove the old one