svn commit: r244650 - in head/sys/dev/usb: . storage wlan
Author: hselasky Date: Mon Dec 24 10:10:18 2012 New Revision: 244650 URL: http://svnweb.freebsd.org/changeset/base/244650 Log: Fix more regression issue after r244503. usbd_transfer_setup() does not set a default length for USB transfers. Only the number of frames is automatically setup. MFC after:1 week Modified: head/sys/dev/usb/storage/ustorage_fs.c head/sys/dev/usb/usb_msctest.c head/sys/dev/usb/wlan/if_urtw.c Modified: head/sys/dev/usb/storage/ustorage_fs.c == --- head/sys/dev/usb/storage/ustorage_fs.c Mon Dec 24 01:00:36 2012 (r244649) +++ head/sys/dev/usb/storage/ustorage_fs.c Mon Dec 24 10:10:18 2012 (r244650) @@ -603,6 +603,8 @@ tr_setup: usbd_xfer_set_stall(xfer); DPRINTF(stall pipe\n); } + usbd_xfer_set_frame_len(xfer, 0, + sizeof(ustorage_fs_bbb_cbw_t)); usbd_transfer_submit(xfer); break; @@ -827,6 +829,8 @@ tr_setup: sc-sc_transfer.data_error = 0; usbd_xfer_set_stall(xfer); } + usbd_xfer_set_frame_len(xfer, 0, + sizeof(ustorage_fs_bbb_csw_t)); usbd_transfer_submit(xfer); break; Modified: head/sys/dev/usb/usb_msctest.c == --- head/sys/dev/usb/usb_msctest.c Mon Dec 24 01:00:36 2012 (r244649) +++ head/sys/dev/usb/usb_msctest.c Mon Dec 24 10:10:18 2012 (r244650) @@ -300,6 +300,8 @@ bbb_command_callback(struct usb_xfer *xf sc-cbw-bCDBLength = sizeof(sc-cbw-CBWCDB); DPRINTFN(0, Truncating long command\n); } + usbd_xfer_set_frame_len(xfer, 0, + sizeof(struct bbb_cbw)); usbd_transfer_submit(xfer); break; @@ -386,7 +388,7 @@ bbb_data_write_callback(struct usb_xfer if (sc-data_rem == 0) { bbb_transfer_start(sc, ST_STATUS); - return; + break; } if (max_bulk sc-data_rem) { max_bulk = sc-data_rem; @@ -394,7 +396,7 @@ bbb_data_write_callback(struct usb_xfer usbd_xfer_set_timeout(xfer, sc-data_timeout); usbd_xfer_set_frame_data(xfer, 0, sc-data_ptr, max_bulk); usbd_transfer_submit(xfer); - return; + break; default:/* Error */ if (error == USB_ERR_CANCELLED) { @@ -402,8 +404,7 @@ bbb_data_write_callback(struct usb_xfer } else { bbb_transfer_start(sc, ST_DATA_WR_CS); } - return; - + break; } } @@ -438,6 +439,8 @@ bbb_status_callback(struct usb_xfer *xfe break; case USB_ST_SETUP: + usbd_xfer_set_frame_len(xfer, 0, + sizeof(struct bbb_csw)); usbd_transfer_submit(xfer); break; Modified: head/sys/dev/usb/wlan/if_urtw.c == --- head/sys/dev/usb/wlan/if_urtw.c Mon Dec 24 01:00:36 2012 (r244649) +++ head/sys/dev/usb/wlan/if_urtw.c Mon Dec 24 10:10:18 2012 (r244650) @@ -4127,6 +4127,7 @@ urtw_bulk_tx_status_callback(struct usb_ case USB_ST_SETUP: setup: memcpy(dma_buf, sc-sc_txstatus, sizeof(uint64_t)); + usbd_xfer_set_frame_len(xfer, 0, sizeof(uint64_t)); usbd_transfer_submit(xfer); break; default: ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r244651 - in stable/9/sys: kern sys
Author: kib Date: Mon Dec 24 12:54:12 2012 New Revision: 244651 URL: http://svnweb.freebsd.org/changeset/base/244651 Log: MFC r240283: Add MNTK_LOOKUP_EXCL_DOTDOT struct mount flag, which specifies to the lookup code that dotdot lookups shall override any shared lock requests with the exclusive one. The flag is useful for filesystems which sometimes need to upgrade shared lock to exclusive inside the VOP_LOOKUP or later, which cannot be done safely for dotdot, due to dvp also locked and causing LOR. Modified: stable/9/sys/kern/vfs_lookup.c stable/9/sys/sys/mount.h Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/kern/vfs_lookup.c == --- stable/9/sys/kern/vfs_lookup.c Mon Dec 24 10:10:18 2012 (r244650) +++ stable/9/sys/kern/vfs_lookup.c Mon Dec 24 12:54:12 2012 (r244651) @@ -393,11 +393,13 @@ namei(struct nameidata *ndp) } static int -compute_cn_lkflags(struct mount *mp, int lkflags) +compute_cn_lkflags(struct mount *mp, int lkflags, int cnflags) { - if (mp == NULL || - ((lkflags LK_SHARED) !(mp-mnt_kern_flag MNTK_LOOKUP_SHARED))) { + if (mp == NULL || ((lkflags LK_SHARED) + (!(mp-mnt_kern_flag MNTK_LOOKUP_SHARED) || + ((cnflags ISDOTDOT) + (mp-mnt_kern_flag MNTK_LOOKUP_EXCL_DOTDOT) { lkflags = ~LK_SHARED; lkflags |= LK_EXCLUSIVE; } @@ -526,7 +528,8 @@ lookup(struct nameidata *ndp) dp = ndp-ni_startdir; ndp-ni_startdir = NULLVP; vn_lock(dp, - compute_cn_lkflags(dp-v_mount, cnp-cn_lkflags | LK_RETRY)); + compute_cn_lkflags(dp-v_mount, cnp-cn_lkflags | LK_RETRY, + cnp-cn_flags)); dirloop: /* @@ -683,7 +686,7 @@ dirloop: VFS_UNLOCK_GIANT(tvfslocked); vn_lock(dp, compute_cn_lkflags(dp-v_mount, cnp-cn_lkflags | - LK_RETRY)); + LK_RETRY, ISDOTDOT)); } } @@ -721,7 +724,8 @@ unionlookup: vprint(lookup in, dp); #endif lkflags_save = cnp-cn_lkflags; - cnp-cn_lkflags = compute_cn_lkflags(dp-v_mount, cnp-cn_lkflags); + cnp-cn_lkflags = compute_cn_lkflags(dp-v_mount, cnp-cn_lkflags, + cnp-cn_flags); if ((error = VOP_LOOKUP(dp, ndp-ni_vp, cnp)) != 0) { cnp-cn_lkflags = lkflags_save; KASSERT(ndp-ni_vp == NULL, (leaf should be empty)); @@ -740,7 +744,7 @@ unionlookup: VFS_UNLOCK_GIANT(tvfslocked); vn_lock(dp, compute_cn_lkflags(dp-v_mount, cnp-cn_lkflags | - LK_RETRY)); + LK_RETRY, cnp-cn_flags)); goto unionlookup; } @@ -812,8 +816,8 @@ unionlookup: dvfslocked = 0; vref(vp_crossmp); ndp-ni_dvp = vp_crossmp; - error = VFS_ROOT(mp, compute_cn_lkflags(mp, cnp-cn_lkflags), - tdp); + error = VFS_ROOT(mp, compute_cn_lkflags(mp, cnp-cn_lkflags, + cnp-cn_flags), tdp); vfs_unbusy(mp); if (vn_lock(vp_crossmp, LK_SHARED | LK_NOWAIT)) panic(vp_crossmp exclusively locked or reclaimed); Modified: stable/9/sys/sys/mount.h == --- stable/9/sys/sys/mount.hMon Dec 24 10:10:18 2012(r244650) +++ stable/9/sys/sys/mount.hMon Dec 24 12:54:12 2012(r244651) @@ -369,6 +369,7 @@ void __mnt_vnode_markerfree(str #defineMNTK_NO_IOPF0x0100 /* Disallow page faults during reads and writes. Filesystem shall properly handle i/o state on EFAULT. */ +#defineMNTK_LOOKUP_EXCL_DOTDOT 0x0800 #define MNTK_NOASYNC 0x0080 /* disable async */ #define MNTK_UNMOUNT 0x0100 /* unmount in progress */ #defineMNTK_MWAIT 0x0200 /* waiting for unmount to finish */ ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r244652 - in stable/9/sys: kern sys
Author: kib Date: Mon Dec 24 13:01:07 2012 New Revision: 244652 URL: http://svnweb.freebsd.org/changeset/base/244652 Log: MFC r240284: Add a facility for vgone() to inform the set of subscribed mounts about vnode reclamation. Typical use is for the bypass mounts like nullfs to get a notification about lower vnode going away. MFC r241225 (by avg): mount.h: MNTK_VGONE_UPPER and MNTK_VGONE_WAITER were supposed to be different Modified: stable/9/sys/kern/vfs_mount.c stable/9/sys/kern/vfs_subr.c stable/9/sys/sys/mount.h Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/kern/vfs_mount.c == --- stable/9/sys/kern/vfs_mount.c Mon Dec 24 12:54:12 2012 (r244651) +++ stable/9/sys/kern/vfs_mount.c Mon Dec 24 13:01:07 2012 (r244652) @@ -479,6 +479,7 @@ vfs_mount_alloc(struct vnode *vp, struct mac_mount_create(cred, mp); #endif arc4rand(mp-mnt_hashseed, sizeof mp-mnt_hashseed, 0); + TAILQ_INIT(mp-mnt_uppers); return (mp); } @@ -512,6 +513,7 @@ vfs_mount_destroy(struct mount *mp) vprint(, vp); panic(unmount: dangling vnode); } + KASSERT(TAILQ_EMPTY(mp-mnt_uppers), (mnt_uppers)); if (mp-mnt_nvnodelistsize != 0) panic(vfs_mount_destroy: nonzero nvnodelistsize); if (mp-mnt_activevnodelistsize != 0) @@ -1259,7 +1261,8 @@ dounmount(mp, flags, td) } MNT_ILOCK(mp); - if (mp-mnt_kern_flag MNTK_UNMOUNT) { + if ((mp-mnt_kern_flag MNTK_UNMOUNT) != 0 || + !TAILQ_EMPTY(mp-mnt_uppers)) { MNT_IUNLOCK(mp); if (coveredvp) VOP_UNLOCK(coveredvp, 0); Modified: stable/9/sys/kern/vfs_subr.c == --- stable/9/sys/kern/vfs_subr.cMon Dec 24 12:54:12 2012 (r244651) +++ stable/9/sys/kern/vfs_subr.cMon Dec 24 13:01:07 2012 (r244652) @@ -2741,6 +2741,58 @@ vgone(struct vnode *vp) VI_UNLOCK(vp); } +static void +vgonel_reclaim_lowervp_vfs(struct mount *mp __unused, +struct vnode *lowervp __unused) +{ +} + +/* + * Notify upper mounts about reclaimed vnode. + */ +static void +vgonel_reclaim_lowervp(struct vnode *vp) +{ + static struct vfsops vgonel_vfsops = { + .vfs_reclaim_lowervp = vgonel_reclaim_lowervp_vfs + }; + struct mount *mp, *ump, *mmp; + + mp = vp-v_mount; + if (mp == NULL) + return; + + MNT_ILOCK(mp); + if (TAILQ_EMPTY(mp-mnt_uppers)) + goto unlock; + MNT_IUNLOCK(mp); + mmp = malloc(sizeof(struct mount), M_TEMP, M_WAITOK | M_ZERO); + mmp-mnt_op = vgonel_vfsops; + mmp-mnt_kern_flag |= MNTK_MARKER; + MNT_ILOCK(mp); + mp-mnt_kern_flag |= MNTK_VGONE_UPPER; + for (ump = TAILQ_FIRST(mp-mnt_uppers); ump != NULL;) { + if ((ump-mnt_kern_flag MNTK_MARKER) != 0) { + ump = TAILQ_NEXT(ump, mnt_upper_link); + continue; + } + TAILQ_INSERT_AFTER(mp-mnt_uppers, ump, mmp, mnt_upper_link); + MNT_IUNLOCK(mp); + VFS_RECLAIM_LOWERVP(ump, vp); + MNT_ILOCK(mp); + ump = TAILQ_NEXT(mmp, mnt_upper_link); + TAILQ_REMOVE(mp-mnt_uppers, mmp, mnt_upper_link); + } + free(mmp, M_TEMP); + mp-mnt_kern_flag = ~MNTK_VGONE_UPPER; + if ((mp-mnt_kern_flag MNTK_VGONE_WAITER) != 0) { + mp-mnt_kern_flag = ~MNTK_VGONE_WAITER; + wakeup(mp-mnt_uppers); + } +unlock: + MNT_IUNLOCK(mp); +} + /* * vgone, with the vp interlock held. */ @@ -2765,6 +2817,7 @@ vgonel(struct vnode *vp) if (vp-v_iflag VI_DOOMED) return; vp-v_iflag |= VI_DOOMED; + /* * Check to see if the vnode is in use. If so, we have to call * VOP_CLOSE() and VOP_INACTIVE(). @@ -2772,6 +2825,8 @@ vgonel(struct vnode *vp) active = vp-v_usecount; oweinact = (vp-v_iflag VI_OWEINACT); VI_UNLOCK(vp); + vgonel_reclaim_lowervp(vp); + /* * Clean out any buffers associated with the vnode. * If the flush fails, just toss the buffers. Modified: stable/9/sys/sys/mount.h == --- stable/9/sys/sys/mount.hMon Dec 24 12:54:12 2012(r244651) +++ stable/9/sys/sys/mount.hMon Dec 24 13:01:07 2012(r244652) @@ -189,6 +189,8 @@ struct mount { #definemnt_endzero mnt_gjprovider char*mnt_gjprovider;/* gjournal provider name */ struct lock mnt_explock;/* vfs_export walkers lock */ + TAILQ_ENTRY(mount) mnt_upper_link; /* (m) we in the
svn commit: r244653 - stable/9/sys/kern
Author: kib Date: Mon Dec 24 13:05:27 2012 New Revision: 244653 URL: http://svnweb.freebsd.org/changeset/base/244653 Log: MFC r242560: Add decoding of the missed MNTK_ flags to ddb show mount command. Modified: stable/9/sys/kern/vfs_subr.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/kern/vfs_subr.c == --- stable/9/sys/kern/vfs_subr.cMon Dec 24 13:01:07 2012 (r244652) +++ stable/9/sys/kern/vfs_subr.cMon Dec 24 13:05:27 2012 (r244653) @@ -3140,6 +3140,11 @@ DB_SHOW_COMMAND(mount, db_show_mount) MNT_KERN_FLAG(MNTK_REFEXPIRE); MNT_KERN_FLAG(MNTK_EXTENDED_SHARED); MNT_KERN_FLAG(MNTK_SHARED_WRITES); + MNT_KERN_FLAG(MNTK_NO_IOPF); + MNT_KERN_FLAG(MNTK_VGONE_UPPER); + MNT_KERN_FLAG(MNTK_VGONE_WAITER); + MNT_KERN_FLAG(MNTK_LOOKUP_EXCL_DOTDOT); + MNT_KERN_FLAG(MNTK_MARKER); MNT_KERN_FLAG(MNTK_NOASYNC); MNT_KERN_FLAG(MNTK_UNMOUNT); MNT_KERN_FLAG(MNTK_MWAIT); ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r244654 - stable/9/sys/fs/nullfs
Author: kib Date: Mon Dec 24 13:14:38 2012 New Revision: 244654 URL: http://svnweb.freebsd.org/changeset/base/244654 Log: MFC r240285: Allow shared lookups for nullfs mounts, if lower filesystem supports it. MFC r241548: Replace the XXX comment with the proper description. MFC r241554: Grammar fixes. Modified: stable/9/sys/fs/nullfs/null.h stable/9/sys/fs/nullfs/null_subr.c stable/9/sys/fs/nullfs/null_vfsops.c stable/9/sys/fs/nullfs/null_vnops.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/fs/ (props changed) Modified: stable/9/sys/fs/nullfs/null.h == --- stable/9/sys/fs/nullfs/null.h Mon Dec 24 13:05:27 2012 (r244653) +++ stable/9/sys/fs/nullfs/null.h Mon Dec 24 13:14:38 2012 (r244654) @@ -56,6 +56,7 @@ struct null_node { int nullfs_init(struct vfsconf *vfsp); int nullfs_uninit(struct vfsconf *vfsp); int null_nodeget(struct mount *mp, struct vnode *target, struct vnode **vpp); +struct vnode *null_hashget(struct mount *mp, struct vnode *lowervp); void null_hashrem(struct null_node *xp); int null_bypass(struct vop_generic_args *ap); Modified: stable/9/sys/fs/nullfs/null_subr.c == --- stable/9/sys/fs/nullfs/null_subr.c Mon Dec 24 13:05:27 2012 (r244653) +++ stable/9/sys/fs/nullfs/null_subr.c Mon Dec 24 13:14:38 2012 (r244654) @@ -67,7 +67,6 @@ struct mtx null_hashmtx; static MALLOC_DEFINE(M_NULLFSHASH, nullfs_hash, NULLFS hash table); MALLOC_DEFINE(M_NULLFSNODE, nullfs_node, NULLFS vnode private part); -static struct vnode * null_hashget(struct mount *, struct vnode *); static struct vnode * null_hashins(struct mount *, struct null_node *); /* @@ -98,7 +97,7 @@ nullfs_uninit(vfsp) * Return a VREF'ed alias for lower vnode if already exists, else 0. * Lower vnode should be locked on entry and will be left locked on exit. */ -static struct vnode * +struct vnode * null_hashget(mp, lowervp) struct mount *mp; struct vnode *lowervp; @@ -209,14 +208,10 @@ null_nodeget(mp, lowervp, vpp) struct vnode *vp; int error; - /* -* The insmntque1() call below requires the exclusive lock on -* the nullfs vnode. -*/ - ASSERT_VOP_ELOCKED(lowervp, lowervp); - KASSERT(lowervp-v_usecount = 1, (Unreferenced vnode %p\n, lowervp)); + ASSERT_VOP_LOCKED(lowervp, lowervp); + KASSERT(lowervp-v_usecount = 1, (Unreferenced vnode %p, lowervp)); - /* Lookup the hash firstly */ + /* Lookup the hash firstly. */ *vpp = null_hashget(mp, lowervp); if (*vpp != NULL) { vrele(lowervp); @@ -224,6 +219,19 @@ null_nodeget(mp, lowervp, vpp) } /* +* The insmntque1() call below requires the exclusive lock on +* the nullfs vnode. Upgrade the lock now if hash failed to +* provide ready to use vnode. +*/ + if (VOP_ISLOCKED(lowervp) != LK_EXCLUSIVE) { + vn_lock(lowervp, LK_UPGRADE | LK_RETRY); + if ((lowervp-v_iflag VI_DOOMED) != 0) { + vput(lowervp); + return (ENOENT); + } + } + + /* * We do not serialize vnode creation, instead we will check for * duplicates later, when adding new vnode to hash. * Note that duplicate can only appear in hash if the lowervp is @@ -233,8 +241,7 @@ null_nodeget(mp, lowervp, vpp) * might cause a bogus v_data pointer to get dereferenced * elsewhere if MALLOC should block. */ - xp = malloc(sizeof(struct null_node), - M_NULLFSNODE, M_WAITOK); + xp = malloc(sizeof(struct null_node), M_NULLFSNODE, M_WAITOK); error = getnewvnode(null, mp, null_vnodeops, vp); if (error) { Modified: stable/9/sys/fs/nullfs/null_vfsops.c == --- stable/9/sys/fs/nullfs/null_vfsops.cMon Dec 24 13:05:27 2012 (r244653) +++ stable/9/sys/fs/nullfs/null_vfsops.cMon Dec 24 13:14:38 2012 (r244654) @@ -65,6 +65,7 @@ static vfs_statfs_t nullfs_statfs; static vfs_unmount_t nullfs_unmount; static vfs_vget_t nullfs_vget; static vfs_extattrctl_tnullfs_extattrctl; +static vfs_reclaim_lowervp_t nullfs_reclaim_lowervp; /* * Mount null layer @@ -121,8 +122,10 @@ nullfs_mount(struct mount *mp) */ NDINIT(ndp, LOOKUP, FOLLOW|LOCKLEAF, UIO_SYSSPACE, target, curthread); error = namei(ndp); + /* * Re-lock vnode. +* XXXKIB This is deadlock-prone as well. */ if (isvnunlocked) vn_lock(mp-mnt_vnodecovered, LK_EXCLUSIVE | LK_RETRY); @@ -146,7 +149,7 @@ nullfs_mount(struct mount *mp) } xmp = (struct
svn commit: r244655 - stable/9/sys/fs/nullfs
Author: kib Date: Mon Dec 24 13:17:22 2012 New Revision: 244655 URL: http://svnweb.freebsd.org/changeset/base/244655 Log: MFC r243340: Remove the check and panic for an impossible condition. Modified: stable/9/sys/fs/nullfs/null_subr.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/fs/ (props changed) Modified: stable/9/sys/fs/nullfs/null_subr.c == --- stable/9/sys/fs/nullfs/null_subr.c Mon Dec 24 13:14:38 2012 (r244654) +++ stable/9/sys/fs/nullfs/null_subr.c Mon Dec 24 13:17:22 2012 (r244655) @@ -255,8 +255,6 @@ null_nodeget(mp, lowervp, vpp) vp-v_type = lowervp-v_type; vp-v_data = xp; vp-v_vnlock = lowervp-v_vnlock; - if (vp-v_vnlock == NULL) - panic(null_nodeget: Passed a NULL vnlock.\n); error = insmntque1(vp, mp, null_insmntque_dtr, xp); if (error != 0) return (error); ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r244658 - in stable/9/sys: compat/linux fs/coda fs/nfsserver kern nfsserver vm
Author: kib Date: Mon Dec 24 13:22:32 2012 New Revision: 244658 URL: http://svnweb.freebsd.org/changeset/base/244658 Log: MFC r241025: Fix the mis-handling of the VV_TEXT on the nullfs vnodes. Add a set of VOPs for the VV_TEXT query, set and clear operations, which are correctly bypassed to lower vnode. Modified: stable/9/sys/compat/linux/linux_misc.c stable/9/sys/fs/coda/coda_subr.c stable/9/sys/fs/nfsserver/nfs_nfsdport.c stable/9/sys/kern/imgact_elf.c stable/9/sys/kern/kern_exec.c stable/9/sys/kern/vfs_default.c stable/9/sys/kern/vfs_vnops.c stable/9/sys/kern/vnode_if.src stable/9/sys/nfsserver/nfs_serv.c stable/9/sys/vm/vm_object.c stable/9/sys/vm/vnode_pager.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/fs/ (props changed) Modified: stable/9/sys/compat/linux/linux_misc.c == --- stable/9/sys/compat/linux/linux_misc.c Mon Dec 24 13:22:22 2012 (r244657) +++ stable/9/sys/compat/linux/linux_misc.c Mon Dec 24 13:22:32 2012 (r244658) @@ -372,7 +372,7 @@ linux_uselib(struct thread *td, struct l * XXX: Note that if any of the VM operations fail below we don't * clear this flag. */ - vp-v_vflag |= VV_TEXT; + VOP_SET_TEXT(vp); /* * Lock no longer needed Modified: stable/9/sys/fs/coda/coda_subr.c == --- stable/9/sys/fs/coda/coda_subr.cMon Dec 24 13:22:22 2012 (r244657) +++ stable/9/sys/fs/coda/coda_subr.cMon Dec 24 13:22:32 2012 (r244658) @@ -486,7 +486,7 @@ handleDownCall(struct coda_mntinfo *mnt, cache_purge(CTOV(cp)); cp-c_flags = ~(C_VATTR | C_ACCCACHE); ASSERT_VOP_LOCKED(CTOV(cp), coda HandleDownCall); - if (CTOV(cp)-v_vflag VV_TEXT) + if (VOP_IS_TEXT(CTOV(cp))) error = coda_vmflush(cp); CODADEBUG(CODA_ZAPFILE, myprintf((zapfile: fid = %s, refcnt = %d, error = @@ -532,7 +532,7 @@ handleDownCall(struct coda_mntinfo *mnt, cp-c_flags = ~(C_VATTR | C_ACCCACHE); ASSERT_VOP_LOCKED(CTOV(cp), coda HandleDownCall); if (!(IS_DIR(out-coda_purgefid.Fid)) -(CTOV(cp)-v_vflag VV_TEXT)) +VOP_IS_TEXT(CTOV(cp))) error = coda_vmflush(cp); CODADEBUG(CODA_PURGEFID, myprintf((purgefid: fid = %s, refcnt = %d, error = %d\n, Modified: stable/9/sys/fs/nfsserver/nfs_nfsdport.c == --- stable/9/sys/fs/nfsserver/nfs_nfsdport.cMon Dec 24 13:22:22 2012 (r244657) +++ stable/9/sys/fs/nfsserver/nfs_nfsdport.cMon Dec 24 13:22:32 2012 (r244658) @@ -253,7 +253,7 @@ nfsvno_accchk(struct vnode *vp, accmode_ * the inode, try to free it up once. If * we fail, we can't allow writing. */ - if ((vp-v_vflag VV_TEXT) != 0 error == 0) + if (VOP_IS_TEXT(vp) error == 0) error = ETXTBSY; } if (error != 0) { Modified: stable/9/sys/kern/imgact_elf.c == --- stable/9/sys/kern/imgact_elf.c Mon Dec 24 13:22:22 2012 (r244657) +++ stable/9/sys/kern/imgact_elf.c Mon Dec 24 13:22:32 2012 (r244658) @@ -646,7 +646,7 @@ __elfN(load_file)(struct proc *p, const * Also make certain that the interpreter stays the same, so set * its VV_TEXT flag, too. */ - nd-ni_vp-v_vflag |= VV_TEXT; + VOP_SET_TEXT(nd-ni_vp); imgp-object = nd-ni_vp-v_object; Modified: stable/9/sys/kern/kern_exec.c == --- stable/9/sys/kern/kern_exec.c Mon Dec 24 13:22:22 2012 (r244657) +++ stable/9/sys/kern/kern_exec.c Mon Dec 24 13:22:32 2012 (r244658) @@ -473,9 +473,8 @@ interpret: * Remember if this was set before and unset it in case this is not * actually an executable image. */ - textset = imgp-vp-v_vflag VV_TEXT; - ASSERT_VOP_ELOCKED(imgp-vp, vv_text); - imgp-vp-v_vflag |= VV_TEXT; + textset = VOP_IS_TEXT(imgp-vp); + VOP_SET_TEXT(imgp-vp); error = exec_map_first_page(imgp); if (error) @@ -506,10 +505,8 @@ interpret: if (error) { if (error == -1) { - if (textset == 0) { - ASSERT_VOP_ELOCKED(imgp-vp, vv_text); - imgp-vp-v_vflag
svn commit: r244660 - in stable/9/sys: compat/linux fs/nullfs fs/unionfs i386/ibcs2 kern ufs/ufs vm
Author: kib Date: Mon Dec 24 13:29:22 2012 New Revision: 244660 URL: http://svnweb.freebsd.org/changeset/base/244660 Log: MFC r242476: The r241025 fixed the case when a binary, executed from nullfs mount, was still possible to open for write from the lower filesystem. There is a symmetric situation where the binary could already has file descriptors opened for write, but it can be executed from the nullfs overlay. Handle the issue by passing one v_writecount reference to the lower vnode if nullfs vnode has non-zero v_writecount. Modified: stable/9/sys/compat/linux/linux_misc.c stable/9/sys/fs/nullfs/null_vnops.c stable/9/sys/fs/unionfs/union_subr.c stable/9/sys/i386/ibcs2/imgact_coff.c stable/9/sys/kern/kern_exec.c stable/9/sys/kern/vfs_default.c stable/9/sys/kern/vfs_vnops.c stable/9/sys/kern/vnode_if.src stable/9/sys/ufs/ufs/ufs_extattr.c stable/9/sys/vm/vnode_pager.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/fs/ (props changed) Modified: stable/9/sys/compat/linux/linux_misc.c == --- stable/9/sys/compat/linux/linux_misc.c Mon Dec 24 13:24:55 2012 (r244659) +++ stable/9/sys/compat/linux/linux_misc.c Mon Dec 24 13:29:22 2012 (r244660) @@ -232,8 +232,7 @@ linux_uselib(struct thread *td, struct l unsigned long bss_size; char *library; ssize_t aresid; - int error; - int locked, vfslocked; + int error, locked, vfslocked, writecount; LCONVPATHEXIST(td, args-library, library); @@ -265,7 +264,10 @@ linux_uselib(struct thread *td, struct l locked = 1; /* Writable? */ - if (vp-v_writecount) { + error = VOP_GET_WRITECOUNT(vp, writecount); + if (error != 0) + goto cleanup; + if (writecount != 0) { error = ETXTBSY; goto cleanup; } Modified: stable/9/sys/fs/nullfs/null_vnops.c == --- stable/9/sys/fs/nullfs/null_vnops.c Mon Dec 24 13:24:55 2012 (r244659) +++ stable/9/sys/fs/nullfs/null_vnops.c Mon Dec 24 13:29:22 2012 (r244660) @@ -329,6 +329,26 @@ null_bypass(struct vop_generic_args *ap) return (error); } +static int +null_add_writecount(struct vop_add_writecount_args *ap) +{ + struct vnode *lvp, *vp; + int error; + + vp = ap-a_vp; + lvp = NULLVPTOLOWERVP(vp); + KASSERT(vp-v_writecount + ap-a_inc = 0, (wrong writecount inc)); + if (vp-v_writecount 0 vp-v_writecount + ap-a_inc == 0) + error = VOP_ADD_WRITECOUNT(lvp, -1); + else if (vp-v_writecount == 0 vp-v_writecount + ap-a_inc 0) + error = VOP_ADD_WRITECOUNT(lvp, 1); + else + error = 0; + if (error == 0) + vp-v_writecount += ap-a_inc; + return (error); +} + /* * We have to carry on the locking protocol on the null layer vnodes * as we progress through the tree. We also have to enforce read-only @@ -826,4 +846,5 @@ struct vop_vector null_vnodeops = { .vop_unlock = null_unlock, .vop_vptocnp = null_vptocnp, .vop_vptofh = null_vptofh, + .vop_add_writecount = null_add_writecount, }; Modified: stable/9/sys/fs/unionfs/union_subr.c == --- stable/9/sys/fs/unionfs/union_subr.cMon Dec 24 13:24:55 2012 (r244659) +++ stable/9/sys/fs/unionfs/union_subr.cMon Dec 24 13:29:22 2012 (r244660) @@ -954,7 +954,7 @@ unionfs_vn_create_on_upper(struct vnode vput(vp); goto unionfs_vn_create_on_upper_free_out1; } - vp-v_writecount++; + VOP_ADD_WRITECOUNT(vp, 1); *vpp = vp; unionfs_vn_create_on_upper_free_out1: @@ -1089,7 +1089,7 @@ unionfs_copyfile(struct unionfs_node *un } } VOP_CLOSE(uvp, FWRITE, cred, td); - uvp-v_writecount--; + VOP_ADD_WRITECOUNT(uvp, -1); vn_finished_write(mp); Modified: stable/9/sys/i386/ibcs2/imgact_coff.c == --- stable/9/sys/i386/ibcs2/imgact_coff.c Mon Dec 24 13:24:55 2012 (r244659) +++ stable/9/sys/i386/ibcs2/imgact_coff.c Mon Dec 24 13:29:22 2012 (r244660) @@ -168,7 +168,7 @@ coff_load_file(struct thread *td, char * unsigned long text_offset = 0, text_address = 0, text_size = 0; unsigned long data_offset = 0, data_address = 0, data_size = 0; unsigned long bss_size = 0; - int i; + int i, writecount; NDINIT(nd, LOOKUP, ISOPEN | LOCKLEAF | FOLLOW | SAVENAME, UIO_SYSSPACE, name, td); @@ -181,7 +181,10 @@ coff_load_file(struct thread *td, char * if (vp == NULL)
svn commit: r244663 - stable/9
Author: kib Date: Mon Dec 24 14:22:52 2012 New Revision: 244663 URL: http://svnweb.freebsd.org/changeset/base/244663 Log: Note that filesystem modules must be recompiled. Modified: stable/9/UPDATING Modified: stable/9/UPDATING == --- stable/9/UPDATING Mon Dec 24 14:12:43 2012(r244662) +++ stable/9/UPDATING Mon Dec 24 14:22:52 2012(r244663) @@ -11,6 +11,11 @@ handbook: Items affecting the ports and packages system can be found in /usr/ports/UPDATING. Please read that file before running portupgrade. +20121224: + The VFS KBI was changed with the merge of several nullfs + optimizations and fixes. All filesystem modules must be + recompiled. + 20121218: With the addition of auditdistd(8), a new auditdistd user is now depended on during installworld. mergemaster -p can be used to add ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
Re: svn commit: r244663 - stable/9
... why'd we break the KBI in a stable branch? Adrian On 24 December 2012 06:22, Konstantin Belousov k...@freebsd.org wrote: Author: kib Date: Mon Dec 24 14:22:52 2012 New Revision: 244663 URL: http://svnweb.freebsd.org/changeset/base/244663 Log: Note that filesystem modules must be recompiled. Modified: stable/9/UPDATING Modified: stable/9/UPDATING == --- stable/9/UPDATING Mon Dec 24 14:12:43 2012(r244662) +++ stable/9/UPDATING Mon Dec 24 14:22:52 2012(r244663) @@ -11,6 +11,11 @@ handbook: Items affecting the ports and packages system can be found in /usr/ports/UPDATING. Please read that file before running portupgrade. +20121224: + The VFS KBI was changed with the merge of several nullfs + optimizations and fixes. All filesystem modules must be + recompiled. + 20121218: With the addition of auditdistd(8), a new auditdistd user is now depended on during installworld. mergemaster -p can be used to add ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
Re: svn commit: r244663 - stable/9
On 12/24/12 11:24 AM, Adrian Chadd wrote: ... why'd we break the KBI in a stable branch? I am not sure either. I think a single VOP for nullfs (while ugly) would have sufficed. I have a partial patch here that shows the direction I was going. What's left is to: shim #defines for -stable to route the new vops from -current (VOP_ISTEXT, VOP_WRITECOUNT..) into just plain #defines inside of vnode.h to call into VOP_NULLFS_CALLTHROUGH with the proper VOP_NULLFS_IS_TEXT/VOP_NULLFS_SET_TEXT and remap stuff around into struct vop_nullfs_callthrough_args. best way to do this would be to just copy the code from the -current vnode_if.h into sys/vnode.h and hack it up for that it maps properly. Partial patch attached. -Alfred Adrian On 24 December 2012 06:22, Konstantin Belousov k...@freebsd.org wrote: Author: kib Date: Mon Dec 24 14:22:52 2012 New Revision: 244663 URL: http://svnweb.freebsd.org/changeset/base/244663 Log: Note that filesystem modules must be recompiled. Modified: stable/9/UPDATING Modified: stable/9/UPDATING == --- stable/9/UPDATING Mon Dec 24 14:12:43 2012(r244662) +++ stable/9/UPDATING Mon Dec 24 14:22:52 2012(r244663) @@ -11,6 +11,11 @@ handbook: Items affecting the ports and packages system can be found in /usr/ports/UPDATING. Please read that file before running portupgrade. +20121224: + The VFS KBI was changed with the merge of several nullfs + optimizations and fixes. All filesystem modules must be + recompiled. + 20121218: With the addition of auditdistd(8), a new auditdistd user is now depended on during installworld. mergemaster -p can be used to add diff --git a/sys/kern/vfs_default.c b/sys/kern/vfs_default.c index fd2437b..f109bc8 100644 --- a/sys/kern/vfs_default.c +++ b/sys/kern/vfs_default.c @@ -78,6 +78,8 @@ static intdirent_exists(struct vnode *vp, const char *dirname, #define DIRENT_MINSIZE (sizeof(struct dirent) - (MAXNAMLEN+1) + 4) +static int vop_nullfs_callthrough(struct vop_nullfs_callthrough_args *ap); + static int vop_stdis_text(struct vop_is_text_args *ap); static int vop_stdset_text(struct vop_set_text_args *ap); static int vop_stdunset_text(struct vop_unset_text_args *ap); @@ -132,11 +134,7 @@ struct vop_vector default_vnodeops = { .vop_unp_bind = vop_stdunp_bind, .vop_unp_connect = vop_stdunp_connect, .vop_unp_detach = vop_stdunp_detach, - .vop_is_text = vop_stdis_text, - .vop_set_text = vop_stdset_text, - .vop_unset_text = vop_stdunset_text, - .vop_get_writecount = vop_stdget_writecount, - .vop_add_writecount = vop_stdadd_writecount, + .vop_nullfs_callthrough = vop_stdnullfs_callthrough, }; /* @@ -1085,6 +1083,54 @@ vop_stdunp_detach(struct vop_unp_detach_args *ap) } static int +vop_stdnullfs_callthrough(struct vop_nullfs_callthrough_args *ap) +{ + + switch (ap-a_op) { + case VOP_NULLFS_IS_TEXT: + { + struct vop_is_text_args ap2; + ap2.a_vp = ap-a_vp; + return vop_stdis_text(ap2); + } + case VOP_NULLFS_SET_TEXT: + { + struct vop_set_text_args ap2; + ap2.a_vp = ap-a_vp; + return vop_stdset_text(ap2); + } + case VOP_NULLFS_UNSET_TEXT: + { + struct vop_unset_text_args ap2; + ap2.a_vp = ap-a_vp; + return vop_stdunset_text(ap2); + } + case VOP_NULLFS_GET_WRITECOUNT: + { + struct vop_get_writecount_args ap2; + int error; + int writecount; + + ap2.a_vp = ap-a_vp; + ap2.a_writecount = writecount; + error = vop_stdget_writecount(ap2); + *((int *)ap-a_out0) = writecount; + return (error); + } + case VOP_NULLFS_ADD_WRITECOUNT: + { + struct vop_add_writecount_args ap2; + + ap2.a_vp = ap-a_vp; + ap2.a_inc = ap-a_in0; + return vop_stdadd_writecount(ap2); + } + default: + return (EOPNOTSUPP); + } +} + +static int vop_stdis_text(struct vop_is_text_args *ap) { diff --git a/sys/kern/vnode_if.src b/sys/kern/vnode_if.src index 194e9f8..2bcc80a 100644 --- a/sys/kern/vnode_if.src +++ b/sys/kern/vnode_if.src @@ -658,36 +658,12 @@ vop_unp_detach { IN struct vnode *vp; }; -%% is_text vp L L L +%% nullfs_callthrough vp = = = -vop_is_text { +vop_nullfs_callthrough { IN struct vnode *vp; -}; - -%% set_textvp
svn commit: r244664 - stable/9/release/doc/en_US.ISO8859-1/relnotes
Author: hrs Date: Mon Dec 24 20:33:37 2012 New Revision: 244664 URL: http://svnweb.freebsd.org/changeset/base/244664 Log: Fix various grammatical errors. Submitted by: bjk Modified: stable/9/release/doc/en_US.ISO8859-1/relnotes/article.xml Modified: stable/9/release/doc/en_US.ISO8859-1/relnotes/article.xml == --- stable/9/release/doc/en_US.ISO8859-1/relnotes/article.xml Mon Dec 24 14:22:52 2012(r244663) +++ stable/9/release/doc/en_US.ISO8859-1/relnotes/article.xml Mon Dec 24 20:33:37 2012(r244664) @@ -167,7 +167,7 @@ sect2 id=kernel titleKernel Changes/title - para revision=232728os; Jail subsystem now supports + para revision=232728The os; Jail subsystem now supports mounting man.devfs.5;, man.nullfs.5;, and ZFS filesystem inside a jail. New man.jail.8; parameters varnameallow.mount.devfs/varname, @@ -178,9 +178,9 @@ para revision=234167A new man.loader.8; tunable varnamekern.eventtimer.activetick/varname has been added. - This tunable is to specify whether each hardclock tick should - be run on every active CPU or only one. Setting it to - literal0/literal, the number of interrupts can be reduced + This tunable specifies whether each hardclock tick should + be run on every active CPU or only one. By setting it to + literal0/literal, the total number of interrupts can be reduced on SMP machines. The default value is literal1/literal./para @@ -189,7 +189,7 @@ man.madvise.2; except that it operates on a file descriptor instead of a memory region./para - para revision=237795The man.filemon.4; pseudo device has + para revision=237795The man.filemon.4; pseudo-device has been added. This allows a process to collect file operations data of its children./para @@ -201,8 +201,8 @@ supports kernel profiling by using man.kgmon.8;./para para revision=231145The os; Linux ABI compatibility layer - now supports functionlinux_fadvice64()/function and - functionlinux_fadvice64_64()/function system call./para + now supports the functionlinux_fadvise64()/function and + functionlinux_fadvise64_64()/function system calls./para para revision=230266The default value of the man.loader.8; tunable varnamehw.memtest.tests/varname is now @@ -211,23 +211,23 @@ para revision=234075A new man.loader.8; tunable varnamekern.msgbuf_show_timestamp/varname has been added. - When this is enabled, timestamp is added to each line of the + When it is enabled, a timestamp is added to each line of the system message buffer. The default value is literal0/literal (disabled)./para para revision=230320The man.null.4; and man.zero.4; pseudo - device driver now supports non-blocking mode via man.fcntl.2; + device driver now supports non-blocking mode via the man.fcntl.2; system call./para para revision=233599The os; man.sched.ule.4; scheduler has - been improved on CPU load balancing of SMT (Simultaneous - MultiThreading) CPUs. It gives 10-15% performance improvement + been improved for CPU load balancing on SMT (Simultaneous + MultiThreading) CPUs. It gives a 10-15% performance improvement when the number of threads is lesser than the number of logical CPUs./para para revision=235992 - arch=sparc64literalPREEMPTION/literal kernel option is - now enabled in filenameGENERIC/filename kernel./para + arch=sparc64The literalPREEMPTION/literal kernel option is + now enabled in the filenameGENERIC/filename kernel./para para revision=230039A new man.sysctl.8; variable varnamesecurity.bsd.unprivileged_idprio/varname has been @@ -242,11 +242,11 @@ titleBoot Loader Changes/title para revision=230065The man.boot0cfg.8; utility now - supports configuration of PXE boot via + supports configuration of PXE boot via the filenameboot0/filename boot block temporarily on the next boot. The slice number literal6/literal or a keyword literalPXE/literal can be specified to enable - PXE boot in the option-s/option option./para + PXE boot using the option-s/option option./para para revision=231287The os; man.boot.8; block now supports filename/boot/config/filename in addition to @@ -262,27 +262,27 @@ LBA for the metadata./para para revision=237766The filenamezfsboot/filename boot - block and filenamezfsloader/filename supports + block and filenamezfsloader/filename support filesystems within a ZFS storage pool. In - filenamezfsloader/filename, ZFS device name format now - is + filenamezfsloader/filename,
Re: svn commit: r244469 - head/sys/arm/arm
On 2012-Dec-20 00:35:27 +, Olivier Houchard cog...@freebsd.org wrote: Author: cognet Date: Thu Dec 20 00:35:26 2012 New Revision: 244469 URL: http://svnweb.freebsd.org/changeset/base/244469 Log: Use the new allocator in bus_dmamem_alloc(). Modified: head/sys/arm/arm/busdma_machdep-v6.c Do you have any plans to make similar changes to the other busdma_machdep.c files? -- Peter Jeremy pgpR1uFwMi0LM.pgp Description: PGP signature
svn commit: r244665 - head/sys/netinet
Author: glebius Date: Mon Dec 24 21:35:48 2012 New Revision: 244665 URL: http://svnweb.freebsd.org/changeset/base/244665 Log: Minor style(9) changes: - Remove declaration in initializer. - Add empty line between logical blocks. Modified: head/sys/netinet/in.c Modified: head/sys/netinet/in.c == --- head/sys/netinet/in.c Mon Dec 24 20:33:37 2012(r244664) +++ head/sys/netinet/in.c Mon Dec 24 21:35:48 2012(r244665) @@ -799,7 +799,7 @@ in_ifinit(struct ifnet *ifp, struct in_i int masksupplied, int vhid) { register u_long i = ntohl(sin-sin_addr.s_addr); - int flags = RTF_UP, error = 0; + int flags, error = 0; IN_IFADDR_WLOCK(); if (ia-ia_addr.sin_family == AF_INET) @@ -843,9 +843,11 @@ in_ifinit(struct ifnet *ifp, struct in_i } ia-ia_subnet = i ia-ia_subnetmask; in_socktrim(ia-ia_sockmask); + /* * Add route for the network. */ + flags = RTF_UP; ia-ia_ifa.ifa_metric = ifp-if_metric; if (ifp-if_flags IFF_BROADCAST) { if (ia-ia_subnetmask == IN_RFC3021_MASK) ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r244669 - stable/9/sbin/sysctl
Author: delphij Date: Tue Dec 25 00:24:43 2012 New Revision: 244669 URL: http://svnweb.freebsd.org/changeset/base/244669 Log: MFC r244104: In parse(): - Only operate on copy, don't operate on source. - Eliminate home-rolled strsep(). - Constify the parameter. Modified: stable/9/sbin/sysctl/sysctl.c Directory Properties: stable/9/sbin/sysctl/ (props changed) Modified: stable/9/sbin/sysctl/sysctl.c == --- stable/9/sbin/sysctl/sysctl.c Mon Dec 24 22:28:52 2012 (r244668) +++ stable/9/sbin/sysctl/sysctl.c Tue Dec 25 00:24:43 2012 (r244669) @@ -62,7 +62,7 @@ static intaflag, bflag, dflag, eflag, h static int Nflag, nflag, oflag, qflag, xflag, warncount; static int oidfmt(int *, int, char *, u_int *); -static voidparse(char *); +static voidparse(const char *); static int show_var(int *, int); static int sysctl_all(int *oid, int len); static int name2oid(char *, int *); @@ -161,7 +161,7 @@ main(int argc, char **argv) * Set a new value if requested. */ static void -parse(char *string) +parse(const char *string) { int len, i, j; void *newval = 0; @@ -176,12 +176,11 @@ parse(char *string) char *cp, *bufp, buf[BUFSIZ], *endptr, fmt[BUFSIZ]; u_int kind; - bufp = buf; + cp = buf; if (snprintf(buf, BUFSIZ, %s, string) = BUFSIZ) errx(1, oid too long: '%s', string); - if ((cp = strchr(string, '=')) != NULL) { - *strchr(buf, '=') = '\0'; - *cp++ = '\0'; + bufp = strsep(cp, =); + if (cp != NULL) { while (isspace(*cp)) cp++; newval = cp; ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r244670 - stable/8/sbin/sysctl
Author: delphij Date: Tue Dec 25 00:25:22 2012 New Revision: 244670 URL: http://svnweb.freebsd.org/changeset/base/244670 Log: MFC r244104: In parse(): - Only operate on copy, don't operate on source. - Eliminate home-rolled strsep(). - Constify the parameter. Modified: stable/8/sbin/sysctl/sysctl.c Directory Properties: stable/8/sbin/sysctl/ (props changed) Modified: stable/8/sbin/sysctl/sysctl.c == --- stable/8/sbin/sysctl/sysctl.c Tue Dec 25 00:24:43 2012 (r244669) +++ stable/8/sbin/sysctl/sysctl.c Tue Dec 25 00:25:22 2012 (r244670) @@ -62,7 +62,7 @@ static intaflag, bflag, dflag, eflag, h static int Nflag, nflag, oflag, qflag, xflag, warncount; static int oidfmt(int *, int, char *, u_int *); -static voidparse(char *); +static voidparse(const char *); static int show_var(int *, int); static int sysctl_all(int *oid, int len); static int name2oid(char *, int *); @@ -162,7 +162,7 @@ main(int argc, char **argv) * Set a new value if requested. */ static void -parse(char *string) +parse(const char *string) { int len, i, j; void *newval = 0; @@ -176,12 +176,11 @@ parse(char *string) char *cp, *bufp, buf[BUFSIZ], *endptr, fmt[BUFSIZ]; u_int kind; - bufp = buf; + cp = buf; if (snprintf(buf, BUFSIZ, %s, string) = BUFSIZ) errx(1, oid too long: '%s', string); - if ((cp = strchr(string, '=')) != NULL) { - *strchr(buf, '=') = '\0'; - *cp++ = '\0'; + bufp = strsep(cp, =); + if (cp != NULL) { while (isspace(*cp)) cp++; newval = cp; ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r244671 - stable/9/release/doc/en_US.ISO8859-1/errata
Author: hrs Date: Tue Dec 25 06:07:34 2012 New Revision: 244671 URL: http://svnweb.freebsd.org/changeset/base/244671 Log: Add Errata items: - mfi(4) driver overflow issue, - typos in Installation Instructions. Modified: stable/9/release/doc/en_US.ISO8859-1/errata/article.xml Modified: stable/9/release/doc/en_US.ISO8859-1/errata/article.xml == --- stable/9/release/doc/en_US.ISO8859-1/errata/article.xml Tue Dec 25 00:25:22 2012(r244670) +++ stable/9/release/doc/en_US.ISO8859-1/errata/article.xml Tue Dec 25 06:07:34 2012(r244671) @@ -205,6 +205,33 @@ sect1 id=late-news titleLate-Breaking News/title -paraNo news./para +para[November 2, 2012] The current man.mfi.4; driver has an + overflow bug when handling disks larger than 2^32 sectors in + SYSPD volumes, also known as JBODs, which will cause data + corruption. This bug has been fixed on this os;-CURRENT but + was too late for inclusion in this release. An Errata Notice + for release.current; is planned./para + +para[December 25, 2012] The Installtion Instructions had the + following wrong information about upgrading procedure. All of + them have been fixed in the online version./para + +itemizedlist + listitem + paraThe link URL of quoteupgrading section in the Release + Notes/quote, branch names where upcoming Security + Advisories or Errata Notices will be applied, and a + command line argument of man.freebsd-update.8; were ones + for 9.0-RELEASE, not for release.current;./para + /listitem + + listitem + paraThe list of releases supported by man.freebsd-update.8; + utility were incorrect. For 9.X, The following versions are + supported: literal9.0-RELEASE/literal, + literal9.1-BETA1/literal, and + literal9.1-RC[123]/literal./para + /listitem +/itemizedlist /sect1 /article ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r244672 - head/tools/tools/netrate/netreceive
Author: luigi Date: Tue Dec 25 07:29:25 2012 New Revision: 244672 URL: http://svnweb.freebsd.org/changeset/base/244672 Log: various connections to last commit Modified: head/tools/tools/netrate/netreceive/Makefile head/tools/tools/netrate/netreceive/netreceive.c Modified: head/tools/tools/netrate/netreceive/Makefile == --- head/tools/tools/netrate/netreceive/MakefileTue Dec 25 06:07:34 2012(r244671) +++ head/tools/tools/netrate/netreceive/MakefileTue Dec 25 07:29:25 2012(r244672) @@ -4,5 +4,6 @@ PROG= netreceive NO_MAN= +LDFLAGS += -lpthread .include bsd.prog.mk Modified: head/tools/tools/netrate/netreceive/netreceive.c == --- head/tools/tools/netrate/netreceive/netreceive.cTue Dec 25 06:07:34 2012(r244671) +++ head/tools/tools/netrate/netreceive/netreceive.cTue Dec 25 07:29:25 2012(r244672) @@ -59,6 +59,7 @@ static int round_to(int n, int l) struct td_desc { pthread_t td_id; uint64_t count; /* rx counter */ + uint64_t byte_count;/* rx byte counter */ int fd; char *buf; int buflen; @@ -116,18 +117,20 @@ rx_body(void *data) if (y 0) break; t-count++; + t-byte_count += y; } } return NULL; } -int -make_threads(struct td_desc **tp, int *s, int nsock, int nthreads) +static struct td_desc ** +make_threads(int *s, int nsock, int nthreads) { int i, si, nt = nsock * nthreads; int lb = round_to(nt * sizeof (struct td_desc *), 64); int td_len = round_to(sizeof(struct td_desc), 64); // cache align char *m = calloc(1, lb + td_len * nt); + struct td_desc **tp; printf(td len %d - %d\n, (int)sizeof(struct td_desc) , td_len); /* pointers plus the structs */ @@ -140,6 +143,8 @@ make_threads(struct td_desc **tp, int *s for (si = i = 0; i nt; i++, m += td_len) { tp[i] = (struct td_desc *)m; tp[i]-fd = s[si]; + tp[i]-buflen = 65536; + tp[i]-buf = calloc(1, tp[i]-buflen); if (++si == nsock) si = 0; if (pthread_create(tp[i]-td_id, NULL, rx_body, tp[i])) { @@ -147,27 +152,29 @@ make_threads(struct td_desc **tp, int *s exit(1); } } + return tp; } -int +static void main_thread(struct td_desc **tp, int nsock, int nthreads) { - uint64_t c0, c1; + uint64_t c0, c1, bc0, bc1; struct timespec now, then, delta; /* now the parent collects and prints results */ - c0 = c1 = 0; + c0 = c1 = bc0 = bc1 = 0; clock_gettime(CLOCK_REALTIME, then); fprintf(stderr, start at %ld.%09ld\n, then.tv_sec, then.tv_nsec); while (1) { int i, nt = nsock * nthreads; int64_t dn; - uint64_t pps; + uint64_t pps, bps; if (poll(NULL, 0, 500) 0) perror(poll); - c0 = 0; + c0 = bc0 = 0; for (i = 0; i nt; i++) { c0 += tp[i]-count; + bc0 += tp[i]-byte_count; } dn = c0 - c1; clock_gettime(CLOCK_REALTIME, now); @@ -176,9 +183,12 @@ main_thread(struct td_desc **tp, int nso then = now; pps = dn; pps = (pps * 10) / (delta.tv_sec*10 + delta.tv_nsec + 1); - fprintf(stderr, %d pkts in %ld.%09ld ns %ld pps\n, - (int)dn, delta.tv_sec, delta.tv_nsec, (long)pps); + bps = ((bc0 - bc1) * 80) / (delta.tv_sec*10 + delta.tv_nsec + 1); + fprintf(stderr, %9ld pps %8.3f Mbps, (long)pps, .01*bps); + fprintf(stderr, - %d pkts in %ld.%09ld ns\n, + (int)dn, delta.tv_sec, delta.tv_nsec); c1 = c0; + bc1 = bc0; } } @@ -256,7 +266,7 @@ main(int argc, char *argv[]) printf(netreceive %d sockets x %d threads listening on UDP port %d\n, nsock, nthreads, (u_short)port); - make_threads(tp, s, nsock, nthreads); + tp = make_threads(s, nsock, nthreads); main_thread(tp, nsock, nthreads); /*NOTREACHED*/ ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r244673 - head/contrib/libstdc++/include/std
Author: andrew Date: Tue Dec 25 07:37:33 2012 New Revision: 244673 URL: http://svnweb.freebsd.org/changeset/base/244673 Log: Fix the __glibcxx_min and __glibcxx_max macros for a signed wchar_t. * The __glibcxx_max macro came from GCC svn r138078, the last GPLv2 revision of this file. * I wrote the updated __glibcxx_min macro. Modified: head/contrib/libstdc++/include/std/std_limits.h Modified: head/contrib/libstdc++/include/std/std_limits.h == --- head/contrib/libstdc++/include/std/std_limits.h Tue Dec 25 07:29:25 2012(r244672) +++ head/contrib/libstdc++/include/std/std_limits.h Tue Dec 25 07:37:33 2012(r244673) @@ -134,10 +134,11 @@ #define __glibcxx_signed(T)((T)(-1) 0) #define __glibcxx_min(T) \ - (__glibcxx_signed (T) ? (T)1 __glibcxx_digits (T) : (T)0) + (__glibcxx_signed (T) ? (((T)1 (__glibcxx_digits (T) - 1)) 1) : (T)0) #define __glibcxx_max(T) \ - (__glibcxx_signed (T) ? ((T)1 __glibcxx_digits (T)) - 1 : ~(T)0) + (__glibcxx_signed (T) ? \ + (T)1 (__glibcxx_digits (T) - 1)) - 1) 1) + 1) : ~(T)0) #define __glibcxx_digits(T) \ (sizeof(T) * __CHAR_BIT__ - __glibcxx_signed (T)) ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
Re: svn commit: r244665 - head/sys/netinet
On Mon, Dec 24, 2012 at 09:35:49PM +, Gleb Smirnoff wrote: Author: glebius Date: Mon Dec 24 21:35:48 2012 New Revision: 244665 URL: http://svnweb.freebsd.org/changeset/base/244665 Log: Minor style(9) changes: - Remove declaration in initializer. i am really curious, what is the point of removing one initialization out of three ? (and if anything, the 'register' should have gone...) cheers luigi - Add empty line between logical blocks. Modified: head/sys/netinet/in.c Modified: head/sys/netinet/in.c == --- head/sys/netinet/in.c Mon Dec 24 20:33:37 2012(r244664) +++ head/sys/netinet/in.c Mon Dec 24 21:35:48 2012(r244665) @@ -799,7 +799,7 @@ in_ifinit(struct ifnet *ifp, struct in_i int masksupplied, int vhid) { register u_long i = ntohl(sin-sin_addr.s_addr); - int flags = RTF_UP, error = 0; + int flags, error = 0; IN_IFADDR_WLOCK(); if (ia-ia_addr.sin_family == AF_INET) @@ -843,9 +843,11 @@ in_ifinit(struct ifnet *ifp, struct in_i } ia-ia_subnet = i ia-ia_subnetmask; in_socktrim(ia-ia_sockmask); + /* * Add route for the network. */ + flags = RTF_UP; ia-ia_ifa.ifa_metric = ifp-if_metric; if (ifp-if_flags IFF_BROADCAST) { if (ia-ia_subnetmask == IN_RFC3021_MASK) ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org