Already initialize the vfs timestamps inside the cdev upon allocation.
In the MPSAFE TTY branch I noticed the vfs timestamps inside devfs were allocated with 0, where the getattr() routine bumps the timestamps to boottime if the value is below 3600. The reason why it has been designed like this, is because timestamps during boot are likely to be invalid. This means that device nodes that are created on demand (posix_openpt()) have timestamps with a value of boottime, which is not what we want. Solve this by calling vfs_timestamp() inside devfs_alloc(). Discussed with: kib
This commit is contained in:
parent
8eda466e5c
commit
b03d0693f2
@ -117,6 +117,7 @@ devfs_alloc(void)
|
||||
{
|
||||
struct cdev_priv *cdp;
|
||||
struct cdev *cdev;
|
||||
struct timespec ts;
|
||||
|
||||
cdp = malloc(sizeof *cdp, M_CDEVP, M_USE_RESERVE | M_ZERO | M_WAITOK);
|
||||
|
||||
@ -128,6 +129,9 @@ devfs_alloc(void)
|
||||
|
||||
cdev->si_name = cdev->__si_namebuf;
|
||||
LIST_INIT(&cdev->si_children);
|
||||
vfs_timestamp(&ts);
|
||||
cdev->si_atime = cdev->si_mtime = cdev->si_ctime = ts;
|
||||
|
||||
return (cdev);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user