Bug 216443

Summary: lib/libarchive/functional_test:test_write_disk_times fails with a ZFS /tmp
Product: Base System Reporter: Alan Somers <asomers>
Component: testsAssignee: Alan Somers <asomers>
Status: Closed FIXED    
Severity: Affects Only Me Flags: asomers: mfc-stable11+
Priority: ---    
Version: CURRENT   
Hardware: Any   
OS: Any   

Description Alan Somers freebsd_committer freebsd_triage 2017-01-24 18:01:01 UTC
If /tmp is on ZFS, the lib/libarchive/functional_test:test_write_disk_times test will fail with the following output:

$ kyua debug functional_test:test_write_disk_times
Executing command [ /usr/tests/lib/libarchive/libarchive_test -d -r /usr/tests/lib/libarchive -v test_write_disk_times ]
Fail: program did not exit cleanly
stdout:

If tests fail or crash, details will be in:
   /tmp/kyua.IhaREU/2/work/libarchive_test.2017-01-24T17.58.54-000

Reference files will be read from: /usr/tests/lib/libarchive
Exercising: libarchive 3.2.2 zlib/1.2.10 liblzma/5.2.3 bz2lib/1.0.6
395: test_write_disk_times
/usr/home/alans/freebsd/head/contrib/libarchive/libarchive/test/test_write_disk_times.c:130: File file11 has btime 1485280734.727379000, expected 3456789.000012000

stderr:
 *** forcing core dump so failure can be debugged ***

Files left in work directory after failure: libarchive_test.2017-01-24T17.58.54-000
functional_test:test_write_disk_times  ->  failed: atf-check failed; see the output of the test for details





The reason seems to be that ZFS does not support setting birthtime.  I'm working on a patch to fix it.
Comment 1 Alan Somers freebsd_committer freebsd_triage 2017-02-14 20:20:00 UTC
r313483 | asomers | 2017-02-09 14:30:53 -0700 (Thu, 09 Feb 2017) | 24 lines

Fix setting birthtime in ZFS

sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c
        * In zfs_freebsd_setattr, if the caller wants to set the birthtime,
          set the bits that zfs_settattr expects

        * In zfs_setattr, if XAT_CREATETIME is set, set xoa_createtime,
          expected by zfs_xvattr_set.  The two levels of indirection seem
          excessive, but it minimizes diffs vs OpenZFS.

        * In zfs_setattr, check for overflow of va_birthtime (from delphij)

        * Remove red herring in zfs_getattr

sys/cddl/contrib/opensolaris/uts/common/sys/vnode.h
        * Un-booby-trap some macros

New tests are under review at https://github.com/pjd/pjdfstest/pull/6

Reviewed by:    avg
MFC after:      3 weeks
Sponsored by:   Spectra Logic Corp
Differential Revision:  https://reviews.freebsd.org/D9353
Comment 2 Alan Somers freebsd_committer freebsd_triage 2017-04-24 16:22:20 UTC
MFCed to stable/11 by r316391.  I'm not sure why bugzilla didn't notice.