Update directory times immediately after an entry is created or

removed.  Postponing it until tmpfs_getattr() is called causes
discordant values reported for file times vs. directory times.

Reported and tested by:	madpilot
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
This commit is contained in:
Konstantin Belousov 2015-01-31 21:31:53 +00:00
parent 8e35ef81cc
commit e0a60ae16a

View File

@ -991,6 +991,7 @@ tmpfs_dir_attach(struct vnode *vp, struct tmpfs_dirent *de)
dnode->tn_size += sizeof(struct tmpfs_dirent);
dnode->tn_status |= TMPFS_NODE_ACCESSED | TMPFS_NODE_CHANGED | \
TMPFS_NODE_MODIFIED;
tmpfs_update(vp);
}
/*
@ -1036,6 +1037,7 @@ tmpfs_dir_detach(struct vnode *vp, struct tmpfs_dirent *de)
dnode->tn_size -= sizeof(struct tmpfs_dirent);
dnode->tn_status |= TMPFS_NODE_ACCESSED | TMPFS_NODE_CHANGED | \
TMPFS_NODE_MODIFIED;
tmpfs_update(vp);
}
void