Birthtime handling in ZFS

Garrett Cooper yanegomi at gmail.com
Sun Dec 2 23:56:36 UTC 2012


On Sun, Dec 2, 2012 at 3:20 PM, Phil Stone <phil.stone at gmx.com> wrote:
> I'm using 8.3-RELEASE-p5
> It seems that st_birthtime returned by lstat(2) on a zfs file always equals ctime instead of birthtime.
>
> Looking at /base/stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c
> Function zfs_getattr()
> Line 2682 :
> SA_ADD_BULK_ATTR(bulk, count, SA_ZPL_CTIME(zfsvfs), NULL, &crtime, 16);
>
> Shouldn't it be :
> SA_ADD_BULK_ATTR(bulk, count, SA_ZPL_CRTIME(zfsvfs), NULL, &crtime, 16);
> instead ?
>
> Same in stable/9 and head.

    Yup, it's a regression introduced with the ZFS v28 import as I
noted in the PR [1]. The patch attached ot the PR will apply to
stable/9 and HEAD and should apply to stable/8.
Thanks!
-Garrett

1. http://www.freebsd.org/cgi/query-pr.cgi?pr=174067


More information about the freebsd-fs mailing list