svn commit: r364292 - in head: lib/libc/tests/sys lib/libfetch lib/libpam/libpam lib/msun/tests libexec/rtld-elf usr.bin/fetch usr.bin/unzip
Author: delphij Date: Mon Aug 17 05:57:02 2020 New Revision: 364292 URL: https://svnweb.freebsd.org/changeset/base/364292 Log: Don't explicitly specify c99 or gnu99 as the default is now gnu99. MFC after:2 weeks Modified: head/lib/libc/tests/sys/Makefile head/lib/libfetch/Makefile head/lib/libpam/libpam/Makefile head/lib/msun/tests/Makefile head/libexec/rtld-elf/Makefile head/usr.bin/fetch/Makefile head/usr.bin/unzip/Makefile Modified: head/lib/libc/tests/sys/Makefile == --- head/lib/libc/tests/sys/MakefileSun Aug 16 23:55:23 2020 (r364291) +++ head/lib/libc/tests/sys/MakefileMon Aug 17 05:57:02 2020 (r364292) @@ -70,8 +70,6 @@ NETBSD_ATF_TESTS_C+= wait_noproc_test NETBSD_ATF_TESTS_C+= wait_noproc_wnohang_test NETBSD_ATF_TESTS_C+= write_test -CSTD?= c99 - LIBADD.getpid_test+= pthread LIBADD.timer_create_test+= rt Modified: head/lib/libfetch/Makefile == --- head/lib/libfetch/Makefile Sun Aug 16 23:55:23 2020(r364291) +++ head/lib/libfetch/Makefile Mon Aug 17 05:57:02 2020(r364292) @@ -23,8 +23,6 @@ LIBADD+= md CFLAGS+= -DFTP_COMBINE_CWDS -CSTD?= c99 - SHLIB_MAJOR=6 ftperr.h: ftp.errors ${.CURDIR}/Makefile Modified: head/lib/libpam/libpam/Makefile == --- head/lib/libpam/libpam/Makefile Sun Aug 16 23:55:23 2020 (r364291) +++ head/lib/libpam/libpam/Makefile Mon Aug 17 05:57:02 2020 (r364292) @@ -156,7 +156,6 @@ MAN?= openpam.3 \ MLINKS?= pam.conf.5 pam.d.5 -CSTD?= c99 CFLAGS+= -I${OPENPAM}/include CFLAGS+= -DLIB_MAJ=${SHLIB_MAJOR} CFLAGS+= -DHAVE_DLFUNC=1 Modified: head/lib/msun/tests/Makefile == --- head/lib/msun/tests/MakefileSun Aug 16 23:55:23 2020 (r364291) +++ head/lib/msun/tests/MakefileMon Aug 17 05:57:02 2020 (r364292) @@ -75,8 +75,6 @@ ATF_TESTS_C+= trig_test CFLAGS+= -O0 .endif -CSTD= c99 - #COPTS+= -Wfloat-equal IGNORE_PRAGMA= Modified: head/libexec/rtld-elf/Makefile == --- head/libexec/rtld-elf/Makefile Sun Aug 16 23:55:23 2020 (r364291) +++ head/libexec/rtld-elf/Makefile Mon Aug 17 05:57:02 2020 (r364292) @@ -29,7 +29,6 @@ SRCS= \ debug.c \ libmap.c MAN?= rtld.1 -CSTD?= gnu99 ACFLAGS+= -DLOCORE CFLAGS+= -Wall -DFREEBSD_ELF -DIN_RTLD -ffreestanding CFLAGS+= -I${SRCTOP}/lib/csu/common Modified: head/usr.bin/fetch/Makefile == --- head/usr.bin/fetch/Makefile Sun Aug 16 23:55:23 2020(r364291) +++ head/usr.bin/fetch/Makefile Mon Aug 17 05:57:02 2020(r364292) @@ -1,7 +1,6 @@ # $FreeBSD$ PROG= fetch -CSTD?= c99 LIBADD=fetch .include Modified: head/usr.bin/unzip/Makefile == --- head/usr.bin/unzip/Makefile Sun Aug 16 23:55:23 2020(r364291) +++ head/usr.bin/unzip/Makefile Mon Aug 17 05:57:02 2020(r364292) @@ -1,7 +1,6 @@ # $FreeBSD$ PROG = unzip -CSTD = c99 LIBADD=archive .include ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r364293 - head/usr.sbin/edquota
Author: delphij Date: Mon Aug 17 05:57:22 2020 New Revision: 364293 URL: https://svnweb.freebsd.org/changeset/base/364293 Log: edquota(8): Cleanup to make it WARNS=6 clean. Tested with: make tinderbox MFC after:2 weeks Modified: head/usr.sbin/edquota/Makefile head/usr.sbin/edquota/edquota.c Modified: head/usr.sbin/edquota/Makefile == --- head/usr.sbin/edquota/Makefile Mon Aug 17 05:57:02 2020 (r364292) +++ head/usr.sbin/edquota/Makefile Mon Aug 17 05:57:22 2020 (r364293) @@ -4,9 +4,6 @@ PROG= edquota MAN= edquota.8 -CSTD= gnu99 -WARNS?=4 - LIBADD=util .include Modified: head/usr.sbin/edquota/edquota.c == --- head/usr.sbin/edquota/edquota.c Mon Aug 17 05:57:02 2020 (r364292) +++ head/usr.sbin/edquota/edquota.c Mon Aug 17 05:57:22 2020 (r364293) @@ -83,9 +83,9 @@ __FBSDID("$FreeBSD$"); #define dbtokb(db) (db) #endif -const char *qfextension[] = INITQFNAMES; -char tmpfil[] = _PATH_TMP; -int hflag; +static const char *qfextension[] = INITQFNAMES; +static char tmpfil[] = _PATH_TMP; +static int hflag; struct quotause { struct quotause *next; ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r364291 - head/usr.bin/patch
Author: imp Date: Sun Aug 16 23:55:23 2020 New Revision: 364291 URL: https://svnweb.freebsd.org/changeset/base/364291 Log: Remove heuristic for dealing with trailing newlines being truncated by mailers. Every version of patch since the first one posted to mod.sources in 1985 have included a heuristic for coping with the state of email messaging at the time. This heuristic would add up to 4 blank lines to a patch if it thought it needed it. The trouble is, though this causes at least one bug. The bug in my case is that if you have a context diff whose last hunk only deletes 3 or fewer lines, then if you try to reverse apply it with -R, it will fail. The reason for this is the heuristic builds an internal representation that includes those blank lines. However, it should really replicate the lines from the pattern lines line it would any other time, not assume they are blank lines. Removing this heuristic will prevent patch from misapplying the lines removed after applying a 'fuzz' factor to the previous blank line in the file. I believe this will only affect 'new-style' 4.3BSD context diffs and not the older-style 4.2BSD diffs and plain, non-context diffs. It won't affect any of the newer formats, since they don't use the 'omitted' construct in the same way. Since this heuristic was put into patch at a time when email / etc ate trailing white space on a regular basis, and since it's clear that this heuristic is the wrong thing to do at least some of the time, it's better to remove it entirely. It's not been needed for maybe 20 years since patch files are not usually corrupted. If there are a small number of patch files that would benefit from this corruption fixing, those already-currupt patches can be fixed by the addition of blank lines. I'd wager that no one will ever come to me with an example of a once-working patch file that breaks with this change. However, I have 2 patches from the first 195 patches to 2.11BSD that are affected by this bug, suggesting that the relative frequency of the issue has changed signficantly since the original heuristic was put into place. Reviewed by: phk@ Differential Revision: https://reviews.freebsd.org/D26081 Modified: head/usr.bin/patch/pch.c Modified: head/usr.bin/patch/pch.c == --- head/usr.bin/patch/pch.cSun Aug 16 22:50:59 2020(r364290) +++ head/usr.bin/patch/pch.cSun Aug 16 23:55:23 2020(r364291) @@ -587,16 +587,11 @@ another_hunk(void) len = pgets(true); p_input_line++; if (len == 0) { - if (p_max - p_end < 4) { - /* assume blank lines got chopped */ - strlcpy(buf, " \n", buf_size); - } else { - if (repl_beginning && repl_could_be_missing) { - repl_missing = true; - goto hunk_done; - } - fatal("unexpected end of file in patch\n"); + if (repl_beginning && repl_could_be_missing) { + repl_missing = true; + goto hunk_done; } + fatal("unexpected end of file in patch\n"); } p_end++; if (p_end >= hunkmax) ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r364290 - head/sys/kern
Author: kib Date: Sun Aug 16 22:50:59 2020 New Revision: 364290 URL: https://svnweb.freebsd.org/changeset/base/364290 Log: Fix powerpc build. Sponsored by: The FreeBSD Foundation Modified: head/sys/kern/vfs_vnops.c Modified: head/sys/kern/vfs_vnops.c == --- head/sys/kern/vfs_vnops.c Sun Aug 16 21:07:19 2020(r364289) +++ head/sys/kern/vfs_vnops.c Sun Aug 16 22:50:59 2020(r364290) @@ -929,7 +929,7 @@ vn_read_from_obj(struct vnode *vp, struct uio *uio) * break calculation. */ #if defined(__powerpc__) && !defined(__powerpc64__) - vsz = object->un_pager.vnp.vnp_size; + vsz = obj->un_pager.vnp.vnp_size; #else vsz = atomic_load_64(&obj->un_pager.vnp.vnp_size); #endif ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r364289 - head/sys/ufs/ufs
Author: kib Date: Sun Aug 16 21:07:19 2020 New Revision: 364289 URL: https://svnweb.freebsd.org/changeset/base/364289 Log: VMIO reads: enable for UFS Move v_object creation earlier, so that VIRF_PGREAD is never set if v_object is NULL. There is no much harm from instantiating v_object when later check for append-only flags disallows open. Reviewed by: markj Tested by:pho Sponsored by: The FreeBSD Foundation Differential revision:https://reviews.freebsd.org/D25968 Modified: head/sys/ufs/ufs/ufs_vnops.c Modified: head/sys/ufs/ufs/ufs_vnops.c == --- head/sys/ufs/ufs/ufs_vnops.cSun Aug 16 21:05:56 2020 (r364288) +++ head/sys/ufs/ufs/ufs_vnops.cSun Aug 16 21:07:19 2020 (r364289) @@ -282,13 +282,20 @@ ufs_open(struct vop_open_args *ap) return (EOPNOTSUPP); ip = VTOI(vp); + vnode_create_vobject(vp, DIP(ip, i_size), ap->a_td); + if (vp->v_type == VREG && (vp->v_irflag & VIRF_PGREAD) == 0) { + VI_LOCK(vp); + vp->v_irflag |= VIRF_PGREAD; + VI_UNLOCK(vp); + } + /* * Files marked append-only must be opened for appending. */ if ((ip->i_flags & APPEND) && (ap->a_mode & (FWRITE | O_APPEND)) == FWRITE) return (EPERM); - vnode_create_vobject(vp, DIP(ip, i_size), ap->a_td); + return (0); } ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r364288 - head/sys/fs/nullfs
Author: kib Date: Sun Aug 16 21:05:56 2020 New Revision: 364288 URL: https://svnweb.freebsd.org/changeset/base/364288 Log: VMIO reads: enable for nullfs upper vnode if the lower vnode supports it. Reviewed by: markj Tested by:pho Sponsored by: The FreeBSD Foundation Differential revision:https://reviews.freebsd.org/D25968 Modified: head/sys/fs/nullfs/null_subr.c head/sys/fs/nullfs/null_vnops.c Modified: head/sys/fs/nullfs/null_subr.c == --- head/sys/fs/nullfs/null_subr.c Sun Aug 16 21:02:45 2020 (r364287) +++ head/sys/fs/nullfs/null_subr.c Sun Aug 16 21:05:56 2020 (r364288) @@ -259,12 +259,33 @@ null_nodeget(mp, lowervp, vpp) vp->v_vflag |= VV_ROOT; /* +* We might miss the case where lower vnode sets VIRF_PGREAD +* some time after construction, which is typical case. +* null_open rechecks. +*/ + if ((lowervp->v_irflag & VIRF_PGREAD) != 0) { + MPASS(lowervp->v_object != NULL); + if ((vp->v_irflag & VIRF_PGREAD) == 0) { + if (vp->v_object == NULL) + vp->v_object = lowervp->v_object; + else + MPASS(vp->v_object == lowervp->v_object); + VI_LOCK(vp); + vp->v_irflag |= VIRF_PGREAD; + VI_UNLOCK(vp); + } else { + MPASS(vp->v_object != NULL); + } + } + + /* * Atomically insert our new node into the hash or vget existing * if someone else has beaten us to it. */ *vpp = null_hashins(mp, xp); if (*vpp != NULL) { vrele(lowervp); + vp->v_object = NULL;/* in case VIRF_PGREAD set it */ null_destroy_proto(vp, xp); return (0); } Modified: head/sys/fs/nullfs/null_vnops.c == --- head/sys/fs/nullfs/null_vnops.c Sun Aug 16 21:02:45 2020 (r364287) +++ head/sys/fs/nullfs/null_vnops.c Sun Aug 16 21:05:56 2020 (r364288) @@ -439,8 +439,17 @@ null_open(struct vop_open_args *ap) vp = ap->a_vp; ldvp = NULLVPTOLOWERVP(vp); retval = null_bypass(&ap->a_gen); - if (retval == 0) + if (retval == 0) { vp->v_object = ldvp->v_object; + if ((ldvp->v_irflag & VIRF_PGREAD) != 0) { + MPASS(vp->v_object != NULL); + if ((vp->v_irflag & VIRF_PGREAD) == 0) { + VI_LOCK(vp); + vp->v_irflag |= VIRF_PGREAD; + VI_UNLOCK(vp); + } + } + } return (retval); } ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r364287 - in head/sys: kern sys
Author: kib Date: Sun Aug 16 21:02:45 2020 New Revision: 364287 URL: https://svnweb.freebsd.org/changeset/base/364287 Log: VMIO read If possible, i.e. if the requested range is resident valid in the vm object queue, and some secondary conditions hold, copy data for read(2) directly from the valid cached pages, avoiding vnode lock and instantiating buffers. I intentionally do not start read-ahead, nor handle the advises on the cached range. Filesystems indicate support for VMIO reads by setting VIRF_PGREAD flag, which must not be cleared until vnode reclamation. Currently only filesystems that use vnode pager for v_objects can enable it, due to reliance on vnp_size. There is a WIP to handle it for tmpfs. Reviewed by: markj Discussed with: jeff Tested by:pho Benchmarked by: mjg Sponsored by: The FreeBSD Foundation Differential revision:https://reviews.freebsd.org/D25968 Modified: head/sys/kern/vfs_subr.c head/sys/kern/vfs_vnops.c head/sys/sys/vnode.h Modified: head/sys/kern/vfs_subr.c == --- head/sys/kern/vfs_subr.cSun Aug 16 20:57:02 2020(r364286) +++ head/sys/kern/vfs_subr.cSun Aug 16 21:02:45 2020(r364287) @@ -3959,7 +3959,9 @@ vn_printf(struct vnode *vp, const char *fmt, ...) buf[1] = '\0'; if (vp->v_irflag & VIRF_DOOMED) strlcat(buf, "|VIRF_DOOMED", sizeof(buf)); - flags = vp->v_irflag & ~(VIRF_DOOMED); + if (vp->v_irflag & VIRF_PGREAD) + strlcat(buf, "|VIRF_PGREAD", sizeof(buf)); + flags = vp->v_irflag & ~(VIRF_DOOMED | VIRF_PGREAD); if (flags != 0) { snprintf(buf2, sizeof(buf2), "|VIRF(0x%lx)", flags); strlcat(buf, buf2, sizeof(buf)); Modified: head/sys/kern/vfs_vnops.c == --- head/sys/kern/vfs_vnops.c Sun Aug 16 20:57:02 2020(r364286) +++ head/sys/kern/vfs_vnops.c Sun Aug 16 21:02:45 2020(r364287) @@ -127,11 +127,15 @@ structfileops vnops = { static const int io_hold_cnt = 16; static int vn_io_fault_enable = 1; -SYSCTL_INT(_debug, OID_AUTO, vn_io_fault_enable, CTLFLAG_RW, +SYSCTL_INT(_debug, OID_AUTO, vn_io_fault_enable, CTLFLAG_RWTUN, &vn_io_fault_enable, 0, "Enable vn_io_fault lock avoidance"); static int vn_io_fault_prefault = 0; -SYSCTL_INT(_debug, OID_AUTO, vn_io_fault_prefault, CTLFLAG_RW, +SYSCTL_INT(_debug, OID_AUTO, vn_io_fault_prefault, CTLFLAG_RWTUN, &vn_io_fault_prefault, 0, "Enable vn_io_fault prefaulting"); +static int vn_io_pgcache_read_enable = 1; +SYSCTL_INT(_debug, OID_AUTO, vn_io_pgcache_read_enable, CTLFLAG_RWTUN, +&vn_io_pgcache_read_enable, 0, +"Enable copying from page cache for reads, avoiding fs"); static u_long vn_io_faults_cnt; SYSCTL_ULONG(_debug, OID_AUTO, vn_io_faults, CTLFLAG_RD, &vn_io_faults_cnt, 0, "Count of vn_io_fault lock avoidance triggers"); @@ -844,6 +848,118 @@ get_advice(struct file *fp, struct uio *uio) return (ret); } +static int +vn_read_from_obj(struct vnode *vp, struct uio *uio) +{ + vm_object_t obj; + vm_page_t ma[io_hold_cnt + 2]; + off_t off, vsz; + ssize_t resid; + int error, i, j; + + obj = vp->v_object; + MPASS(uio->uio_resid <= ptoa(io_hold_cnt + 2)); + MPASS(obj != NULL); + MPASS(obj->type == OBJT_VNODE); + + /* +* Depends on type stability of vm_objects. +*/ + vm_object_pip_add(obj, 1); + if ((obj->flags & OBJ_DEAD) != 0) { + /* +* Note that object might be already reused from the +* vnode, and the OBJ_DEAD flag cleared. This is fine, +* we recheck for DOOMED vnode state after all pages +* are busied, and retract then. +* +* But we check for OBJ_DEAD to ensure that we do not +* busy pages while vm_object_terminate_pages() +* processes the queue. +*/ + error = EJUSTRETURN; + goto out_pip; + } + + resid = uio->uio_resid; + off = uio->uio_offset; + for (i = 0; resid > 0; i++) { + MPASS(i < io_hold_cnt + 2); + ma[i] = vm_page_grab_unlocked(obj, atop(off), + VM_ALLOC_NOCREAT | VM_ALLOC_SBUSY | VM_ALLOC_IGN_SBUSY | + VM_ALLOC_NOWAIT); + if (ma[i] == NULL) + break; + + /* +* Skip invalid pages. Valid mask can be partial only +* at EOF, and we clip later. +*/ + if (vm_page_none_valid(ma[i])) { + vm_page_sunbusy(ma[i]); + break; + } + + resid -= PAGE_SIZE; + off += PAGE_SIZE; +
svn commit: r364286 - head/sys/vm
Author: kib Date: Sun Aug 16 20:57:02 2020 New Revision: 364286 URL: https://svnweb.freebsd.org/changeset/base/364286 Log: vm_object: allow paging_in_progress to be acquired after object termination. The vm objects are type-stable, and can be accessed even after the last reference is dropped, or in case of vnode objects, after vgone() destroyed it as well. Stop asserting that pip == 0 after vm_object_terminate() waited for existing owners to drop it, we only want to drain them before setting OBJ_DEAD flag. Also stop asserting pip == 0 in object destructor. Update comments explaining the interaction between paging_in_progress and termination. Reviewed by: markj Tested by:pho Sponsored by: The FreeBSD Foundation Differential revision:https://reviews.freebsd.org/D25968 Modified: head/sys/vm/vm_object.c Modified: head/sys/vm/vm_object.c == --- head/sys/vm/vm_object.c Sun Aug 16 20:52:24 2020(r364285) +++ head/sys/vm/vm_object.c Sun Aug 16 20:57:02 2020(r364286) @@ -192,9 +192,6 @@ vm_object_zdtor(void *mem, int size, void *arg) ("object %p has reservations", object)); #endif - KASSERT(blockcount_read(&object->paging_in_progress) == 0, - ("object %p paging_in_progress = %d", - object, blockcount_read(&object->paging_in_progress))); KASSERT(!vm_object_busied(object), ("object %p busy = %d", object, blockcount_read(&object->busy))); KASSERT(object->resident_page_count == 0, @@ -294,6 +291,9 @@ vm_object_init(void) * The lock portion of struct vm_object must be type stable due * to vm_pageout_fallback_object_lock locking a vm object * without holding any references to it. +* +* paging_in_progress is valid always. Lockless references to +* the objects may acquire pip and then check OBJ_DEAD. */ obj_zone = uma_zcreate("VM OBJECT", sizeof (struct vm_object), NULL, #ifdef INVARIANTS @@ -936,12 +936,13 @@ vm_object_terminate(vm_object_t object) ("terminating shadow obj %p", object)); /* -* wait for the pageout daemon to be done with the object +* Wait for the pageout daemon and other current users to be +* done with the object. Note that new paging_in_progress +* users can come after this wait, but they must check +* OBJ_DEAD flag set (without unlocking the object), and avoid +* the object being terminated. */ vm_object_pip_wait(object, "objtrm"); - - KASSERT(!blockcount_read(&object->paging_in_progress), - ("vm_object_terminate: pageout in progress")); KASSERT(object->ref_count == 0, ("vm_object_terminate: object with references, ref_count=%d", ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r364285 - head/sys/vm
Author: kib Date: Sun Aug 16 20:52:24 2020 New Revision: 364285 URL: https://svnweb.freebsd.org/changeset/base/364285 Log: Atomically update vm_object vnp_size, where atomic is available. This will be used later, where it matters on 32bit arches. Reviewed by: markj Tested by:pho Sponsored by: The FreeBSD Foundation Differential revision:https://reviews.freebsd.org/D25968 Modified: head/sys/vm/vnode_pager.c Modified: head/sys/vm/vnode_pager.c == --- head/sys/vm/vnode_pager.c Sun Aug 16 19:14:04 2020(r364284) +++ head/sys/vm/vnode_pager.c Sun Aug 16 20:52:24 2020(r364285) @@ -520,7 +520,11 @@ vnode_pager_setsize(struct vnode *vp, vm_ooffset_t nsi vm_page_xunbusy(m); } out: +#if defined(__powerpc__) && !defined(__powerpc64__) object->un_pager.vnp.vnp_size = nsize; +#else + atomic_store_64(&object->un_pager.vnp.vnp_size, nsize); +#endif object->size = nobjsize; VM_OBJECT_WUNLOCK(object); } ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r364283 - in head/sys: kern sys
Author: mjg Date: Sun Aug 16 18:51:12 2020 New Revision: 364283 URL: https://svnweb.freebsd.org/changeset/base/364283 Log: vfs: retire vrefl as a symbol vrefl calls vref and there is only one in-tree consumer. Keep it as a macro for assertion purposes. Modified: head/sys/kern/vfs_subr.c head/sys/sys/vnode.h Modified: head/sys/kern/vfs_subr.c == --- head/sys/kern/vfs_subr.cSun Aug 16 18:45:31 2020(r364282) +++ head/sys/kern/vfs_subr.cSun Aug 16 18:51:12 2020(r364283) @@ -2929,15 +2929,6 @@ vref(struct vnode *vp) } void -vrefl(struct vnode *vp) -{ - - ASSERT_VI_LOCKED(vp, __func__); - CTR2(KTR_VFS, "%s: vp %p", __func__, vp); - vref(vp); -} - -void vrefact(struct vnode *vp) { Modified: head/sys/sys/vnode.h == --- head/sys/sys/vnode.hSun Aug 16 18:45:31 2020(r364282) +++ head/sys/sys/vnode.hSun Aug 16 18:51:12 2020(r364283) @@ -965,7 +965,6 @@ do { \ void vput(struct vnode *vp); void vrele(struct vnode *vp); void vref(struct vnode *vp); -void vrefl(struct vnode *vp); void vrefact(struct vnode *vp); void v_addpollinfo(struct vnode *vp); static __inline int @@ -974,6 +973,11 @@ vrefcnt(struct vnode *vp) return (vp->v_usecount); } + +#definevrefl(vp) do { \ + ASSERT_VI_LOCKED(vp, __func__); \ + vref(vp); \ +} while (0) int vnode_create_vobject(struct vnode *vp, off_t size, struct thread *td); void vnode_destroy_vobject(struct vnode *vp); ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r364282 - head/sys/kern
Author: mjg Date: Sun Aug 16 18:45:31 2020 New Revision: 364282 URL: https://svnweb.freebsd.org/changeset/base/364282 Log: vfs: assert that VI_TEXT_REF is not already set Modified: head/sys/kern/vfs_default.c Modified: head/sys/kern/vfs_default.c == --- head/sys/kern/vfs_default.c Sun Aug 16 18:33:24 2020(r364281) +++ head/sys/kern/vfs_default.c Sun Aug 16 18:45:31 2020(r364282) @@ -1186,6 +1186,7 @@ vop_stdset_text(struct vop_set_text_args *ap) mp = vp->v_mount; if (mp != NULL && (mp->mnt_kern_flag & MNTK_TEXT_REFS) != 0 && vp->v_writecount == 0) { + VNPASS((vp->v_iflag & VI_TEXT_REF) == 0, vp); vp->v_iflag |= VI_TEXT_REF; vrefl(vp); } ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r364281 - head/sys/kern
Author: mjg Date: Sun Aug 16 18:33:24 2020 New Revision: 364281 URL: https://svnweb.freebsd.org/changeset/base/364281 Log: cache: add NOCAPCHECK to the list of supported flags for lockless lookup It is de facto supported in that lockless lookup does not do any capability checks. Modified: head/sys/kern/vfs_cache.c Modified: head/sys/kern/vfs_cache.c == --- head/sys/kern/vfs_cache.c Sun Aug 16 18:27:42 2020(r364280) +++ head/sys/kern/vfs_cache.c Sun Aug 16 18:33:24 2020(r364281) @@ -3144,7 +3144,7 @@ cache_fpl_handled_impl(struct cache_fpl *fpl, int erro #define CACHE_FPL_SUPPORTED_CN_FLAGS \ (LOCKLEAF | LOCKPARENT | WANTPARENT | NOCACHE | FOLLOW | LOCKSHARED | SAVENAME | \ -SAVESTART | WILLBEDIR | ISOPEN | NOMACCHECK | AUDITVNODE1 | AUDITVNODE2) +SAVESTART | WILLBEDIR | ISOPEN | NOMACCHECK | AUDITVNODE1 | AUDITVNODE2 | NOCAPCHECK) #define CACHE_FPL_INTERNAL_CN_FLAGS \ (ISDOTDOT | MAKEENTRY | ISLASTCN) ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r364280 - head/sys/sys
Author: mjg Date: Sun Aug 16 18:27:42 2020 New Revision: 364280 URL: https://svnweb.freebsd.org/changeset/base/364280 Log: vfs: restore sorted order of unused nameidata flags Modified: head/sys/sys/namei.h Modified: head/sys/sys/namei.h == --- head/sys/sys/namei.hSun Aug 16 18:24:48 2020(r364279) +++ head/sys/sys/namei.hSun Aug 16 18:27:42 2020(r364280) @@ -160,8 +160,8 @@ int cache_fplookup(struct nameidata *ndp, enum cache_f #defineAUDITVNODE1 0x0004 /* audit the looked up vnode information */ #defineAUDITVNODE2 0x0008 /* audit the looked up vnode information */ #defineNOCAPCHECK 0x0010 /* do not perform capability checks */ -/* UNUSED 0x0040 */ /* UNUSED 0x0020 */ +/* UNUSED 0x0040 */ /* UNUSED 0x0080 */ #defineHASBUF 0x0100 /* has allocated pathname buffer */ #defineNOEXECCHECK 0x0200 /* do not perform exec check on dir */ ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r364277 - head/sys/kern
Author: mjg Date: Sun Aug 16 18:21:21 2020 New Revision: 364277 URL: https://svnweb.freebsd.org/changeset/base/364277 Log: vfs: use namei_zone for getcwd allocations instead of malloc. Note that this should probably be wrapped with a dedicated API and other vn_getcwd callers did not get converted. Modified: head/sys/kern/vfs_cache.c Modified: head/sys/kern/vfs_cache.c == --- head/sys/kern/vfs_cache.c Sun Aug 16 18:12:21 2020(r364276) +++ head/sys/kern/vfs_cache.c Sun Aug 16 18:21:21 2020(r364277) @@ -2427,11 +2427,11 @@ sys___getcwd(struct thread *td, struct __getcwd_args * if (buflen > MAXPATHLEN) buflen = MAXPATHLEN; - buf = malloc(buflen, M_TEMP, M_WAITOK); + buf = uma_zalloc(namei_zone, M_WAITOK); error = vn_getcwd(td, buf, &retbuf, &buflen); if (error == 0) error = copyout(retbuf, uap->buf, buflen); - free(buf, M_TEMP); + uma_zfree(namei_zone, buf); return (error); } @@ -2982,8 +2982,6 @@ DB_SHOW_COMMAND(vpath, db_show_vpath) } #endif - -extern uma_zone_t namei_zone; static bool __read_frequently cache_fast_lookup = true; SYSCTL_BOOL(_vfs, OID_AUTO, cache_fast_lookup, CTLFLAG_RW, ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r364276 - in head: lib/libcasper/services lib/libcasper/services/cap_dns lib/libcasper/services/cap_net lib/libcasper/services/cap_net/tests share/mk
Author: oshogbo Date: Sun Aug 16 18:12:21 2020 New Revision: 364276 URL: https://svnweb.freebsd.org/changeset/base/364276 Log: libcasper: Introduce cap_net a network service for Casper. Reviewed by: emaste, markj (previous version), bcr (man page) Differential Revision:https://reviews.freebsd.org/D24688 Added: head/lib/libcasper/services/cap_net/ head/lib/libcasper/services/cap_net/Makefile (contents, props changed) head/lib/libcasper/services/cap_net/cap_net.3 (contents, props changed) head/lib/libcasper/services/cap_net/cap_net.c (contents, props changed) head/lib/libcasper/services/cap_net/cap_net.h (contents, props changed) head/lib/libcasper/services/cap_net/tests/ head/lib/libcasper/services/cap_net/tests/Makefile (contents, props changed) head/lib/libcasper/services/cap_net/tests/net_test.c (contents, props changed) Modified: head/lib/libcasper/services/Makefile head/lib/libcasper/services/cap_dns/Makefile head/lib/libcasper/services/cap_dns/cap_dns.3 head/share/mk/src.libnames.mk Modified: head/lib/libcasper/services/Makefile == --- head/lib/libcasper/services/MakefileSun Aug 16 18:10:15 2020 (r364275) +++ head/lib/libcasper/services/MakefileSun Aug 16 18:12:21 2020 (r364276) @@ -5,6 +5,7 @@ SUBDIR=cap_dns SUBDIR+= cap_fileargs SUBDIR+= cap_grp +SUBDIR+= cap_net SUBDIR+= cap_pwd SUBDIR+= cap_sysctl SUBDIR+= cap_syslog Modified: head/lib/libcasper/services/cap_dns/Makefile == --- head/lib/libcasper/services/cap_dns/MakefileSun Aug 16 18:10:15 2020(r364275) +++ head/lib/libcasper/services/cap_dns/MakefileSun Aug 16 18:12:21 2020(r364276) @@ -27,11 +27,6 @@ SUBDIR.${MK_TESTS}+= tests MAN+= cap_dns.3 MLINKS+=cap_dns.3 libcap_dns.3 -MLINKS+=cap_dns.3 cap_gethostbyname.3 -MLINKS+=cap_dns.3 cap_gethostbyname2.3 -MLINKS+=cap_dns.3 cap_gethostbyaddr.3 -MLINKS+=cap_dns.3 cap_getaddrinfo.3 -MLINKS+=cap_dns.3 cap_getnameinfo.3 MLINKS+=cap_dns.3 cap_dns_type_limit.3 MLINKS+=cap_dns.3 cap_dns_family_limit.3 Modified: head/lib/libcasper/services/cap_dns/cap_dns.3 == --- head/lib/libcasper/services/cap_dns/cap_dns.3 Sun Aug 16 18:10:15 2020(r364275) +++ head/lib/libcasper/services/cap_dns/cap_dns.3 Sun Aug 16 18:12:21 2020(r364276) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 5, 2020 +.Dd August 15, 2020 .Dt CAP_DNS 3 .Os .Sh NAME @@ -58,6 +58,9 @@ .Fn cap_dns_family_limit "const cap_channel_t *chan" "const int *families" "size_t nfamilies" .Sh DESCRIPTION .Bf -symbolic +This service is obsolete and +.Xr cap_net 3 +should be used instead. The .Fn cap_getaddrinfo , and Added: head/lib/libcasper/services/cap_net/Makefile == --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libcasper/services/cap_net/MakefileSun Aug 16 18:12:21 2020(r364276) @@ -0,0 +1,48 @@ +# $FreeBSD$ + +SHLIBDIR?= /lib/casper + +.include + +PACKAGE=libcasper + +SHLIB_MAJOR= 1 +INCSDIR?= ${INCLUDEDIR}/casper + +.if ${MK_CASPER} != "no" +SHLIB= cap_net + +SRCS= cap_net.c +.endif + +INCS= cap_net.h + +LIBADD=nv + +CFLAGS+=-I${.CURDIR} +CFLAGS+=-DWITH_CASPER + +HAS_TESTS= +SUBDIR.${MK_TESTS}+= tests + +MAN+= cap_net.3 + +MLINKS+=cap_net.3 libcap_net.3 +MLINKS+=cap_net.3 cap_bind.3 +MLINKS+=cap_net.3 cap_connect.3 +MLINKS+=cap_net.3 cap_net_free.3 +MLINKS+=cap_net.3 cap_net_limit.3 +MLINKS+=cap_net.3 cap_net_limit_addr2name.3 +MLINKS+=cap_net.3 cap_net_limit_addr2name_family.3 +MLINKS+=cap_net.3 cap_net_limit_bind.3 +MLINKS+=cap_net.3 cap_net_limit_connect.3 +MLINKS+=cap_net.3 cap_net_limit_init.3 +MLINKS+=cap_net.3 cap_net_limit_name2addr.3 +MLINKS+=cap_net.3 cap_net_limit_name2addr_family.3 +MLINKS+=cap_net.3 cap_getaddrinfo.3 +MLINKS+=cap_net.3 cap_gethostbyaddr.3 +MLINKS+=cap_net.3 cap_gethostbyname.3 +MLINKS+=cap_net.3 cap_gethostbyname2.3 +MLINKS+=cap_net.3 cap_getnameinfo.3 + +.include Added: head/lib/libcasper/services/cap_net/cap_net.3 == --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libcasper/services/cap_net/cap_net.3 Sun Aug 16 18:12:21 2020(r364276) @@ -0,0 +1,287 @@ +.\" Copyright (c) 2020 Mariusz Zaborski +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\"notice, this list of conditions and the following disclaimer.
svn commit: r364274 - head/sys/sys
Author: mjg Date: Sun Aug 16 17:56:30 2020 New Revision: 364274 URL: https://svnweb.freebsd.org/changeset/base/364274 Log: Bump __FreeBSD_version after vget() and HASBUF change Modified: head/sys/sys/param.h Modified: head/sys/sys/param.h == --- head/sys/sys/param.hSun Aug 16 17:55:20 2020(r364273) +++ head/sys/sys/param.hSun Aug 16 17:56:30 2020(r364274) @@ -60,7 +60,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1300108 /* Master, propagated to newvers */ +#define __FreeBSD_version 1300109 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r364273 - in head/sys: kern sys
Author: mjg Date: Sun Aug 16 17:55:20 2020 New Revision: 364273 URL: https://svnweb.freebsd.org/changeset/base/364273 Log: vfs: mark HASBUF as an internal flag There is no setter for cn_pnbuf. Modified: head/sys/kern/vfs_lookup.c head/sys/sys/namei.h Modified: head/sys/kern/vfs_lookup.c == --- head/sys/kern/vfs_lookup.c Sun Aug 16 17:19:23 2020(r364272) +++ head/sys/kern/vfs_lookup.c Sun Aug 16 17:55:20 2020(r364273) @@ -504,8 +504,7 @@ namei(struct nameidata *ndp) * Get a buffer for the name to be translated, and copy the * name into the buffer. */ - if ((cnp->cn_flags & HASBUF) == 0) - cnp->cn_pnbuf = uma_zalloc(namei_zone, M_WAITOK); + cnp->cn_pnbuf = uma_zalloc(namei_zone, M_WAITOK); if (ndp->ni_segflg == UIO_SYSSPACE) error = copystr(ndp->ni_dirp, cnp->cn_pnbuf, MAXPATHLEN, &ndp->ni_pathlen); Modified: head/sys/sys/namei.h == --- head/sys/sys/namei.hSun Aug 16 17:19:23 2020(r364272) +++ head/sys/sys/namei.hSun Aug 16 17:55:20 2020(r364273) @@ -149,21 +149,21 @@ int cache_fplookup(struct nameidata *ndp, enum cache_f * buffer and for vrele'ing ni_startdir. */ #defineRDONLY 0x0200 /* lookup with read-only semantics */ -#defineHASBUF 0x0400 /* has allocated pathname buffer */ -#defineSAVENAME0x0800 /* save pathname buffer */ -#defineSAVESTART 0x1000 /* save starting directory */ -#defineISWHITEOUT 0x2000 /* found whiteout */ -#defineDOWHITEOUT 0x4000 /* do whiteouts */ -#defineWILLBEDIR 0x8000 /* new files will be dirs; allow trailing / */ -#defineISOPEN 0x0001 /* caller is opening; return a real vnode. */ -#defineNOCROSSMOUNT0x0002 /* do not cross mount points */ -#defineNOMACCHECK 0x0004 /* do not perform MAC checks */ -#defineAUDITVNODE1 0x0008 /* audit the looked up vnode information */ -#defineAUDITVNODE2 0x0010 /* audit the looked up vnode information */ -#defineNOCAPCHECK 0x0020 /* do not perform capability checks */ +#defineSAVENAME0x0400 /* save pathname buffer */ +#defineSAVESTART 0x0800 /* save starting directory */ +#defineISWHITEOUT 0x1000 /* found whiteout */ +#defineDOWHITEOUT 0x2000 /* do whiteouts */ +#defineWILLBEDIR 0x4000 /* new files will be dirs; allow trailing / */ +#defineISOPEN 0x8000 /* caller is opening; return a real vnode. */ +#defineNOCROSSMOUNT0x0001 /* do not cross mount points */ +#defineNOMACCHECK 0x0002 /* do not perform MAC checks */ +#defineAUDITVNODE1 0x0004 /* audit the looked up vnode information */ +#defineAUDITVNODE2 0x0008 /* audit the looked up vnode information */ +#defineNOCAPCHECK 0x0010 /* do not perform capability checks */ /* UNUSED 0x0040 */ +/* UNUSED 0x0020 */ /* UNUSED 0x0080 */ -/* UNUSED 0x0100 */ +#defineHASBUF 0x0100 /* has allocated pathname buffer */ #defineNOEXECCHECK 0x0200 /* do not perform exec check on dir */ #defineMAKEENTRY 0x0400 /* entry is to be added to name cache */ #defineISSYMLINK 0x0800 /* symlink needs interpretation */ @@ -176,7 +176,8 @@ int cache_fplookup(struct nameidata *ndp, enum cache_f * Flags which must not be passed in by callers. */ #define NAMEI_INTERNAL_FLAGS \ - (NOEXECCHECK | MAKEENTRY | ISSYMLINK | ISLASTCN | ISDOTDOT | TRAILINGSLASH) + (HASBUF | NOEXECCHECK | MAKEENTRY | ISSYMLINK | ISLASTCN | ISDOTDOT | \ +TRAILINGSLASH) /* * Namei results flags ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r364271 - in head/sys: compat/linuxkpi/common/include/linux fs/autofs fs/ext2fs fs/fdescfs fs/fuse fs/msdosfs fs/nfsclient fs/nullfs fs/pseudofs fs/smbfs fs/tmpfs kern sys ufs/ffs ufs/u...
Author: mjg Date: Sun Aug 16 17:18:54 2020 New Revision: 364271 URL: https://svnweb.freebsd.org/changeset/base/364271 Log: vfs: remove the thread argument from vget It was already asserted to be curthread. Semantic patch: @@ expression arg1, arg2, arg3; @@ - vget(arg1, arg2, arg3) + vget(arg1, arg2) Modified: head/sys/compat/linuxkpi/common/include/linux/fs.h head/sys/fs/autofs/autofs_vnops.c head/sys/fs/ext2fs/ext2_vfsops.c head/sys/fs/fdescfs/fdesc_vfsops.c head/sys/fs/fdescfs/fdesc_vnops.c head/sys/fs/fuse/fuse_vfsops.c head/sys/fs/msdosfs/msdosfs_vfsops.c head/sys/fs/nfsclient/nfs_clvfsops.c head/sys/fs/nullfs/null_vfsops.c head/sys/fs/pseudofs/pseudofs_vncache.c head/sys/fs/smbfs/smbfs_node.c head/sys/fs/smbfs/smbfs_vfsops.c head/sys/fs/tmpfs/tmpfs_subr.c head/sys/fs/tmpfs/tmpfs_vfsops.c head/sys/kern/uipc_mqueue.c head/sys/kern/vfs_default.c head/sys/kern/vfs_subr.c head/sys/sys/vnode.h head/sys/ufs/ffs/ffs_alloc.c head/sys/ufs/ffs/ffs_softdep.c head/sys/ufs/ffs/ffs_vfsops.c head/sys/ufs/ufs/ufs_quota.c head/sys/vm/vm_fault.c head/sys/vm/vm_mmap.c head/sys/vm/vm_pageout.c Modified: head/sys/compat/linuxkpi/common/include/linux/fs.h == --- head/sys/compat/linuxkpi/common/include/linux/fs.h Sun Aug 16 13:31:14 2020(r364270) +++ head/sys/compat/linuxkpi/common/include/linux/fs.h Sun Aug 16 17:18:54 2020(r364271) @@ -260,7 +260,7 @@ igrab(struct inode *inode) { int error; - error = vget(inode, 0, curthread); + error = vget(inode, 0); if (error) return (NULL); Modified: head/sys/fs/autofs/autofs_vnops.c == --- head/sys/fs/autofs/autofs_vnops.c Sun Aug 16 13:31:14 2020 (r364270) +++ head/sys/fs/autofs/autofs_vnops.c Sun Aug 16 17:18:54 2020 (r364271) @@ -656,7 +656,7 @@ autofs_node_vn(struct autofs_node *anp, struct mount * vp = anp->an_vnode; if (vp != NULL) { - error = vget(vp, flags | LK_RETRY, curthread); + error = vget(vp, flags | LK_RETRY); if (error != 0) { AUTOFS_WARN("vget failed with error %d", error); sx_xunlock(&anp->an_vnode_lock); Modified: head/sys/fs/ext2fs/ext2_vfsops.c == --- head/sys/fs/ext2fs/ext2_vfsops.cSun Aug 16 13:31:14 2020 (r364270) +++ head/sys/fs/ext2fs/ext2_vfsops.cSun Aug 16 17:18:54 2020 (r364271) @@ -799,7 +799,7 @@ loop: /* * Step 4: invalidate all cached file data. */ - if (vget(vp, LK_EXCLUSIVE | LK_INTERLOCK, td)) { + if (vget(vp, LK_EXCLUSIVE | LK_INTERLOCK)) { MNT_VNODE_FOREACH_ALL_ABORT(mp, mvp); goto loop; } @@ -1158,7 +1158,7 @@ loop: VI_UNLOCK(vp); continue; } - error = vget(vp, LK_EXCLUSIVE | LK_NOWAIT | LK_INTERLOCK, td); + error = vget(vp, LK_EXCLUSIVE | LK_NOWAIT | LK_INTERLOCK); if (error) { if (error == ENOENT) { MNT_VNODE_FOREACH_ALL_ABORT(mp, mvp); Modified: head/sys/fs/fdescfs/fdesc_vfsops.c == --- head/sys/fs/fdescfs/fdesc_vfsops.c Sun Aug 16 13:31:14 2020 (r364270) +++ head/sys/fs/fdescfs/fdesc_vfsops.c Sun Aug 16 17:18:54 2020 (r364271) @@ -163,7 +163,7 @@ fdesc_root(struct mount *mp, int flags, struct vnode * * Return locked reference to root. */ vp = VFSTOFDESC(mp)->f_root; - vget(vp, LK_EXCLUSIVE | LK_RETRY, curthread); + vget(vp, LK_EXCLUSIVE | LK_RETRY); *vpp = vp; return (0); } Modified: head/sys/fs/fdescfs/fdesc_vnops.c == --- head/sys/fs/fdescfs/fdesc_vnops.c Sun Aug 16 13:31:14 2020 (r364270) +++ head/sys/fs/fdescfs/fdesc_vnops.c Sun Aug 16 17:18:54 2020 (r364271) @@ -182,7 +182,7 @@ loop: vp = fd->fd_vnode; VI_LOCK(vp); mtx_unlock(&fdesc_hashmtx); - if (vget(vp, LK_EXCLUSIVE | LK_INTERLOCK, td)) + if (vget(vp, LK_EXCLUSIVE | LK_INTERLOCK)) goto loop; *vpp = vp; return (0); @@ -232,7 +232,7 @@ loop: vp2 = fd2->fd_vnode; VI_LOCK(vp2); mtx_unlock(&fdesc_hashmtx); - error = vget(vp2, LK_EXC
svn commit: r364272 - head/sys/fs/tmpfs
Author: mjg Date: Sun Aug 16 17:19:23 2020 New Revision: 364272 URL: https://svnweb.freebsd.org/changeset/base/364272 Log: tmpfs: use vget_prep/vget_finish instead of vget + vnode Modified: head/sys/fs/tmpfs/tmpfs_subr.c Modified: head/sys/fs/tmpfs/tmpfs_subr.c == --- head/sys/fs/tmpfs/tmpfs_subr.c Sun Aug 16 17:18:54 2020 (r364271) +++ head/sys/fs/tmpfs/tmpfs_subr.c Sun Aug 16 17:19:23 2020 (r364272) @@ -588,6 +588,7 @@ tmpfs_alloc_vp(struct mount *mp, struct tmpfs_node *no struct vnode **vpp) { struct vnode *vp; + enum vgetstate vs; struct tmpfs_mount *tm; vm_object_t object; int error; @@ -600,18 +601,15 @@ loop: TMPFS_NODE_ASSERT_LOCKED(node); if ((vp = node->tn_vnode) != NULL) { MPASS((node->tn_vpstate & TMPFS_VNODE_DOOMED) == 0); - VI_LOCK(vp); if ((node->tn_type == VDIR && node->tn_dir.tn_parent == NULL) || (VN_IS_DOOMED(vp) && (lkflag & LK_NOWAIT) != 0)) { - VI_UNLOCK(vp); TMPFS_NODE_UNLOCK(node); error = ENOENT; vp = NULL; goto out; } if (VN_IS_DOOMED(vp)) { - VI_UNLOCK(vp); node->tn_vpstate |= TMPFS_VNODE_WRECLAIM; while ((node->tn_vpstate & TMPFS_VNODE_WRECLAIM) != 0) { msleep(&node->tn_vnode, TMPFS_NODE_MTX(node), @@ -619,8 +617,9 @@ loop: } goto loop; } + vs = vget_prep(vp); TMPFS_NODE_UNLOCK(node); - error = vget(vp, lkflag | LK_INTERLOCK); + error = vget_finish(vp, lkflag, vs); if (error == ENOENT) { TMPFS_NODE_LOCK(node); goto loop; ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r364270 - head/sys/netinet
Author: tuexen Date: Sun Aug 16 13:31:14 2020 New Revision: 364270 URL: https://svnweb.freebsd.org/changeset/base/364270 Log: Remove a line which is needed and was added in https://svnweb.freebsd.org/changeset/base/364268 MFC after:3 days Modified: head/sys/netinet/sctp_usrreq.c Modified: head/sys/netinet/sctp_usrreq.c == --- head/sys/netinet/sctp_usrreq.c Sun Aug 16 12:59:43 2020 (r364269) +++ head/sys/netinet/sctp_usrreq.c Sun Aug 16 13:31:14 2020 (r364270) @@ -190,7 +190,6 @@ sctp_notify(struct sctp_inpcb *inp, } else if ((icmp_code == ICMP_UNREACH_PROTOCOL) || (icmp_code == ICMP_UNREACH_PORT)) { /* Treat it like an ABORT. */ - SCTP_ADD_SUBSTATE(stcb, SCTP_STATE_WAS_ABORTED); sctp_abort_notification(stcb, 1, 0, NULL, SCTP_SO_NOT_LOCKED); (void)sctp_free_assoc(inp, stcb, SCTP_NORMAL_PROC, SCTP_FROM_SCTP_USRREQ + SCTP_LOC_2); ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r364269 - head/sys/modules/usb/cp2112
Author: eugen Date: Sun Aug 16 12:59:43 2020 New Revision: 364269 URL: https://svnweb.freebsd.org/changeset/base/364269 Log: Unbreak building cp2112(8) as a module outside of kernel build environment. Modified: head/sys/modules/usb/cp2112/Makefile Modified: head/sys/modules/usb/cp2112/Makefile == --- head/sys/modules/usb/cp2112/MakefileSun Aug 16 11:50:37 2020 (r364268) +++ head/sys/modules/usb/cp2112/MakefileSun Aug 16 12:59:43 2020 (r364269) @@ -31,7 +31,7 @@ S= ${SRCTOP}/sys KMOD= cp2112 SRCS= cp2112.c -SRCS+= opt_bus.h opt_usb.h +SRCS+= opt_bus.h opt_platform.h opt_usb.h SRCS+= device_if.h bus_if.h gpio_if.h iicbus_if.h usb_if.h usbdevs.h .include ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r364268 - head/sys/netinet
Author: tuexen Date: Sun Aug 16 11:50:37 2020 New Revision: 364268 URL: https://svnweb.freebsd.org/changeset/base/364268 Log: Improve the handling of concurrent send() calls for SCTP sockets, especially when having the explicit EOR mode enabled. Reported by: megan2013...@protonmail.com Reported by: syzbot+bc02585076c3cc977...@syzkaller.appspotmail.com MFC after:3 days Modified: head/sys/netinet/sctp_input.c head/sys/netinet/sctp_output.c head/sys/netinet/sctp_pcb.c head/sys/netinet/sctp_structs.h head/sys/netinet/sctp_usrreq.c head/sys/netinet/sctputil.c head/sys/netinet/sctputil.h Modified: head/sys/netinet/sctp_input.c == --- head/sys/netinet/sctp_input.c Sun Aug 16 11:37:28 2020 (r364267) +++ head/sys/netinet/sctp_input.c Sun Aug 16 11:50:37 2020 (r364268) @@ -829,7 +829,6 @@ sctp_handle_abort(struct sctp_abort_chunk *abort, #ifdef SCTP_ASOCLOG_OF_TSNS sctp_print_out_track_log(stcb); #endif - SCTP_ADD_SUBSTATE(stcb, SCTP_STATE_WAS_ABORTED); (void)sctp_free_assoc(stcb->sctp_ep, stcb, SCTP_NORMAL_PROC, SCTP_FROM_SCTP_INPUT + SCTP_LOC_8); SCTPDBG(SCTP_DEBUG_INPUT2, "sctp_handle_abort: finished\n"); @@ -1866,7 +1865,7 @@ sctp_process_cookie_existing(struct mbuf *m, int iphle /* send up all the data */ SCTP_TCB_SEND_LOCK(stcb); - sctp_report_all_outbound(stcb, 0, 1, SCTP_SO_LOCKED); + sctp_report_all_outbound(stcb, 0, SCTP_SO_LOCKED); for (i = 0; i < stcb->asoc.streamoutcnt; i++) { stcb->asoc.strmout[i].chunks_on_queues = 0; #if defined(SCTP_DETAILED_STR_STATS) Modified: head/sys/netinet/sctp_output.c == --- head/sys/netinet/sctp_output.c Sun Aug 16 11:37:28 2020 (r364267) +++ head/sys/netinet/sctp_output.c Sun Aug 16 11:50:37 2020 (r364268) @@ -13148,12 +13148,21 @@ skip_preblock: if (sinfo_flags & SCTP_UNORDERED) { SCTP_STAT_INCR(sctps_sends_with_unord); } + sp->processing = 1; TAILQ_INSERT_TAIL(&strm->outqueue, sp, next); stcb->asoc.ss_functions.sctp_ss_add_to_stream(stcb, asoc, strm, sp, 1); SCTP_TCB_SEND_UNLOCK(stcb); } else { SCTP_TCB_SEND_LOCK(stcb); sp = TAILQ_LAST(&strm->outqueue, sctp_streamhead); + if (sp->processing) { + SCTP_TCB_SEND_UNLOCK(stcb); + SCTP_LTRACE_ERR_RET(inp, stcb, net, SCTP_FROM_SCTP_OUTPUT, EINVAL); + error = EINVAL; + goto out; + } else { + sp->processing = 1; + } SCTP_TCB_SEND_UNLOCK(stcb); if (sp == NULL) { /* Huh ??? last msg is gone */ @@ -13195,13 +13204,14 @@ skip_preblock: } /* Update the mbuf and count */ SCTP_TCB_SEND_LOCK(stcb); - if (stcb->asoc.state & SCTP_STATE_ABOUT_TO_BE_FREED) { + if ((stcb->asoc.state & SCTP_STATE_ABOUT_TO_BE_FREED) || + (stcb->asoc.state & SCTP_STATE_WAS_ABORTED)) { /* * we need to get out. Peer probably * aborted. */ sctp_m_freem(mm); - if (stcb->asoc.state & SCTP_PCB_FLAGS_WAS_ABORTED) { + if (stcb->asoc.state & SCTP_STATE_WAS_ABORTED) { SCTP_LTRACE_ERR_RET(NULL, stcb, NULL, SCTP_FROM_SCTP_OUTPUT, ECONNRESET); error = ECONNRESET; } @@ -13405,7 +13415,8 @@ skip_preblock: } } SCTP_TCB_SEND_LOCK(stcb); - if (stcb->asoc.state & SCTP_STATE_ABOUT_TO_BE_FREED) { + if ((stcb->asoc.state & SCTP_STATE_ABOUT_TO_BE_FREED) || + (stcb->asoc.state & SCTP_STATE_WAS_ABORTED)) { SCTP_TCB_SEND_UNLOCK(stcb); goto out_unlocked; } @@ -13421,6 +13432,7 @@ skip_preblock: strm->last_msg_incomplete = 0; as
svn commit: r364267 - head/sys/modules/nvd
Author: eugen Date: Sun Aug 16 11:37:28 2020 New Revision: 364267 URL: https://svnweb.freebsd.org/changeset/base/364267 Log: Unbreak nvd(8) build as module outside of kernel build environment. Modified: head/sys/modules/nvd/Makefile Modified: head/sys/modules/nvd/Makefile == --- head/sys/modules/nvd/Makefile Sun Aug 16 02:05:18 2020 (r364266) +++ head/sys/modules/nvd/Makefile Sun Aug 16 11:37:28 2020 (r364267) @@ -3,6 +3,6 @@ .PATH: ${SRCTOP}/sys/dev/nvd KMOD= nvd -SRCS= nvd.c opt_geom.h device_if.h bus_if.h +SRCS= nvd.c opt_geom.h device_if.h bus_if.h pci_if.h .include ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"