svn commit: r277829 - head/contrib/netbsd-tests/bin/expr
Author: ngie Date: Wed Jan 28 11:38:12 2015 New Revision: 277829 URL: https://svnweb.freebsd.org/changeset/base/277829 Log: Revert r277357 as expr has been enhanced to better detect overflow conditions, and now the tests pass PR: 196867 X-MFC with: r277798 MFC after: 1 week Sponsored by: EMC / Isilon Storage Division Modified: head/contrib/netbsd-tests/bin/expr/t_expr.sh Modified: head/contrib/netbsd-tests/bin/expr/t_expr.sh == --- head/contrib/netbsd-tests/bin/expr/t_expr.shWed Jan 28 10:37:23 2015(r277828) +++ head/contrib/netbsd-tests/bin/expr/t_expr.shWed Jan 28 11:38:12 2015(r277829) @@ -54,9 +54,6 @@ overflow_head() { atf_set descr Test overflow cases } overflow_body() { - # Begin FreeBSD - atf_expect_fail FreeBSD's expr does not check overflow to the same degree NetBSD's expr does; see bug 196867 for more details - # End FreeBSD test_expr '4611686018427387904 + 4611686018427387903' \ '9223372036854775807' test_expr '4611686018427387904 + 4611686018427387904' \ ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
Re: svn commit: r277796 - in head/sys: dev/acpica dev/syscons dev/vt sys
On 27/01/2015 19:47, Konstantin Belousov wrote: On Tue, Jan 27, 2015 at 05:33:19PM +, Andriy Gapon wrote: +EVENTHANDLER_INVOKE(power_suspend_early); +stop_all_proc(); It also makes sense to call syncer_suspend() after stop_all_proc(), I suppose. It would ensure that a failed resume still ends with the consistent filesystem metadata. Probably yes. I can make that change if you endorse it. Or you can make it if that'll be faster. Thanks! -- Andriy Gapon ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
Re: svn commit: r277796 - in head/sys: dev/acpica dev/syscons dev/vt sys
On 28/01/2015 00:36, Ivan Klymenko wrote: acpiconf -s 3 works perfectly, but there is one problem. I use not the main timecounter kern.timecounter.hardware=HPET after turning on the power button does not occur laptop recovery hdac0 and it is likely that the same applies to the timer. Indirect evidence of this - it's a quick video playback, for example in flash on YouTube. dmesg_first : http://pastebin.com/a4gC5PGy dmesg_afterS3 : http://pastebin.com/vyHtrakZ my HW: pciconf -lvbce : https://bz-attachments.freebsd.org/attachment.cgi?id=148947 devinfo -vr : https://bz-attachments.freebsd.org/attachment.cgi?id=148948 Is that a new problem introduced by this commit? I have a hard time connecting the described symptoms to the code affected by this commit. -- Andriy Gapon ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
Re: svn commit: r277802 - head/usr.bin/sed
On Tue, 27 Jan 2015, Pedro F. Giffuni wrote: Log: Fix resource leak and dereference after NULL. process.c: Protect access against NULL. main.c: Prevent outfile overwrite resource leak. ... Modified: head/usr.bin/sed/main.c == --- head/usr.bin/sed/main.c Tue Jan 27 18:56:46 2015(r277801) +++ head/usr.bin/sed/main.c Tue Jan 27 18:58:24 2015(r277802) @@ -411,6 +411,8 @@ mf_fgets(SPACE *sp, enum e_spflag spflag unlink(tmpfname); if ((outfile = fopen(tmpfname, w)) == NULL) err(1, %s, fname); + if (outfile != NULL outfile != stdout) + fclose(outfile); fchown(fileno(outfile), sb.st_uid, sb.st_gid); fchmod(fileno(outfile), sb.st_mode ALLPERMS); outfname = tmpfname; This is mismerged at best. It just breaks the new outfile by closing it. The check in it makes no sense in this contents, since the freshly-opened outfile cannot be NULL (since the open succeeded) or stdout (fopen() cannot return a pointer to an already-open stream, so it can only return stdout if the stdout pointer is garbage, but then it is not really stdout). Bruce ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
svn commit: r277826 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs
Author: delphij Date: Wed Jan 28 08:56:48 2015 New Revision: 277826 URL: https://svnweb.freebsd.org/changeset/base/277826 Log: MFV r255258: Diff reduction with upstream. The actual change was merged in r272483 already. MFC after:2 weeks Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Directory Properties: head/sys/cddl/contrib/opensolaris/ (props changed) Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c == --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Wed Jan 28 07:29:38 2015(r277825) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Wed Jan 28 08:56:48 2015(r277826) @@ -20,6 +20,7 @@ */ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, Joyent, Inc. All rights reserved. * Copyright (c) 2011, 2014 by Delphix. All rights reserved. * Copyright (c) 2014 by Saso Kiselkov. All rights reserved. * Copyright 2014 Nexenta Systems, Inc. All rights reserved. ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
Re: svn commit: r277652 - in head/usr.sbin/pw: . tests
On Tue, 27 Jan 2015, Robert Watson wrote: On Sun, 25 Jan 2015, Bruce Evans wrote: Negative ids have historical abuses in places like mountd. mountd still hard-codes -2 and -2 for the default uid and gid of an unprivileged user. ... I'm sure it goes without saying, but for those that don't know (i.e., some subset of people who are not Bruce): (-1) has a defined value both for our system-call interface (chown(2), fchown(2), etc, use (-1) to indicate that no change is requested). This is also used inside the kernel to similar end, where VNOVAL also takes on a value of (-1). This problem also used to exist in NFS, where in NFSv2, (-1) was also used to indicate which fields not to update, but this was fixed in NFSv3 by introducing discriminated unions. I personally find myself a fan of fixing (eliminating) VNOVAL, but in the end it would likely just be disruptive and confusing. VNOVAL is kernel-only, so it need not limit values. But then you would have to escape the value that it usurps. ffs uses VNOVAL for (quoting an old version): % if (vap-va_rdev != VNOVAL) { % if ((vap-va_type != VNON) || (vap-va_nlink != VNOVAL) || % (vap-va_fsid != VNOVAL) || (vap-va_fileid != VNOVAL) || % (vap-va_blocksize != VNOVAL) || (vap-va_rdev != VNOVAL) || % ((int)vap-va_bytes != VNOVAL) || (vap-va_gen != VNOVAL)) { Some of these are magic or kernel-only or otherwise have plenty of out of band values. va_nlink is most interesting. It is only 16 bits signed. If it were not signed, then it couldn't represent VNOVAL. {LINK_MAX} is hard-coded as LINK_MAX = 32767. The hard-coded type and value are both broken for file systems that have larger or smaller limits. Removing the definition of LINK_MAX would fix this for limits up to 32767. The limit in ext2fs is 32000 and the limit in ext2fs is 65000. 65000 is not supported in FreeBSD. It doesn't fit in nlink_t. It leaves 536 out of band vales in a 16-bit unsigned nlink_t. One of these can be VNOVAL after type puns to make VNOVAL 65535. % if (vap-va_flags != VNOVAL) { Flags have enough spare bits. va_flags is u_long, so type puns occur implicitly in this comparison. The flags type(s) have even more design botches than older types. A mixture of signed int, uint32_t and u_long is used for flags variables. %* Go through the fields and update iff not VNOVAL. % if (vap-va_uid != (uid_t)VNOVAL || vap-va_gid != (gid_t)VNOVAL) { Here the type puns are done explicitly (so they are not really puns). The types here are unsigned, so there are no unportabilities in these conversions. It is just accidental that VNOVAL = -1 matches the POSIX magic number -1 (even before the conversions). The code depends on this. % if (vap-va_size != VNOVAL) { A size of -1 is impossible, but va_size is unsigned so the usual type puns occur and the out of band value is actually 0x. That should be large enough for anyone. It is currently physically impossible, and also theoretically impossible, since file offsets are signed so they can only reach half as high. % if (vap-va_atime.tv_sec != VNOVAL || % vap-va_mtime.tv_sec != VNOVAL || % vap-va_birthtime.tv_sec != VNOVAL) { % if (vap-va_atime.tv_sec != VNOVAL) % if (vap-va_mtime.tv_sec != VNOVAL) % if (vap-va_birthtime.tv_sec != VNOVAL % if (vap-va_atime.tv_sec != VNOVAL) { % if (vap-va_mtime.tv_sec != VNOVAL) { % if (vap-va_birthtime.tv_sec != VNOVAL time_t is signed, so the out of band value is 1 second before the Epoch, not (via type puns) 1 second before the time_t's roll over. This magic value is also reserved for reporting errors in C (for mktime(), etc.). Error handling is especially difficult for APIs like mktime(), strtol(), and some syscalls since the error value is also a supported in-band. For strtol(), it is a very normal value. In C, the representation can be anything so the error value can be for any time. Implementations should avoid using it for a useful time, but portable applications cannot depend on this. In POSIX, the error value must be 1 second before the Epoch and that is an interesting time. % if (vap-va_mode != (mode_t)VNOVAL) { The 16-bit mode_t is not quite full (type 017 is free), so VNOVAL is out of band. Oops. There would be no problem even if mode_t were full, since it gets promoted and since it is unsigned it cannot promote to -1. Similarly for nlink_t if it were unsigned. Bruce ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
svn commit: r277827 - head/sys/fs/tmpfs
Author: kib Date: Wed Jan 28 10:25:35 2015 New Revision: 277827 URL: https://svnweb.freebsd.org/changeset/base/277827 Log: tmpfs does not use UVM on FreeBSD. Sponsored by: The FreeBSD Foundation MFC after:3 days Modified: head/sys/fs/tmpfs/tmpfs_vfsops.c Modified: head/sys/fs/tmpfs/tmpfs_vfsops.c == --- head/sys/fs/tmpfs/tmpfs_vfsops.cWed Jan 28 08:56:48 2015 (r277826) +++ head/sys/fs/tmpfs/tmpfs_vfsops.cWed Jan 28 10:25:35 2015 (r277827) @@ -33,10 +33,10 @@ /* * Efficient memory file system. * - * tmpfs is a file system that uses NetBSD's virtual memory sub-system - * (the well-known UVM) to store file data and metadata in an efficient - * way. This means that it does not follow the structure of an on-disk - * file system because it simply does not need to. Instead, it uses + * tmpfs is a file system that uses FreeBSD's virtual memory + * sub-system to store file data and metadata in an efficient way. + * This means that it does not follow the structure of an on-disk file + * system because it simply does not need to. Instead, it uses * memory-specific data structures and algorithms to automatically * allocate and release resources. */ ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
Re: svn commit: r277764 - in head/usr.sbin/pw: . tests
On Mon, 26 Jan 2015, Baptiste Daroussin wrote: Log: Revert r277652 uid and gid are never and should never be negative. The pw(8) manpage clearly states the -u and -g arguments are for uids/gids, hence using negative values is abusing a bug in former versions of pw(8) Thanks. Further discussion showed that the historical misbehaviour is more common than I thought, so this doesn't resolve the problem in pw. But it seems reasonable to start disallowing creating negative ids in utilities for creating ids. Ones that used to allow it should at least allow creating all the positive ids that the negative ids were accidentally mapped to (like -2 - huge value). Bruce ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
svn commit: r277828 - in head/sys: fs/tmpfs vm
Author: kib Date: Wed Jan 28 10:37:23 2015 New Revision: 277828 URL: https://svnweb.freebsd.org/changeset/base/277828 Log: Update mtime for tmpfs files modified through memory mapping. Similar to UFS, perform updates during syncer scans, which in particular means that tmpfs now performs scan on sync. Also, this means that a mtime update may be delayed up to 30 seconds after the write. The vm_object' OBJ_TMPFS_DIRTY flag for tmpfs swap object is similar to the OBJ_MIGHTBEDIRTY flag for the vnode object, it indicates that object could have been dirtied. Adapt fast page fault handler and vm_object_set_writeable_dirty() to handle OBJ_TMPFS_NODE same as OBJT_VNODE. Reported by: Ronald Klop ronald-li...@klop.ws Tested by:pho Sponsored by: The FreeBSD Foundation MFC after:2 weeks Modified: head/sys/fs/tmpfs/tmpfs.h head/sys/fs/tmpfs/tmpfs_subr.c head/sys/fs/tmpfs/tmpfs_vfsops.c head/sys/fs/tmpfs/tmpfs_vnops.c head/sys/vm/vm_fault.c head/sys/vm/vm_object.c head/sys/vm/vm_object.h Modified: head/sys/fs/tmpfs/tmpfs.h == --- head/sys/fs/tmpfs/tmpfs.h Wed Jan 28 10:25:35 2015(r277827) +++ head/sys/fs/tmpfs/tmpfs.h Wed Jan 28 10:37:23 2015(r277828) @@ -398,6 +398,7 @@ int tmpfs_alloc_vp(struct mount *, struc void tmpfs_free_vp(struct vnode *); inttmpfs_alloc_file(struct vnode *, struct vnode **, struct vattr *, struct componentname *, char *); +void tmpfs_check_mtime(struct vnode *); void tmpfs_dir_attach(struct vnode *, struct tmpfs_dirent *); void tmpfs_dir_detach(struct vnode *, struct tmpfs_dirent *); void tmpfs_dir_destroy(struct tmpfs_mount *, struct tmpfs_node *); Modified: head/sys/fs/tmpfs/tmpfs_subr.c == --- head/sys/fs/tmpfs/tmpfs_subr.c Wed Jan 28 10:25:35 2015 (r277827) +++ head/sys/fs/tmpfs/tmpfs_subr.c Wed Jan 28 10:37:23 2015 (r277828) @@ -1415,6 +1415,31 @@ retry: return (0); } +void +tmpfs_check_mtime(struct vnode *vp) +{ + struct tmpfs_node *node; + struct vm_object *obj; + + ASSERT_VOP_ELOCKED(vp, check_mtime); + if (vp-v_type != VREG) + return; + node = VP_TO_TMPFS_NODE(vp); + obj = vp-v_object; + KASSERT((obj-flags (OBJ_TMPFS_NODE | OBJ_TMPFS)) == + (OBJ_TMPFS_NODE | OBJ_TMPFS), (non-tmpfs obj)); + /* unlocked read */ + if ((obj-flags OBJ_TMPFS_DIRTY) != 0) { + VM_OBJECT_WLOCK(obj); + if ((obj-flags OBJ_TMPFS_DIRTY) != 0) { + obj-flags = ~OBJ_TMPFS_DIRTY; + node = VP_TO_TMPFS_NODE(vp); + node-tn_status |= TMPFS_NODE_MODIFIED; + } + VM_OBJECT_WUNLOCK(obj); + } +} + /* * Change flags of the given vnode. * Caller should execute tmpfs_update on vp after a successful execution. Modified: head/sys/fs/tmpfs/tmpfs_vfsops.c == --- head/sys/fs/tmpfs/tmpfs_vfsops.cWed Jan 28 10:25:35 2015 (r277827) +++ head/sys/fs/tmpfs/tmpfs_vfsops.cWed Jan 28 10:37:23 2015 (r277828) @@ -50,6 +50,7 @@ __FBSDID($FreeBSD$); #include sys/proc.h #include sys/jail.h #include sys/kernel.h +#include sys/rwlock.h #include sys/stat.h #include sys/systm.h #include sys/sysctl.h @@ -418,11 +419,45 @@ tmpfs_statfs(struct mount *mp, struct st static int tmpfs_sync(struct mount *mp, int waitfor) { + struct vnode *vp, *mvp; + struct vm_object *obj; if (waitfor == MNT_SUSPEND) { MNT_ILOCK(mp); mp-mnt_kern_flag |= MNTK_SUSPEND2 | MNTK_SUSPENDED; MNT_IUNLOCK(mp); + } else if (waitfor == MNT_LAZY) { + /* +* Handle lazy updates of mtime from writes to mmaped +* regions. Use MNT_VNODE_FOREACH_ALL instead of +* MNT_VNODE_FOREACH_ACTIVE, since unmap of the +* tmpfs-backed vnode does not call vinactive(), due +* to vm object type is OBJT_SWAP. +*/ + MNT_VNODE_FOREACH_ALL(vp, mp, mvp) { + if (vp-v_type != VREG) { + VI_UNLOCK(vp); + continue; + } + obj = vp-v_object; + KASSERT((obj-flags (OBJ_TMPFS_NODE | OBJ_TMPFS)) == + (OBJ_TMPFS_NODE | OBJ_TMPFS), (non-tmpfs obj)); + + /* +* Unlocked read, avoid taking vnode lock if +* not needed. Lost update will be handled on +* the next call. +*/ + if ((obj-flags OBJ_TMPFS_DIRTY) == 0) {
svn commit: r277836 - head/release
Author: gjb Date: Wed Jan 28 17:32:45 2015 New Revision: 277836 URL: https://svnweb.freebsd.org/changeset/base/277836 Log: Rename the 'system' target to 'disc1', which is specific to the disc1.iso installer image. Replace 'system' with 'release' in CLEANFILES, and add 'disc1' to CLEANDIRS. Ensure the 'dvd' target depends on 'packagesystem'. Fix 'mini-memstick.img' prerequisite, which should be the 'bootonly' target, not 'disc1' (previously 'system'). Use .TARGET as the target installation directory for the disc1.iso and bootonly.iso images, which now expand to 'disc1' and 'bootonly' respectively, mimicking the behavior of the 'dvd' target. Remove '@true' from the 'release' target, and instead use 'touch ${.TARGET}' to prevent multiple iterations of 'make release' from clobbering previously-built installer medium. Tested with: head@r277834 MFC after:3 weeks X-MFC-with: r277458, r277536, r277606, r277609 Sponsored by: The FreeBSD Foundation Modified: head/release/Makefile Modified: head/release/Makefile == --- head/release/Makefile Wed Jan 28 16:08:07 2015(r277835) +++ head/release/Makefile Wed Jan 28 17:32:45 2015(r277836) @@ -109,7 +109,7 @@ IMAGES+=memstick.img IMAGES+= mini-memstick.img .endif -CLEANFILES=packagesystem *.txz MANIFEST system ${IMAGES} +CLEANFILES=packagesystem *.txz MANIFEST release ${IMAGES} .if defined(WITH_COMPRESSED_IMAGES) !empty(WITH_COMPRESSED_IMAGES) . for I in ${IMAGES} CLEANFILES+= ${I}.xz @@ -118,7 +118,7 @@ CLEANFILES+=${I}.xz .if defined(WITH_DVD) !empty(WITH_DVD) CLEANFILES+= pkg-stage .endif -CLEANDIRS= dist ftp release bootonly dvd +CLEANDIRS= dist ftp disc1 bootonly dvd beforeclean: chflags -R noschg . .include bsd.obj.mk @@ -165,57 +165,57 @@ reldoc: .endfor cp rdoc/${RELNOTES_LANG}/readme/docbook.css reldoc -system: packagesystem +disc1: packagesystem # Install system - mkdir -p release + mkdir -p ${.TARGET} cd ${WORLDDIR} ${IMAKE} installkernel installworld distribution \ - DESTDIR=${.OBJDIR}/release MK_RESCUE=no MK_KERNEL_SYMBOLS=no \ + DESTDIR=${.OBJDIR}/${.TARGET} MK_RESCUE=no MK_KERNEL_SYMBOLS=no \ MK_PROFILE=no MK_SENDMAIL=no MK_TESTS=no MK_LIB32=no \ MK_DEBUG_FILES=no # Copy distfiles - mkdir -p release/usr/freebsd-dist + mkdir -p ${.TARGET}/usr/freebsd-dist for dist in MANIFEST $$(ls *.txz | grep -v -- '-dbg'); \ - do cp $${dist} release/usr/freebsd-dist; \ + do cp $${dist} ${.TARGET}/usr/freebsd-dist; \ done # Copy documentation, if generated .if !defined(NODOC) - cp reldoc/* release + cp reldoc/* ${.TARGET} .endif # Set up installation environment - ln -fs /tmp/bsdinstall_etc/resolv.conf release/etc/resolv.conf - echo sendmail_enable=\NONE\ release/etc/rc.conf - echo hostid_enable=\NO\ release/etc/rc.conf - echo debug.witness.trace=0 release/etc/sysctl.conf - echo vfs.mountroot.timeout=\10\ release/boot/loader.conf - cp ${.CURDIR}/rc.local release/etc + ln -fs /tmp/bsdinstall_etc/resolv.conf ${.TARGET}/etc/resolv.conf + echo sendmail_enable=\NONE\ ${.TARGET}/etc/rc.conf + echo hostid_enable=\NO\ ${.TARGET}/etc/rc.conf + echo debug.witness.trace=0 ${.TARGET}/etc/sysctl.conf + echo vfs.mountroot.timeout=\10\ ${.TARGET}/boot/loader.conf + cp ${.CURDIR}/rc.local ${.TARGET}/etc touch ${.TARGET} bootonly: packagesystem # Install system - mkdir -p bootonly + mkdir -p ${.TARGET} cd ${WORLDDIR} ${IMAKE} installkernel installworld distribution \ - DESTDIR=${.OBJDIR}/bootonly MK_AMD=no MK_AT=no \ + DESTDIR=${.OBJDIR}/${.TARGET} MK_AMD=no MK_AT=no \ MK_GAMES=no MK_GROFF=no \ MK_INSTALLLIB=no MK_LIB32=no MK_MAIL=no \ MK_NCP=no MK_TOOLCHAIN=no MK_PROFILE=no \ MK_INSTALLIB=no MK_RESCUE=no MK_DICT=no \ MK_KERNEL_SYMBOLS=no MK_TESTS=no MK_DEBUG_FILES=no # Copy manifest only (no distfiles) to get checksums - mkdir -p bootonly/usr/freebsd-dist - cp MANIFEST bootonly/usr/freebsd-dist + mkdir -p ${.TARGET}/usr/freebsd-dist + cp MANIFEST ${.TARGET}/usr/freebsd-dist # Copy documentation, if generated .if !defined(NODOC) - cp reldoc/* bootonly + cp reldoc/* ${.TARGET} .endif # Set up installation environment - ln -fs /tmp/bsdinstall_etc/resolv.conf bootonly/etc/resolv.conf - echo sendmail_enable=\NONE\ bootonly/etc/rc.conf - echo hostid_enable=\NO\ bootonly/etc/rc.conf - echo debug.witness.trace=0 bootonly/etc/sysctl.conf - echo vfs.mountroot.timeout=\10\ bootonly/boot/loader.conf - cp ${.CURDIR}/rc.local bootonly/etc + ln
svn commit: r277837 - head/release/scripts
Author: gjb Date: Wed Jan 28 17:34:27 2015 New Revision: 277837 URL: https://svnweb.freebsd.org/changeset/base/277837 Log: Provide a description for the 'tests.txz' distribution in the MANIFEST file. Turn off the test suite installation by default. Tested with: head@r277834 MFC after:1 week Sponsored by: The FreeBSD Foundation Modified: head/release/scripts/make-manifest.sh Modified: head/release/scripts/make-manifest.sh == --- head/release/scripts/make-manifest.sh Wed Jan 28 17:32:45 2015 (r277836) +++ head/release/scripts/make-manifest.sh Wed Jan 28 17:34:27 2015 (r277837) @@ -17,7 +17,9 @@ desc_games=Games (fortune, etc.) desc_lib32=32-bit compatibility libraries desc_ports=Ports tree desc_src=System source code +desc_tests=Test suite src_default=off +tests_default=off for i in $*; do echo `basename $i` `sha256 -q $i` `tar tvf $i | wc -l | tr -d ' '``basename $i .txz` \`eval echo \\\$desc_$(basename $i .txz)`\ `eval echo \\\${$(basename $i .txz)_default:-on}` ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
svn commit: r277838 - head/release/scripts
Author: gjb Date: Wed Jan 28 17:39:57 2015 New Revision: 277838 URL: https://svnweb.freebsd.org/changeset/base/277838 Log: Fix a typo in a comment. MFC after:1 week X-MFC-with: r277837 Sponsored by: The FreeBSD Foundation Modified: head/release/scripts/make-manifest.sh Modified: head/release/scripts/make-manifest.sh == --- head/release/scripts/make-manifest.sh Wed Jan 28 17:34:27 2015 (r277837) +++ head/release/scripts/make-manifest.sh Wed Jan 28 17:39:57 2015 (r277838) @@ -5,7 +5,7 @@ # Usage: make-manifest.sh foo1.txz foo2.txz ... # # The output file looks like this (tab-delimited): -# foo1.txz SHA256-checksu Number-of-files foo1 Description Install-by-default +# foo1.txz SHA256-checksum Number-of-files foo1 Description Install-by-default # # $FreeBSD$ ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
Re: svn commit: r277828 - in head/sys: fs/tmpfs vm
On 28 Jan, Konstantin Belousov wrote: Author: kib Date: Wed Jan 28 10:37:23 2015 New Revision: 277828 URL: https://svnweb.freebsd.org/changeset/base/277828 Log: Update mtime for tmpfs files modified through memory mapping. Similar to UFS, perform updates during syncer scans, which in particular means that tmpfs now performs scan on sync. Also, this means that a mtime update may be delayed up to 30 seconds after the write. Maybe disable the scan if mounted noatime? ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
Re: svn commit: r277828 - in head/sys: fs/tmpfs vm
On Wed, Jan 28, 2015 at 09:41:06AM -0800, Don Lewis wrote: On 28 Jan, Konstantin Belousov wrote: Author: kib Date: Wed Jan 28 10:37:23 2015 New Revision: 277828 URL: https://svnweb.freebsd.org/changeset/base/277828 Log: Update mtime for tmpfs files modified through memory mapping. Similar to UFS, perform updates during syncer scans, which in particular means that tmpfs now performs scan on sync. Also, this means that a mtime update may be delayed up to 30 seconds after the write. Maybe disable the scan if mounted noatime? It is for mtime, not atime, updates. In fact, I thought about per-mount option to enable/disable mtime updates, but then decided that it is too exotic. I will add if if real performance complain appear, this also explains relatively long MFC timeout. ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
Re: svn commit: r277835 - in head: lib/libpmc sys/arm/arm sys/arm/include sys/arm/ti sys/conf sys/dev/hwpmc sys/sys
On Jan 28, 2015, at 08:35, Ian Lepore i...@freebsd.org wrote: On Wed, 2015-01-28 at 16:08 +, Ruslan Bukin wrote: Author: br Date: Wed Jan 28 16:08:07 2015 New Revision: 277835 URL: https://svnweb.freebsd.org/changeset/base/277835 Log: Add ARMv7 performance monitoring counters. Differential Revision: https://reviews.freebsd.org/D1687 Reviewed by:rpaulo Sponsored by: DARPA, AFRL Added: head/sys/dev/hwpmc/hwpmc_armv7.c (contents, props changed) head/sys/dev/hwpmc/hwpmc_armv7.h (contents, props changed) Modified: head/lib/libpmc/libpmc.c head/sys/arm/arm/intr.c head/sys/arm/include/pmc_mdep.h head/sys/arm/ti/files.ti head/sys/conf/files.arm head/sys/dev/hwpmc/hwpmc_arm.c head/sys/dev/hwpmc/pmc_events.h head/sys/sys/pmc.h This was in phabricator for review for 27 hours before it got committed, that's not enough time to allow people to actually review it. That would be not enough time for even a simple change, let alone over a thousand of lines of code. It certainly wasn't reviewed by those actively working on arm pmc stuff recently (gnn and to a lesser degree, me). Just from a quick glance at the part that wasn't truncated, I notice all the inline asm stuff is wrong -- it duplicates what's already available in cpu-v6.h. I do agree that reviewers weren't given enough time and phabricator seems to make that worse by saying the code is ready to land (we're trying to change that). In my defense, I only reviewed this because I implemented the original XScale PMC. I also didn't know who else was working on ARM PMC, so I couldn't warn Ruslan. Andrew was the one that added the ARM group to the review, so maybe he wasn't aware of it either. -- Rui Paulo ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
svn commit: r277854 - head/etc/rc.d
Author: cy Date: Wed Jan 28 21:01:55 2015 New Revision: 277854 URL: https://svnweb.freebsd.org/changeset/base/277854 Log: ipfilter 5.1.2 (vs 4.1.28 in previous releases of FreeBSD) stores IPv4 and IPv6 rules in a single table. ipf -6 -Fa will flush the whole table, including IPv4 rules. This patch removes the redundant ipf -I -6 -Fa statement. PR: 188318 MFC after:2 weeks Modified: head/etc/rc.d/ipfilter Modified: head/etc/rc.d/ipfilter == --- head/etc/rc.d/ipfilter Wed Jan 28 20:22:48 2015(r277853) +++ head/etc/rc.d/ipfilter Wed Jan 28 21:01:55 2015(r277854) @@ -65,7 +65,6 @@ ipfilter_reload() err 1 'Load of rules into alternate set failed; aborting reload' fi fi - ${ipfilter_program:-/sbin/ipf} -I -6 -Fa if [ -r ${ipv6_ipfilter_rules} ]; then ${ipfilter_program:-/sbin/ipf} -I -6 \ -f ${ipv6_ipfilter_rules} ${ipfilter_flags} ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
Re: svn commit: r277854 - head/etc/rc.d
In message 201501282101.t0sl1ukn054...@svn.freebsd.org, Cy Schubert writes: Author: cy Date: Wed Jan 28 21:01:55 2015 New Revision: 277854 URL: https://svnweb.freebsd.org/changeset/base/277854 Log: ipfilter 5.1.2 (vs 4.1.28 in previous releases of FreeBSD) stores IPv4 and IPv6 rules in a single table. ipf -6 -Fa will flush the whole table, including IPv4 rules. This patch removes the redundant ipf -I -6 -Fa statement. PR: 188318 MFC after: 2 weeks Modified: head/etc/rc.d/ipfilter Modified: head/etc/rc.d/ipfilter = = --- head/etc/rc.d/ipfilterWed Jan 28 20:22:48 2015(r277853) +++ head/etc/rc.d/ipfilterWed Jan 28 21:01:55 2015(r277854) @@ -65,7 +65,6 @@ ipfilter_reload() err 1 'Load of rules into alternate set failed; abortin g reload' fi fi - ${ipfilter_program:-/sbin/ipf} -I -6 -Fa if [ -r ${ipv6_ipfilter_rules} ]; then ${ipfilter_program:-/sbin/ipf} -I -6 \ -f ${ipv6_ipfilter_rules} ${ipfilter_flags} A subsequent commit to this one will address the redundant ipf rules file issue. As the next commit to this will affect POLA, it will not MFC to stable/10. This commit is safe to MFC. I will hold off committing the next change to this file for a while to allow ample time for this commit to mature. -- Cheers, Cy Schubert cy.schub...@komquats.com or cy.schub...@cschubert.com FreeBSD UNIX: c...@freebsd.org Web: http://www.FreeBSD.org The need of the many outweighs the greed of the few. ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
svn commit: r277857 - head/usr.sbin/ppp
Author: dim Date: Wed Jan 28 21:33:49 2015 New Revision: 277857 URL: https://svnweb.freebsd.org/changeset/base/277857 Log: Fix multiple instances of the following clang 3.6.0 warning in ppp: usr.sbin/ppp/command.c:2054:74: error: address of array 'arg-bundle-radius.cfg.file' will always evaluate to 'true' [-Werror,-Wpointer-bool-conversion] if (arg-bundle-radius.alive.interval !arg-bundle-radius.cfg.file) { ~^~~~ In all cases, the file field of struct radius is a char array, but the intent was to check whether the string is empty, so add an indirection to achieve that. Use a similar approach for the sockname field of struct server. Modified: head/usr.sbin/ppp/command.c head/usr.sbin/ppp/ipcp.c head/usr.sbin/ppp/ipv6cp.c head/usr.sbin/ppp/radius.c head/usr.sbin/ppp/server.c Modified: head/usr.sbin/ppp/command.c == --- head/usr.sbin/ppp/command.c Wed Jan 28 21:21:35 2015(r277856) +++ head/usr.sbin/ppp/command.c Wed Jan 28 21:33:49 2015(r277857) @@ -2051,7 +2051,7 @@ SetVariable(struct cmdargs const *arg) res = 1; } else { arg-bundle-radius.alive.interval = atoi(argp); - if (arg-bundle-radius.alive.interval !arg-bundle-radius.cfg.file) { + if (arg-bundle-radius.alive.interval !*arg-bundle-radius.cfg.file) { log_Printf(LogWARN, rad_alive requires radius to be configured\n); res = 1; } else if (arg-bundle-ncp.ipcp.fsm.state == ST_OPENED) { @@ -2335,7 +2335,7 @@ SetVariable(struct cmdargs const *arg) res = 1; } -if (arg-bundle-radius.port_id_type !arg-bundle-radius.cfg.file) { +if (arg-bundle-radius.port_id_type !*arg-bundle-radius.cfg.file) { log_Printf(LogWARN, rad_port_id requires radius to be configured\n); res = 1; } Modified: head/usr.sbin/ppp/ipcp.c == --- head/usr.sbin/ppp/ipcp.cWed Jan 28 21:21:35 2015(r277856) +++ head/usr.sbin/ppp/ipcp.cWed Jan 28 21:33:49 2015(r277857) @@ -880,7 +880,7 @@ IpcpLayerDown(struct fsm *fp) radius_Account(fp-bundle-radius, fp-bundle-radacct, fp-bundle-links, RAD_STOP, ipcp-throughput); -if (fp-bundle-radius.cfg.file fp-bundle-radius.filterid) +if (*fp-bundle-radius.cfg.file fp-bundle-radius.filterid) system_Select(fp-bundle, fp-bundle-radius.filterid, LINKDOWNFILE, NULL, NULL); radius_StopTimer(fp-bundle-radius); @@ -949,7 +949,7 @@ IpcpLayerUp(struct fsm *fp) radius_Account(fp-bundle-radius, fp-bundle-radacct, fp-bundle-links, RAD_START, ipcp-throughput); - if (fp-bundle-radius.cfg.file fp-bundle-radius.filterid) + if (*fp-bundle-radius.cfg.file fp-bundle-radius.filterid) system_Select(fp-bundle, fp-bundle-radius.filterid, LINKUPFILE, NULL, NULL); radius_StartTimer(fp-bundle); Modified: head/usr.sbin/ppp/ipv6cp.c == --- head/usr.sbin/ppp/ipv6cp.c Wed Jan 28 21:21:35 2015(r277856) +++ head/usr.sbin/ppp/ipv6cp.c Wed Jan 28 21:33:49 2015(r277857) @@ -486,7 +486,7 @@ ipv6cp_LayerUp(struct fsm *fp) * evaluated. */ if (!Enabled(fp-bundle, OPT_IPCP)) { -if (fp-bundle-radius.cfg.file fp-bundle-radius.filterid) +if (*fp-bundle-radius.cfg.file fp-bundle-radius.filterid) system_Select(fp-bundle, fp-bundle-radius.filterid, LINKUPFILE, NULL, NULL); } @@ -539,7 +539,7 @@ ipv6cp_LayerDown(struct fsm *fp) * evaluated. */ if (!Enabled(fp-bundle, OPT_IPCP)) { - if (fp-bundle-radius.cfg.file fp-bundle-radius.filterid) + if (*fp-bundle-radius.cfg.file fp-bundle-radius.filterid) system_Select(fp-bundle, fp-bundle-radius.filterid, LINKDOWNFILE, NULL, NULL); } Modified: head/usr.sbin/ppp/radius.c == --- head/usr.sbin/ppp/radius.c Wed Jan 28 21:21:35 2015(r277856) +++ head/usr.sbin/ppp/radius.c Wed Jan 28 21:33:49 2015(r277857) @@ -1345,7 +1345,7 @@ radius_alive(void *v) void radius_StartTimer(struct bundle *bundle) { - if (bundle-radius.cfg.file bundle-radius.alive.interval) { + if (*bundle-radius.cfg.file bundle-radius.alive.interval) { bundle-radius.alive.timer.func = radius_alive; bundle-radius.alive.timer.name = radius alive; bundle-radius.alive.timer.load = bundle-radius.alive.interval * SECTICKS; Modified: head/usr.sbin/ppp/server.c == --- head/usr.sbin/ppp/server.c Wed Jan 28 21:21:35 2015(r277856) +++ head/usr.sbin/ppp/server.c Wed Jan 28
svn commit: r277856 - head/usr.sbin/pciconf
Author: dim Date: Wed Jan 28 21:21:35 2015 New Revision: 277856 URL: https://svnweb.freebsd.org/changeset/base/277856 Log: Fix the following clang 3.6.0 warnings in pciconf: usr.sbin/pciconf/pciconf.c:237:12: error: address of array 'p-pd_name' will always evaluate to 'true' [-Werror,-Wpointer-bool-conversion] (p-pd_name *p-pd_name) ? p-pd_name : ~~~^~~ ~~ usr.sbin/pciconf/pciconf.c:239:12: error: address of array 'p-pd_name' will always evaluate to 'true' [-Werror,-Wpointer-bool-conversion] (p-pd_name *p-pd_name) ? (int)p-pd_unit : ~~~^~~ ~~ The pd_name field of struct pci_conf is an array, so it can never be null. Remove the unnecessary check. Modified: head/usr.sbin/pciconf/pciconf.c Modified: head/usr.sbin/pciconf/pciconf.c == --- head/usr.sbin/pciconf/pciconf.c Wed Jan 28 21:08:09 2015 (r277855) +++ head/usr.sbin/pciconf/pciconf.c Wed Jan 28 21:21:35 2015 (r277856) @@ -234,9 +234,9 @@ list_devs(const char *name, int verbose, for (p = conf; p conf[pc.num_matches]; p++) { printf(%s%d@pci%d:%d:%d:%d:\tclass=0x%06x card=0x%08x chip=0x%08x rev=0x%02x hdr=0x%02x\n, - (p-pd_name *p-pd_name) ? p-pd_name : + *p-pd_name ? p-pd_name : none, - (p-pd_name *p-pd_name) ? (int)p-pd_unit : + *p-pd_name ? (int)p-pd_unit : none_count++, p-pc_sel.pc_domain, p-pc_sel.pc_bus, p-pc_sel.pc_dev, p-pc_sel.pc_func, (p-pc_class 16) | ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
svn commit: r277853 - head/usr.sbin/binmiscctl
Author: sbruno Date: Wed Jan 28 20:22:48 2015 New Revision: 277853 URL: https://svnweb.freebsd.org/changeset/base/277853 Log: Check for invalid length or more than max length for the interpreter, instead of the validity of the string pointer holding the interpreter. Submitted by: sson Reviewed by: dim MFC after:3 days Modified: head/usr.sbin/binmiscctl/binmiscctl.c Modified: head/usr.sbin/binmiscctl/binmiscctl.c == --- head/usr.sbin/binmiscctl/binmiscctl.c Wed Jan 28 20:01:21 2015 (r277852) +++ head/usr.sbin/binmiscctl/binmiscctl.c Wed Jan 28 20:22:48 2015 (r277853) @@ -363,7 +363,7 @@ add_cmd(__unused int argc, char *argv[], usage(Error: Missing magic argument); } - if (!xbe-xbe_interpreter) { + if (!strnlen(xbe-xbe_interpreter, IBE_INTERP_LEN_MAX)) { usage(Error: Missing 'interpreter' argument); } ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
svn commit: r277855 - in head: sys/fs/fdescfs sys/kern sys/sys usr.sbin/jail
Author: jamie Date: Wed Jan 28 21:08:09 2015 New Revision: 277855 URL: https://svnweb.freebsd.org/changeset/base/277855 Log: Add allow.mount.fdescfs jail flag. PR: 192951 Submitted by: ru...@verweg.com MFC after:3 days Modified: head/sys/fs/fdescfs/fdesc_vfsops.c head/sys/kern/kern_jail.c head/sys/sys/jail.h head/usr.sbin/jail/jail.8 Modified: head/sys/fs/fdescfs/fdesc_vfsops.c == --- head/sys/fs/fdescfs/fdesc_vfsops.c Wed Jan 28 21:01:55 2015 (r277854) +++ head/sys/fs/fdescfs/fdesc_vfsops.c Wed Jan 28 21:08:09 2015 (r277855) @@ -42,6 +42,7 @@ #include sys/systm.h #include sys/filedesc.h #include sys/kernel.h +#include sys/jail.h #include sys/lock.h #include sys/mutex.h #include sys/malloc.h @@ -78,8 +79,12 @@ fdesc_mount(struct mount *mp) { int error = 0; struct fdescmount *fmp; + struct thread *td = curthread; struct vnode *rvp; + if (!prison_allow(td-td_ucred, PR_ALLOW_MOUNT_FDESCFS)) + return (EPERM); + /* * Update is a no-op */ @@ -237,4 +242,4 @@ static struct vfsops fdesc_vfsops = { .vfs_unmount = fdesc_unmount, }; -VFS_SET(fdesc_vfsops, fdescfs, VFCF_SYNTHETIC); +VFS_SET(fdesc_vfsops, fdescfs, VFCF_SYNTHETIC | VFCF_JAIL); Modified: head/sys/kern/kern_jail.c == --- head/sys/kern/kern_jail.c Wed Jan 28 21:01:55 2015(r277854) +++ head/sys/kern/kern_jail.c Wed Jan 28 21:08:09 2015(r277855) @@ -208,6 +208,7 @@ static char *pr_allow_names[] = { allow.mount.zfs, allow.mount.procfs, allow.mount.tmpfs, + allow.mount.fdescfs, }; const size_t pr_allow_names_size = sizeof(pr_allow_names); @@ -224,6 +225,7 @@ static char *pr_allow_nonames[] = { allow.mount.nozfs, allow.mount.noprocfs, allow.mount.notmpfs, + allow.mount.nofdescfs, }; const size_t pr_allow_nonames_size = sizeof(pr_allow_nonames); @@ -4213,6 +4215,10 @@ SYSCTL_PROC(_security_jail, OID_AUTO, mo CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, NULL, PR_ALLOW_MOUNT_DEVFS, sysctl_jail_default_allow, I, Processes in jail can mount the devfs file system); +SYSCTL_PROC(_security_jail, OID_AUTO, mount_fdescfs_allowed, +CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, +NULL, PR_ALLOW_MOUNT_FDESCFS, sysctl_jail_default_allow, I, +Processes in jail can mount the fdescfs file system); SYSCTL_PROC(_security_jail, OID_AUTO, mount_nullfs_allowed, CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, NULL, PR_ALLOW_MOUNT_NULLFS, sysctl_jail_default_allow, I, @@ -4373,6 +4379,8 @@ SYSCTL_JAIL_PARAM(_allow_mount, , CTLTYP B, Jail may mount/unmount jail-friendly file systems in general); SYSCTL_JAIL_PARAM(_allow_mount, devfs, CTLTYPE_INT | CTLFLAG_RW, B, Jail may mount the devfs file system); +SYSCTL_JAIL_PARAM(_allow_mount, fdescfs, CTLTYPE_INT | CTLFLAG_RW, +B, Jail may mount the fdescfs file system); SYSCTL_JAIL_PARAM(_allow_mount, nullfs, CTLTYPE_INT | CTLFLAG_RW, B, Jail may mount the nullfs file system); SYSCTL_JAIL_PARAM(_allow_mount, procfs, CTLTYPE_INT | CTLFLAG_RW, Modified: head/sys/sys/jail.h == --- head/sys/sys/jail.h Wed Jan 28 21:01:55 2015(r277854) +++ head/sys/sys/jail.h Wed Jan 28 21:08:09 2015(r277855) @@ -226,7 +226,8 @@ struct prison_racct { #definePR_ALLOW_MOUNT_ZFS 0x0200 #definePR_ALLOW_MOUNT_PROCFS 0x0400 #definePR_ALLOW_MOUNT_TMPFS0x0800 -#definePR_ALLOW_ALL0x0fff +#definePR_ALLOW_MOUNT_FDESCFS 0x1000 +#definePR_ALLOW_ALL0x1fff /* * OSD methods Modified: head/usr.sbin/jail/jail.8 == --- head/usr.sbin/jail/jail.8 Wed Jan 28 21:01:55 2015(r277854) +++ head/usr.sbin/jail/jail.8 Wed Jan 28 21:08:09 2015(r277855) @@ -25,7 +25,7 @@ .\ .\ $FreeBSD$ .\ -.Dd August 4, 2014 +.Dd January 28, 2015 .Dt JAIL 8 .Os .Sh NAME @@ -362,7 +362,7 @@ A set of IPv6 options for the jail, the and .Va ip4 above. -.It vnet +.It Va vnet Create the jail with its own virtual network stack, with its own network interfaces, addresses, routing table, etc. The kernel must have been compiled with the @@ -531,6 +531,14 @@ is set to a value lower than 2. The devfs ruleset should be restricted from the default by using the .Va devfs_ruleset option. +.It Va allow.mount.fdescfs +privileged users inside the jail will be able to mount and unmount the +fdescfs file system. +This permission is effective only together with +.Va allow.mount +and only when +.Va enforce_statfs +is set to a value lower than 2. .It Va
Re: svn commit: r277841 - head/contrib/amd/hlfsd
On 01/28/15 14:25, Dimitry Andric wrote: On 28 Jan 2015, at 20:04, Roman Divacky rdiva...@freebsd.org wrote: On Wed, Jan 28, 2015 at 06:19:26PM +, Dimitry Andric wrote: Author: dim Date: Wed Jan 28 18:19:25 2015 New Revision: 277841 URL: https://svnweb.freebsd.org/changeset/base/277841 Log: Fix the following clang 3.6.0 warning in contrib/amd/hlfsd/homedir.c: contrib/amd/hlfsd/homedir.c:497:8: error: address of array 'buf' will always evaluate to 'true' [-Werror,-Wpointer-bool-conversion] if (!buf || buf[0] == '\0') ~^~~ In the affected function, 'buf' is declared as an array of char, so it can never be null. Remove the unecessary check. ... Given that this is a contributed code - have you sent the fix upstream? Also, upstream seems to have newer versions of this... Apparently upstream fixed this about six years ago: http://git.fsl.cs.sunysb.edu/?p=am-utils-6.2.git;a=commitdiff;h=e6301006ef97d31745f9ffbb17c58cb39d18c6aa#patch9 The last real import for am-utils was about 7 year ago. Maybe it's time for an update, if it is still actively used. -Dimitry I have no idea if this should be updated (it's probably meant to be replaced by autofs nowadays) but the patches should be merged through the vendor area so I flattened the distdir and brought I change I had done there. Regards, Pedro. ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
Re: svn commit: r277802 - head/usr.bin/sed
Hello; On 01/28/15 03:41, Bruce Evans wrote: On Tue, 27 Jan 2015, Pedro F. Giffuni wrote: Log: Fix resource leak and dereference after NULL. process.c: Protect access against NULL. main.c: Prevent outfile overwrite resource leak. ... Modified: head/usr.bin/sed/main.c == --- head/usr.bin/sed/main.cTue Jan 27 18:56:46 2015 (r277801) +++ head/usr.bin/sed/main.cTue Jan 27 18:58:24 2015 (r277802) @@ -411,6 +411,8 @@ mf_fgets(SPACE *sp, enum e_spflag spflag unlink(tmpfname); if ((outfile = fopen(tmpfname, w)) == NULL) err(1, %s, fname); +if (outfile != NULL outfile != stdout) +fclose(outfile); fchown(fileno(outfile), sb.st_uid, sb.st_gid); fchmod(fileno(outfile), sb.st_mode ALLPERMS); outfname = tmpfname; This is mismerged at best. It just breaks the new outfile by closing it. The check in it makes no sense in this contents, since the freshly-opened outfile cannot be NULL (since the open succeeded) or stdout (fopen() cannot return a pointer to an already-open stream, so it can only return stdout if the stdout pointer is garbage, but then it is not really stdout). Yes, I pasted the check after it was useful and not before like the original. I noticed right away and fixed it though: https://svnweb.freebsd.org/base?view=revisionrevision=277811 But thanks for checking! Pedro. ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
svn commit: r277834 - head/usr.sbin/autofs
Author: trasz Date: Wed Jan 28 15:46:11 2015 New Revision: 277834 URL: https://svnweb.freebsd.org/changeset/base/277834 Log: When there are no automounted filesystems, autounmountd(8) should wait for filesystem event, instead of looping on a timeout. MFC after:1 month Sponsored by: The FreeBSD Foundation Modified: head/usr.sbin/autofs/autounmountd.c Modified: head/usr.sbin/autofs/autounmountd.c == --- head/usr.sbin/autofs/autounmountd.c Wed Jan 28 15:37:35 2015 (r277833) +++ head/usr.sbin/autofs/autounmountd.c Wed Jan 28 15:46:11 2015 (r277834) @@ -182,7 +182,7 @@ expire_automounted(double expiration_tim { struct automounted_fs *af, *tmpaf; time_t now; - double mounted_for, mounted_max = 0; + double mounted_for, mounted_max = -1.0; int error; now = time(NULL); @@ -231,21 +231,28 @@ do_wait(int kq, double sleep_time) { struct timespec timeout; struct kevent unused; - int error; - - assert(sleep_time 0); - timeout.tv_sec = sleep_time; - timeout.tv_nsec = 0; + int nevents; - log_debugx(waiting for filesystem event for %.0f seconds, sleep_time); - error = kevent(kq, NULL, 0, unused, 1, timeout); - if (error 0) + if (sleep_time != -1.0) { + assert(sleep_time 0.0); + timeout.tv_sec = sleep_time; + timeout.tv_nsec = 0; + + log_debugx(waiting for filesystem event for %.0f seconds, sleep_time); + nevents = kevent(kq, NULL, 0, unused, 1, timeout); + } else { + log_debugx(waiting for filesystem event); + nevents = kevent(kq, NULL, 0, unused, 1, NULL); + } + if (nevents 0) log_err(1, kevent); - if (error == 0) + if (nevents == 0) { log_debugx(timeout reached); - else + assert(sleep_time 0.0); + } else { log_debugx(got filesystem event); + } } int @@ -324,7 +331,10 @@ main_autounmountd(int argc, char **argv) for (;;) { refresh_automounted(); mounted_max = expire_automounted(expiration_time); - if (mounted_max expiration_time) { + if (mounted_max == -1.0) { + sleep_time = mounted_max; + log_debugx(no filesystems to expire); + } else if (mounted_max expiration_time) { sleep_time = difftime(expiration_time, mounted_max); log_debugx(some filesystems expire in %.0f seconds, sleep_time); ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
Re: svn commit: r277796 - in head/sys: dev/acpica dev/syscons dev/vt sys
On Wed, Jan 28, 2015 at 03:53:34PM +0200, Andriy Gapon wrote: On 27/01/2015 19:47, Konstantin Belousov wrote: On Tue, Jan 27, 2015 at 05:33:19PM +, Andriy Gapon wrote: +EVENTHANDLER_INVOKE(power_suspend_early); +stop_all_proc(); It also makes sense to call syncer_suspend() after stop_all_proc(), I suppose. It would ensure that a failed resume still ends with the consistent filesystem metadata. Probably yes. I can make that change if you endorse it. Or you can make it if that'll be faster. Thanks! I prefer that the change is made by somebody who uses and tests the suspension code, i.e. you. ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
svn commit: r277860 - head/usr.sbin/sa
Author: dim Date: Wed Jan 28 22:22:49 2015 New Revision: 277860 URL: https://svnweb.freebsd.org/changeset/base/277860 Log: Fix the following -Wcast-qual warnings in usr.sbin/sa/db.c: usr.sbin/sa/db.c:82:20: error: cast from 'char const (*)[9]' to 'void *' drops const qualifier [-Werror,-Wcast-qual] key.data = (void*)VERSION_KEY; ^ usr.sbin/sa/db.c:178:20: error: cast from 'char const (*)[9]' to 'void *' drops const qualifier [-Werror,-Wcast-qual] key.data = (void*)VERSION_KEY; ^ Replace the VERSION_KEY define with a writable char array, so no const qualifier needs to be dropped anymore. Submitted by: rdivacky Modified: head/usr.sbin/sa/db.c Modified: head/usr.sbin/sa/db.c == --- head/usr.sbin/sa/db.c Wed Jan 28 21:51:34 2015(r277859) +++ head/usr.sbin/sa/db.c Wed Jan 28 22:22:49 2015(r277860) @@ -44,7 +44,7 @@ __FBSDID($FreeBSD$); #include extern.h /* Key used to store the version of the database data elements. */ -#define VERSION_KEY \0VERSION +static char VERSION_KEY[] = \0VERSION; /* * Create the in-memory database, *mdb. ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
Re: svn commit: r277795 - in head/sys/dev: fb vt vt/hw/fb
On 27.01.2015 16:28, Andriy Gapon wrote: Author: avg Date: Tue Jan 27 15:28:46 2015 New Revision: 277795 URL: https://svnweb.freebsd.org/changeset/base/277795 Log: vt(4): Use power_{suspend,resume} event handlers to implement suspend/resume Thank you very much for committing this! I couldn't find the time to do it... -- Jean-Sébastien Pédron signature.asc Description: OpenPGP digital signature
svn commit: r277862 - head/lib/libc/gen
Author: jilles Date: Wed Jan 28 22:42:56 2015 New Revision: 277862 URL: https://svnweb.freebsd.org/changeset/base/277862 Log: sem_post(): Fix and document semaphore value overflow error. The error code is per Austin Group issue #315. I provided different wording for the manual page change. Submitted by: pluknet MFC after:1 week Modified: head/lib/libc/gen/sem_new.c head/lib/libc/gen/sem_post.3 Modified: head/lib/libc/gen/sem_new.c == --- head/lib/libc/gen/sem_new.c Wed Jan 28 22:32:03 2015(r277861) +++ head/lib/libc/gen/sem_new.c Wed Jan 28 22:42:56 2015(r277862) @@ -439,8 +439,10 @@ _sem_post(sem_t *sem) do { count = sem-_kern._count; - if (USEM_COUNT(count) + 1 SEM_VALUE_MAX) - return (EOVERFLOW); + if (USEM_COUNT(count) + 1 SEM_VALUE_MAX) { + errno = EOVERFLOW; + return (-1); + } } while (!atomic_cmpset_rel_int(sem-_kern._count, count, count + 1)); if (count USEM_HAS_WAITERS) usem_wake(sem-_kern); Modified: head/lib/libc/gen/sem_post.3 == --- head/lib/libc/gen/sem_post.3Wed Jan 28 22:32:03 2015 (r277861) +++ head/lib/libc/gen/sem_post.3Wed Jan 28 22:42:56 2015 (r277862) @@ -27,7 +27,7 @@ .\ .\ $FreeBSD$ .\ -.Dd February 15, 2000 +.Dd January 28, 2015 .Dt SEM_POST 3 .Os .Sh NAME @@ -65,6 +65,9 @@ The .Fa sem argument points to an invalid semaphore. +.It Bq Er EOVERFLOW +The semaphore value would exceed +.Dv SEM_VALUE_MAX . .El .Sh SEE ALSO .Xr sem_getvalue 3 , ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
svn commit: r277868 - head/contrib/amd/amd
Author: pfg Date: Thu Jan 29 01:26:23 2015 New Revision: 277868 URL: https://svnweb.freebsd.org/changeset/base/277868 Log: Revert r277814: It will be re-merged through the vendor area. Modified: head/contrib/amd/amd/amfs_generic.c Modified: head/contrib/amd/amd/amfs_generic.c == --- head/contrib/amd/amd/amfs_generic.c Thu Jan 29 00:34:58 2015 (r277867) +++ head/contrib/amd/amd/amfs_generic.c Thu Jan 29 01:26:23 2015 (r277868) @@ -1113,7 +1113,7 @@ amfs_generic_mount_child(am_node *new_mp new_mp-am_transp = (SVCXPRT *) xmalloc(sizeof(SVCXPRT)); *(new_mp-am_transp) = *current_transp; } - if (error new_mp-am_mnt (new_mp-am_mnt-mf_ops == amfs_error_ops)) + if (error (new_mp-am_mnt-mf_ops == amfs_error_ops)) new_mp-am_error = error; if (new_mp-am_error 0) ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
svn commit: r277869 - head/contrib/amd/amd
Author: pfg Date: Thu Jan 29 01:28:39 2015 New Revision: 277869 URL: https://svnweb.freebsd.org/changeset/base/277869 Log: MFV r277866 amd: Add extra check for NULL before deref. CID: 274421 Obtained from:NetBSD MFC after:4 days Modified: head/contrib/amd/amd/amfs_generic.c Directory Properties: head/contrib/amd/ (props changed) Modified: head/contrib/amd/amd/amfs_generic.c == --- head/contrib/amd/amd/amfs_generic.c Thu Jan 29 01:26:23 2015 (r277868) +++ head/contrib/amd/amd/amfs_generic.c Thu Jan 29 01:28:39 2015 (r277869) @@ -1113,7 +1113,7 @@ amfs_generic_mount_child(am_node *new_mp new_mp-am_transp = (SVCXPRT *) xmalloc(sizeof(SVCXPRT)); *(new_mp-am_transp) = *current_transp; } - if (error (new_mp-am_mnt-mf_ops == amfs_error_ops)) + if (error new_mp-am_mnt (new_mp-am_mnt-mf_ops == amfs_error_ops)) new_mp-am_error = error; if (new_mp-am_error 0) ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
svn commit: r277871 - head/sys/arm/ti/am335x
Author: gonzo Date: Thu Jan 29 01:59:42 2015 New Revision: 277871 URL: https://svnweb.freebsd.org/changeset/base/277871 Log: Set LCDC clock frequency to 2*148500 KHz Minimum LCDC is 2 so clock freq shouild be 2*max_pixel_clock. Maximum pixel clock for HDMI is 148500 (1920x1080). But AM335x can not run in this mode due to bandwidth and clock limitations Modified: head/sys/arm/ti/am335x/am335x_prcm.c Modified: head/sys/arm/ti/am335x/am335x_prcm.c == --- head/sys/arm/ti/am335x/am335x_prcm.cThu Jan 29 01:55:24 2015 (r277870) +++ head/sys/arm/ti/am335x/am335x_prcm.cThu Jan 29 01:59:42 2015 (r277871) @@ -729,10 +729,10 @@ am335x_clk_lcdc_activate(struct ti_clock DELAY(10); /* -* For now set frequency to 5xSYSFREQ -* More flexible control might be required +* For now set frequency to 99*SYSFREQ/8 which is twice as +* HDMI 1080p pixel clock (minimum LCDC freq divisor is 2) */ - prcm_write_4(CM_WKUP_CM_CLKSEL_DPLL_DISP, (5 8) | 0); + prcm_write_4(CM_WKUP_CM_CLKSEL_DPLL_DISP, (99 8) | 8); /* Locked mode */ prcm_write_4(CM_WKUP_CM_CLKMODE_DPLL_DISP, 0x7); ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
svn commit: r277835 - in head: lib/libpmc sys/arm/arm sys/arm/include sys/arm/ti sys/conf sys/dev/hwpmc sys/sys
Author: br Date: Wed Jan 28 16:08:07 2015 New Revision: 277835 URL: https://svnweb.freebsd.org/changeset/base/277835 Log: Add ARMv7 performance monitoring counters. Differential Revision:https://reviews.freebsd.org/D1687 Reviewed by: rpaulo Sponsored by: DARPA, AFRL Added: head/sys/dev/hwpmc/hwpmc_armv7.c (contents, props changed) head/sys/dev/hwpmc/hwpmc_armv7.h (contents, props changed) Modified: head/lib/libpmc/libpmc.c head/sys/arm/arm/intr.c head/sys/arm/include/pmc_mdep.h head/sys/arm/ti/files.ti head/sys/conf/files.arm head/sys/dev/hwpmc/hwpmc_arm.c head/sys/dev/hwpmc/pmc_events.h head/sys/sys/pmc.h Modified: head/lib/libpmc/libpmc.c == --- head/lib/libpmc/libpmc.cWed Jan 28 15:46:11 2015(r277834) +++ head/lib/libpmc/libpmc.cWed Jan 28 16:08:07 2015(r277835) @@ -74,10 +74,14 @@ static int p6_allocate_pmc(enum pmc_even static int tsc_allocate_pmc(enum pmc_event _pe, char *_ctrspec, struct pmc_op_pmcallocate *_pmc_config); #endif +#if defined(__arm__) #if defined(__XSCALE__) static int xscale_allocate_pmc(enum pmc_event _pe, char *_ctrspec, struct pmc_op_pmcallocate *_pmc_config); #endif +static int armv7_allocate_pmc(enum pmc_event _pe, char *_ctrspec, +struct pmc_op_pmcallocate *_pmc_config); +#endif #if defined(__mips__) static int mips_allocate_pmc(enum pmc_event _pe, char* ctrspec, struct pmc_op_pmcallocate *_pmc_config); @@ -153,6 +157,7 @@ PMC_CLASSDEP_TABLE(p4, P4); PMC_CLASSDEP_TABLE(p5, P5); PMC_CLASSDEP_TABLE(p6, P6); PMC_CLASSDEP_TABLE(xscale, XSCALE); +PMC_CLASSDEP_TABLE(armv7, ARMV7); PMC_CLASSDEP_TABLE(mips24k, MIPS24K); PMC_CLASSDEP_TABLE(octeon, OCTEON); PMC_CLASSDEP_TABLE(ucf, UCF); @@ -286,6 +291,7 @@ PMC_MDEP_TABLE(p4, P4, PMC_CLASS_SOFT, P PMC_MDEP_TABLE(p5, P5, PMC_CLASS_SOFT, PMC_CLASS_TSC); PMC_MDEP_TABLE(p6, P6, PMC_CLASS_SOFT, PMC_CLASS_TSC); PMC_MDEP_TABLE(xscale, XSCALE, PMC_CLASS_SOFT, PMC_CLASS_XSCALE); +PMC_MDEP_TABLE(armv7, ARMV7, PMC_CLASS_SOFT, PMC_CLASS_ARMV7); PMC_MDEP_TABLE(mips24k, MIPS24K, PMC_CLASS_SOFT, PMC_CLASS_MIPS24K); PMC_MDEP_TABLE(octeon, OCTEON, PMC_CLASS_SOFT, PMC_CLASS_OCTEON); PMC_MDEP_TABLE(ppc7450, PPC7450, PMC_CLASS_SOFT, PMC_CLASS_PPC7450); @@ -346,9 +352,12 @@ PMC_CLASS_TABLE_DESC(p6, P6, p6, p6); #ifdefined(__i386__) || defined(__amd64__) PMC_CLASS_TABLE_DESC(tsc, TSC, tsc, tsc); #endif +#ifdefined(__arm__) #ifdefined(__XSCALE__) PMC_CLASS_TABLE_DESC(xscale, XSCALE, xscale, xscale); #endif +PMC_CLASS_TABLE_DESC(armv7, ARMV7, armv7, armv7); +#endif #if defined(__mips__) PMC_CLASS_TABLE_DESC(mips24k, MIPS24K, mips24k, mips); PMC_CLASS_TABLE_DESC(octeon, OCTEON, octeon, mips); @@ -2371,6 +2380,7 @@ soft_allocate_pmc(enum pmc_event pe, cha return (0); } +#ifdefined(__arm__) #ifdefined(__XSCALE__) static struct pmc_event_alias xscale_aliases[] = { @@ -2394,6 +2404,25 @@ xscale_allocate_pmc(enum pmc_event pe, c } #endif +static struct pmc_event_alias armv7_aliases[] = { + EV_ALIAS(dc-misses, L1_DCACHE_REFILL), + EV_ALIAS(ic-misses, L1_ICACHE_REFILL), + EV_ALIAS(instructions,INSTR_EXECUTED), + EV_ALIAS(NULL, NULL) +}; +static int +armv7_allocate_pmc(enum pmc_event pe, char *ctrspec __unused, +struct pmc_op_pmcallocate *pmc_config __unused) +{ + switch (pe) { + default: + break; + } + + return (0); +} +#endif + #if defined(__mips__) static struct pmc_event_alias mips24k_aliases[] = { @@ -2886,6 +2915,10 @@ pmc_event_names_of_class(enum pmc_class ev = xscale_event_table; count = PMC_EVENT_TABLE_SIZE(xscale); break; + case PMC_CLASS_ARMV7: + ev = armv7_event_table; + count = PMC_EVENT_TABLE_SIZE(armv7); + break; case PMC_CLASS_MIPS24K: ev = mips24k_event_table; count = PMC_EVENT_TABLE_SIZE(mips24k); @@ -3163,12 +3196,18 @@ pmc_init(void) case PMC_CPU_GENERIC: PMC_MDEP_INIT(generic); break; +#if defined(__arm__) #if defined(__XSCALE__) case PMC_CPU_INTEL_XSCALE: PMC_MDEP_INIT(xscale); pmc_class_table[n] = xscale_class_table_descr; break; #endif + case PMC_CPU_ARMV7: + PMC_MDEP_INIT(armv7); + pmc_class_table[n] = armv7_class_table_descr; + break; +#endif #if defined(__mips__) case PMC_CPU_MIPS_24K: PMC_MDEP_INIT(mips24k); @@ -3369,6 +3408,9 @@ _pmc_name_of_event(enum pmc_event pe, en } else if (pe = PMC_EV_XSCALE_FIRST pe = PMC_EV_XSCALE_LAST) { ev = xscale_event_table; evfence = xscale_event_table + PMC_EVENT_TABLE_SIZE(xscale); + } else if (pe =
Re: svn commit: r277835 - in head: lib/libpmc sys/arm/arm sys/arm/include sys/arm/ti sys/conf sys/dev/hwpmc sys/sys
On Wed, 2015-01-28 at 16:08 +, Ruslan Bukin wrote: Author: br Date: Wed Jan 28 16:08:07 2015 New Revision: 277835 URL: https://svnweb.freebsd.org/changeset/base/277835 Log: Add ARMv7 performance monitoring counters. Differential Revision: https://reviews.freebsd.org/D1687 Reviewed by:rpaulo Sponsored by: DARPA, AFRL Added: head/sys/dev/hwpmc/hwpmc_armv7.c (contents, props changed) head/sys/dev/hwpmc/hwpmc_armv7.h (contents, props changed) Modified: head/lib/libpmc/libpmc.c head/sys/arm/arm/intr.c head/sys/arm/include/pmc_mdep.h head/sys/arm/ti/files.ti head/sys/conf/files.arm head/sys/dev/hwpmc/hwpmc_arm.c head/sys/dev/hwpmc/pmc_events.h head/sys/sys/pmc.h This was in phabricator for review for 27 hours before it got committed, that's not enough time to allow people to actually review it. That would be not enough time for even a simple change, let alone over a thousand of lines of code. It certainly wasn't reviewed by those actively working on arm pmc stuff recently (gnn and to a lesser degree, me). Just from a quick glance at the part that wasn't truncated, I notice all the inline asm stuff is wrong -- it duplicates what's already available in cpu-v6.h. -- Ian ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
Re: svn commit: r277828 - in head/sys: fs/tmpfs vm
On 28 Jan, Konstantin Belousov wrote: On Wed, Jan 28, 2015 at 09:41:06AM -0800, Don Lewis wrote: On 28 Jan, Konstantin Belousov wrote: Author: kib Date: Wed Jan 28 10:37:23 2015 New Revision: 277828 URL: https://svnweb.freebsd.org/changeset/base/277828 Log: Update mtime for tmpfs files modified through memory mapping. Similar to UFS, perform updates during syncer scans, which in particular means that tmpfs now performs scan on sync. Also, this means that a mtime update may be delayed up to 30 seconds after the write. Maybe disable the scan if mounted noatime? It is for mtime, not atime, updates. Yeah, I haven't had my caffeine fix yet this morning ... ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
svn commit: r277843 - head/contrib/elftoolchain/elfcopy
Author: emaste Date: Wed Jan 28 18:37:09 2015 New Revision: 277843 URL: https://svnweb.freebsd.org/changeset/base/277843 Log: Preserve hard symbolic links when modifying source file Strip is often used to modify existing files, rather than creating new files. If the existing file has hard links or is a symbolic link, act as if editing the file in place and preserve the links. Reported by: luigi Reviewed by: imp, rpaulo Sponsored by: The FreeBSD Foundation Differential Revision:https://reviews.freebsd.org/D1682 Modified: head/contrib/elftoolchain/elfcopy/main.c Modified: head/contrib/elftoolchain/elfcopy/main.c == --- head/contrib/elftoolchain/elfcopy/main.cWed Jan 28 18:36:33 2015 (r277842) +++ head/contrib/elftoolchain/elfcopy/main.cWed Jan 28 18:37:09 2015 (r277843) @@ -210,7 +210,7 @@ static struct { }; static int copy_from_tempfile(const char *src, const char *dst, -int infd, int *outfd); +int infd, int *outfd, int in_place); static voidcreate_file(struct elfcopy *ecp, const char *src, const char *dst); static voidelfcopy_main(struct elfcopy *ecp, int argc, char **argv); @@ -523,33 +523,39 @@ create_tempfile(char **fn, int *fd) #undef _TEMPFILEPATH } +/* + * Copy temporary file with path src and file descriptor infd to path dst. + * If in_place is set act as if editing the file in place, avoiding rename() + * to preserve hard and symbolic links. Output file remains open, with file + * descriptor returned in outfd. + */ static int -copy_from_tempfile(const char *src, const char *dst, int infd, int *outfd) +copy_from_tempfile(const char *src, const char *dst, int infd, int *outfd, +int in_place) { int tmpfd; /* * First, check if we can use rename(). */ - if (rename(src, dst) = 0) { - *outfd = infd; - return (0); - } else if (errno != EXDEV) - return (-1); - - /* -* If the rename() failed due to 'src' and 'dst' residing in -* two different file systems, invoke a helper function in -* libelftc to do the copy. -*/ - - if (unlink(dst) 0) - return (-1); + if (in_place == 0) { + if (rename(src, dst) = 0) { + *outfd = infd; + return (0); + } else if (errno != EXDEV) + return (-1); + + /* +* If the rename() failed due to 'src' and 'dst' residing in +* two different file systems, invoke a helper function in +* libelftc to do the copy. +*/ - if ((tmpfd = open(dst, O_CREAT | O_WRONLY, 0755)) 0) - return (-1); + if (unlink(dst) 0) + return (-1); + } - if (lseek(infd, 0, SEEK_SET) 0) + if ((tmpfd = open(dst, O_CREAT | O_TRUNC | O_WRONLY, 0755)) 0) return (-1); if (elftc_copyfile(infd, tmpfd) 0) @@ -578,6 +584,7 @@ create_file(struct elfcopy *ecp, const c struct stat sb; char*tempfile, *elftemp; int efd, ifd, ofd, ofd0, tfd; + int in_place; tempfile = NULL; @@ -718,10 +725,15 @@ copy_done: #endif if (tempfile != NULL) { - if (dst == NULL) + in_place = 0; + if (dst == NULL) { dst = src; + if (lstat(dst, sb) != -1 + (sb.st_nlink 1 || S_ISLNK(sb.st_mode))) + in_place = 1; + } - if (copy_from_tempfile(tempfile, dst, ofd, tfd) 0) + if (copy_from_tempfile(tempfile, dst, ofd, tfd, in_place) 0) err(EXIT_FAILURE, creation of %s failed, dst); free(tempfile); ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
svn commit: r277839 - head/share/man/man7
Author: gjb Date: Wed Jan 28 18:13:16 2015 New Revision: 277839 URL: https://svnweb.freebsd.org/changeset/base/277839 Log: Update release(7) to reflect renaming the 'system' target to 'disc1'. MFC after:3 weeks X-MFC-with: r277458, r277536, r277606, r277609, r277836 Sponsored by: The FreeBSD Foundation Modified: head/share/man/man7/release.7 Modified: head/share/man/man7/release.7 == --- head/share/man/man7/release.7 Wed Jan 28 17:39:57 2015 (r277838) +++ head/share/man/man7/release.7 Wed Jan 28 18:13:16 2015 (r277839) @@ -24,7 +24,7 @@ .\ .\ $FreeBSD$ .\ -.Dd January 16, 2015 +.Dd January 28, 2015 .Dt RELEASE 7 .Os .Sh NAME @@ -546,7 +546,7 @@ Major subtargets called by targets above Generates all the distribution archives .Pq base, kernel, ports, doc applicable on this platform. -.It Cm system +.It Cm disc1 Builds a bootable installation system containing all the distribution files packaged by the .Cm packagesystem ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
svn commit: r277841 - head/contrib/amd/hlfsd
Author: dim Date: Wed Jan 28 18:19:25 2015 New Revision: 277841 URL: https://svnweb.freebsd.org/changeset/base/277841 Log: Fix the following clang 3.6.0 warning in contrib/amd/hlfsd/homedir.c: contrib/amd/hlfsd/homedir.c:497:8: error: address of array 'buf' will always evaluate to 'true' [-Werror,-Wpointer-bool-conversion] if (!buf || buf[0] == '\0') ~^~~ In the affected function, 'buf' is declared as an array of char, so it can never be null. Remove the unecessary check. Modified: head/contrib/amd/hlfsd/homedir.c Modified: head/contrib/amd/hlfsd/homedir.c == --- head/contrib/amd/hlfsd/homedir.cWed Jan 28 18:13:52 2015 (r277840) +++ head/contrib/amd/hlfsd/homedir.cWed Jan 28 18:19:25 2015 (r277841) @@ -494,7 +494,7 @@ readent: buf[0] = '\0'; fgets(buf, 256, passwd_fp); passwd_line++; - if (!buf || buf[0] == '\0') + if (buf[0] == '\0') goto readent; /* read user name */ ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
Re: svn commit: r277693 - head/sys/boot/forth
On 1/25/2015 5:57 AM, Dag-Erling Smørgrav wrote: Author: des Date: Sun Jan 25 11:57:18 2015 New Revision: 277693 URL: https://svnweb.freebsd.org/changeset/base/277693 Log: Fix the font in the text version. This has bothered me for a long time... MFC after: 1 week Same, thanks. -- Regards, Bryan Drewery signature.asc Description: OpenPGP digital signature
Re: svn commit: r277835 - in head: lib/libpmc sys/arm/arm sys/arm/include sys/arm/ti sys/conf sys/dev/hwpmc sys/sys
On Wed, Jan 28, 2015 at 09:35:03AM -0700, Ian Lepore wrote: On Wed, 2015-01-28 at 16:08 +, Ruslan Bukin wrote: Author: br Date: Wed Jan 28 16:08:07 2015 New Revision: 277835 URL: https://svnweb.freebsd.org/changeset/base/277835 Log: Add ARMv7 performance monitoring counters. Differential Revision:https://reviews.freebsd.org/D1687 Reviewed by: rpaulo Sponsored by: DARPA, AFRL Added: head/sys/dev/hwpmc/hwpmc_armv7.c (contents, props changed) head/sys/dev/hwpmc/hwpmc_armv7.h (contents, props changed) Modified: head/lib/libpmc/libpmc.c head/sys/arm/arm/intr.c head/sys/arm/include/pmc_mdep.h head/sys/arm/ti/files.ti head/sys/conf/files.arm head/sys/dev/hwpmc/hwpmc_arm.c head/sys/dev/hwpmc/pmc_events.h head/sys/sys/pmc.h This was in phabricator for review for 27 hours before it got committed, that's not enough time to allow people to actually review it. That would be not enough time for even a simple change, let alone over a thousand of lines of code. It certainly wasn't reviewed by those actively working on arm pmc stuff recently (gnn and to a lesser degree, me). Ok, make sense, it actually was my first experience with PB, and I expected any activity from people who want to review this. Just from a quick glance at the part that wasn't truncated, I notice all the inline asm stuff is wrong -- it duplicates what's already available in cpu-v6.h. I had a conversation with Andrew this morning, he pointed me out those defines in cpu-v6.h, but we agreed those are optional stuff. I.e. duplicates != wrong. I'll fix that. Thanks Ruslan ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
Re: svn commit: r277841 - head/contrib/amd/hlfsd
Given that this is a contributed code - have you sent the fix upstream? Also, upstream seems to have newer versions of this... On Wed, Jan 28, 2015 at 06:19:26PM +, Dimitry Andric wrote: Author: dim Date: Wed Jan 28 18:19:25 2015 New Revision: 277841 URL: https://svnweb.freebsd.org/changeset/base/277841 Log: Fix the following clang 3.6.0 warning in contrib/amd/hlfsd/homedir.c: contrib/amd/hlfsd/homedir.c:497:8: error: address of array 'buf' will always evaluate to 'true' [-Werror,-Wpointer-bool-conversion] if (!buf || buf[0] == '\0') ~^~~ In the affected function, 'buf' is declared as an array of char, so it can never be null. Remove the unecessary check. Modified: head/contrib/amd/hlfsd/homedir.c Modified: head/contrib/amd/hlfsd/homedir.c == --- head/contrib/amd/hlfsd/homedir.c Wed Jan 28 18:13:52 2015 (r277840) +++ head/contrib/amd/hlfsd/homedir.c Wed Jan 28 18:19:25 2015 (r277841) @@ -494,7 +494,7 @@ readent: buf[0] = '\0'; fgets(buf, 256, passwd_fp); passwd_line++; - if (!buf || buf[0] == '\0') + if (buf[0] == '\0') goto readent; /* read user name */ ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
Re: svn commit: r277841 - head/contrib/amd/hlfsd
On 28 Jan 2015, at 20:04, Roman Divacky rdiva...@freebsd.org wrote: On Wed, Jan 28, 2015 at 06:19:26PM +, Dimitry Andric wrote: Author: dim Date: Wed Jan 28 18:19:25 2015 New Revision: 277841 URL: https://svnweb.freebsd.org/changeset/base/277841 Log: Fix the following clang 3.6.0 warning in contrib/amd/hlfsd/homedir.c: contrib/amd/hlfsd/homedir.c:497:8: error: address of array 'buf' will always evaluate to 'true' [-Werror,-Wpointer-bool-conversion] if (!buf || buf[0] == '\0') ~^~~ In the affected function, 'buf' is declared as an array of char, so it can never be null. Remove the unecessary check. ... Given that this is a contributed code - have you sent the fix upstream? Also, upstream seems to have newer versions of this... Apparently upstream fixed this about six years ago: http://git.fsl.cs.sunysb.edu/?p=am-utils-6.2.git;a=commitdiff;h=e6301006ef97d31745f9ffbb17c58cb39d18c6aa#patch9 The last real import for am-utils was about 7 year ago. Maybe it's time for an update, if it is still actively used. -Dimitry signature.asc Description: Message signed with OpenPGP using GPGMail
Re: svn commit: r277835 - in head: lib/libpmc sys/arm/arm sys/arm/include sys/arm/ti sys/conf sys/dev/hwpmc sys/sys
On Wed, 28 Jan 2015 18:39:13 + Ruslan Bukin b...@freebsd.org wrote: On Wed, Jan 28, 2015 at 09:35:03AM -0700, Ian Lepore wrote: Just from a quick glance at the part that wasn't truncated, I notice all the inline asm stuff is wrong -- it duplicates what's already available in cpu-v6.h. I had a conversation with Andrew this morning, he pointed me out those defines in cpu-v6.h, but we agreed those are optional stuff. I.e. duplicates != wrong. I'll fix that. Thanks It would be useful to use them, but this will need Makefile changes as some of these defines are only available when __ARM_ARCH 6 which may not be true in userland. If we do make these changes we then need to make sure that none of the code on the file built as ARMv7 is run on an ARMv6 as the compiler may choose to use invalid instructions on v6. Andrew ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
Re: svn commit: r277652 - in head/usr.sbin/pw: . tests
On 1/27/2015 5:44 PM, Baptiste Daroussin wrote: pw groupdel -u plop removing wheel... or pw userdel -u something trying to delete root. I just realized this has bitten me many times. I added a ton of voodoo in my scripts to avoid removing root/wheel. This is surely it though. -- Regards, Bryan Drewery signature.asc Description: OpenPGP digital signature