From owner-svn-src-projects@freebsd.org Sun Apr 7 17:22:32 2019 Return-Path: Delivered-To: svn-src-projects@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AC8A5156593E for ; Sun, 7 Apr 2019 17:22:32 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 52B506A594; Sun, 7 Apr 2019 17:22:32 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 26AE1F507; Sun, 7 Apr 2019 17:22:32 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x37HMW9S064849; Sun, 7 Apr 2019 17:22:32 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x37HMWY0064848; Sun, 7 Apr 2019 17:22:32 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201904071722.x37HMWY0064848@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Enji Cooper Date: Sun, 7 Apr 2019 17:22:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r346014 - projects/runtime-coverage-v2/share/mk X-SVN-Group: projects X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: projects/runtime-coverage-v2/share/mk X-SVN-Commit-Revision: 346014 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 52B506A594 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.969,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Apr 2019 17:22:32 -0000 Author: ngie Date: Sun Apr 7 17:22:31 2019 New Revision: 346014 URL: https://svnweb.freebsd.org/changeset/base/346014 Log: Disable MK_COVERAGE* when cross-building Unfortunately, make tinderbox is building a copy of libclang_rt.profile*.a for the machine architecture, not the target architecture, while looking for the library under the cross-toolchain directory, with the current set of proposed changes. As such, disable MK_COVERAGE and MK_COVERAGE_SUPPORT until I work out why the library isn't being built and installed as expected. Add a comment to note the issue. Modified: projects/runtime-coverage-v2/share/mk/src.opts.mk Modified: projects/runtime-coverage-v2/share/mk/src.opts.mk ============================================================================== --- projects/runtime-coverage-v2/share/mk/src.opts.mk Sun Apr 7 16:33:22 2019 (r346013) +++ projects/runtime-coverage-v2/share/mk/src.opts.mk Sun Apr 7 17:22:31 2019 (r346014) @@ -405,6 +405,15 @@ __DEFAULT_YES_OPTIONS+=OPENMP __DEFAULT_NO_OPTIONS+=OPENMP .endif +# cross toolchains with "make universe" aren't properly building +# libclang_rt.profile*.a yet for the target platform and installing it to the +# expected location, so disable coverage support for now with clang when +# cross-building. +.if ${COMPILER_TYPE} == "clang" && ${__T} != ${__TT} +BROKEN_OPTIONS+=COVERAGE +BROKEN_OPTIONS+=COVERAGE_SUPPORT +.endif + .include # From owner-svn-src-projects@freebsd.org Mon Apr 8 18:45:46 2019 Return-Path: Delivered-To: svn-src-projects@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CAB69156538E for ; Mon, 8 Apr 2019 18:45:45 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 789DB86D57; Mon, 8 Apr 2019 18:45:45 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 38FF527641; Mon, 8 Apr 2019 18:45:45 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x38Ijj66065552; Mon, 8 Apr 2019 18:45:45 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x38Ijfdd065529; Mon, 8 Apr 2019 18:45:41 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201904081845.x38Ijfdd065529@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Mon, 8 Apr 2019 18:45:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r346043 - in projects/fuse2: sys/fs/fuse tests/sys/fs/fusefs X-SVN-Group: projects X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: in projects/fuse2: sys/fs/fuse tests/sys/fs/fusefs X-SVN-Commit-Revision: 346043 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 789DB86D57 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.99)[-0.986,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Apr 2019 18:45:46 -0000 Author: asomers Date: Mon Apr 8 18:45:41 2019 New Revision: 346043 URL: https://svnweb.freebsd.org/changeset/base/346043 Log: fusefs: cache file attributes FUSE_LOOKUP, FUSE_GETATTR, FUSE_SETATTR, FUSE_MKDIR, FUSE_LINK, FUSE_SYMLINK, FUSE_MKNOD, and FUSE_CREATE all return file attributes with a cache validity period. fusefs will now cache the attributes, if the server returns a non-zero cache validity period. This change does _not_ implement finite attr cache timeouts. That will follow as part of PR 235773. PR: 235775 Reported by: cem Sponsored by: The FreeBSD Foundation Modified: projects/fuse2/sys/fs/fuse/fuse_internal.c projects/fuse2/sys/fs/fuse/fuse_internal.h projects/fuse2/sys/fs/fuse/fuse_node.c projects/fuse2/sys/fs/fuse/fuse_node.h projects/fuse2/sys/fs/fuse/fuse_vnops.c projects/fuse2/tests/sys/fs/fusefs/allow_other.cc projects/fuse2/tests/sys/fs/fusefs/create.cc projects/fuse2/tests/sys/fs/fusefs/default_permissions.cc projects/fuse2/tests/sys/fs/fusefs/flush.cc projects/fuse2/tests/sys/fs/fusefs/fsync.cc projects/fuse2/tests/sys/fs/fusefs/getattr.cc projects/fuse2/tests/sys/fs/fusefs/locks.cc projects/fuse2/tests/sys/fs/fusefs/lookup.cc projects/fuse2/tests/sys/fs/fusefs/open.cc projects/fuse2/tests/sys/fs/fusefs/read.cc projects/fuse2/tests/sys/fs/fusefs/release.cc projects/fuse2/tests/sys/fs/fusefs/setattr.cc projects/fuse2/tests/sys/fs/fusefs/unlink.cc projects/fuse2/tests/sys/fs/fusefs/utils.cc projects/fuse2/tests/sys/fs/fusefs/write.cc Modified: projects/fuse2/sys/fs/fuse/fuse_internal.c ============================================================================== --- projects/fuse2/sys/fs/fuse/fuse_internal.c Mon Apr 8 18:38:18 2019 (r346042) +++ projects/fuse2/sys/fs/fuse/fuse_internal.c Mon Apr 8 18:45:41 2019 (r346043) @@ -175,9 +175,9 @@ fuse_internal_access(struct vnode *vp, } /* - * Cache FUSE attributes from feo, in attr cache associated with vnode 'vp'. - * Optionally, if argument 'vap' is not NULL, store a copy of the converted - * attributes there as well. + * Cache FUSE attributes from attr, in attribute cache associated with vnode + * 'vp'. Optionally, if argument 'vap' is not NULL, store a copy of the + * converted attributes there as well. * * If the nominal attribute cache TTL is zero, do not cache on the 'vp' (but do * return the result to the caller). @@ -581,6 +581,62 @@ fuse_internal_forget_send(struct mount *mp, fuse_insert_message(fdi.tick); fdisp_destroy(&fdi); +} + +/* Read a vnode's attributes from cache or fetch them from the fuse daemon */ +int +fuse_internal_getattr(struct vnode *vp, struct vattr *vap, struct ucred *cred, + struct thread *td) +{ + struct fuse_dispatcher fdi; + struct fuse_vnode_data *fvdat = VTOFUD(vp); + struct vattr *attrs; + struct fuse_attr_out *fao; + int err = 0; + + if ((attrs = VTOVA(vp)) != NULL) { + /* struct copy */ + *vap = *attrs; + if ((fvdat->flag & FN_SIZECHANGE) != 0) + vap->va_size = fvdat->filesize; + return 0; + } + + fdisp_init(&fdi, 0); + if ((err = fdisp_simple_putget_vp(&fdi, FUSE_GETATTR, vp, td, cred))) { + if (err == ENOENT) { + fuse_internal_vnode_disappear(vp); + } + goto out; + } + + fao = (struct fuse_attr_out *)fdi.answ; + fuse_internal_cache_attrs(vp, &fao->attr, fao->attr_valid, + fao->attr_valid_nsec, vap); + if (vap->va_type != vnode_vtype(vp)) { + fuse_internal_vnode_disappear(vp); + err = ENOENT; + goto out; + } + if ((fvdat->flag & FN_SIZECHANGE) != 0) + vap->va_size = fvdat->filesize; + + if (vnode_isreg(vp) && (fvdat->flag & FN_SIZECHANGE) == 0) { + /* + * This is for those cases when the file size changed without us + * knowing, and we want to catch up. + */ + off_t new_filesize = fao->attr.size; + + if (fvdat->filesize != new_filesize) { + fuse_vnode_setsize(vp, cred, new_filesize); + fvdat->flag &= ~FN_SIZECHANGE; + } + } + +out: + fdisp_destroy(&fdi); + return err; } void Modified: projects/fuse2/sys/fs/fuse/fuse_internal.h ============================================================================== --- projects/fuse2/sys/fs/fuse/fuse_internal.h Mon Apr 8 18:38:18 2019 (r346042) +++ projects/fuse2/sys/fs/fuse/fuse_internal.h Mon Apr 8 18:45:41 2019 (r346043) @@ -199,6 +199,10 @@ int fuse_internal_fsync(struct vnode *vp, struct threa bool datasync); int fuse_internal_fsync_callback(struct fuse_ticket *tick, struct uio *uio); +/* getattr */ +int fuse_internal_getattr(struct vnode *vp, struct vattr *vap, + struct ucred *cred, struct thread *td); + /* readdir */ struct pseudo_dirent { Modified: projects/fuse2/sys/fs/fuse/fuse_node.c ============================================================================== --- projects/fuse2/sys/fs/fuse/fuse_node.c Mon Apr 8 18:38:18 2019 (r346042) +++ projects/fuse2/sys/fs/fuse/fuse_node.c Mon Apr 8 18:45:41 2019 (r346043) @@ -403,6 +403,7 @@ int fuse_vnode_setsize(struct vnode *vp, struct ucred *cred, off_t newsize) { struct fuse_vnode_data *fvdat = VTOFUD(vp); + struct vattr *attrs; off_t oldsize; size_t iosize; struct buf *bp = NULL; @@ -413,6 +414,8 @@ fuse_vnode_setsize(struct vnode *vp, struct ucred *cre iosize = fuse_iosize(vp); oldsize = fvdat->filesize; fvdat->filesize = newsize; + if ((attrs = VTOVA(vp)) != NULL) + attrs->va_size = newsize; fvdat->flag |= FN_SIZECHANGE; if (newsize < oldsize) { Modified: projects/fuse2/sys/fs/fuse/fuse_node.h ============================================================================== --- projects/fuse2/sys/fs/fuse/fuse_node.h Mon Apr 8 18:38:18 2019 (r346042) +++ projects/fuse2/sys/fs/fuse/fuse_node.h Mon Apr 8 18:45:41 2019 (r346043) @@ -80,7 +80,7 @@ struct fuse_vnode_data { uint64_t parent_nid; /** I/O **/ - /* List of file data for each of the vnode's open file descriptors */ + /* List of file handles for all of the vnode's open file descriptors */ LIST_HEAD(, fuse_filehandle) handles; /** flags **/ Modified: projects/fuse2/sys/fs/fuse/fuse_vnops.c ============================================================================== --- projects/fuse2/sys/fs/fuse/fuse_vnops.c Mon Apr 8 18:38:18 2019 (r346042) +++ projects/fuse2/sys/fs/fuse/fuse_vnops.c Mon Apr 8 18:45:41 2019 (r346043) @@ -478,6 +478,8 @@ fuse_vnop_create(struct vop_create_args *ap) goto out; } ASSERT_VOP_ELOCKED(*vpp, "fuse_vnop_create"); + fuse_internal_cache_attrs(*vpp, &feo->attr, feo->attr_valid, + feo->attr_valid_nsec, NULL); fuse_filehandle_init(*vpp, FUFH_RDWR, NULL, td, cred, foo); fuse_vnode_open(*vpp, foo->open_flags, td); @@ -555,12 +557,9 @@ fuse_vnop_getattr(struct vop_getattr_args *ap) struct vattr *vap = ap->a_vap; struct ucred *cred = ap->a_cred; struct thread *td = curthread; - struct fuse_vnode_data *fvdat = VTOFUD(vp); - struct fuse_attr_out *fao; int err = 0; int dataflags; - struct fuse_dispatcher fdi; dataflags = fuse_get_mpdata(vnode_mount(vp))->dataflags; @@ -575,47 +574,13 @@ fuse_vnop_getattr(struct vop_getattr_args *ap) goto fake; } } - fdisp_init(&fdi, 0); - if ((err = fdisp_simple_putget_vp(&fdi, FUSE_GETATTR, vp, td, cred))) { - if ((err == ENOTCONN) && vnode_isvroot(vp)) { - /* see comment in fuse_vfsop_statfs() */ - fdisp_destroy(&fdi); - goto fake; - } - if (err == ENOENT) { - fuse_internal_vnode_disappear(vp); - } - goto out; + err = fuse_internal_getattr(vp, vap, cred, td); + if (err == ENOTCONN && vnode_isvroot(vp)) { + /* see comment in fuse_vfsop_statfs() */ + goto fake; + } else { + return err; } - - fao = (struct fuse_attr_out *)fdi.answ; - fuse_internal_cache_attrs(vp, &fao->attr, fao->attr_valid, - fao->attr_valid_nsec, vap); - if (vap->va_type != vnode_vtype(vp)) { - fuse_internal_vnode_disappear(vp); - err = ENOENT; - goto out; - } - if ((fvdat->flag & FN_SIZECHANGE) != 0) - vap->va_size = fvdat->filesize; - - if (vnode_isreg(vp) && (fvdat->flag & FN_SIZECHANGE) == 0) { - /* - * This is for those cases when the file size changed without us - * knowing, and we want to catch up. - */ - off_t new_filesize = ((struct fuse_attr_out *) - fdi.answ)->attr.size; - - if (fvdat->filesize != new_filesize) { - fuse_vnode_setsize(vp, cred, new_filesize); - fvdat->flag &= ~FN_SIZECHANGE; - } - } - -out: - fdisp_destroy(&fdi); - return err; fake: bzero(vap, sizeof(*vap)); Modified: projects/fuse2/tests/sys/fs/fusefs/allow_other.cc ============================================================================== --- projects/fuse2/tests/sys/fs/fusefs/allow_other.cc Mon Apr 8 18:38:18 2019 (r346042) +++ projects/fuse2/tests/sys/fs/fusefs/allow_other.cc Mon Apr 8 18:45:41 2019 (r346043) @@ -80,7 +80,6 @@ TEST_F(AllowOther, allowed) expect_open(ino, 0, 1); expect_flush(ino, 1, ReturnErrno(0)); expect_release(ino, FH); - expect_getattr(ino, 0); }, []() { int fd; @@ -137,7 +136,6 @@ TEST_F(AllowOther, privilege_escalation) _) ).Times(AnyNumber()) .WillRepeatedly(Invoke(ReturnErrno(EPERM))); - expect_getattr(ino, 0); fd1 = open(FULLPATH, O_RDONLY); EXPECT_LE(0, fd1) << strerror(errno); Modified: projects/fuse2/tests/sys/fs/fusefs/create.cc ============================================================================== --- projects/fuse2/tests/sys/fs/fusefs/create.cc Mon Apr 8 18:38:18 2019 (r346042) +++ projects/fuse2/tests/sys/fs/fusefs/create.cc Mon Apr 8 18:45:41 2019 (r346043) @@ -59,8 +59,7 @@ void expect_create(const char *relpath, ProcessMockerT * If FUSE_CREATE sets the attr_valid, then subsequent GETATTRs should use the * attribute cache */ -/* https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=235775 */ -TEST_F(Create, DISABLED_attr_cache) +TEST_F(Create, attr_cache) { const char FULLPATH[] = "mountpoint/some_file.txt"; const char RELPATH[] = "some_file.txt"; @@ -151,19 +150,6 @@ TEST_F(Create, Enosys) SET_OUT_HEADER_LEN(out, open); }))); - /* Until the attr cache is working, we may send an additional GETATTR */ - EXPECT_CALL(*m_mock, process( - ResultOf([=](auto in) { - return (in->header.opcode == FUSE_GETATTR && - in->header.nodeid == ino); - }, Eq(true)), - _) - ).WillRepeatedly(Invoke(ReturnImmediate([=](auto i __unused, auto out) { - SET_OUT_HEADER_LEN(out, attr); - out->body.attr.attr.ino = ino; // Must match nodeid - out->body.attr.attr.mode = S_IFREG | 0644; - }))); - fd = open(FULLPATH, O_CREAT | O_EXCL, mode); EXPECT_LE(0, fd) << strerror(errno); /* Deliberately leak fd. close(2) will be tested in release.cc */ @@ -196,19 +182,6 @@ TEST_F(Create, entry_cache_negative) out->body.create.entry.attr_valid = UINT64_MAX; })); - /* Until the attr cache is working, we may send an additional GETATTR */ - EXPECT_CALL(*m_mock, process( - ResultOf([=](auto in) { - return (in->header.opcode == FUSE_GETATTR && - in->header.nodeid == ino); - }, Eq(true)), - _) - ).WillRepeatedly(Invoke(ReturnImmediate([=](auto i __unused, auto out) { - SET_OUT_HEADER_LEN(out, attr); - out->body.attr.attr.ino = ino; // Must match nodeid - out->body.attr.attr.mode = S_IFREG | 0644; - }))); - fd = open(FULLPATH, O_CREAT | O_EXCL, mode); ASSERT_LE(0, fd) << strerror(errno); /* Deliberately leak fd. close(2) will be tested in release.cc */ @@ -239,19 +212,6 @@ TEST_F(Create, entry_cache_negative_purge) out->body.create.entry.attr_valid = UINT64_MAX; })); - /* Until the attr cache is working, we may send an additional GETATTR */ - EXPECT_CALL(*m_mock, process( - ResultOf([=](auto in) { - return (in->header.opcode == FUSE_GETATTR && - in->header.nodeid == ino); - }, Eq(true)), - _) - ).WillRepeatedly(Invoke(ReturnImmediate([=](auto i __unused, auto out) { - SET_OUT_HEADER_LEN(out, attr); - out->body.attr.attr.ino = ino; // Must match nodeid - out->body.attr.attr.mode = S_IFREG | 0644; - }))); - fd = open(FULLPATH, O_CREAT | O_EXCL, mode); ASSERT_LE(0, fd) << strerror(errno); @@ -296,19 +256,6 @@ TEST_F(Create, ok) out->body.create.entry.attr_valid = UINT64_MAX; })); - /* Until the attr cache is working, we may send an additional GETATTR */ - EXPECT_CALL(*m_mock, process( - ResultOf([=](auto in) { - return (in->header.opcode == FUSE_GETATTR && - in->header.nodeid == ino); - }, Eq(true)), - _) - ).WillRepeatedly(Invoke(ReturnImmediate([=](auto i __unused, auto out) { - SET_OUT_HEADER_LEN(out, attr); - out->body.attr.attr.ino = ino; // Must match nodeid - out->body.attr.attr.mode = S_IFREG | mode; - }))); - fd = open(FULLPATH, O_CREAT | O_EXCL, mode); EXPECT_LE(0, fd) << strerror(errno); /* Deliberately leak fd. close(2) will be tested in release.cc */ @@ -338,19 +285,6 @@ TEST_F(Create, wronly_0444) out->body.create.entry.entry_valid = UINT64_MAX; out->body.create.entry.attr_valid = UINT64_MAX; })); - - /* Until the attr cache is working, we may send an additional GETATTR */ - EXPECT_CALL(*m_mock, process( - ResultOf([=](auto in) { - return (in->header.opcode == FUSE_GETATTR && - in->header.nodeid == ino); - }, Eq(true)), - _) - ).WillRepeatedly(Invoke(ReturnImmediate([=](auto i __unused, auto out) { - SET_OUT_HEADER_LEN(out, attr); - out->body.attr.attr.ino = ino; // Must match nodeid - out->body.attr.attr.mode = S_IFREG | mode; - }))); fd = open(FULLPATH, O_CREAT | O_WRONLY, mode); EXPECT_LE(0, fd) << strerror(errno); Modified: projects/fuse2/tests/sys/fs/fusefs/default_permissions.cc ============================================================================== --- projects/fuse2/tests/sys/fs/fusefs/default_permissions.cc Mon Apr 8 18:38:18 2019 (r346042) +++ projects/fuse2/tests/sys/fs/fusefs/default_permissions.cc Mon Apr 8 18:45:41 2019 (r346043) @@ -111,8 +111,6 @@ TEST_F(Open, ok) expect_lookup(RELPATH, ino, S_IFREG | 0644); expect_open(ino, 0, 1); - /* Until the attr cache is working, we may send an additional GETATTR */ - expect_getattr(ino, 0); fd = open(FULLPATH, O_RDONLY); EXPECT_LE(0, fd) << strerror(errno); Modified: projects/fuse2/tests/sys/fs/fusefs/flush.cc ============================================================================== --- projects/fuse2/tests/sys/fs/fusefs/flush.cc Mon Apr 8 18:38:18 2019 (r346042) +++ projects/fuse2/tests/sys/fs/fusefs/flush.cc Mon Apr 8 18:45:41 2019 (r346043) @@ -96,7 +96,6 @@ TEST_F(Flush, open_twice) expect_lookup(RELPATH, ino, 2); expect_open(ino, 0, 1); - expect_getattr(ino, 0); expect_flush(ino, 2, 0, ReturnErrno(0)); expect_release(); @@ -127,7 +126,6 @@ TEST_F(Flush, eio) expect_lookup(RELPATH, ino, 1); expect_open(ino, 0, 1); - expect_getattr(ino, 0); expect_flush(ino, 1, 0, ReturnErrno(EIO)); expect_release(); @@ -153,14 +151,12 @@ TEST_F(Flush, enosys) expect_lookup(RELPATH0, ino0, 1); expect_open(ino0, 0, 1); - expect_getattr(ino0, 0); /* On the 2nd close, FUSE_FLUSH won't be sent at all */ expect_flush(ino0, 1, 0, ReturnErrno(ENOSYS)); expect_release(); expect_lookup(RELPATH1, ino1, 1); expect_open(ino1, 0, 1); - expect_getattr(ino1, 0); /* On the 2nd close, FUSE_FLUSH won't be sent at all */ expect_release(); @@ -184,7 +180,6 @@ TEST_F(Flush, flush) expect_lookup(RELPATH, ino, 1); expect_open(ino, 0, 1); - expect_getattr(ino, 0); expect_flush(ino, 1, 0, ReturnErrno(0)); expect_release(); @@ -210,7 +205,6 @@ TEST_F(FlushWithLocks, DISABLED_unlock_on_close) expect_lookup(RELPATH, ino, 1); expect_open(ino, 0, 1); - expect_getattr(ino, 0); EXPECT_CALL(*m_mock, process( ResultOf([=](auto in) { return (in->header.opcode == FUSE_SETLK && Modified: projects/fuse2/tests/sys/fs/fusefs/fsync.cc ============================================================================== --- projects/fuse2/tests/sys/fs/fusefs/fsync.cc Mon Apr 8 18:38:18 2019 (r346042) +++ projects/fuse2/tests/sys/fs/fusefs/fsync.cc Mon Apr 8 18:45:41 2019 (r346043) @@ -93,7 +93,6 @@ TEST_F(Fsync, aio_fsync) expect_lookup(RELPATH, ino); expect_open(ino, 0, 1); - expect_getattr(ino, 0); expect_write(ino, bufsize, CONTENTS); expect_fsync(ino, 0, 0); @@ -127,7 +126,6 @@ TEST_F(Fsync, close) expect_lookup(RELPATH, ino); expect_open(ino, 0, 1); - expect_getattr(ino, 0); expect_write(ino, bufsize, CONTENTS); EXPECT_CALL(*m_mock, process( ResultOf([=](auto in) { @@ -164,7 +162,6 @@ TEST_F(Fsync, eio) expect_lookup(RELPATH, ino); expect_open(ino, 0, 1); - expect_getattr(ino, 0); expect_write(ino, bufsize, CONTENTS); expect_fsync(ino, FUSE_FSYNC_FDATASYNC, EIO); @@ -194,7 +191,6 @@ TEST_F(Fsync, DISABLED_enosys) expect_lookup(RELPATH, ino); expect_open(ino, 0, 1); - expect_getattr(ino, 0); expect_write(ino, bufsize, CONTENTS); expect_fsync(ino, FUSE_FSYNC_FDATASYNC, ENOSYS); @@ -220,7 +216,6 @@ TEST_F(Fsync, fdatasync) expect_lookup(RELPATH, ino); expect_open(ino, 0, 1); - expect_getattr(ino, 0); expect_write(ino, bufsize, CONTENTS); expect_fsync(ino, FUSE_FSYNC_FDATASYNC, 0); @@ -243,7 +238,6 @@ TEST_F(Fsync, fsync) expect_lookup(RELPATH, ino); expect_open(ino, 0, 1); - expect_getattr(ino, 0); expect_write(ino, bufsize, CONTENTS); expect_fsync(ino, 0, 0); Modified: projects/fuse2/tests/sys/fs/fusefs/getattr.cc ============================================================================== --- projects/fuse2/tests/sys/fs/fusefs/getattr.cc Mon Apr 8 18:38:18 2019 (r346042) +++ projects/fuse2/tests/sys/fs/fusefs/getattr.cc Mon Apr 8 18:45:41 2019 (r346043) @@ -33,14 +33,32 @@ using namespace testing; -class Getattr : public FuseTest {}; +class Getattr : public FuseTest { +public: +void expect_lookup(const char *relpath, uint64_t ino, mode_t mode, + uint64_t size, int times, uint64_t attr_valid, uint32_t attr_valid_nsec) +{ + EXPECT_LOOKUP(1, relpath) + .Times(times) + .WillRepeatedly(Invoke(ReturnImmediate([=](auto in __unused, auto out) { + SET_OUT_HEADER_LEN(out, entry); + out->body.entry.attr.mode = mode; + out->body.entry.nodeid = ino; + out->body.entry.attr.nlink = 1; + out->body.entry.attr_valid = attr_valid; + out->body.entry.attr_valid_nsec = attr_valid_nsec; + out->body.entry.attr.size = size; + out->body.entry.entry_valid = UINT64_MAX; + }))); +} +}; + /* * If getattr returns a non-zero cache timeout, then subsequent VOP_GETATTRs * should use the cached attributes, rather than query the daemon */ -/* https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=235775 */ -TEST_F(Getattr, DISABLED_attr_cache) +TEST_F(Getattr, attr_cache) { const char FULLPATH[] = "mountpoint/some_file.txt"; const char RELPATH[] = "some_file.txt"; @@ -52,6 +70,7 @@ TEST_F(Getattr, DISABLED_attr_cache) SET_OUT_HEADER_LEN(out, entry); out->body.entry.attr.mode = S_IFREG | 0644; out->body.entry.nodeid = ino; + out->body.entry.entry_valid = UINT64_MAX; }))); EXPECT_CALL(*m_mock, process( ResultOf([](auto in) { @@ -76,7 +95,7 @@ TEST_F(Getattr, DISABLED_attr_cache) * period passes. */ /* https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=235773 */ -TEST_F(Getattr, attr_cache_timeout) +TEST_F(Getattr, DISABLED_attr_cache_timeout) { const char FULLPATH[] = "mountpoint/some_file.txt"; const char RELPATH[] = "some_file.txt"; @@ -88,7 +107,7 @@ TEST_F(Getattr, attr_cache_timeout) */ long timeout_ns = 250'000'000; - expect_lookup(RELPATH, ino, S_IFREG | 0644, 0, 2); + expect_lookup(RELPATH, ino, S_IFREG | 0644, 0, 2, 0, 0); EXPECT_CALL(*m_mock, process( ResultOf([](auto in) { return (in->header.opcode == FUSE_GETATTR && @@ -116,7 +135,7 @@ TEST_F(Getattr, enoent) struct stat sb; const uint64_t ino = 42; - expect_lookup(RELPATH, ino, S_IFREG | 0644, 0, 1); + expect_lookup(RELPATH, ino, S_IFREG | 0644, 0, 1, 0, 0); EXPECT_CALL(*m_mock, process( ResultOf([](auto in) { return (in->header.opcode == FUSE_GETATTR && @@ -135,7 +154,7 @@ TEST_F(Getattr, ok) const uint64_t ino = 42; struct stat sb; - expect_lookup(RELPATH, ino, S_IFREG | 0644, 1, 1); + expect_lookup(RELPATH, ino, S_IFREG | 0644, 1, 1, 0, 0); EXPECT_CALL(*m_mock, process( ResultOf([](auto in) { return (in->header.opcode == FUSE_GETATTR && Modified: projects/fuse2/tests/sys/fs/fusefs/locks.cc ============================================================================== --- projects/fuse2/tests/sys/fs/fusefs/locks.cc Mon Apr 8 18:38:18 2019 (r346042) +++ projects/fuse2/tests/sys/fs/fusefs/locks.cc Mon Apr 8 18:45:41 2019 (r346043) @@ -80,7 +80,6 @@ TEST_F(GetlkFallback, local) expect_lookup(RELPATH, ino); expect_open(ino, 0, 1); - expect_getattr(ino, 0); fd = open(FULLPATH, O_RDWR); ASSERT_LE(0, fd) << strerror(errno); @@ -110,7 +109,6 @@ TEST_F(Getlk, DISABLED_no_locks) expect_lookup(RELPATH, ino); expect_open(ino, 0, 1); - expect_getattr(ino, 0); EXPECT_CALL(*m_mock, process( ResultOf([=](auto in) { return (in->header.opcode == FUSE_GETLK && @@ -156,7 +154,6 @@ TEST_F(Getlk, DISABLED_lock_exists) expect_lookup(RELPATH, ino); expect_open(ino, 0, 1); - expect_getattr(ino, 0); EXPECT_CALL(*m_mock, process( ResultOf([=](auto in) { return (in->header.opcode == FUSE_GETLK && @@ -209,7 +206,6 @@ TEST_F(SetlkFallback, local) expect_lookup(RELPATH, ino); expect_open(ino, 0, 1); - expect_getattr(ino, 0); fd = open(FULLPATH, O_RDWR); ASSERT_LE(0, fd) << strerror(errno); @@ -236,7 +232,6 @@ TEST_F(Setlk, DISABLED_set) expect_lookup(RELPATH, ino); expect_open(ino, 0, 1); - expect_getattr(ino, 0); EXPECT_CALL(*m_mock, process( ResultOf([=](auto in) { return (in->header.opcode == FUSE_SETLK && @@ -279,7 +274,6 @@ TEST_F(Setlk, DISABLED_set_eof) expect_lookup(RELPATH, ino); expect_open(ino, 0, 1); - expect_getattr(ino, 0); EXPECT_CALL(*m_mock, process( ResultOf([=](auto in) { return (in->header.opcode == FUSE_SETLK && @@ -322,7 +316,6 @@ TEST_F(Setlk, DISABLED_eagain) expect_lookup(RELPATH, ino); expect_open(ino, 0, 1); - expect_getattr(ino, 0); EXPECT_CALL(*m_mock, process( ResultOf([=](auto in) { return (in->header.opcode == FUSE_SETLK && @@ -364,7 +357,6 @@ TEST_F(SetlkwFallback, local) expect_lookup(RELPATH, ino); expect_open(ino, 0, 1); - expect_getattr(ino, 0); fd = open(FULLPATH, O_RDWR); ASSERT_LE(0, fd) << strerror(errno); @@ -395,7 +387,6 @@ TEST_F(Setlkw, DISABLED_set) expect_lookup(RELPATH, ino); expect_open(ino, 0, 1); - expect_getattr(ino, 0); EXPECT_CALL(*m_mock, process( ResultOf([=](auto in) { return (in->header.opcode == FUSE_SETLK && Modified: projects/fuse2/tests/sys/fs/fusefs/lookup.cc ============================================================================== --- projects/fuse2/tests/sys/fs/fusefs/lookup.cc Mon Apr 8 18:38:18 2019 (r346042) +++ projects/fuse2/tests/sys/fs/fusefs/lookup.cc Mon Apr 8 18:45:41 2019 (r346043) @@ -43,8 +43,7 @@ class Lookup: public FuseTest {}; * If lookup returns a non-zero cache timeout, then subsequent VOP_GETATTRs * should use the cached attributes, rather than query the daemon */ -/* https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=235775 */ -TEST_F(Lookup, DISABLED_attr_cache) +TEST_F(Lookup, attr_cache) { const char FULLPATH[] = "mountpoint/some_file.txt"; const char RELPATH[] = "some_file.txt"; @@ -106,7 +105,7 @@ TEST_F(Lookup, DISABLED_attr_cache) * the cached attributes and requery the daemon. */ /* https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=235773 */ -TEST_F(Lookup, attr_cache_timeout) +TEST_F(Lookup, DISABLED_attr_cache_timeout) { const char FULLPATH[] = "mountpoint/some_file.txt"; const char RELPATH[] = "some_file.txt"; Modified: projects/fuse2/tests/sys/fs/fusefs/open.cc ============================================================================== --- projects/fuse2/tests/sys/fs/fusefs/open.cc Mon Apr 8 18:38:18 2019 (r346042) +++ projects/fuse2/tests/sys/fs/fusefs/open.cc Mon Apr 8 18:45:41 2019 (r346043) @@ -61,9 +61,6 @@ void test_ok(int os_flags, int fuse_flags) { SET_OUT_HEADER_LEN(out, open); }))); - /* Until the attr cache is working, we may send an additional GETATTR */ - expect_getattr(ino, 0); - fd = open(FULLPATH, os_flags); EXPECT_LE(0, fd) << strerror(errno); /* Deliberately leak fd. close(2) will be tested in release.cc */ @@ -204,7 +201,6 @@ TEST_F(Open, multiple_creds) out->header.len = sizeof(out->header); SET_OUT_HEADER_LEN(out, open); }))); - expect_getattr(ino, 0); expect_flush(ino, 2, ReturnErrno(0)); expect_release(ino, fh0); expect_release(ino, fh1); Modified: projects/fuse2/tests/sys/fs/fusefs/read.cc ============================================================================== --- projects/fuse2/tests/sys/fs/fusefs/read.cc Mon Apr 8 18:38:18 2019 (r346042) +++ projects/fuse2/tests/sys/fs/fusefs/read.cc Mon Apr 8 18:45:41 2019 (r346043) @@ -117,7 +117,6 @@ TEST_F(AioRead, aio_read) expect_lookup(RELPATH, ino, bufsize); expect_open(ino, 0, 1); - expect_getattr(ino, bufsize); expect_read(ino, 0, bufsize, bufsize, CONTENTS); fd = open(FULLPATH, O_RDONLY); @@ -152,7 +151,6 @@ TEST_F(AioRead, async_read_disabled) expect_lookup(RELPATH, ino, bufsize); expect_open(ino, 0, 1); - expect_getattr(ino, bufsize); EXPECT_CALL(*m_mock, process( ResultOf([=](auto in) { return (in->header.opcode == FUSE_READ && @@ -230,7 +228,6 @@ TEST_F(AsyncRead, DISABLED_async_read) expect_lookup(RELPATH, ino, bufsize); expect_open(ino, 0, 1); - expect_getattr(ino, bufsize); EXPECT_CALL(*m_mock, process( ResultOf([=](auto in) { return (in->header.opcode == FUSE_READ && @@ -299,7 +296,6 @@ TEST_F(Read, direct_io_read_nothing) expect_lookup(RELPATH, ino, offset + 1000); expect_open(ino, FOPEN_DIRECT_IO, 1); - expect_getattr(ino, offset + 1000); fd = open(FULLPATH, O_RDONLY); ASSERT_LE(0, fd) << strerror(errno); @@ -325,7 +321,6 @@ TEST_F(Read, direct_io_pread) expect_lookup(RELPATH, ino, offset + bufsize); expect_open(ino, FOPEN_DIRECT_IO, 1); - expect_getattr(ino, offset + bufsize); expect_read(ino, offset, bufsize, bufsize, CONTENTS); fd = open(FULLPATH, O_RDONLY); @@ -354,7 +349,6 @@ TEST_F(Read, direct_io_short_read) expect_lookup(RELPATH, ino, offset + bufsize); expect_open(ino, FOPEN_DIRECT_IO, 1); - expect_getattr(ino, offset + bufsize); expect_read(ino, offset, bufsize, halfbufsize, CONTENTS); fd = open(FULLPATH, O_RDONLY); @@ -378,7 +372,6 @@ TEST_F(Read, eio) expect_lookup(RELPATH, ino, bufsize); expect_open(ino, 0, 1); - expect_getattr(ino, bufsize); EXPECT_CALL(*m_mock, process( ResultOf([=](auto in) { return (in->header.opcode == FUSE_READ); @@ -410,7 +403,6 @@ TEST_F(Read, keep_cache) FuseTest::expect_lookup(RELPATH, ino, S_IFREG | 0644, bufsize, 2); expect_open(ino, FOPEN_KEEP_CACHE, 2); - expect_getattr(ino, bufsize); expect_read(ino, 0, bufsize, bufsize, CONTENTS); fd0 = open(FULLPATH, O_RDONLY); @@ -445,7 +437,6 @@ TEST_F(Read, keep_cache_disabled) FuseTest::expect_lookup(RELPATH, ino, S_IFREG | 0644, bufsize, 2); expect_open(ino, 0, 2); - expect_getattr(ino, bufsize); expect_read(ino, 0, bufsize, bufsize, CONTENTS); fd0 = open(FULLPATH, O_RDONLY); @@ -482,7 +473,6 @@ TEST_F(ReadCacheable, mmap) expect_lookup(RELPATH, ino, bufsize); expect_open(ino, 0, 1); - expect_getattr(ino, bufsize); /* mmap may legitimately try to read more data than is available */ EXPECT_CALL(*m_mock, process( ResultOf([=](auto in) { @@ -526,7 +516,6 @@ TEST_F(Read, o_direct) expect_lookup(RELPATH, ino, bufsize); expect_open(ino, 0, 1); - expect_getattr(ino, bufsize); expect_read(ino, 0, bufsize, bufsize, CONTENTS); fd = open(FULLPATH, O_RDONLY); @@ -563,7 +552,6 @@ TEST_F(Read, pread) expect_lookup(RELPATH, ino, offset + bufsize); expect_open(ino, 0, 1); - expect_getattr(ino, offset + bufsize); expect_read(ino, offset, bufsize, bufsize, CONTENTS); fd = open(FULLPATH, O_RDONLY); @@ -586,7 +574,6 @@ TEST_F(Read, read) expect_lookup(RELPATH, ino, bufsize); expect_open(ino, 0, 1); - expect_getattr(ino, bufsize); expect_read(ino, 0, bufsize, bufsize, CONTENTS); fd = open(FULLPATH, O_RDONLY); @@ -620,7 +607,6 @@ TEST_F(ReadCacheable, default_readahead) expect_lookup(RELPATH, ino, filesize); expect_open(ino, 0, 1); - expect_getattr(ino, filesize); expect_read(ino, 0, default_maxreadahead, default_maxreadahead, contents); @@ -651,7 +637,6 @@ TEST_F(ReadCacheable, sendfile) expect_lookup(RELPATH, ino, bufsize); expect_open(ino, 0, 1); - expect_getattr(ino, bufsize); /* Like mmap, sendfile may request more data than is available */ EXPECT_CALL(*m_mock, process( ResultOf([=](auto in) { @@ -697,7 +682,6 @@ TEST_F(ReadCacheable, DISABLED_sendfile_eio) expect_lookup(RELPATH, ino, bufsize); expect_open(ino, 0, 1); - expect_getattr(ino, bufsize); EXPECT_CALL(*m_mock, process( ResultOf([=](auto in) { return (in->header.opcode == FUSE_READ); @@ -739,7 +723,6 @@ TEST_P(ReadAhead, DISABLED_readahead) { expect_lookup(RELPATH, ino, filesize); expect_open(ino, 0, 1); - expect_getattr(ino, filesize); /* fuse(4) should only read ahead the allowed amount */ expect_read(ino, 0, GetParam(), GetParam(), contents); Modified: projects/fuse2/tests/sys/fs/fusefs/release.cc ============================================================================== --- projects/fuse2/tests/sys/fs/fusefs/release.cc Mon Apr 8 18:38:18 2019 (r346042) +++ projects/fuse2/tests/sys/fs/fusefs/release.cc Mon Apr 8 18:45:41 2019 (r346043) @@ -81,7 +81,6 @@ TEST_F(Release, dup) expect_lookup(RELPATH, ino, 1); expect_open(ino, 0, 1); - expect_getattr(ino, 0); expect_flush(ino, 1, ReturnErrno(0)); expect_release(ino, 0, O_RDONLY, 0); @@ -111,7 +110,6 @@ TEST_F(Release, eio) expect_lookup(RELPATH, ino, 1); expect_open(ino, 0, 1); - expect_getattr(ino, 0); expect_flush(ino, 1, ReturnErrno(0)); expect_release(ino, 0, O_WRONLY, EIO); @@ -134,7 +132,6 @@ TEST_F(Release, DISABLED_flags) expect_lookup(RELPATH, ino, 1); expect_open(ino, 0, 1); - expect_getattr(ino, 0); expect_flush(ino, 1, ReturnErrno(0)); expect_release(ino, 0, O_RDWR | O_APPEND, 0); @@ -158,7 +155,6 @@ TEST_F(Release, multiple_opens) expect_lookup(RELPATH, ino, 2); expect_open(ino, 0, 2); - expect_getattr(ino, 0); expect_flush(ino, 2, ReturnErrno(0)); expect_release(ino, 0, O_RDONLY, 0); @@ -182,7 +178,6 @@ TEST_F(Release, ok) expect_lookup(RELPATH, ino, 1); expect_open(ino, 0, 1); - expect_getattr(ino, 0); expect_flush(ino, 1, ReturnErrno(0)); expect_release(ino, 0, O_RDONLY, 0); @@ -205,7 +200,6 @@ TEST_F(ReleaseWithLocks, DISABLED_unlock_on_close) expect_lookup(RELPATH, ino, 1); expect_open(ino, 0, 1); - expect_getattr(ino, 0); EXPECT_CALL(*m_mock, process( ResultOf([=](auto in) { return (in->header.opcode == FUSE_SETLK && Modified: projects/fuse2/tests/sys/fs/fusefs/setattr.cc ============================================================================== --- projects/fuse2/tests/sys/fs/fusefs/setattr.cc Mon Apr 8 18:38:18 2019 (r346042) +++ projects/fuse2/tests/sys/fs/fusefs/setattr.cc Mon Apr 8 18:45:41 2019 (r346043) @@ -46,8 +46,7 @@ class Setattr : public FuseTest {}; * If setattr returns a non-zero cache timeout, then subsequent VOP_GETATTRs * should use the cached attributes, rather than query the daemon */ -/* https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=235775 */ -TEST_F(Setattr, DISABLED_attr_cache) +TEST_F(Setattr, attr_cache) { const char FULLPATH[] = "mountpoint/some_file.txt"; const char RELPATH[] = "some_file.txt"; @@ -60,11 +59,11 @@ TEST_F(Setattr, DISABLED_attr_cache) SET_OUT_HEADER_LEN(out, entry); out->body.entry.attr.mode = S_IFREG | 0644; out->body.entry.nodeid = ino; + out->body.entry.entry_valid = UINT64_MAX; }))); EXPECT_CALL(*m_mock, process( ResultOf([](auto in) { - /* In protocol 7.23, ctime will be changed too */ return (in->header.opcode == FUSE_SETATTR && in->header.nodeid == ino); }, Eq(true)), @@ -73,6 +72,7 @@ TEST_F(Setattr, DISABLED_attr_cache) SET_OUT_HEADER_LEN(out, attr); out->body.attr.attr.ino = ino; // Must match nodeid out->body.attr.attr.mode = S_IFREG | newmode; + out->body.attr.attr_valid = UINT64_MAX; }))); EXPECT_CALL(*m_mock, process( ResultOf([](auto in) { @@ -227,21 +227,8 @@ TEST_F(Setattr, fchmod) SET_OUT_HEADER_LEN(out, open); }))); - /* Until the attr cache is working, we may send an additional GETATTR */ EXPECT_CALL(*m_mock, process( ResultOf([=](auto in) { - return (in->header.opcode == FUSE_GETATTR && - in->header.nodeid == ino); - }, Eq(true)), - _) - ).WillRepeatedly(Invoke(ReturnImmediate([=](auto i __unused, auto out) { - SET_OUT_HEADER_LEN(out, attr); - out->body.attr.attr.ino = ino; // Must match nodeid - out->body.attr.attr.mode = S_IFREG | oldmode; - }))); - - EXPECT_CALL(*m_mock, process( - ResultOf([=](auto in) { /* In protocol 7.23, ctime will be changed too */ uint32_t valid = FATTR_MODE; return (in->header.opcode == FUSE_SETATTR && @@ -294,22 +281,8 @@ TEST_F(Setattr, ftruncate) out->body.open.fh = fh; }))); - /* Until the attr cache is working, we may send an additional GETATTR */ EXPECT_CALL(*m_mock, process( ResultOf([=](auto in) { - return (in->header.opcode == FUSE_GETATTR && - in->header.nodeid == ino); - }, Eq(true)), - _) - ).WillRepeatedly(Invoke(ReturnImmediate([=](auto i __unused, auto out) { - SET_OUT_HEADER_LEN(out, attr); - out->body.attr.attr.ino = ino; // Must match nodeid - out->body.attr.attr.mode = S_IFREG | 0755; - out->body.attr.attr.size = oldsize; - }))); - - EXPECT_CALL(*m_mock, process( - ResultOf([=](auto in) { /* In protocol 7.23, ctime will be changed too */ uint32_t valid = FATTR_SIZE | FATTR_FH; return (in->header.opcode == FUSE_SETATTR && @@ -502,27 +475,7 @@ TEST_F(Setattr, utimensat) { out->body.entry.attr.mtimensec = oldtimes[1].tv_nsec; }))); - /* - * Until bug 235775 is fixed, utimensat will make an extra FUSE_GETATTR - * call - */ EXPECT_CALL(*m_mock, process( - ResultOf([](auto in) { - return (in->header.opcode == FUSE_GETATTR && - in->header.nodeid == ino); - }, Eq(true)), - _) - ).WillOnce(Invoke(ReturnImmediate([=](auto in __unused, auto out) { - SET_OUT_HEADER_LEN(out, attr); - out->body.attr.attr.ino = ino; // Must match nodeid - out->body.attr.attr.mode = S_IFREG | 0644; - out->body.attr.attr.atime = oldtimes[0].tv_sec; - out->body.attr.attr.atimensec = oldtimes[0].tv_nsec; - out->body.attr.attr.mtime = oldtimes[1].tv_sec; - out->body.attr.attr.mtimensec = oldtimes[1].tv_nsec; - }))); - - EXPECT_CALL(*m_mock, process( ResultOf([=](auto in) { /* In protocol 7.23, ctime will be changed too */ uint32_t valid = FATTR_ATIME | FATTR_MTIME; @@ -574,26 +527,6 @@ TEST_F(Setattr, utimensat_mtime_only) { out->body.entry.attr.atimensec = oldtimes[0].tv_nsec; out->body.entry.attr.mtime = oldtimes[1].tv_sec; out->body.entry.attr.mtimensec = oldtimes[1].tv_nsec; - }))); - - /* - * Until bug 235775 is fixed, utimensat will make an extra FUSE_GETATTR - * call - */ - EXPECT_CALL(*m_mock, process( - ResultOf([](auto in) { - return (in->header.opcode == FUSE_GETATTR && - in->header.nodeid == ino); - }, Eq(true)), - _) - ).WillOnce(Invoke(ReturnImmediate([=](auto in __unused, auto out) { - SET_OUT_HEADER_LEN(out, attr); - out->body.attr.attr.ino = ino; // Must match nodeid - out->body.attr.attr.mode = S_IFREG | 0644; - out->body.attr.attr.atime = oldtimes[0].tv_sec; - out->body.attr.attr.atimensec = oldtimes[0].tv_nsec; - out->body.attr.attr.mtime = oldtimes[1].tv_sec; - out->body.attr.attr.mtimensec = oldtimes[1].tv_nsec; }))); EXPECT_CALL(*m_mock, process( Modified: projects/fuse2/tests/sys/fs/fusefs/unlink.cc ============================================================================== --- projects/fuse2/tests/sys/fs/fusefs/unlink.cc Mon Apr 8 18:38:18 2019 (r346042) +++ projects/fuse2/tests/sys/fs/fusefs/unlink.cc Mon Apr 8 18:45:41 2019 (r346043) @@ -92,7 +92,6 @@ TEST_F(Unlink, open_but_deleted) expect_lookup(RELPATH, ino, 2); expect_open(ino, 0, 1); - expect_getattr(ino, 0); expect_unlink(1, RELPATH, 0); fd = open(FULLPATH, O_RDWR); Modified: projects/fuse2/tests/sys/fs/fusefs/utils.cc ============================================================================== --- projects/fuse2/tests/sys/fs/fusefs/utils.cc Mon Apr 8 18:38:18 2019 (r346042) +++ projects/fuse2/tests/sys/fs/fusefs/utils.cc Mon Apr 8 18:45:41 2019 (r346043) @@ -144,14 +144,13 @@ FuseTest::expect_flush(uint64_t ino, int times, Proces void FuseTest::expect_getattr(uint64_t ino, uint64_t size) { - /* Until the attr cache is working, we may send an additional GETATTR */ EXPECT_CALL(*m_mock, process( ResultOf([=](auto in) { return (in->header.opcode == FUSE_GETATTR && in->header.nodeid == ino); }, Eq(true)), _) - ).WillRepeatedly(Invoke(ReturnImmediate([=](auto i __unused, auto out) { + ).WillOnce(Invoke(ReturnImmediate([=](auto i __unused, auto out) { SET_OUT_HEADER_LEN(out, attr); out->body.attr.attr.ino = ino; // Must match nodeid out->body.attr.attr.mode = S_IFREG | 0644; Modified: projects/fuse2/tests/sys/fs/fusefs/write.cc ============================================================================== --- projects/fuse2/tests/sys/fs/fusefs/write.cc Mon Apr 8 18:38:18 2019 (r346042) +++ projects/fuse2/tests/sys/fs/fusefs/write.cc Mon Apr 8 18:45:41 2019 (r346043) @@ -153,7 +153,6 @@ TEST_F(AioWrite, DISABLED_aio_write) expect_lookup(RELPATH, ino, 0); expect_open(ino, 0, 1); - expect_getattr(ino, 0); expect_write(ino, offset, bufsize, bufsize, 0, CONTENTS); fd = open(FULLPATH, O_WRONLY); @@ -197,7 +196,6 @@ TEST_F(Write, append) expect_lookup(RELPATH, ino, initial_offset); expect_open(ino, 0, 1); - expect_getattr(ino, initial_offset); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-projects@freebsd.org Mon Apr 8 22:57:41 2019 Return-Path: Delivered-To: svn-src-projects@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CAEBB156BB85 for ; Mon, 8 Apr 2019 22:57:40 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 622238F9FE; Mon, 8 Apr 2019 22:57:40 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1B29F21B5; Mon, 8 Apr 2019 22:57:40 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x38Mvdcf097806; Mon, 8 Apr 2019 22:57:39 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x38Mvbem097796; Mon, 8 Apr 2019 22:57:37 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201904082257.x38Mvbem097796@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Enji Cooper Date: Mon, 8 Apr 2019 22:57:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r346044 - in projects/runtime-coverage-v2: . contrib/bsnmp/lib contrib/elftoolchain/strings contrib/libxo contrib/libxo/doc contrib/libxo/libxo contrib/libxo/tests/core contrib/libxo/te... X-SVN-Group: projects X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: in projects/runtime-coverage-v2: . contrib/bsnmp/lib contrib/elftoolchain/strings contrib/libxo contrib/libxo/doc contrib/libxo/libxo contrib/libxo/tests/core contrib/libxo/tests/core/saved contrib/li... X-SVN-Commit-Revision: 346044 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 622238F9FE X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.984,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Apr 2019 22:57:41 -0000 Author: ngie Date: Mon Apr 8 22:57:36 2019 New Revision: 346044 URL: https://svnweb.freebsd.org/changeset/base/346044 Log: MFhead@r346043 Added: projects/runtime-coverage-v2/contrib/libxo/libxo/xo_explicit.h - copied unchanged from r346043, head/contrib/libxo/libxo/xo_explicit.h projects/runtime-coverage-v2/contrib/libxo/tests/xo/saved/xo_02.H.err - copied unchanged from r346043, head/contrib/libxo/tests/xo/saved/xo_02.H.err projects/runtime-coverage-v2/contrib/libxo/tests/xo/saved/xo_02.H.out - copied unchanged from r346043, head/contrib/libxo/tests/xo/saved/xo_02.H.out projects/runtime-coverage-v2/contrib/libxo/tests/xo/saved/xo_02.HIPx.err - copied unchanged from r346043, head/contrib/libxo/tests/xo/saved/xo_02.HIPx.err projects/runtime-coverage-v2/contrib/libxo/tests/xo/saved/xo_02.HIPx.out - copied unchanged from r346043, head/contrib/libxo/tests/xo/saved/xo_02.HIPx.out projects/runtime-coverage-v2/contrib/libxo/tests/xo/saved/xo_02.HP.err - copied unchanged from r346043, head/contrib/libxo/tests/xo/saved/xo_02.HP.err projects/runtime-coverage-v2/contrib/libxo/tests/xo/saved/xo_02.HP.out - copied unchanged from r346043, head/contrib/libxo/tests/xo/saved/xo_02.HP.out projects/runtime-coverage-v2/contrib/libxo/tests/xo/saved/xo_02.J.err - copied unchanged from r346043, head/contrib/libxo/tests/xo/saved/xo_02.J.err projects/runtime-coverage-v2/contrib/libxo/tests/xo/saved/xo_02.J.out - copied unchanged from r346043, head/contrib/libxo/tests/xo/saved/xo_02.J.out projects/runtime-coverage-v2/contrib/libxo/tests/xo/saved/xo_02.JP.err - copied unchanged from r346043, head/contrib/libxo/tests/xo/saved/xo_02.JP.err projects/runtime-coverage-v2/contrib/libxo/tests/xo/saved/xo_02.JP.out - copied unchanged from r346043, head/contrib/libxo/tests/xo/saved/xo_02.JP.out projects/runtime-coverage-v2/contrib/libxo/tests/xo/saved/xo_02.T.err - copied unchanged from r346043, head/contrib/libxo/tests/xo/saved/xo_02.T.err projects/runtime-coverage-v2/contrib/libxo/tests/xo/saved/xo_02.T.out - copied unchanged from r346043, head/contrib/libxo/tests/xo/saved/xo_02.T.out projects/runtime-coverage-v2/contrib/libxo/tests/xo/saved/xo_02.X.err - copied unchanged from r346043, head/contrib/libxo/tests/xo/saved/xo_02.X.err projects/runtime-coverage-v2/contrib/libxo/tests/xo/saved/xo_02.X.out - copied unchanged from r346043, head/contrib/libxo/tests/xo/saved/xo_02.X.out projects/runtime-coverage-v2/contrib/libxo/tests/xo/saved/xo_02.XP.err - copied unchanged from r346043, head/contrib/libxo/tests/xo/saved/xo_02.XP.err projects/runtime-coverage-v2/contrib/libxo/tests/xo/saved/xo_02.XP.out - copied unchanged from r346043, head/contrib/libxo/tests/xo/saved/xo_02.XP.out projects/runtime-coverage-v2/contrib/libxo/tests/xo/xo_02.sh - copied unchanged from r346043, head/contrib/libxo/tests/xo/xo_02.sh projects/runtime-coverage-v2/lib/libsecureboot/pass_manifest.c - copied unchanged from r346043, head/lib/libsecureboot/pass_manifest.c projects/runtime-coverage-v2/sys/security/mac_veriexec_parser/ - copied from r346043, head/sys/security/mac_veriexec_parser/ projects/runtime-coverage-v2/tests/sys/geom/class/eli/online_resize_test.sh - copied unchanged from r346043, head/tests/sys/geom/class/eli/online_resize_test.sh projects/runtime-coverage-v2/tools/build/options/WITHOUT_LLVM_TARGET_RISCV - copied unchanged from r346043, head/tools/build/options/WITHOUT_LLVM_TARGET_RISCV projects/runtime-coverage-v2/tools/build/options/WITH_LLVM_TARGET_RISCV - copied unchanged from r346043, head/tools/build/options/WITH_LLVM_TARGET_RISCV projects/runtime-coverage-v2/tools/build/options/WITH_LOADER_VERIEXEC_PASS_MANFIEST - copied unchanged from r346043, head/tools/build/options/WITH_LOADER_VERIEXEC_PASS_MANFIEST Modified: projects/runtime-coverage-v2/UPDATING projects/runtime-coverage-v2/contrib/bsnmp/lib/snmpclient.c projects/runtime-coverage-v2/contrib/elftoolchain/strings/strings.c projects/runtime-coverage-v2/contrib/libxo/configure.ac projects/runtime-coverage-v2/contrib/libxo/doc/api.rst projects/runtime-coverage-v2/contrib/libxo/doc/libxo-manual.html projects/runtime-coverage-v2/contrib/libxo/doc/xo.rst projects/runtime-coverage-v2/contrib/libxo/libxo/Makefile.am projects/runtime-coverage-v2/contrib/libxo/libxo/libxo.c projects/runtime-coverage-v2/contrib/libxo/libxo/xo.h projects/runtime-coverage-v2/contrib/libxo/libxo/xo_attr.3 projects/runtime-coverage-v2/contrib/libxo/libxo/xo_buf.h projects/runtime-coverage-v2/contrib/libxo/libxo/xo_emit.3 projects/runtime-coverage-v2/contrib/libxo/libxo/xo_emit_f.3 projects/runtime-coverage-v2/contrib/libxo/libxo/xo_finish.3 projects/runtime-coverage-v2/contrib/libxo/libxo/xo_flush.3 projects/runtime-coverage-v2/contrib/libxo/libxo/xo_open_container.3 projects/runtime-coverage-v2/contrib/libxo/libxo/xo_open_list.3 projects/runtime-coverage-v2/contrib/libxo/libxo/xo_open_marker.3 projects/runtime-coverage-v2/contrib/libxo/libxo/xo_set_writer.3 projects/runtime-coverage-v2/contrib/libxo/tests/core/saved/test_01.J.out projects/runtime-coverage-v2/contrib/libxo/tests/core/saved/test_02.J.out projects/runtime-coverage-v2/contrib/libxo/tests/core/saved/test_03.J.out projects/runtime-coverage-v2/contrib/libxo/tests/core/saved/test_04.J.out projects/runtime-coverage-v2/contrib/libxo/tests/core/saved/test_05.J.out projects/runtime-coverage-v2/contrib/libxo/tests/core/saved/test_05.JP.out projects/runtime-coverage-v2/contrib/libxo/tests/core/saved/test_06.J.out projects/runtime-coverage-v2/contrib/libxo/tests/core/saved/test_07.J.out projects/runtime-coverage-v2/contrib/libxo/tests/core/saved/test_08.J.out projects/runtime-coverage-v2/contrib/libxo/tests/core/saved/test_09.J.out projects/runtime-coverage-v2/contrib/libxo/tests/core/saved/test_10.J.out projects/runtime-coverage-v2/contrib/libxo/tests/core/saved/test_11.J.out projects/runtime-coverage-v2/contrib/libxo/tests/core/saved/test_12.E.err projects/runtime-coverage-v2/contrib/libxo/tests/core/saved/test_12.E.out projects/runtime-coverage-v2/contrib/libxo/tests/core/saved/test_12.H.err projects/runtime-coverage-v2/contrib/libxo/tests/core/saved/test_12.H.out projects/runtime-coverage-v2/contrib/libxo/tests/core/saved/test_12.HIPx.err projects/runtime-coverage-v2/contrib/libxo/tests/core/saved/test_12.HIPx.out projects/runtime-coverage-v2/contrib/libxo/tests/core/saved/test_12.HP.err projects/runtime-coverage-v2/contrib/libxo/tests/core/saved/test_12.HP.out projects/runtime-coverage-v2/contrib/libxo/tests/core/saved/test_12.J.err projects/runtime-coverage-v2/contrib/libxo/tests/core/saved/test_12.J.out projects/runtime-coverage-v2/contrib/libxo/tests/core/saved/test_12.JP.err projects/runtime-coverage-v2/contrib/libxo/tests/core/saved/test_12.JP.out projects/runtime-coverage-v2/contrib/libxo/tests/core/saved/test_12.T.err projects/runtime-coverage-v2/contrib/libxo/tests/core/saved/test_12.T.out projects/runtime-coverage-v2/contrib/libxo/tests/core/saved/test_12.X.err projects/runtime-coverage-v2/contrib/libxo/tests/core/saved/test_12.X.out projects/runtime-coverage-v2/contrib/libxo/tests/core/saved/test_12.XP.err projects/runtime-coverage-v2/contrib/libxo/tests/core/saved/test_12.XP.out projects/runtime-coverage-v2/contrib/libxo/tests/core/test_12.c projects/runtime-coverage-v2/contrib/libxo/tests/gettext/po/pig_latin/strerror.po projects/runtime-coverage-v2/contrib/libxo/tests/gettext/saved/gt_01.J.out projects/runtime-coverage-v2/contrib/libxo/tests/xo/Makefile.am projects/runtime-coverage-v2/contrib/libxo/tests/xo/saved/xo_01.H.out projects/runtime-coverage-v2/contrib/libxo/tests/xo/saved/xo_01.HIPx.out projects/runtime-coverage-v2/contrib/libxo/tests/xo/saved/xo_01.HP.out projects/runtime-coverage-v2/contrib/libxo/tests/xo/saved/xo_01.J.out projects/runtime-coverage-v2/contrib/libxo/tests/xo/saved/xo_01.JP.out projects/runtime-coverage-v2/contrib/libxo/tests/xo/saved/xo_01.T.out projects/runtime-coverage-v2/contrib/libxo/tests/xo/xo_01.sh projects/runtime-coverage-v2/contrib/libxo/xo/xo.1 projects/runtime-coverage-v2/contrib/libxo/xo/xo.c projects/runtime-coverage-v2/contrib/sqlite3/Makefile.in projects/runtime-coverage-v2/contrib/sqlite3/Makefile.msc projects/runtime-coverage-v2/contrib/sqlite3/aclocal.m4 projects/runtime-coverage-v2/contrib/sqlite3/config.guess projects/runtime-coverage-v2/contrib/sqlite3/config.sub projects/runtime-coverage-v2/contrib/sqlite3/configure projects/runtime-coverage-v2/contrib/sqlite3/configure.ac projects/runtime-coverage-v2/contrib/sqlite3/depcomp projects/runtime-coverage-v2/contrib/sqlite3/install-sh projects/runtime-coverage-v2/contrib/sqlite3/ltmain.sh projects/runtime-coverage-v2/contrib/sqlite3/shell.c projects/runtime-coverage-v2/contrib/sqlite3/sqlite3.c projects/runtime-coverage-v2/contrib/sqlite3/sqlite3.h projects/runtime-coverage-v2/contrib/sqlite3/tea/configure projects/runtime-coverage-v2/contrib/sqlite3/tea/configure.ac projects/runtime-coverage-v2/contrib/sqlite3/tea/generic/tclsqlite3.c projects/runtime-coverage-v2/include/unistd.h projects/runtime-coverage-v2/lib/atf/libatf-c++/tests/Makefile projects/runtime-coverage-v2/lib/atf/libatf-c/tests/Makefile projects/runtime-coverage-v2/lib/clang/include/llvm/Config/AsmParsers.def projects/runtime-coverage-v2/lib/clang/include/llvm/Config/AsmPrinters.def projects/runtime-coverage-v2/lib/clang/include/llvm/Config/Disassemblers.def projects/runtime-coverage-v2/lib/clang/include/llvm/Config/Targets.def projects/runtime-coverage-v2/lib/clang/libllvm/Makefile projects/runtime-coverage-v2/lib/clang/llvm.build.mk projects/runtime-coverage-v2/lib/geom/eli/geli.8 projects/runtime-coverage-v2/lib/geom/eli/geom_eli.c projects/runtime-coverage-v2/lib/libbe/be.c projects/runtime-coverage-v2/lib/libc/net/getnameinfo.c projects/runtime-coverage-v2/lib/libc/sys/Makefile.inc projects/runtime-coverage-v2/lib/libc/sys/Symbol.map projects/runtime-coverage-v2/lib/libc/sys/unlink.2 projects/runtime-coverage-v2/lib/libdevctl/devctl.3 projects/runtime-coverage-v2/lib/libdevctl/devctl.c projects/runtime-coverage-v2/lib/libdevctl/devctl.h projects/runtime-coverage-v2/lib/libsecureboot/Makefile.libsa.inc projects/runtime-coverage-v2/lib/libsecureboot/h/verify_file.h projects/runtime-coverage-v2/lib/libsecureboot/libsecureboot-priv.h projects/runtime-coverage-v2/lib/libsecureboot/verify_file.c projects/runtime-coverage-v2/lib/libutil/pidfile.c projects/runtime-coverage-v2/lib/libvgl/bitmap.c projects/runtime-coverage-v2/lib/libxo/xo_config.h projects/runtime-coverage-v2/libexec/rc/network.subr projects/runtime-coverage-v2/libexec/rc/rc.conf projects/runtime-coverage-v2/libexec/rc/rc.d/abi projects/runtime-coverage-v2/libexec/rc/rc.d/bthidd projects/runtime-coverage-v2/libexec/rc/rc.d/cfumass projects/runtime-coverage-v2/libexec/rc/rc.d/kld projects/runtime-coverage-v2/libexec/rc/rc.d/mdconfig projects/runtime-coverage-v2/libexec/rc/rc.d/mdconfig2 projects/runtime-coverage-v2/libexec/rc/rc.d/mountcritremote projects/runtime-coverage-v2/libexec/rc/rc.d/syscons projects/runtime-coverage-v2/libexec/rc/rc.subr projects/runtime-coverage-v2/release/Makefile.vm projects/runtime-coverage-v2/release/tools/ec2.conf projects/runtime-coverage-v2/release/tools/vmimage.subr projects/runtime-coverage-v2/sbin/bectl/bectl.8 projects/runtime-coverage-v2/sbin/fsck_msdosfs/dir.c projects/runtime-coverage-v2/sbin/fsck_msdosfs/fat.c projects/runtime-coverage-v2/sbin/mount/mount.c projects/runtime-coverage-v2/share/man/man4/intro.4 projects/runtime-coverage-v2/share/man/man5/rc.conf.5 projects/runtime-coverage-v2/share/man/man5/src.conf.5 projects/runtime-coverage-v2/share/mk/src.opts.mk projects/runtime-coverage-v2/stand/common/boot.c projects/runtime-coverage-v2/stand/common/module.c projects/runtime-coverage-v2/stand/efi/loader/main.c projects/runtime-coverage-v2/stand/loader.mk projects/runtime-coverage-v2/sys/amd64/conf/NOTES projects/runtime-coverage-v2/sys/amd64/vmm/io/ppt.c projects/runtime-coverage-v2/sys/arm/ti/cpsw/if_cpsw.c projects/runtime-coverage-v2/sys/cam/ata/ata_all.c projects/runtime-coverage-v2/sys/cddl/compat/opensolaris/sys/vnode.h projects/runtime-coverage-v2/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c projects/runtime-coverage-v2/sys/compat/cloudabi/cloudabi_file.c projects/runtime-coverage-v2/sys/compat/freebsd32/freebsd32_syscall.h projects/runtime-coverage-v2/sys/compat/freebsd32/freebsd32_syscalls.c projects/runtime-coverage-v2/sys/compat/freebsd32/freebsd32_sysent.c projects/runtime-coverage-v2/sys/compat/freebsd32/freebsd32_systrace_args.c projects/runtime-coverage-v2/sys/compat/freebsd32/syscalls.master projects/runtime-coverage-v2/sys/compat/linux/linux_file.c projects/runtime-coverage-v2/sys/compat/linuxkpi/common/include/linux/etherdevice.h projects/runtime-coverage-v2/sys/compat/linuxkpi/common/include/linux/random.h projects/runtime-coverage-v2/sys/conf/files projects/runtime-coverage-v2/sys/conf/newvers.sh projects/runtime-coverage-v2/sys/contrib/dev/acpica/changes.txt projects/runtime-coverage-v2/sys/contrib/dev/acpica/common/adisasm.c projects/runtime-coverage-v2/sys/contrib/dev/acpica/compiler/aslcodegen.c projects/runtime-coverage-v2/sys/contrib/dev/acpica/compiler/aslcompile.c projects/runtime-coverage-v2/sys/contrib/dev/acpica/compiler/aslcompiler.h projects/runtime-coverage-v2/sys/contrib/dev/acpica/compiler/asldefine.h projects/runtime-coverage-v2/sys/contrib/dev/acpica/compiler/aslerror.c projects/runtime-coverage-v2/sys/contrib/dev/acpica/compiler/aslfileio.c projects/runtime-coverage-v2/sys/contrib/dev/acpica/compiler/aslfiles.c projects/runtime-coverage-v2/sys/contrib/dev/acpica/compiler/aslglobal.h projects/runtime-coverage-v2/sys/contrib/dev/acpica/compiler/asllisting.c projects/runtime-coverage-v2/sys/contrib/dev/acpica/compiler/aslload.c projects/runtime-coverage-v2/sys/contrib/dev/acpica/compiler/aslmain.c projects/runtime-coverage-v2/sys/contrib/dev/acpica/compiler/aslmessages.c projects/runtime-coverage-v2/sys/contrib/dev/acpica/compiler/aslmessages.h projects/runtime-coverage-v2/sys/contrib/dev/acpica/compiler/asloperands.c projects/runtime-coverage-v2/sys/contrib/dev/acpica/compiler/asloptions.c projects/runtime-coverage-v2/sys/contrib/dev/acpica/compiler/aslstartup.c projects/runtime-coverage-v2/sys/contrib/dev/acpica/compiler/aslsupport.l projects/runtime-coverage-v2/sys/contrib/dev/acpica/compiler/asltree.c projects/runtime-coverage-v2/sys/contrib/dev/acpica/compiler/asltypes.h projects/runtime-coverage-v2/sys/contrib/dev/acpica/compiler/aslutils.c projects/runtime-coverage-v2/sys/contrib/dev/acpica/compiler/aslxref.c projects/runtime-coverage-v2/sys/contrib/dev/acpica/compiler/dtcompile.c projects/runtime-coverage-v2/sys/contrib/dev/acpica/compiler/prutils.c projects/runtime-coverage-v2/sys/contrib/dev/acpica/components/events/evgpe.c projects/runtime-coverage-v2/sys/contrib/dev/acpica/components/namespace/nsalloc.c projects/runtime-coverage-v2/sys/contrib/dev/acpica/include/acpixf.h projects/runtime-coverage-v2/sys/dev/fdt/fdt_common.c projects/runtime-coverage-v2/sys/dev/iicbus/twsi/a10_twsi.c projects/runtime-coverage-v2/sys/dev/iicbus/twsi/twsi.c projects/runtime-coverage-v2/sys/dev/iicbus/twsi/twsi.h projects/runtime-coverage-v2/sys/dev/pci/pci.c projects/runtime-coverage-v2/sys/dev/pci/pci_pci.c projects/runtime-coverage-v2/sys/dev/pci/pcivar.h projects/runtime-coverage-v2/sys/dev/smartpqi/smartpqi_cam.c projects/runtime-coverage-v2/sys/dev/smartpqi/smartpqi_defines.h projects/runtime-coverage-v2/sys/dev/tpm/tpm20.c projects/runtime-coverage-v2/sys/dev/usb/net/if_muge.c projects/runtime-coverage-v2/sys/dev/usb/net/if_urereg.h projects/runtime-coverage-v2/sys/fs/fuse/fuse_vfsops.c projects/runtime-coverage-v2/sys/fs/msdosfs/msdosfs_denode.c projects/runtime-coverage-v2/sys/fs/nfs/nfs.h projects/runtime-coverage-v2/sys/fs/nfs/nfs_commonkrpc.c projects/runtime-coverage-v2/sys/fs/nfs/nfs_commonport.c projects/runtime-coverage-v2/sys/fs/nfs/nfs_commonsubs.c projects/runtime-coverage-v2/sys/fs/nfs/nfs_var.h projects/runtime-coverage-v2/sys/fs/nfsclient/nfs_clport.c projects/runtime-coverage-v2/sys/geom/eli/g_eli.c projects/runtime-coverage-v2/sys/geom/eli/g_eli.h projects/runtime-coverage-v2/sys/geom/eli/g_eli_ctl.c projects/runtime-coverage-v2/sys/geom/eli/g_eli_key_cache.c projects/runtime-coverage-v2/sys/i386/conf/NOTES projects/runtime-coverage-v2/sys/kern/bus_if.m projects/runtime-coverage-v2/sys/kern/capabilities.conf projects/runtime-coverage-v2/sys/kern/imgact_elf.c projects/runtime-coverage-v2/sys/kern/init_sysent.c projects/runtime-coverage-v2/sys/kern/kern_exit.c projects/runtime-coverage-v2/sys/kern/subr_bus.c projects/runtime-coverage-v2/sys/kern/subr_pctrie.c projects/runtime-coverage-v2/sys/kern/syscalls.c projects/runtime-coverage-v2/sys/kern/syscalls.master projects/runtime-coverage-v2/sys/kern/systrace_args.c projects/runtime-coverage-v2/sys/kern/vfs_mountroot.c projects/runtime-coverage-v2/sys/kern/vfs_syscalls.c projects/runtime-coverage-v2/sys/kern/vfs_vnops.c projects/runtime-coverage-v2/sys/modules/geom/geom_label/Makefile projects/runtime-coverage-v2/sys/net/if_spppsubr.c projects/runtime-coverage-v2/sys/netinet/in.c projects/runtime-coverage-v2/sys/netinet/ip_input.c projects/runtime-coverage-v2/sys/netinet/ip_output.c projects/runtime-coverage-v2/sys/netinet/netdump/netdump_client.c projects/runtime-coverage-v2/sys/netinet/tcp_output.c projects/runtime-coverage-v2/sys/netipsec/key.c projects/runtime-coverage-v2/sys/netipsec/key.h projects/runtime-coverage-v2/sys/netipsec/xform_esp.c projects/runtime-coverage-v2/sys/netpfil/ipfw/nat64/nat64_translate.h projects/runtime-coverage-v2/sys/netpfil/pf/pf.c projects/runtime-coverage-v2/sys/powerpc/fpu/fpu_sqrt.c projects/runtime-coverage-v2/sys/powerpc/include/trap.h projects/runtime-coverage-v2/sys/powerpc/powernv/opal.h projects/runtime-coverage-v2/sys/powerpc/powernv/opal_async.c projects/runtime-coverage-v2/sys/powerpc/powernv/opal_flash.c projects/runtime-coverage-v2/sys/powerpc/powerpc/exec_machdep.c projects/runtime-coverage-v2/sys/powerpc/powerpc/trap.c projects/runtime-coverage-v2/sys/riscv/include/pcpu.h projects/runtime-coverage-v2/sys/riscv/riscv/machdep.c projects/runtime-coverage-v2/sys/rpc/rpcsec_gss/svc_rpcsec_gss.c projects/runtime-coverage-v2/sys/sparc64/conf/NOTES projects/runtime-coverage-v2/sys/sys/ata.h projects/runtime-coverage-v2/sys/sys/bus.h projects/runtime-coverage-v2/sys/sys/fcntl.h projects/runtime-coverage-v2/sys/sys/param.h projects/runtime-coverage-v2/sys/sys/pctrie.h projects/runtime-coverage-v2/sys/sys/syscall.h projects/runtime-coverage-v2/sys/sys/syscall.mk projects/runtime-coverage-v2/sys/sys/syscallsubr.h projects/runtime-coverage-v2/sys/sys/sysproto.h projects/runtime-coverage-v2/sys/ufs/ffs/ffs_alloc.c projects/runtime-coverage-v2/sys/ufs/ffs/ffs_vfsops.c projects/runtime-coverage-v2/sys/vm/vm_map.c projects/runtime-coverage-v2/tests/sys/geom/class/eli/Makefile projects/runtime-coverage-v2/tests/sys/geom/class/eli/configure_test.sh projects/runtime-coverage-v2/tests/sys/kern/ptrace_test.c projects/runtime-coverage-v2/tools/build/Makefile projects/runtime-coverage-v2/usr.bin/rctl/rctl.c projects/runtime-coverage-v2/usr.bin/sort/coll.c projects/runtime-coverage-v2/usr.bin/strings/Makefile projects/runtime-coverage-v2/usr.bin/xohtml/xohtml.sh projects/runtime-coverage-v2/usr.sbin/bhyve/Makefile projects/runtime-coverage-v2/usr.sbin/bhyve/pci_nvme.c projects/runtime-coverage-v2/usr.sbin/bhyve/uart_emul.c projects/runtime-coverage-v2/usr.sbin/devctl/devctl.8 projects/runtime-coverage-v2/usr.sbin/devctl/devctl.c projects/runtime-coverage-v2/usr.sbin/nfsuserd/Makefile projects/runtime-coverage-v2/usr.sbin/nfsuserd/nfsuserd.8 projects/runtime-coverage-v2/usr.sbin/nfsuserd/nfsuserd.c projects/runtime-coverage-v2/usr.sbin/vidcontrol/vidcontrol.c Directory Properties: projects/runtime-coverage-v2/ (props changed) projects/runtime-coverage-v2/contrib/elftoolchain/ (props changed) projects/runtime-coverage-v2/contrib/libxo/ (props changed) projects/runtime-coverage-v2/contrib/sqlite3/ (props changed) projects/runtime-coverage-v2/sys/cddl/contrib/opensolaris/ (props changed) projects/runtime-coverage-v2/sys/contrib/dev/acpica/ (props changed) Modified: projects/runtime-coverage-v2/UPDATING ============================================================================== --- projects/runtime-coverage-v2/UPDATING Mon Apr 8 18:45:41 2019 (r346043) +++ projects/runtime-coverage-v2/UPDATING Mon Apr 8 22:57:36 2019 (r346044) @@ -31,6 +31,14 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 13.x IS SLOW: disable the most expensive debugging functionality run "ln -s 'abort:false,junk:false' /etc/malloc.conf".) +20190404: + r345895 reverts r320698. This implies that an nfsuserd(8) daemon + built from head sources between r320757 (July 6, 2017) and + r338192 (Aug. 22, 2018) will not work unless the "-use-udpsock" + is added to the command line. + nfsuserd daemons built from head sources that are post-r338192 are + not affected and should continue to work. + 20190320: The fuse(4) module has been renamed to fusefs(4) for consistency with other filesystems. You should update any kld_load="fuse" entries in Modified: projects/runtime-coverage-v2/contrib/bsnmp/lib/snmpclient.c ============================================================================== --- projects/runtime-coverage-v2/contrib/bsnmp/lib/snmpclient.c Mon Apr 8 18:45:41 2019 (r346043) +++ projects/runtime-coverage-v2/contrib/bsnmp/lib/snmpclient.c Mon Apr 8 22:57:36 2019 (r346044) @@ -1874,38 +1874,47 @@ snmp_client_set_port(struct snmp_client *cl, const cha return (0); } +static const char *const trans_list[] = { + [SNMP_TRANS_UDP] = "udp::", + [SNMP_TRANS_LOC_DGRAM] = "dgram::", + [SNMP_TRANS_LOC_STREAM] = "stream::", + [SNMP_TRANS_UDP6] = "udp6::", +}; + /** * Try to get a transport identifier which is a leading alphanumeric string - * (starting with '_' or a letter and including also '_') terminated by - * a double colon. The string may not be empty. The transport identifier - * is optional. + * terminated by a double colon. The string may not be empty. The transport + * identifier is optional. * * \param sc client struct to set errors * \param strp possible start of transport; updated to point to * the next character to parse * - * \return end of transport; equals *strp if there is none; NULL if there - * was an error + * \return transport identifier */ -static inline const char * +static inline int get_transp(struct snmp_client *sc, const char **strp) { - const char *p = *strp; + const char *p; + size_t i; - if (isascii(*p) && (isalpha(*p) || *p == '_')) { - p++; - while (isascii(*p) && (isalnum(*p) || *p == '_')) - p++; - if (p[0] == ':' && p[1] == ':') { - *strp = p + 2; - return (p); + for (i = 0; i < nitems(trans_list); i++) { + if (trans_list[i] == NULL || *trans_list[i] == '\0') + continue; + p = strstr(*strp, trans_list[i]); + if (p == *strp) { + *strp += strlen(trans_list[i]); + return ((int)i); } } + + p = *strp; if (p[0] == ':' && p[1] == ':') { seterr(sc, "empty transport specifier"); - return (NULL); + return (-1); } - return (*strp); + /* by default assume UDP */ + return (SNMP_TRANS_UDP); } /** @@ -2143,24 +2152,13 @@ save_str(struct snmp_client *sc, const char *const s[2 int snmp_parse_server(struct snmp_client *sc, const char *str) { -#if DEBUG_PARSE const char *const orig = str; -#endif - - const char *const trans_list[] = { - [SNMP_TRANS_UDP] = "udp", - [SNMP_TRANS_LOC_DGRAM] = "dgram", - [SNMP_TRANS_LOC_STREAM] = "stream", - [SNMP_TRANS_UDP6] = "udp6", - }; - /* parse input */ - const char *const transp[2] = { - str, - get_transp(sc, &str), - }; - if (transp[1] == NULL) + int i, trans = get_transp(sc, &str); + if (trans < 0) return (-1); + /* choose automatically */ + i = orig == str ? -1: trans; const char *const comm[2] = { str, @@ -2206,7 +2204,7 @@ snmp_parse_server(struct snmp_client *sc, const char * } #if DEBUG_PARSE - printf("transp: %zu %zu\n", transp[0] - orig, transp[1] - orig); + printf("transp: %u\n", trans); printf("comm: %zu %zu\n", comm[0] - orig, comm[1] - orig); printf("ipv6: %zu %zu\n", ipv6[0] - orig, ipv6[1] - orig); printf("ipv4: %zu %zu\n", ipv4[0] - orig, ipv4[1] - orig); @@ -2215,69 +2213,73 @@ snmp_parse_server(struct snmp_client *sc, const char * #endif /* analyse and allocate */ - int i = -1; - if (transp[0] != transp[1]) { - for (i = 0; i < (int)nitems(trans_list); i++) { - if (trans_list[i] != NULL && - strlen(trans_list[i]) == (size_t)(transp[1] - - transp[0]) && !strncmp(trans_list[i], transp[0], - transp[1] - transp[0])) - break; - } - - if (i == (int)nitems(trans_list)) { - seterr(sc, "unknown transport specifier '%.*s'", - transp[1] - transp[0], transp[0]); - return (-1); - } - } - char *chost; if (ipv6[0] != ipv6[1]) { if ((chost = save_str(sc, ipv6)) == NULL) return (-1); - if (i == -1) - i = SNMP_TRANS_UDP6; + if (i == -1 || trans == SNMP_TRANS_UDP) + trans = SNMP_TRANS_UDP6; } else if (ipv4[0] != ipv4[1]) { if ((chost = save_str(sc, ipv4)) == NULL) return (-1); if (i == -1) - i = SNMP_TRANS_UDP; + trans = SNMP_TRANS_UDP; } else { if ((chost = save_str(sc, host)) == NULL) return (-1); if (i == -1) { - /* Default transport is UDP unless the host contains - * a slash in which case we default to DGRAM. */ - i = SNMP_TRANS_UDP; + /* + * Default transport is UDP unless the host contains + * a slash in which case we default to DGRAM. + */ for (const char *p = host[0]; p < host[1]; p++) if (*p == '/') { - i = SNMP_TRANS_LOC_DGRAM; + trans = SNMP_TRANS_LOC_DGRAM; break; } } } - char *cport = save_str(sc, port); + char *cport; + + if (port[0] == port[1] && ( + trans == SNMP_TRANS_UDP || trans == SNMP_TRANS_UDP6)) { + /* If port was not specified, use "snmp" name by default */ + cport = strdup("snmp"); + } else + cport = save_str(sc, port); + if (cport == NULL) { free(chost); return (-1); } /* commit */ - sc->trans = i; + sc->trans = trans; + /* + * If community string was specified and it is empty, overwrite it. + * If it was not specified, use default. + */ + if (comm[0] != comm[1] || strrchr(comm[0], '@') != NULL) { + strncpy(sc->read_community, comm[0], comm[1] - comm[0]); + sc->read_community[comm[1] - comm[0]] = '\0'; + strncpy(sc->write_community, comm[0], comm[1] - comm[0]); + sc->write_community[comm[1] - comm[0]] = '\0'; + } - strncpy(sc->read_community, comm[0], comm[1] - comm[0]); - sc->read_community[comm[1] - comm[0]] = '\0'; - strncpy(sc->write_community, comm[0], comm[1] - comm[0]); - sc->write_community[comm[1] - comm[0]] = '\0'; - free(sc->chost); sc->chost = chost; free(sc->cport); sc->cport = cport; +#if DEBUG_PARSE + printf("Committed values:\n"); + printf("trans: %u\n", sc->trans); + printf("comm: '%s'/'%s'\n", sc->read_community, sc->write_community); + printf("host: '%s'\n", sc->chost); + printf("port: '%s'\n", sc->cport); +#endif return (0); } Modified: projects/runtime-coverage-v2/contrib/elftoolchain/strings/strings.c ============================================================================== --- projects/runtime-coverage-v2/contrib/elftoolchain/strings/strings.c Mon Apr 8 18:45:41 2019 (r346043) +++ projects/runtime-coverage-v2/contrib/elftoolchain/strings/strings.c Mon Apr 8 22:57:36 2019 (r346044) @@ -25,8 +25,10 @@ */ #include +#include #include +#include #include #include #include @@ -44,6 +46,9 @@ #include #include +#include +#include + #include "_elftc.h" ELFTC_VCSID("$Id: strings.c 3648 2018-11-22 23:26:43Z emaste $"); @@ -85,7 +90,7 @@ static struct option strings_longopts[] = { }; int getcharacter(FILE *, long *); -int handle_file(const char *); +int handle_file(fileargs_t *fa, const char *); int handle_elf(const char *, FILE *); int handle_binary(const char *, FILE *, size_t); int find_strings(const char *, FILE *, off_t, off_t); @@ -99,6 +104,8 @@ void usage(void); int main(int argc, char **argv) { + fileargs_t *fa; + cap_rights_t rights; int ch, rc; rc = 0; @@ -187,27 +194,41 @@ main(int argc, char **argv) argc -= optind; argv += optind; + cap_rights_init(&rights, CAP_READ, CAP_SEEK, CAP_FSTAT, CAP_FCNTL); + fa = fileargs_init(argc, argv, O_RDONLY, 0, &rights); + if (fa == NULL) + err(1, "Unable to initialize casper fileargs"); + + caph_cache_catpages(); + if (caph_limit_stdio() < 0 && caph_enter_casper() < 0) { + fileargs_free(fa); + err(1, "Unable to enter capability mode"); + } + if (min_len == 0) min_len = 4; if (*argv == NULL) rc = find_strings("{standard input}", stdin, 0, 0); else while (*argv != NULL) { - if (handle_file(*argv) != 0) + if (handle_file(fa, *argv) != 0) rc = 1; argv++; } + + fileargs_free(fa); + return (rc); } int -handle_file(const char *name) +handle_file(fileargs_t *fa, const char *name) { FILE *pfile; int rt; if (name == NULL) return (1); - pfile = fopen(name, "rb"); + pfile = fileargs_fopen(fa, name, "rb"); if (pfile == NULL) { warnx("'%s': %s", name, strerror(errno)); return (1); Modified: projects/runtime-coverage-v2/contrib/libxo/configure.ac ============================================================================== --- projects/runtime-coverage-v2/contrib/libxo/configure.ac Mon Apr 8 18:45:41 2019 (r346043) +++ projects/runtime-coverage-v2/contrib/libxo/configure.ac Mon Apr 8 22:57:36 2019 (r346044) @@ -12,7 +12,7 @@ # AC_PREREQ(2.2) -AC_INIT([libxo], [0.9.0], [phil@juniper.net]) +AC_INIT([libxo], [1.0.2], [phil@juniper.net]) AM_INIT_AUTOMAKE([-Wall -Werror foreign -Wno-portability]) # Support silent build rules. Requires at least automake-1.11. Modified: projects/runtime-coverage-v2/contrib/libxo/doc/api.rst ============================================================================== --- projects/runtime-coverage-v2/contrib/libxo/doc/api.rst Mon Apr 8 18:45:41 2019 (r346043) +++ projects/runtime-coverage-v2/contrib/libxo/doc/api.rst Mon Apr 8 22:57:36 2019 (r346044) @@ -400,28 +400,28 @@ string, since an inappropriate cast can ruin your day. argument to `xo_emit_hv` points to a variable argument list that can be used to retrieve arguments via `va_arg`. -.. c:function:: int xo_emit (const char *fmt, ...) +.. c:function:: xo_ssize_t xo_emit (const char *fmt, ...) :param fmt: The format string, followed by zero or more arguments :returns: If XOF_COLUMNS is set, the number of columns used; otherwise the number of bytes emitted - :rtype: int + :rtype: xo_ssize_t -.. c:function:: int xo_emit_h (xo_handle_t *xop, const char *fmt, ...) +.. c:function:: xo_ssize_t xo_emit_h (xo_handle_t *xop, const char *fmt, ...) :param xop: Handle for modify (or NULL for default handle) :type xop: xo_handle_t \* :param fmt: The format string, followed by zero or more arguments :returns: If XOF_COLUMNS is set, the number of columns used; otherwise the number of bytes emitted - :rtype: int + :rtype: xo_ssize_t -.. c:function:: int xo_emit_hv (xo_handle_t *xop, const char *fmt, va_list vap) +.. c:function:: xo_ssize_t xo_emit_hv (xo_handle_t *xop, const char *fmt, va_list vap) :param xop: Handle for modify (or NULL for default handle) :type xop: xo_handle_t \* :param fmt: The format string :param va_list vap: A set of variadic arguments :returns: If XOF_COLUMNS is set, the number of columns used; otherwise the number of bytes emitted - :rtype: int + :rtype: xo_ssize_t .. index:: xo_emit_field @@ -434,7 +434,7 @@ scenario where one would otherwise need to compose a f descriptors using `snprintf`. The individual parts of the format descriptor are passed in distinctly. -.. c:function:: int xo_emit_field (const char *rolmod, const char *contents, const char *fmt, const char *efmt, ...) +.. c:function:: xo_ssize_t xo_emit_field (const char *rolmod, const char *contents, const char *fmt, const char *efmt, ...) :param rolmod: A comma-separated list of field roles and field modifiers :type rolmod: const char * @@ -445,7 +445,7 @@ descriptor are passed in distinctly. :param efmt: Encoding format string, followed by additional arguments :type efmt: const char * :returns: If XOF_COLUMNS is set, the number of columns used; otherwise the number of bytes emitted - :rtype: int + :rtype: xo_ssize_t :: @@ -453,7 +453,7 @@ descriptor are passed in distinctly. xo_emit_field("T", "Host name is ", NULL, NULL); xo_emit_field("V", "host-name", NULL, NULL, host-name); -.. c:function:: int xo_emit_field_h (xo_handle_t *xop, const char *rolmod, const char *contents, const char *fmt, const char *efmt, ...) +.. c:function:: xo_ssize_t xo_emit_field_h (xo_handle_t *xop, const char *rolmod, const char *contents, const char *fmt, const char *efmt, ...) :param xop: Handle for modify (or NULL for default handle) :type xop: xo_handle_t \* @@ -466,9 +466,9 @@ descriptor are passed in distinctly. :param efmt: Encoding format string, followed by additional arguments :type efmt: const char * :returns: If XOF_COLUMNS is set, the number of columns used; otherwise the number of bytes emitted - :rtype: int + :rtype: xo_ssize_t -.. c:function:: int xo_emit_field_hv (xo_handle_t *xop, const char *rolmod, const char *contents, const char *fmt, const char *efmt, va_list vap) +.. c:function:: xo_ssize_t xo_emit_field_hv (xo_handle_t *xop, const char *rolmod, const char *contents, const char *fmt, const char *efmt, va_list vap) :param xop: Handle for modify (or NULL for default handle) :type xop: xo_handle_t \* @@ -482,7 +482,7 @@ descriptor are passed in distinctly. :type efmt: const char * :param va_list vap: A set of variadic arguments :returns: If XOF_COLUMNS is set, the number of columns used; otherwise the number of bytes emitted - :rtype: int + :rtype: xo_ssize_t .. index:: xo_attr .. _xo_attr: @@ -505,14 +505,14 @@ Since attributes are only emitted in XML, their use sh to meta-data and additional or redundant representations of data already emitted in other form. -.. c:function:: int xo_attr (const char *name, const char *fmt, ...) +.. c:function:: xo_ssize_t xo_attr (const char *name, const char *fmt, ...) :param name: Attribute name :type name: const char * :param fmt: Attribute value, as variadic arguments :type fmt: const char * :returns: -1 for error, or the number of bytes in the formatted attribute value - :rtype: int + :rtype: xo_ssize_t :: @@ -525,7 +525,7 @@ already emitted in other form. 00:14 -.. c:function:: int xo_attr_h (xo_handle_t *xop, const char *name, const char *fmt, ...) +.. c:function:: xo_ssize_t xo_attr_h (xo_handle_t *xop, const char *name, const char *fmt, ...) :param xop: Handle for modify (or NULL for default handle) :type xop: xo_handle_t \* @@ -533,7 +533,7 @@ already emitted in other form. The `xo_attr_h` function follows the conventions of `xo_attr` but adds an explicit libxo handle. -.. c:function:: int xo_attr_hv (xo_handle_t *xop, const char *name, const char *fmt, va_list vap) +.. c:function:: xo_ssize_t xo_attr_hv (xo_handle_t *xop, const char *name, const char *fmt, va_list vap) The `xo_attr_h` function follows the conventions of `xo_attr_h` but replaced the variadic list with a variadic pointer. Modified: projects/runtime-coverage-v2/contrib/libxo/doc/libxo-manual.html ============================================================================== --- projects/runtime-coverage-v2/contrib/libxo/doc/libxo-manual.html Mon Apr 8 18:45:41 2019 (r346043) +++ projects/runtime-coverage-v2/contrib/libxo/doc/libxo-manual.html Mon Apr 8 22:57:36 2019 (r346044) @@ -515,7 +515,7 @@ li.indline1 { } @top-right { - content: "May 2018"; + content: "April 2019"; } @top-center { @@ -22011,7 +22011,7 @@ jQuery(function ($) { -May 21, 2018 +April 2, 2019

libxo: The Easy Way to Generate text, XML, JSON, and HTML output
libxo-manual

Modified: projects/runtime-coverage-v2/contrib/libxo/doc/xo.rst ============================================================================== --- projects/runtime-coverage-v2/contrib/libxo/doc/xo.rst Mon Apr 8 18:45:41 2019 (r346043) +++ projects/runtime-coverage-v2/contrib/libxo/doc/xo.rst Mon Apr 8 22:57:36 2019 (r346044) @@ -75,7 +75,7 @@ prepend data to the XPath values used for HTML output EXAMPLE; #!/bin/sh xo --open top/data - xo --depth 2 '{tag}' value + xo --depth 2 '{:tag}' value xo --close top/data XML: @@ -90,6 +90,84 @@ prepend data to the XPath values used for HTML output } } +When making partial lines of output (where the format string does not +include a newline), use the `--continuation` option to let secondary +invocations know they are adding data to an existing line. + +When emitting a series of objects, use the `--not-first` option to +ensure that any details from the previous object (e.g. commas in JSON) +are handled correctly. + +Use the `--top-wrap` option to ensure any top-level object details are +handled correctly, e.g. wrap the entire output in a top-level set of +braces for JSON output. + + EXAMPLE; + #!/bin/sh + xo --top-wrap --open top/data + xo --depth 2 'First {:tag} ' value1 + xo --depth 2 --continuation 'and then {:tag}\n' value2 + xo --top-wrap --close top/data + TEXT: + First value1 and then value2 + HTML: +
+
First
+
value1
+
+
and then
+
value2
+
+ XML: + + + value1 + value2 + + + JSON: + { + "top": { + "data": { + "tag": "value1", + "tag": "value2" + } + } + } + +Lists and Instances +------------------- + +A "*list*" is set of one or more instances that appear under the same +parent. The instances contain details about a specific object. One +can think of instances as objects or records. A call is needed to +open and close the list, while a distinct call is needed to open and +close each instance of the list. + +Use the `--open-list` and `--open-instances` to open lists and +instances. Use the `--close-list` and `--close-instances` to close +them. Each of these options take a `name` parameter, providing the +name of the list and instance. + +In the following example, a list named "machine" is created with three +instances: + + opts="--json" + xo $opts --open-list machine + NF= + for name in red green blue; do + xo $opts --depth 1 $NF --open-instance machine + xo $opts --depth 2 "Machine {k:name} has {:memory}\n" $name 55 + xo $opts --depth 1 --close-instance machine + NF=--not-first + done + xo $opts $NF --close-list machine + +The normal `libxo` functions use a state machine to help these +transitions, but since each `xo` command is invoked independent of the +previous calls, the state must be passed in explicitly via these +command line options. + Command Line Options -------------------- @@ -97,15 +175,23 @@ Command Line Options Usage: xo [options] format [fields] --close Close tags for the given path + --close-instance Close an open instance name + --close-list Close an open list name + --continuation OR -C Output belongs on same line as previous output --depth Set the depth for pretty printing --help Display this help text --html OR -H Generate HTML output --json OR -J Generate JSON output --leading-xpath Add a prefix to generated XPaths (HTML) + --not-first Indicate this object is not the first (JSON) --open Open tags for the given path + --open-instance Open an instance given by name + --open-list Open a list given by name + --option -or -O Give formatting options --pretty OR -p Make 'pretty' output (add indent, newlines) --style