From owner-svn-src-stable-6@FreeBSD.ORG Mon May 25 04:13:07 2009 Return-Path: Delivered-To: svn-src-stable-6@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 347A11065672; Mon, 25 May 2009 04:13:07 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 178718FC08; Mon, 25 May 2009 04:13:07 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n4P4D6SQ010548; Mon, 25 May 2009 04:13:06 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n4P4D6Kw010547; Mon, 25 May 2009 04:13:06 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <200905250413.n4P4D6Kw010547@svn.freebsd.org> From: Doug Barton Date: Mon, 25 May 2009 04:13:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-6@freebsd.org X-SVN-Group: stable-6 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r192722 - stable/6/usr.sbin/mergemaster X-BeenThere: svn-src-stable-6@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 6-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 May 2009 04:13:07 -0000 Author: dougb Date: Mon May 25 04:13:06 2009 New Revision: 192722 URL: http://svn.freebsd.org/changeset/base/192722 Log: MFC 192219: Add -L to the mtree invocation to chase symbolic links that are present in "Service jails." MFC 192230: Enhance the safety and efficiency of the -U option, fix indentation on one line. Modified: stable/6/usr.sbin/mergemaster/ (props changed) stable/6/usr.sbin/mergemaster/mergemaster.sh Modified: stable/6/usr.sbin/mergemaster/mergemaster.sh ============================================================================== --- stable/6/usr.sbin/mergemaster/mergemaster.sh Mon May 25 04:11:30 2009 (r192721) +++ stable/6/usr.sbin/mergemaster/mergemaster.sh Mon May 25 04:13:06 2009 (r192722) @@ -115,8 +115,10 @@ diff_loop () { while [ "${HANDLE_COMPFILE}" = "v" -o "${HANDLE_COMPFILE}" = "V" -o \ "${HANDLE_COMPFILE}" = "NOT V" ]; do if [ -f "${DESTDIR}${COMPFILE#.}" -a -f "${COMPFILE}" ]; then - if [ -n "${AUTO_UPGRADE}" ]; then - if echo "${CHANGED}" | grep -qsv ${DESTDIR}${COMPFILE#.}; then + if [ -n "${AUTO_UPGRADE}" -a -n "${CHANGED}" ]; then + case "${CHANGED}" in + *:${DESTDIR}${COMPFILE#.}:*) ;; # File has been modified + *) echo '' echo " *** ${COMPFILE} has not been user modified." echo '' @@ -128,10 +130,11 @@ diff_loop () { AUTO_UPGRADED_FILES="${AUTO_UPGRADED_FILES} ${DESTDIR}${COMPFILE#.} " else - echo " *** Problem upgrading ${COMPFILE}, it will remain to merge by hand" + echo " *** Problem upgrading ${COMPFILE}, it will remain to merge by hand" fi return - fi + ;; + esac fi if [ "${HANDLE_COMPFILE}" = "v" -o "${HANDLE_COMPFILE}" = "V" ]; then echo '' @@ -348,7 +351,7 @@ fi case "${AUTO_UPGRADE}" in '') ;; # If the option is not set no need to run the test or warn the user *) - if [ ! -f "${DESTDIR}${MTREEFILE}" ]; then + if [ ! -s "${DESTDIR}${MTREEFILE}" ]; then echo '' echo "*** Unable to find mtree database. Skipping auto-upgrade." echo '' @@ -459,14 +462,15 @@ MM_MAKE="make ${ARCHSTRING} -m ${SOURCED # Check DESTDIR against the mergemaster mtree database to see what # files the user changed from the reference files. # -CHANGED= -if [ -n "${AUTO_UPGRADE}" -a -f "${DESTDIR}${MTREEFILE}" ]; then - for file in `mtree -eq -f ${DESTDIR}${MTREEFILE} -p ${DESTDIR}/ \ +if [ -n "${AUTO_UPGRADE}" -a -s "${DESTDIR}${MTREEFILE}" ]; then + CHANGED=: + for file in `mtree -eqL -f ${DESTDIR}${MTREEFILE} -p ${DESTDIR}/ \ 2>/dev/null | awk '($2 == "changed") {print $1}'`; do if [ -f "${DESTDIR}/$file" ]; then - CHANGED="${CHANGED} ${DESTDIR}/$file" + CHANGED="${CHANGED}${DESTDIR}/${file}:" fi done + [ "$CHANGED" = ':' ] && unset CHANGED fi # Check the width of the user's terminal @@ -1049,7 +1053,7 @@ done # This is for the for way up there echo '' echo "*** Comparison complete" -if [ -f "${MTREENEW}" ]; then +if [ -s "${MTREENEW}" ]; then echo "*** Saving mtree database for future upgrades" test -e "${DESTDIR}${MTREEFILE}" && unlink ${DESTDIR}${MTREEFILE} mv ${MTREENEW} ${DESTDIR}${MTREEFILE} From owner-svn-src-stable-6@FreeBSD.ORG Thu May 28 15:28:30 2009 Return-Path: Delivered-To: svn-src-stable-6@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 37289106564A; Thu, 28 May 2009 15:28:30 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 246BC8FC16; Thu, 28 May 2009 15:28:30 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n4SFSTPr041773; Thu, 28 May 2009 15:28:29 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n4SFSTv0041772; Thu, 28 May 2009 15:28:29 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <200905281528.n4SFSTv0041772@svn.freebsd.org> From: John Baldwin Date: Thu, 28 May 2009 15:28:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-6@freebsd.org X-SVN-Group: stable-6 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r192979 - in stable/6/sys: . contrib/pf dev/cxgb dev/mpt X-BeenThere: svn-src-stable-6@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 6-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 May 2009 15:28:31 -0000 Author: jhb Date: Thu May 28 15:28:29 2009 New Revision: 192979 URL: http://svn.freebsd.org/changeset/base/192979 Log: MFC: Largely revert the earlier change to use a single CCB for the RAID recovery thread. Modified: stable/6/sys/ (props changed) stable/6/sys/contrib/pf/ (props changed) stable/6/sys/dev/cxgb/ (props changed) stable/6/sys/dev/mpt/mpt_raid.c Modified: stable/6/sys/dev/mpt/mpt_raid.c ============================================================================== --- stable/6/sys/dev/mpt/mpt_raid.c Thu May 28 15:02:52 2009 (r192978) +++ stable/6/sys/dev/mpt/mpt_raid.c Thu May 28 15:28:29 2009 (r192979) @@ -649,14 +649,15 @@ mpt_terminate_raid_thread(struct mpt_sof static void mpt_cam_rescan_callback(struct cam_periph *periph, union ccb *ccb) { + xpt_free_path(ccb->ccb_h.path); + xpt_free_ccb(ccb); } static void mpt_raid_thread(void *arg) { struct mpt_softc *mpt; - union ccb *ccb; int firstrun; #if __FreeBSD_version >= 500000 @@ -664,7 +665,6 @@ mpt_raid_thread(void *arg) #endif mpt = (struct mpt_softc *)arg; firstrun = 1; - ccb = xpt_alloc_ccb(); MPT_LOCK(mpt); while (mpt->shutdwn_raid == 0) { @@ -692,15 +692,21 @@ mpt_raid_thread(void *arg) } if (mpt->raid_rescan != 0) { + union ccb *ccb; struct cam_path *path; int error; mpt->raid_rescan = 0; + MPT_UNLOCK(mpt); + ccb = xpt_alloc_ccb(); + + MPT_LOCK(mpt); error = xpt_create_path(&path, xpt_periph, cam_sim_path(mpt->phydisk_sim), CAM_TARGET_WILDCARD, CAM_LUN_WILDCARD); if (error != CAM_REQ_CMP) { + xpt_free_ccb(ccb); mpt_prt(mpt, "Unable to rescan RAID Bus!\n"); } else { xpt_setup_ccb(&ccb->ccb_h, path, 5); @@ -713,7 +719,6 @@ mpt_raid_thread(void *arg) } } } - xpt_free_ccb(ccb); mpt->raid_thread = NULL; wakeup(&mpt->raid_thread); MPT_UNLOCK(mpt); From owner-svn-src-stable-6@FreeBSD.ORG Thu May 28 21:19:22 2009 Return-Path: Delivered-To: svn-src-stable-6@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2511C1065677; Thu, 28 May 2009 21:19:22 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1139A8FC25; Thu, 28 May 2009 21:19:22 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n4SLJLLe050138; Thu, 28 May 2009 21:19:21 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n4SLJLI9050137; Thu, 28 May 2009 21:19:21 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <200905282119.n4SLJLI9050137@svn.freebsd.org> From: Xin LI Date: Thu, 28 May 2009 21:19:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-6@freebsd.org X-SVN-Group: stable-6 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r192996 - stable/6/lib/libufs X-BeenThere: svn-src-stable-6@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 6-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 May 2009 21:19:23 -0000 Author: delphij Date: Thu May 28 21:19:21 2009 New Revision: 192996 URL: http://svn.freebsd.org/changeset/base/192996 Log: Merge r190646: Bail out when memory allocation is failed, rather than referencing a NULL pointer. PR: kern/94480 Submitted by: Michiel Pelt Modified: stable/6/lib/libufs/ (props changed) stable/6/lib/libufs/block.c Modified: stable/6/lib/libufs/block.c ============================================================================== --- stable/6/lib/libufs/block.c Thu May 28 21:17:27 2009 (r192995) +++ stable/6/lib/libufs/block.c Thu May 28 21:19:21 2009 (r192996) @@ -63,8 +63,10 @@ bread(struct uufsd *disk, ufs2_daddr_t b */ if (((intptr_t)data) & 0x3f) { p2 = malloc(size); - if (p2 == NULL) + if (p2 == NULL) { ERROR(disk, "allocate bounce buffer"); + goto fail; + } } cnt = pread(disk->d_fd, p2, size, (off_t)(blockno * disk->d_bsize)); if (cnt == -1) { @@ -114,8 +116,10 @@ bwrite(struct uufsd *disk, ufs2_daddr_t */ if (((intptr_t)data) & 0x3f) { p2 = malloc(size); - if (p2 == NULL) + if (p2 == NULL) { ERROR(disk, "allocate bounce buffer"); + return (-1); + } memcpy(p2, data, size); data = p2; } From owner-svn-src-stable-6@FreeBSD.ORG Thu May 28 21:52:36 2009 Return-Path: Delivered-To: svn-src-stable-6@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A9AE91065673; Thu, 28 May 2009 21:52:36 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 96F3C8FC08; Thu, 28 May 2009 21:52:36 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n4SLqaT7051026; Thu, 28 May 2009 21:52:36 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n4SLqanv051025; Thu, 28 May 2009 21:52:36 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <200905282152.n4SLqanv051025@svn.freebsd.org> From: Xin LI Date: Thu, 28 May 2009 21:52:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-6@freebsd.org X-SVN-Group: stable-6 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193000 - in stable/6/lib/libc: . gen inet sys X-BeenThere: svn-src-stable-6@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 6-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 May 2009 21:52:38 -0000 Author: delphij Date: Thu May 28 21:52:36 2009 New Revision: 193000 URL: http://svn.freebsd.org/changeset/base/193000 Log: Merge r192129+r190661: Properly handle malloc() failures. PR: bin/83338 Modified: stable/6/lib/libc/ (props changed) stable/6/lib/libc/gen/getcap.c stable/6/lib/libc/inet/inet_net_pton.c (props changed) stable/6/lib/libc/sys/ (props changed) Modified: stable/6/lib/libc/gen/getcap.c ============================================================================== --- stable/6/lib/libc/gen/getcap.c Thu May 28 21:52:00 2009 (r192999) +++ stable/6/lib/libc/gen/getcap.c Thu May 28 21:52:36 2009 (r193000) @@ -193,7 +193,7 @@ getent(char **cap, u_int *len, char **db { DB *capdbp; char *r_end, *rp, **db_p; - int myfd, eof, foundit, retval, clen; + int myfd, eof, foundit, retval; char *record, *cbuf; int tc_not_resolved; char pbuf[_POSIX_PATH_MAX]; @@ -255,14 +255,16 @@ getent(char **cap, u_int *len, char **db return (retval); } /* save the data; close frees it */ - clen = strlen(record); - cbuf = malloc(clen + 1); - memcpy(cbuf, record, clen + 1); + cbuf = strdup(record); if (capdbp->close(capdbp) < 0) { free(cbuf); return (-2); } - *len = clen; + if (cbuf == NULL) { + errno = ENOMEM; + return (-2); + } + *len = strlen(cbuf); *cap = cbuf; return (retval); } else {