Date: Mon, 18 Mar 2019 19:26:36 +0000 (UTC) From: Ed Maste <emaste@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r345281 - in head/usr.sbin/makefs: . tests Message-ID: <201903181926.x2IJQaRh054778@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: emaste Date: Mon Mar 18 19:26:36 2019 New Revision: 345281 URL: https://svnweb.freebsd.org/changeset/base/345281 Log: makefs: Fix "time" mtree attribute handling When processing mtree(5) MANIFEST files, makefs(8) previously threw an error if it encountered an entry whose "time" attribute contained a non-zero subsecond component (e.g. time=1551620152.987220000). Update the handling logic to properly assign the subsecond component if built with nanosecond support, or silently discard it otherwise. Also, re-enable the time attribute for the kyua tests. PR: 194703 Submitted by: Mitchell Horne <mhorne063@gmail.com> Differential Revision: https://reviews.freebsd.org/D19627 Modified: head/usr.sbin/makefs/mtree.c head/usr.sbin/makefs/tests/makefs_tests_common.sh Modified: head/usr.sbin/makefs/mtree.c ============================================================================== --- head/usr.sbin/makefs/mtree.c Mon Mar 18 19:23:19 2019 (r345280) +++ head/usr.sbin/makefs/mtree.c Mon Mar 18 19:26:36 2019 (r345281) @@ -644,14 +644,17 @@ read_mtree_keywords(FILE *fp, fsnode *node) st->st_atime = num; st->st_ctime = num; st->st_mtime = num; +#if HAVE_STRUCT_STAT_ST_MTIMENSEC if (p == NULL) break; error = read_number(p, 10, &num, 0, INTMAX_MAX); if (error) break; - if (num != 0) - error = EINVAL; + st->st_atimensec = num; + st->st_ctimensec = num; + st->st_mtimensec = num; +#endif } else if (strcmp(keyword, "type") == 0) { if (value == NULL) { error = ENOATTR; Modified: head/usr.sbin/makefs/tests/makefs_tests_common.sh ============================================================================== --- head/usr.sbin/makefs/tests/makefs_tests_common.sh Mon Mar 18 19:23:19 2019 (r345280) +++ head/usr.sbin/makefs/tests/makefs_tests_common.sh Mon Mar 18 19:26:36 2019 (r345281) @@ -29,13 +29,7 @@ KB=1024 : ${TMPDIR=/tmp} -# TODO: add mtree `time` support; get a lot of errors like this right now when -# passing generating disk images with keyword mtree support, like: -# -# `[...]/mtree.spec:8: error: time: invalid value '1446458503'` -# -#DEFAULT_MTREE_KEYWORDS="type,mode,gid,uid,size,link,time" -DEFAULT_MTREE_KEYWORDS="type,mode,gid,uid,size,link" +DEFAULT_MTREE_KEYWORDS="type,mode,gid,uid,size,link,time" TEST_IMAGE="$TMPDIR/test.img" TEST_INPUTS_DIR="$TMPDIR/inputs" TEST_MD_DEVICE_FILE="$TMPDIR/md.output"
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201903181926.x2IJQaRh054778>