Initialize birthtime fields in vn_stat() to prevent stat(2) from
returning uninitialized birthtime. Most file systems don't initialize birthtime properly in their VOP_GETTATTR(). Submitted by: Jaakko Heinonen <jh saunalahti fi> Reviewed by: bde Discussed on: freebsd-fs MFC after: 1 month
This commit is contained in:
parent
cb959fa205
commit
ea60a5f526
@ -703,6 +703,15 @@ vn_stat(vp, sb, active_cred, file_cred, td)
|
||||
#endif
|
||||
|
||||
vap = &vattr;
|
||||
|
||||
/*
|
||||
* Initialize defaults for new and unusual fields, so that file
|
||||
* systems which don't support these fields don't need to know
|
||||
* about them.
|
||||
*/
|
||||
vap->va_birthtime.tv_sec = -1;
|
||||
vap->va_birthtime.tv_nsec = 0;
|
||||
|
||||
error = VOP_GETATTR(vp, vap, active_cred);
|
||||
if (error)
|
||||
return (error);
|
||||
|
Loading…
x
Reference in New Issue
Block a user