From owner-svn-src-stable-9@FreeBSD.ORG Sun Jan 27 16:49:12 2013 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 15857645; Sun, 27 Jan 2013 16:49:12 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id E3BB4AD0; Sun, 27 Jan 2013 16:49:11 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0RGnBml007510; Sun, 27 Jan 2013 16:49:11 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0RGnBup007507; Sun, 27 Jan 2013 16:49:11 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201301271649.r0RGnBup007507@svn.freebsd.org> From: Marius Strobl Date: Sun, 27 Jan 2013 16:49:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r245981 - in stable/9/sys/sparc64: include sparc64 X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Jan 2013 16:49:12 -0000 Author: marius Date: Sun Jan 27 16:49:11 2013 New Revision: 245981 URL: http://svnweb.freebsd.org/changeset/base/245981 Log: MFC: 241780 - Give PIL_PREEMPT the lowest priority just above low/stray interrupts. The reason for this is that the SPARC v9 architecture allows nested interrupts of higher priority/level than that of the current interrupt to occur (and we can't just entirely bypass this model, also, at least for tick interrupts, this also wouldn't be wise). However, when a preemption interrupt interrupts another interrupt of lower priority, f.e. PIL_ITHREAD, and that one in turn is nested by a third interrupt, f.e. PIL_TICK, with SCHED_ULE the execution of interrupts higher than PIL_PREEMPT may be migrated to another CPU. In particular, tl1_ret(), which is responsible for restoring the state of the CPU prior to entry to the interrupt based on the (also migrated) trap frame, then is run on a CPU which actually didn't receive the interrupt in question, causing an inappropriate processor interrupt level to be "restored". In turn, this causes interrupts of the first level, i.e. PIL_ITHREAD in the above scenario, to be blocked on the target of the migration until the correct PIL happens to be restored again on that CPU again. Making PIL_PREEMPT the lowest real priority, this effectively prevents this scenario from happening, as preemption interrupts no longer can interrupt any other interrupt besides stray ones (which is no issue). Thanks to attilio@ and especially mav@ for helping me to understand this problem at the 201208DevSummit. - Give PIL_STOP (which is also used for IPI_STOP_HARD, given that there's no real equivalent to NMIs on SPARC v9) the highest possible priority just below the hardwired PIL_TICK, so it has a chance to interrupt more things. Modified: stable/9/sys/sparc64/include/intr_machdep.h stable/9/sys/sparc64/sparc64/intr_machdep.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/sparc64/include/intr_machdep.h ============================================================================== --- stable/9/sys/sparc64/include/intr_machdep.h Sun Jan 27 14:49:54 2013 (r245980) +++ stable/9/sys/sparc64/include/intr_machdep.h Sun Jan 27 16:49:11 2013 (r245981) @@ -41,14 +41,14 @@ #define IV_SHIFT 6 #define PIL_LOW 1 /* stray interrupts */ -#define PIL_ITHREAD 2 /* interrupts that use ithreads */ -#define PIL_RENDEZVOUS 3 /* smp rendezvous ipi */ -#define PIL_AST 4 /* ast ipi */ -#define PIL_STOP 5 /* stop cpu ipi */ -#define PIL_PREEMPT 6 /* preempt idle thread cpu ipi */ -#define PIL_HARDCLOCK 7 /* hardclock broadcast */ -#define PIL_FILTER 12 /* filter interrupts */ -#define PIL_BRIDGE 13 /* bridge interrupts */ +#define PIL_PREEMPT 2 /* preempt idle thread CPU IPI */ +#define PIL_ITHREAD 3 /* interrupts that use ithreads */ +#define PIL_RENDEZVOUS 4 /* SMP rendezvous IPI */ +#define PIL_AST 5 /* asynchronous trap IPI */ +#define PIL_HARDCLOCK 6 /* hardclock broadcast */ +#define PIL_FILTER 11 /* filter interrupts */ +#define PIL_BRIDGE 12 /* bridge interrupts */ +#define PIL_STOP 13 /* stop CPU IPI */ #define PIL_TICK 14 /* tick interrupts */ #ifndef LOCORE Modified: stable/9/sys/sparc64/sparc64/intr_machdep.c ============================================================================== --- stable/9/sys/sparc64/sparc64/intr_machdep.c Sun Jan 27 14:49:54 2013 (r245980) +++ stable/9/sys/sparc64/sparc64/intr_machdep.c Sun Jan 27 16:49:11 2013 (r245981) @@ -92,15 +92,15 @@ static uint16_t intr_stray_count[IV_MAX] static const char *const pil_names[] = { "stray", "low", /* PIL_LOW */ + "preempt", /* PIL_PREEMPT */ "ithrd", /* PIL_ITHREAD */ "rndzvs", /* PIL_RENDEZVOUS */ "ast", /* PIL_AST */ - "stop", /* PIL_STOP */ - "preempt", /* PIL_PREEMPT */ "hardclock", /* PIL_HARDCLOCK */ "stray", "stray", "stray", "stray", "filter", /* PIL_FILTER */ "bridge", /* PIL_BRIDGE */ + "stop", /* PIL_STOP */ "tick", /* PIL_TICK */ }; From owner-svn-src-stable-9@FreeBSD.ORG Sun Jan 27 17:13:12 2013 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 8AB73E86; Sun, 27 Jan 2013 17:13:12 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 60B77C00; Sun, 27 Jan 2013 17:13:12 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0RHDCjS016116; Sun, 27 Jan 2013 17:13:12 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0RHDBQm016110; Sun, 27 Jan 2013 17:13:11 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201301271713.r0RHDBQm016110@svn.freebsd.org> From: Marius Strobl Date: Sun, 27 Jan 2013 17:13:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r245983 - stable/9/sys/dev/mpt X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Jan 2013 17:13:12 -0000 Author: marius Date: Sun Jan 27 17:13:11 2013 New Revision: 245983 URL: http://svnweb.freebsd.org/changeset/base/245983 Log: MFC: r241874 After r241858 (MFC'ed to stable/9 in r242286), remove the remainder of FreeBSD ~4 support from mpt(4). Modified: stable/9/sys/dev/mpt/mpt.c stable/9/sys/dev/mpt/mpt.h stable/9/sys/dev/mpt/mpt_cam.c stable/9/sys/dev/mpt/mpt_debug.c stable/9/sys/dev/mpt/mpt_raid.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/mpt/mpt.c ============================================================================== --- stable/9/sys/dev/mpt/mpt.c Sun Jan 27 16:49:13 2013 (r245982) +++ stable/9/sys/dev/mpt/mpt.c Sun Jan 27 17:13:11 2013 (r245983) @@ -286,10 +286,8 @@ mpt_modevent(module_t mod, int type, voi } case MOD_SHUTDOWN: break; -#if __FreeBSD_version >= 500000 case MOD_QUIESCE: break; -#endif case MOD_UNLOAD: error = pers->unload(pers); mpt_personalities[pers->id] = NULL; @@ -1471,15 +1469,9 @@ mpt_recv_handshake_reply(struct mpt_soft */ if ((reply_len >> 1) != hdr->MsgLength && (hdr->Function != MPI_FUNCTION_IOC_FACTS)){ -#if __FreeBSD_version >= 500000 mpt_prt(mpt, "reply length does not match message length: " "got %x; expected %zx for function %x\n", hdr->MsgLength << 2, reply_len << 1, hdr->Function); -#else - mpt_prt(mpt, "reply length does not match message length: " - "got %x; expected %x for function %x\n", - hdr->MsgLength << 2, reply_len << 1, hdr->Function); -#endif } /* Get rest of the reply; but don't overflow the provided buffer */ @@ -2155,7 +2147,6 @@ mpt_disable_ints(struct mpt_softc *mpt) static void mpt_sysctl_attach(struct mpt_softc *mpt) { -#if __FreeBSD_version >= 500000 struct sysctl_ctx_list *ctx = device_get_sysctl_ctx(mpt->dev); struct sysctl_oid *tree = device_get_sysctl_tree(mpt->dev); @@ -2170,7 +2161,6 @@ mpt_sysctl_attach(struct mpt_softc *mpt) "failure_id", CTLFLAG_RW, &mpt->failure_id, -1, "Next Target to Fail"); #endif -#endif } int Modified: stable/9/sys/dev/mpt/mpt.h ============================================================================== --- stable/9/sys/dev/mpt/mpt.h Sun Jan 27 16:49:13 2013 (r245982) +++ stable/9/sys/dev/mpt/mpt.h Sun Jan 27 17:13:11 2013 (r245983) @@ -100,52 +100,34 @@ #define _MPT_H_ /********************************* OS Includes ********************************/ -#include #include #include +#include +#include #include #include -#if __FreeBSD_version < 500000 #include -#include -#include -#include -#else #include -#include -#include #include +#include #include -#include -#endif #include -#include -#include +#include +#include +#include +#include #include #include -#if __FreeBSD_version < 500000 -#include -#include -#endif - #ifdef __sparc64__ #include #include #endif -#include - -#if __FreeBSD_version < 500000 -#include -#include -#else #include #include -#endif -#include #include "opt_ddb.h" /**************************** Register Definitions ****************************/ @@ -241,7 +223,6 @@ int mpt_modevent(module_t, int, void *); #if __FreeBSD_version < 600000 #define bus_get_dma_tag(x) NULL #endif -#if __FreeBSD_version >= 501102 #define mpt_dma_tag_create(mpt, parent_tag, alignment, boundary, \ lowaddr, highaddr, filter, filterarg, \ maxsize, nsegments, maxsegsz, flags, \ @@ -251,17 +232,6 @@ int mpt_modevent(module_t, int, void *); maxsize, nsegments, maxsegsz, flags, \ busdma_lock_mutex, &(mpt)->mpt_lock, \ dma_tagp) -#else -#define mpt_dma_tag_create(mpt, parent_tag, alignment, boundary, \ - lowaddr, highaddr, filter, filterarg, \ - maxsize, nsegments, maxsegsz, flags, \ - dma_tagp) \ - bus_dma_tag_create(parent_tag, alignment, boundary, \ - lowaddr, highaddr, filter, filterarg, \ - maxsize, nsegments, maxsegsz, flags, \ - dma_tagp) -#endif - struct mpt_map_info { struct mpt_softc *mpt; int error; @@ -291,14 +261,9 @@ void mpt_map_rquest(void *, bus_dma_segm kproc_create(func, farg, proc_ptr, flags, stackpgs, fmtstr, arg) #define mpt_kthread_exit(status) \ kproc_exit(status) -#elif __FreeBSD_version > 500005 -#define mpt_kthread_create(func, farg, proc_ptr, flags, stackpgs, fmtstr, arg) \ - kthread_create(func, farg, proc_ptr, flags, stackpgs, fmtstr, arg) -#define mpt_kthread_exit(status) \ - kthread_exit(status) #else #define mpt_kthread_create(func, farg, proc_ptr, flags, stackpgs, fmtstr, arg) \ - kthread_create(func, farg, proc_ptr, fmtstr, arg) + kthread_create(func, farg, proc_ptr, flags, stackpgs, fmtstr, arg) #define mpt_kthread_exit(status) \ kthread_exit(status) #endif @@ -599,13 +564,8 @@ struct mptsas_portinfo { struct mpt_softc { device_t dev; -#if __FreeBSD_version < 500000 - uint32_t mpt_islocked; - int mpt_splsaved; -#else struct mtx mpt_lock; int mpt_locksetup; -#endif uint32_t mpt_pers_mask; uint32_t : 7, @@ -676,7 +636,6 @@ struct mpt_softc { #define mpt_fcport_speed cfg.fc._port_speed } fc; } cfg; -#if __FreeBSD_version >= 500000 /* * Device config information stored up for sysctl to access */ @@ -689,7 +648,6 @@ struct mpt_softc { char wwpn[19]; } fc; } scinfo; -#endif /* Controller Info for RAID information */ CONFIG_PAGE_IOC_2 * ioc_page2; @@ -830,74 +788,6 @@ mpt_assign_serno(struct mpt_softc *mpt, } /***************************** Locking Primitives *****************************/ -#if __FreeBSD_version < 500000 -#define MPT_IFLAGS INTR_TYPE_CAM -#define MPT_LOCK(mpt) mpt_lockspl(mpt) -#define MPT_UNLOCK(mpt) mpt_unlockspl(mpt) -#define MPT_OWNED(mpt) mpt->mpt_islocked -#define MPT_LOCK_ASSERT(mpt) -#define MPTLOCK_2_CAMLOCK MPT_UNLOCK -#define CAMLOCK_2_MPTLOCK MPT_LOCK -#define MPT_LOCK_SETUP(mpt) -#define MPT_LOCK_DESTROY(mpt) - -static __inline void mpt_lockspl(struct mpt_softc *mpt); -static __inline void mpt_unlockspl(struct mpt_softc *mpt); - -static __inline void -mpt_lockspl(struct mpt_softc *mpt) -{ - int s; - - s = splcam(); - if (mpt->mpt_islocked++ == 0) { - mpt->mpt_splsaved = s; - } else { - splx(s); - panic("Recursed lock with mask: 0x%x", s); - } -} - -static __inline void -mpt_unlockspl(struct mpt_softc *mpt) -{ - if (mpt->mpt_islocked) { - if (--mpt->mpt_islocked == 0) { - splx(mpt->mpt_splsaved); - } - } else - panic("Negative lock count"); -} - -static __inline int -mpt_sleep(struct mpt_softc *mpt, void *ident, int priority, - const char *wmesg, int timo) -{ - int saved_cnt; - int saved_spl; - int error; - - KASSERT(mpt->mpt_islocked <= 1, ("Invalid lock count on tsleep")); - saved_cnt = mpt->mpt_islocked; - saved_spl = mpt->mpt_splsaved; - mpt->mpt_islocked = 0; - error = tsleep(ident, priority, wmesg, timo); - KASSERT(mpt->mpt_islocked == 0, ("Invalid lock count on wakeup")); - mpt->mpt_islocked = saved_cnt; - mpt->mpt_splsaved = saved_spl; - return (error); -} - -#define mpt_req_timeout(req, ticks, func, arg) \ - callout_reset(&(req)->callout, (ticks), (func), (arg)); -#define mpt_req_untimeout(req, func, arg) \ - callout_stop(&(req)->callout) -#define mpt_callout_init(mpt, c) \ - callout_init(c) -#define mpt_callout_drain(mpt, c) \ - callout_stop(c) - -#else #if 1 #define MPT_IFLAGS INTR_TYPE_CAM | INTR_ENTROPY | INTR_MPSAFE #define MPT_LOCK_SETUP(mpt) \ @@ -957,7 +847,6 @@ mpt_sleep(struct mpt_softc *mpt, void *i return (r); } #endif -#endif /******************************* Register Access ******************************/ static __inline void mpt_write(struct mpt_softc *, size_t, uint32_t); @@ -1098,7 +987,6 @@ enum { MPT_PRT_NONE=100 }; -#if __FreeBSD_version > 500000 #define mpt_lprt(mpt, level, ...) \ do { \ if (level <= (mpt)->verbose) \ @@ -1112,14 +1000,7 @@ do { \ mpt_prtc(mpt, __VA_ARGS__); \ } while (0) #endif -#else -void mpt_lprt(struct mpt_softc *, int, const char *, ...) - __printflike(3, 4); -#if 0 -void mpt_lprtc(struct mpt_softc *, int, const char *, ...) - __printflike(3, 4); -#endif -#endif + void mpt_prt(struct mpt_softc *, const char *, ...) __printflike(2, 3); void mpt_prtc(struct mpt_softc *, const char *, ...) Modified: stable/9/sys/dev/mpt/mpt_cam.c ============================================================================== --- stable/9/sys/dev/mpt/mpt_cam.c Sun Jan 27 16:49:13 2013 (r245982) +++ stable/9/sys/dev/mpt/mpt_cam.c Sun Jan 27 17:13:11 2013 (r245983) @@ -105,11 +105,10 @@ __FBSDID("$FreeBSD$"); #include "dev/mpt/mpilib/mpi_targ.h" #include "dev/mpt/mpilib/mpi_fc.h" #include "dev/mpt/mpilib/mpi_sas.h" -#if __FreeBSD_version >= 500000 -#include -#endif + #include #include +#include #if __FreeBSD_version >= 700025 #ifndef CAM_NEW_TRAN_CODE @@ -125,7 +124,6 @@ mpt_get_spi_settings(struct mpt_softc *, static void mpt_setwidth(struct mpt_softc *, int, int); static void mpt_setsync(struct mpt_softc *, int, int, int); static int mpt_update_spi_config(struct mpt_softc *, int); -static void mpt_calc_geometry(struct ccb_calc_geometry *ccg, int extended); static mpt_reply_handler_t mpt_scsi_reply_handler; static mpt_reply_handler_t mpt_scsi_tmf_reply_handler; @@ -416,6 +414,8 @@ cleanup: static int mpt_read_config_info_fc(struct mpt_softc *mpt) { + struct sysctl_ctx_list *ctx; + struct sysctl_oid *tree; char *topology = NULL; int rv; @@ -473,33 +473,27 @@ mpt_read_config_info_fc(struct mpt_softc mpt->mpt_fcport_page0.WWPN.High, mpt->mpt_fcport_page0.WWPN.Low, mpt->mpt_fcport_speed); -#if __FreeBSD_version >= 500000 MPT_UNLOCK(mpt); - { - struct sysctl_ctx_list *ctx = device_get_sysctl_ctx(mpt->dev); - struct sysctl_oid *tree = device_get_sysctl_tree(mpt->dev); + ctx = device_get_sysctl_ctx(mpt->dev); + tree = device_get_sysctl_tree(mpt->dev); - snprintf(mpt->scinfo.fc.wwnn, - sizeof (mpt->scinfo.fc.wwnn), "0x%08x%08x", - mpt->mpt_fcport_page0.WWNN.High, - mpt->mpt_fcport_page0.WWNN.Low); - - snprintf(mpt->scinfo.fc.wwpn, - sizeof (mpt->scinfo.fc.wwpn), "0x%08x%08x", - mpt->mpt_fcport_page0.WWPN.High, - mpt->mpt_fcport_page0.WWPN.Low); - - SYSCTL_ADD_STRING(ctx, SYSCTL_CHILDREN(tree), OID_AUTO, - "wwnn", CTLFLAG_RD, mpt->scinfo.fc.wwnn, 0, - "World Wide Node Name"); - - SYSCTL_ADD_STRING(ctx, SYSCTL_CHILDREN(tree), OID_AUTO, - "wwpn", CTLFLAG_RD, mpt->scinfo.fc.wwpn, 0, - "World Wide Port Name"); + snprintf(mpt->scinfo.fc.wwnn, sizeof (mpt->scinfo.fc.wwnn), + "0x%08x%08x", mpt->mpt_fcport_page0.WWNN.High, + mpt->mpt_fcport_page0.WWNN.Low); + + snprintf(mpt->scinfo.fc.wwpn, sizeof (mpt->scinfo.fc.wwpn), + "0x%08x%08x", mpt->mpt_fcport_page0.WWPN.High, + mpt->mpt_fcport_page0.WWPN.Low); + + SYSCTL_ADD_STRING(ctx, SYSCTL_CHILDREN(tree), OID_AUTO, + "wwnn", CTLFLAG_RD, mpt->scinfo.fc.wwnn, 0, + "World Wide Node Name"); + + SYSCTL_ADD_STRING(ctx, SYSCTL_CHILDREN(tree), OID_AUTO, + "wwpn", CTLFLAG_RD, mpt->scinfo.fc.wwpn, 0, + "World Wide Port Name"); - } MPT_LOCK(mpt); -#endif return (0); } @@ -1246,9 +1240,6 @@ mpt_timeout(void *arg) ccb = (union ccb *)arg; mpt = ccb->ccb_h.ccb_mpt_ptr; -#if __FreeBSD_version < 500000 - MPT_LOCK(mpt); -#endif MPT_LOCK_ASSERT(mpt); req = ccb->ccb_h.ccb_req_ptr; mpt_prt(mpt, "request %p:%u timed out for ccb %p (req->ccb %p)\n", req, @@ -1260,9 +1251,6 @@ mpt_timeout(void *arg) req->state |= REQ_STATE_TIMEDOUT; mpt_wakeup_recovery_thread(mpt); } -#if __FreeBSD_version < 500000 - MPT_UNLOCK(mpt); -#endif } /* @@ -3660,7 +3648,7 @@ mpt_action(struct cam_sim *sim, union cc mpt_set_ccb_status(ccb, CAM_REQ_INVALID); break; } - mpt_calc_geometry(ccg, /*extended*/1); + cam_calc_geometry(ccg, /* extended */ 1); KASSERT(ccb->ccb_h.status, ("zero ccb sts at %d", __LINE__)); break; } @@ -4022,33 +4010,6 @@ mpt_update_spi_config(struct mpt_softc * return (0); } -static void -mpt_calc_geometry(struct ccb_calc_geometry *ccg, int extended) -{ -#if __FreeBSD_version >= 500000 - cam_calc_geometry(ccg, extended); -#else - uint32_t size_mb; - uint32_t secs_per_cylinder; - - if (ccg->block_size == 0) { - ccg->ccb_h.status = CAM_REQ_INVALID; - return; - } - size_mb = ccg->volume_size / ((1024L * 1024L) / ccg->block_size); - if (size_mb > 1024 && extended) { - ccg->heads = 255; - ccg->secs_per_track = 63; - } else { - ccg->heads = 64; - ccg->secs_per_track = 32; - } - secs_per_cylinder = ccg->heads * ccg->secs_per_track; - ccg->cylinders = ccg->volume_size / secs_per_cylinder; - ccg->ccb_h.status = CAM_REQ_CMP; -#endif -} - /****************************** Timeout Recovery ******************************/ static int mpt_spawn_recovery_thread(struct mpt_softc *mpt) Modified: stable/9/sys/dev/mpt/mpt_debug.c ============================================================================== --- stable/9/sys/dev/mpt/mpt_debug.c Sun Jan 27 16:49:13 2013 (r245982) +++ stable/9/sys/dev/mpt/mpt_debug.c Sun Jan 27 17:13:11 2013 (r245983) @@ -518,6 +518,7 @@ mpt_print_reply(void *vmsg) static void mpt_print_request_hdr(MSG_REQUEST_HEADER *req) { + printf("%s @ %p\n", mpt_ioc_function(req->Function), req); printf("\tChain Offset 0x%02x\n", req->ChainOffset); printf("\tMsgFlags 0x%02x\n", req->MsgFlags); @@ -841,13 +842,8 @@ mpt_dump_request(struct mpt_softc *mpt, uint32_t *pReq = req->req_vbuf; int o; -#if __FreeBSD_version >= 500000 mpt_prt(mpt, "Send Request %d (%jx):", req->index, (uintmax_t) req->req_pbuf); -#else - mpt_prt(mpt, "Send Request %d (%llx):", - req->index, (unsigned long long) req->req_pbuf); -#endif for (o = 0; o < mpt->ioc_facts.RequestFrameSize; o++) { if ((o & 0x7) == 0) { mpt_prtc(mpt, "\n"); @@ -858,33 +854,6 @@ mpt_dump_request(struct mpt_softc *mpt, mpt_prtc(mpt, "\n"); } -#if __FreeBSD_version < 500000 -void -mpt_lprt(struct mpt_softc *mpt, int level, const char *fmt, ...) -{ - va_list ap; - if (level <= mpt->verbose) { - printf("%s: ", device_get_nameunit(mpt->dev)); - va_start(ap, fmt); - vprintf(fmt, ap); - va_end(ap); - } -} - -#if 0 -void -mpt_lprtc(struct mpt_softc *mpt, int level, const char *fmt, ...) -{ - va_list ap; - if (level <= mpt->verbose) { - va_start(ap, fmt); - vprintf(fmt, ap); - va_end(ap); - } -} -#endif -#endif - void mpt_prt(struct mpt_softc *mpt, const char *fmt, ...) { Modified: stable/9/sys/dev/mpt/mpt_raid.c ============================================================================== --- stable/9/sys/dev/mpt/mpt_raid.c Sun Jan 27 16:49:13 2013 (r245982) +++ stable/9/sys/dev/mpt/mpt_raid.c Sun Jan 27 17:13:11 2013 (r245983) @@ -51,15 +51,10 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include -#if __FreeBSD_version < 500000 -#include -#define GIANT_REQUIRED -#endif -#include - #include #include #include @@ -118,11 +113,7 @@ static void mpt_enable_vol(struct mpt_so static void mpt_verify_mwce(struct mpt_softc *, struct mpt_raid_volume *); static void mpt_adjust_queue_depth(struct mpt_softc *, struct mpt_raid_volume *, struct cam_path *); -#if __FreeBSD_version < 500000 -#define mpt_raid_sysctl_attach(x) do { } while (0) -#else static void mpt_raid_sysctl_attach(struct mpt_softc *); -#endif static const char *mpt_vol_type(struct mpt_raid_volume *vol); static const char *mpt_vol_state(struct mpt_raid_volume *vol); @@ -1520,15 +1511,9 @@ mpt_refresh_raid_data(struct mpt_softc * mpt_vol_prt(mpt, mpt_vol, "%s Priority Re-Sync\n", prio ? "High" : "Low"); } -#if __FreeBSD_version >= 500000 mpt_vol_prt(mpt, mpt_vol, "%ju of %ju " "blocks remaining\n", (uintmax_t)left, (uintmax_t)total); -#else - mpt_vol_prt(mpt, mpt_vol, "%llu of %llu " - "blocks remaining\n", (uint64_t)left, - (uint64_t)total); -#endif /* Periodically report on sync progress. */ mpt_schedule_raid_refresh(mpt); @@ -1593,14 +1578,8 @@ mpt_raid_timer(void *arg) struct mpt_softc *mpt; mpt = (struct mpt_softc *)arg; -#if __FreeBSD_version < 500000 - MPT_LOCK(mpt); -#endif MPT_LOCK_ASSERT(mpt); mpt_raid_wakeup(mpt); -#if __FreeBSD_version < 500000 - MPT_UNLOCK(mpt); -#endif } static void @@ -1644,7 +1623,6 @@ mpt_raid_free_mem(struct mpt_softc *mpt) mpt->raid_max_disks = 0; } -#if __FreeBSD_version >= 500000 static int mpt_raid_set_vol_resync_rate(struct mpt_softc *mpt, u_int rate) { @@ -1869,4 +1847,3 @@ mpt_raid_sysctl_attach(struct mpt_softc &mpt->raid_nonopt_volumes, 0, "number of nonoptimal volumes"); } -#endif From owner-svn-src-stable-9@FreeBSD.ORG Sun Jan 27 17:15:57 2013 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 4C243356; Sun, 27 Jan 2013 17:15:57 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 3C28FC2B; Sun, 27 Jan 2013 17:15:57 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0RHFvW8016698; Sun, 27 Jan 2013 17:15:57 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0RHFuAx016692; Sun, 27 Jan 2013 17:15:56 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201301271715.r0RHFuAx016692@svn.freebsd.org> From: Marius Strobl Date: Sun, 27 Jan 2013 17:15:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r245986 - stable/9/sys/dev/mpt X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Jan 2013 17:15:57 -0000 Author: marius Date: Sun Jan 27 17:15:56 2013 New Revision: 245986 URL: http://svnweb.freebsd.org/changeset/base/245986 Log: MFC: r241875 Remove support for using Giant for locking within mpt(4). Finer grained locking has been working fine for ~5.5 years by now. Modified: stable/9/sys/dev/mpt/mpt.h stable/9/sys/dev/mpt/mpt_cam.c stable/9/sys/dev/mpt/mpt_raid.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/mpt/mpt.h ============================================================================== --- stable/9/sys/dev/mpt/mpt.h Sun Jan 27 17:13:21 2013 (r245985) +++ stable/9/sys/dev/mpt/mpt.h Sun Jan 27 17:15:56 2013 (r245986) @@ -788,7 +788,6 @@ mpt_assign_serno(struct mpt_softc *mpt, } /***************************** Locking Primitives *****************************/ -#if 1 #define MPT_IFLAGS INTR_TYPE_CAM | INTR_ENTROPY | INTR_MPSAFE #define MPT_LOCK_SETUP(mpt) \ mtx_init(&mpt->mpt_lock, "mpt", NULL, MTX_DEF); \ @@ -803,8 +802,6 @@ mpt_assign_serno(struct mpt_softc *mpt, #define MPT_UNLOCK(mpt) mtx_unlock(&(mpt)->mpt_lock) #define MPT_OWNED(mpt) mtx_owned(&(mpt)->mpt_lock) #define MPT_LOCK_ASSERT(mpt) mtx_assert(&(mpt)->mpt_lock, MA_OWNED) -#define MPTLOCK_2_CAMLOCK(mpt) -#define CAMLOCK_2_MPTLOCK(mpt) #define mpt_sleep(mpt, ident, priority, wmesg, timo) \ msleep(ident, &(mpt)->mpt_lock, priority, wmesg, timo) #define mpt_req_timeout(req, ticks, func, arg) \ @@ -816,38 +813,6 @@ mpt_assign_serno(struct mpt_softc *mpt, #define mpt_callout_drain(mpt, c) \ callout_drain(c) -#else - -#define MPT_IFLAGS INTR_TYPE_CAM | INTR_ENTROPY -#define MPT_LOCK_SETUP(mpt) do { } while (0) -#define MPT_LOCK_DESTROY(mpt) do { } while (0) -#define MPT_LOCK_ASSERT(mpt) mtx_assert(&Giant, MA_OWNED) -#define MPT_LOCK(mpt) mtx_lock(&Giant) -#define MPT_UNLOCK(mpt) mtx_unlock(&Giant) -#define MPTLOCK_2_CAMLOCK(mpt) -#define CAMLOCK_2_MPTLOCK(mpt) - -#define mpt_req_timeout(req, ticks, func, arg) \ - callout_reset(&(req)->callout, (ticks), (func), (arg)) -#define mpt_req_untimeout(req, func, arg) \ - callout_stop(&(req)->callout) -#define mpt_callout_init(mpt, c) \ - callout_init(c, 0) -#define mpt_callout_drain(mpt, c) \ - callout_drain(c) - -static __inline int -mpt_sleep(struct mpt_softc *, void *, int, const char *, int); - -static __inline int -mpt_sleep(struct mpt_softc *mpt, void *i, int p, const char *w, int t) -{ - int r; - r = tsleep(i, p, w, t); - return (r); -} -#endif - /******************************* Register Access ******************************/ static __inline void mpt_write(struct mpt_softc *, size_t, uint32_t); static __inline uint32_t mpt_read(struct mpt_softc *, int); Modified: stable/9/sys/dev/mpt/mpt_cam.c ============================================================================== --- stable/9/sys/dev/mpt/mpt_cam.c Sun Jan 27 17:13:21 2013 (r245985) +++ stable/9/sys/dev/mpt/mpt_cam.c Sun Jan 27 17:15:56 2013 (r245986) @@ -1347,9 +1347,7 @@ bad: ccb->ccb_h.status &= ~CAM_SIM_QUEUED; KASSERT(ccb->ccb_h.status, ("zero ccb sts at %d", __LINE__)); xpt_done(ccb); - CAMLOCK_2_MPTLOCK(mpt); mpt_free_request(mpt, req); - MPTLOCK_2_CAMLOCK(mpt); return; } @@ -1583,9 +1581,7 @@ bad: if (seg < nseg && nxt_off >= MPT_REQUEST_AREA) { request_t *nrq; - CAMLOCK_2_MPTLOCK(mpt); nrq = mpt_get_request(mpt, FALSE); - MPTLOCK_2_CAMLOCK(mpt); if (nrq == NULL) { error = ENOMEM; @@ -1633,9 +1629,7 @@ out: ccb->ccb_h.status &= ~CAM_SIM_QUEUED; KASSERT(ccb->ccb_h.status, ("zero ccb sts at %d", __LINE__)); xpt_done(ccb); - CAMLOCK_2_MPTLOCK(mpt); mpt_free_request(mpt, req); - MPTLOCK_2_CAMLOCK(mpt); return; } @@ -1667,9 +1661,7 @@ out: tgt->state = TGT_STATE_MOVING_DATA; #endif } - CAMLOCK_2_MPTLOCK(mpt); mpt_send_cmd(mpt, req); - MPTLOCK_2_CAMLOCK(mpt); } static void @@ -1758,9 +1750,7 @@ bad: ccb->ccb_h.status &= ~CAM_SIM_QUEUED; KASSERT(ccb->ccb_h.status, ("zero ccb sts at %d", __LINE__)); xpt_done(ccb); - CAMLOCK_2_MPTLOCK(mpt); mpt_free_request(mpt, req); - MPTLOCK_2_CAMLOCK(mpt); return; } @@ -1978,9 +1968,7 @@ bad: if (seg < nseg && nxt_off >= MPT_REQUEST_AREA) { request_t *nrq; - CAMLOCK_2_MPTLOCK(mpt); nrq = mpt_get_request(mpt, FALSE); - MPTLOCK_2_CAMLOCK(mpt); if (nrq == NULL) { error = ENOMEM; @@ -2028,9 +2016,7 @@ out: ccb->ccb_h.status &= ~CAM_SIM_QUEUED; KASSERT(ccb->ccb_h.status, ("zero ccb sts at %d", __LINE__)); xpt_done(ccb); - CAMLOCK_2_MPTLOCK(mpt); mpt_free_request(mpt, req); - MPTLOCK_2_CAMLOCK(mpt); return; } @@ -2062,9 +2048,7 @@ out: tgt->state = TGT_STATE_MOVING_DATA; #endif } - CAMLOCK_2_MPTLOCK(mpt); mpt_send_cmd(mpt, req); - MPTLOCK_2_CAMLOCK(mpt); } static void @@ -2083,7 +2067,6 @@ mpt_start(struct cam_sim *sim, union ccb mpt = ccb->ccb_h.ccb_mpt_ptr; raid_passthru = (sim == mpt->phydisk_sim); - CAMLOCK_2_MPTLOCK(mpt); if ((req = mpt_get_request(mpt, FALSE)) == NULL) { if (mpt->outofbeer == 0) { mpt->outofbeer = 1; @@ -2092,14 +2075,12 @@ mpt_start(struct cam_sim *sim, union ccb } ccb->ccb_h.status &= ~CAM_SIM_QUEUED; mpt_set_ccb_status(ccb, CAM_REQUEUE_REQ); - MPTLOCK_2_CAMLOCK(mpt); xpt_done(ccb); return; } #ifdef INVARIANTS mpt_req_not_spcl(mpt, req, "mpt_start", __LINE__); #endif - MPTLOCK_2_CAMLOCK(mpt); if (sizeof (bus_addr_t) > 4) { cb = mpt_execute_req_a64; @@ -2121,15 +2102,12 @@ mpt_start(struct cam_sim *sim, union ccb mpt_req->Function = MPI_FUNCTION_SCSI_IO_REQUEST; if (raid_passthru) { mpt_req->Function = MPI_FUNCTION_RAID_SCSI_IO_PASSTHROUGH; - CAMLOCK_2_MPTLOCK(mpt); if (mpt_map_physdisk(mpt, ccb, &tgt) != 0) { - MPTLOCK_2_CAMLOCK(mpt); ccb->ccb_h.status &= ~CAM_SIM_QUEUED; mpt_set_ccb_status(ccb, CAM_DEV_NOT_THERE); xpt_done(ccb); return; } - MPTLOCK_2_CAMLOCK(mpt); mpt_req->Bus = 0; /* we never set bus here */ } else { tgt = ccb->ccb_h.target_id; @@ -2424,7 +2402,6 @@ mpt_cam_event(struct mpt_softc *mpt, req } else { pathid = cam_sim_path(mpt->sim); } - MPTLOCK_2_CAMLOCK(mpt); /* * Allocate a CCB, create a wildcard path for this bus, * and schedule a rescan. @@ -2432,19 +2409,16 @@ mpt_cam_event(struct mpt_softc *mpt, req ccb = xpt_alloc_ccb_nowait(); if (ccb == NULL) { mpt_prt(mpt, "unable to alloc CCB for rescan\n"); - CAMLOCK_2_MPTLOCK(mpt); break; } if (xpt_create_path(&ccb->ccb_h.path, xpt_periph, pathid, CAM_TARGET_WILDCARD, CAM_LUN_WILDCARD) != CAM_REQ_CMP) { - CAMLOCK_2_MPTLOCK(mpt); mpt_prt(mpt, "unable to create path for rescan\n"); xpt_free_ccb(ccb); break; } xpt_rescan(ccb); - CAMLOCK_2_MPTLOCK(mpt); break; } #else @@ -2541,13 +2515,11 @@ mpt_cam_event(struct mpt_softc *mpt, req } else { sim = mpt->sim; } - MPTLOCK_2_CAMLOCK(mpt); for (lun_id = 0; lun_id < MPT_MAX_LUNS; lun_id++) { if (xpt_create_path(&tmppath, NULL, cam_sim_path(sim), pqf->TargetID, lun_id) != CAM_REQ_CMP) { mpt_prt(mpt, "unable to create a path to send " "XPT_REL_SIMQ"); - CAMLOCK_2_MPTLOCK(mpt); break; } xpt_setup_ccb(&crs.ccb_h, tmppath, 5); @@ -2561,7 +2533,6 @@ mpt_cam_event(struct mpt_softc *mpt, req } xpt_free_path(tmppath); } - CAMLOCK_2_MPTLOCK(mpt); break; } case MPI_EVENT_IR_RESYNC_UPDATE: @@ -2583,39 +2554,32 @@ mpt_cam_event(struct mpt_softc *mpt, req sim = mpt->sim; switch(psdsc->ReasonCode) { case MPI_EVENT_SAS_DEV_STAT_RC_ADDED: - MPTLOCK_2_CAMLOCK(mpt); ccb = xpt_alloc_ccb_nowait(); if (ccb == NULL) { mpt_prt(mpt, "unable to alloc CCB for rescan\n"); - CAMLOCK_2_MPTLOCK(mpt); break; } if (xpt_create_path(&ccb->ccb_h.path, xpt_periph, cam_sim_path(sim), psdsc->TargetID, CAM_LUN_WILDCARD) != CAM_REQ_CMP) { - CAMLOCK_2_MPTLOCK(mpt); mpt_prt(mpt, "unable to create path for rescan\n"); xpt_free_ccb(ccb); break; } xpt_rescan(ccb); - CAMLOCK_2_MPTLOCK(mpt); break; case MPI_EVENT_SAS_DEV_STAT_RC_NOT_RESPONDING: - MPTLOCK_2_CAMLOCK(mpt); if (xpt_create_path(&tmppath, NULL, cam_sim_path(sim), psdsc->TargetID, CAM_LUN_WILDCARD) != CAM_REQ_CMP) { mpt_prt(mpt, "unable to create path for async event"); - CAMLOCK_2_MPTLOCK(mpt); break; } xpt_async(AC_LOST_DEVICE, tmppath, NULL); xpt_free_path(tmppath); - CAMLOCK_2_MPTLOCK(mpt); break; case MPI_EVENT_SAS_DEV_STAT_RC_CMPL_INTERNAL_DEV_RESET: case MPI_EVENT_SAS_DEV_STAT_RC_CMPL_TASK_ABORT_INTERNAL: @@ -2735,9 +2699,7 @@ mpt_scsi_reply_handler(struct mpt_softc req, req->serno); } KASSERT(ccb->ccb_h.status, ("zero ccb sts at %d", __LINE__)); - MPTLOCK_2_CAMLOCK(mpt); xpt_done(ccb); - CAMLOCK_2_MPTLOCK(mpt); if ((req->state & REQ_STATE_TIMEDOUT) == 0) { TAILQ_REMOVE(&mpt->request_pending_list, req, links); } else { @@ -3323,15 +3285,12 @@ mpt_action(struct cam_sim *sim, union cc ccb->ccb_h.func_code != XPT_PATH_INQ && ccb->ccb_h.func_code != XPT_RESET_BUS && ccb->ccb_h.func_code != XPT_RESET_DEV) { - CAMLOCK_2_MPTLOCK(mpt); if (mpt_map_physdisk(mpt, ccb, &tgt) != 0) { - MPTLOCK_2_CAMLOCK(mpt); ccb->ccb_h.status &= ~CAM_SIM_QUEUED; mpt_set_ccb_status(ccb, CAM_DEV_NOT_THERE); xpt_done(ccb); return; } - MPTLOCK_2_CAMLOCK(mpt); } ccb->ccb_h.ccb_mpt_ptr = mpt; @@ -3380,9 +3339,7 @@ mpt_action(struct cam_sim *sim, union cc } else { xpt_print(ccb->ccb_h.path, "reset device\n"); } - CAMLOCK_2_MPTLOCK(mpt); (void) mpt_bus_reset(mpt, tgt, lun, FALSE); - MPTLOCK_2_CAMLOCK(mpt); /* * mpt_bus_reset is always successful in that it @@ -3396,7 +3353,6 @@ mpt_action(struct cam_sim *sim, union cc case XPT_ABORT: { union ccb *accb = ccb->cab.abort_ccb; - CAMLOCK_2_MPTLOCK(mpt); switch (accb->ccb_h.func_code) { case XPT_ACCEPT_TARGET_IO: case XPT_IMMEDIATE_NOTIFY: @@ -3413,7 +3369,6 @@ mpt_action(struct cam_sim *sim, union cc ccb->ccb_h.status = CAM_REQ_INVALID; break; } - MPTLOCK_2_CAMLOCK(mpt); break; } @@ -3553,7 +3508,6 @@ mpt_action(struct cam_sim *sim, union cc period >>= MPI_SCSIDEVPAGE1_RP_SHIFT_MIN_SYNC_PERIOD; } #endif - CAMLOCK_2_MPTLOCK(mpt); if (dval & DP_DISC_ENABLE) { mpt->mpt_disc_enable |= (1 << tgt); } else if (dval & DP_DISC_DISABL) { @@ -3571,7 +3525,6 @@ mpt_action(struct cam_sim *sim, union cc mpt_setsync(mpt, tgt, period, offset); } if (dval == 0) { - MPTLOCK_2_CAMLOCK(mpt); mpt_set_ccb_status(ccb, CAM_REQ_CMP); break; } @@ -3583,7 +3536,6 @@ mpt_action(struct cam_sim *sim, union cc } else { mpt_set_ccb_status(ccb, CAM_REQ_CMP); } - MPTLOCK_2_CAMLOCK(mpt); break; } case XPT_GET_TRAN_SETTINGS: @@ -3758,14 +3710,12 @@ mpt_action(struct cam_sim *sim, union cc { int result; - CAMLOCK_2_MPTLOCK(mpt); if (ccb->cel.enable) result = mpt_enable_lun(mpt, ccb->ccb_h.target_id, ccb->ccb_h.target_lun); else result = mpt_disable_lun(mpt, ccb->ccb_h.target_id, ccb->ccb_h.target_lun); - MPTLOCK_2_CAMLOCK(mpt); if (result == 0) { mpt_set_ccb_status(ccb, CAM_REQ_CMP); } else { @@ -3795,7 +3745,6 @@ mpt_action(struct cam_sim *sim, union cc } else { trtp = &mpt->trt[lun]; } - CAMLOCK_2_MPTLOCK(mpt); if (ccb->ccb_h.func_code == XPT_ACCEPT_TARGET_IO) { mpt_lprt(mpt, MPT_PRT_DEBUG1, "Put FREE ATIO %p lun %d\n", ccb, lun); @@ -3810,13 +3759,10 @@ mpt_action(struct cam_sim *sim, union cc mpt_lprt(mpt, MPT_PRT_ALWAYS, "Got Notify ACK\n"); } mpt_set_ccb_status(ccb, CAM_REQ_INPROG); - MPTLOCK_2_CAMLOCK(mpt); return; } case XPT_CONT_TARGET_IO: - CAMLOCK_2_MPTLOCK(mpt); mpt_target_start_io(mpt, ccb); - MPTLOCK_2_CAMLOCK(mpt); return; default: @@ -3860,18 +3806,15 @@ mpt_get_spi_settings(struct mpt_softc *m CONFIG_PAGE_SCSI_DEVICE_0 tmp; dval = 0; - CAMLOCK_2_MPTLOCK(mpt); tmp = mpt->mpt_dev_page0[tgt]; rv = mpt_read_cur_cfg_page(mpt, tgt, &tmp.Header, sizeof(tmp), FALSE, 5000); if (rv) { - MPTLOCK_2_CAMLOCK(mpt); mpt_prt(mpt, "can't get tgt %d config page 0\n", tgt); return (rv); } mpt2host_config_page_scsi_device_0(&tmp); - MPTLOCK_2_CAMLOCK(mpt); mpt_lprt(mpt, MPT_PRT_DEBUG, "mpt_get_spi_settings[%d]: current NP %x Info %x\n", tgt, tmp.NegotiatedParameters, tmp.Information); @@ -4500,18 +4443,14 @@ mpt_target_start_io(struct mpt_softc *mp xpt_freeze_simq(mpt->sim, 1); ccb->ccb_h.status &= ~CAM_SIM_QUEUED; tgt->ccb->ccb_h.status |= CAM_RELEASE_SIMQ; - MPTLOCK_2_CAMLOCK(mpt); xpt_done(ccb); - CAMLOCK_2_MPTLOCK(mpt); return; default: mpt_prt(mpt, "ccb %p flags 0x%x tag 0x%08x had bad request " "starting I/O\n", ccb, csio->ccb_h.flags, csio->tag_id); mpt_tgt_dump_req_state(mpt, cmd_req); mpt_set_ccb_status(ccb, CAM_REQ_CMP_ERR); - MPTLOCK_2_CAMLOCK(mpt); xpt_done(ccb); - CAMLOCK_2_MPTLOCK(mpt); return; } @@ -4531,9 +4470,7 @@ mpt_target_start_io(struct mpt_softc *mp } ccb->ccb_h.status &= ~CAM_SIM_QUEUED; mpt_set_ccb_status(ccb, CAM_REQUEUE_REQ); - MPTLOCK_2_CAMLOCK(mpt); xpt_done(ccb); - CAMLOCK_2_MPTLOCK(mpt); return; } ccb->ccb_h.status = CAM_SIM_QUEUED | CAM_REQ_INPROG; @@ -4607,7 +4544,6 @@ mpt_target_start_io(struct mpt_softc *mp "nxtstate=%d\n", csio, csio->tag_id, csio->dxfer_len, tgt->resid, ccb->ccb_h.flags, req, req->serno, tgt->state); - MPTLOCK_2_CAMLOCK(mpt); if ((ccb->ccb_h.flags & CAM_SCATTER_VALID) == 0) { if ((ccb->ccb_h.flags & CAM_DATA_PHYS) == 0) { int error; @@ -4647,7 +4583,6 @@ mpt_target_start_io(struct mpt_softc *mp (*cb)(req, sgs, csio->sglist_cnt, 0); } } - CAMLOCK_2_MPTLOCK(mpt); } else { uint8_t *sp = NULL, sense[MPT_SENSE_SIZE]; @@ -4664,9 +4599,7 @@ mpt_target_start_io(struct mpt_softc *mp ccb->ccb_h.status, tgt->resid, tgt->bytes_xfered); mpt_set_ccb_status(ccb, CAM_REQ_CMP); ccb->ccb_h.status &= ~CAM_SIM_QUEUED; - MPTLOCK_2_CAMLOCK(mpt); xpt_done(ccb); - CAMLOCK_2_MPTLOCK(mpt); return; } if (ccb->ccb_h.flags & CAM_SEND_SENSE) { @@ -4872,9 +4805,7 @@ mpt_scsi_tgt_status(struct mpt_softc *mp if (ccb) { ccb->ccb_h.status &= ~CAM_SIM_QUEUED; mpt_set_ccb_status(ccb, CAM_REQUEUE_REQ); - MPTLOCK_2_CAMLOCK(mpt); xpt_done(ccb); - CAMLOCK_2_MPTLOCK(mpt); } else { mpt_prt(mpt, "could not allocate status request- dropping\n"); @@ -5049,9 +4980,7 @@ mpt_scsi_tgt_tsk_mgmt(struct mpt_softc * */ tgt->ccb = (union ccb *) inot; inot->ccb_h.status = CAM_MESSAGE_RECV|CAM_DEV_QFRZN; - MPTLOCK_2_CAMLOCK(mpt); xpt_done((union ccb *)inot); - CAMLOCK_2_MPTLOCK(mpt); } static void @@ -5321,9 +5250,7 @@ mpt_scsi_tgt_atio(struct mpt_softc *mpt, itag, atiop->tag_id, tgt->reply_desc, tgt->resid); } - MPTLOCK_2_CAMLOCK(mpt); xpt_done((union ccb *)atiop); - CAMLOCK_2_MPTLOCK(mpt); } static void @@ -5432,9 +5359,7 @@ mpt_scsi_tgt_reply_handler(struct mpt_so mpt->outofbeer = 0; mpt_lprt(mpt, MPT_PRT_DEBUG, "THAWQ\n"); } - MPTLOCK_2_CAMLOCK(mpt); xpt_done(ccb); - CAMLOCK_2_MPTLOCK(mpt); break; } /* @@ -5517,9 +5442,7 @@ mpt_scsi_tgt_reply_handler(struct mpt_so mpt->outofbeer = 0; mpt_lprt(mpt, MPT_PRT_DEBUG, "THAWQ\n"); } - MPTLOCK_2_CAMLOCK(mpt); xpt_done(ccb); - CAMLOCK_2_MPTLOCK(mpt); } break; } Modified: stable/9/sys/dev/mpt/mpt_raid.c ============================================================================== --- stable/9/sys/dev/mpt/mpt_raid.c Sun Jan 27 17:13:21 2013 (r245985) +++ stable/9/sys/dev/mpt/mpt_raid.c Sun Jan 27 17:15:56 2013 (r245986) @@ -692,9 +692,7 @@ mpt_raid_thread(void *arg) */ if (firstrun) { firstrun = 0; - MPTLOCK_2_CAMLOCK(mpt); xpt_release_simq(mpt->phydisk_sim, TRUE); - CAMLOCK_2_MPTLOCK(mpt); } if (mpt->raid_rescan != 0) { @@ -1664,19 +1662,16 @@ mpt_raid_set_vol_queue_depth(struct mpt_ mpt->raid_rescan = 0; - MPTLOCK_2_CAMLOCK(mpt); error = xpt_create_path(&path, xpt_periph, cam_sim_path(mpt->sim), mpt_vol->config_page->VolumeID, /*lun*/0); if (error != CAM_REQ_CMP) { - CAMLOCK_2_MPTLOCK(mpt); mpt_vol_prt(mpt, mpt_vol, "Unable to allocate path!\n"); continue; } mpt_adjust_queue_depth(mpt, mpt_vol, path); xpt_free_path(path); - CAMLOCK_2_MPTLOCK(mpt); } MPT_UNLOCK(mpt); return (0); From owner-svn-src-stable-9@FreeBSD.ORG Sun Jan 27 17:33:22 2013 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id DFCF3C2B; Sun, 27 Jan 2013 17:33:22 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id CF8DAD50; Sun, 27 Jan 2013 17:33:22 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0RHXMwQ023217; Sun, 27 Jan 2013 17:33:22 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0RHXMx4023216; Sun, 27 Jan 2013 17:33:22 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201301271733.r0RHXMx4023216@svn.freebsd.org> From: Marius Strobl Date: Sun, 27 Jan 2013 17:33:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r245990 - stable/9/sys/boot/sparc64/boot1 X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Jan 2013 17:33:23 -0000 Author: marius Date: Sun Jan 27 17:33:22 2013 New Revision: 245990 URL: http://svnweb.freebsd.org/changeset/base/245990 Log: MFC: r244307 Restore pre-r234898 (MFC'ed to stable/9 in r236076) printing of boot loader and path. Modified: stable/9/sys/boot/sparc64/boot1/boot1.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/boot/ (props changed) Modified: stable/9/sys/boot/sparc64/boot1/boot1.c ============================================================================== --- stable/9/sys/boot/sparc64/boot1/boot1.c Sun Jan 27 17:24:50 2013 (r245989) +++ stable/9/sys/boot/sparc64/boot1/boot1.c Sun Jan 27 17:33:22 2013 (r245990) @@ -340,11 +340,11 @@ main(int ac, char **av) } #ifdef ZFSBOOT - printf(" \n>> FreeBSD/sparc64 ZFS boot block\n Boot path: %s\n", + printf(" \n>> FreeBSD/sparc64 ZFS boot block\n Boot path: %s\n", bootpath); #else - printf(" \n>> FreeBSD/sparc64 boot block\n Boot path: %s\n" - " Boot loader: %s\n", "", bootpath, path); + printf(" \n>> FreeBSD/sparc64 boot block\n Boot path: %s\n" + " Boot loader: %s\n", bootpath, path); #endif if (mount(bootpath) == -1) From owner-svn-src-stable-9@FreeBSD.ORG Sun Jan 27 17:38:29 2013 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id D97A1F22; Sun, 27 Jan 2013 17:38:29 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id C6B65D76; Sun, 27 Jan 2013 17:38:29 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0RHcTpr023945; Sun, 27 Jan 2013 17:38:29 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0RHcTlP023944; Sun, 27 Jan 2013 17:38:29 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201301271738.r0RHcTlP023944@svn.freebsd.org> From: Marius Strobl Date: Sun, 27 Jan 2013 17:38:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r245992 - stable/9/sys/sparc64/conf X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Jan 2013 17:38:29 -0000 Author: marius Date: Sun Jan 27 17:38:29 2013 New Revision: 245992 URL: http://svnweb.freebsd.org/changeset/base/245992 Log: Revert r237842 (MFC'ed to stable/9 in r238012) and switch back to SCHED_ULE. All problems I encountered with the latter have been fixed with r241780 (MFC'ed to stable/9 in r245981). Modified: stable/9/sys/sparc64/conf/GENERIC Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/sparc64/conf/GENERIC ============================================================================== --- stable/9/sys/sparc64/conf/GENERIC Sun Jan 27 17:33:28 2013 (r245991) +++ stable/9/sys/sparc64/conf/GENERIC Sun Jan 27 17:38:29 2013 (r245992) @@ -26,7 +26,7 @@ makeoptions DEBUG=-g # Build kernel wit # Platforms supported # At this time all platforms are supported, as-is. -options SCHED_4BSD # 4BSD scheduler +options SCHED_ULE # ULE scheduler options PREEMPTION # Enable kernel thread preemption options INET # InterNETworking options INET6 # IPv6 communications protocols From owner-svn-src-stable-9@FreeBSD.ORG Sun Jan 27 17:41:27 2013 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 514FB2C4; Sun, 27 Jan 2013 17:41:27 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 4301ADB6; Sun, 27 Jan 2013 17:41:27 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0RHfRS4025965; Sun, 27 Jan 2013 17:41:27 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0RHfRB4025964; Sun, 27 Jan 2013 17:41:27 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201301271741.r0RHfRB4025964@svn.freebsd.org> From: Marius Strobl Date: Sun, 27 Jan 2013 17:41:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r245993 - stable/9/usr.sbin/daemon X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Jan 2013 17:41:27 -0000 Author: marius Date: Sun Jan 27 17:41:26 2013 New Revision: 245993 URL: http://svnweb.freebsd.org/changeset/base/245993 Log: MFC: r244986 Remove bogus '-' from getopt(3) string hit when porting daemon(8) to GNU/Linux *duck*. Modified: stable/9/usr.sbin/daemon/daemon.c Directory Properties: stable/9/usr.sbin/daemon/ (props changed) Modified: stable/9/usr.sbin/daemon/daemon.c ============================================================================== --- stable/9/usr.sbin/daemon/daemon.c Sun Jan 27 17:38:29 2013 (r245992) +++ stable/9/usr.sbin/daemon/daemon.c Sun Jan 27 17:41:26 2013 (r245993) @@ -62,7 +62,7 @@ main(int argc, char *argv[]) nochdir = noclose = 1; restart = 0; pidfile = user = NULL; - while ((ch = getopt(argc, argv, "-cfp:ru:")) != -1) { + while ((ch = getopt(argc, argv, "cfp:ru:")) != -1) { switch (ch) { case 'c': nochdir = 0; From owner-svn-src-stable-9@FreeBSD.ORG Sun Jan 27 19:44:42 2013 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 1C3634CC; Sun, 27 Jan 2013 19:44:42 +0000 (UTC) (envelope-from gabor@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 0E788245; Sun, 27 Jan 2013 19:44:42 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0RJifP5062004; Sun, 27 Jan 2013 19:44:41 GMT (envelope-from gabor@svn.freebsd.org) Received: (from gabor@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0RJifD8062003; Sun, 27 Jan 2013 19:44:41 GMT (envelope-from gabor@svn.freebsd.org) Message-Id: <201301271944.r0RJifD8062003@svn.freebsd.org> From: Gabor Kovesdan Date: Sun, 27 Jan 2013 19:44:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r245996 - stable/9/usr.bin/grep X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Jan 2013 19:44:42 -0000 Author: gabor Date: Sun Jan 27 19:44:41 2013 New Revision: 245996 URL: http://svnweb.freebsd.org/changeset/base/245996 Log: MFC r245057, r245688 - Fix handling of the case when multiple patterns are specified in a single command line argument, separated by newlines Modified: stable/9/usr.bin/grep/grep.c Directory Properties: stable/9/usr.bin/grep/ (props changed) Modified: stable/9/usr.bin/grep/grep.c ============================================================================== --- stable/9/usr.bin/grep/grep.c Sun Jan 27 18:01:03 2013 (r245995) +++ stable/9/usr.bin/grep/grep.c Sun Jan 27 19:44:41 2013 (r245996) @@ -477,7 +477,13 @@ main(int argc, char *argv[]) grepbehave = GREP_EXTENDED; break; case 'e': - add_pattern(optarg, strlen(optarg)); + { + char *token; + char *string = optarg; + + while ((token = strsep(&string, "\n")) != NULL) + add_pattern(token, strlen(token)); + } needpattern = 0; break; case 'F': @@ -666,7 +672,11 @@ main(int argc, char *argv[]) /* Process patterns from command line */ if (aargc != 0 && needpattern) { - add_pattern(*aargv, strlen(*aargv)); + char *token; + char *string = *aargv; + + while ((token = strsep(&string, "\n")) != NULL) + add_pattern(token, strlen(token)); --aargc; ++aargv; } From owner-svn-src-stable-9@FreeBSD.ORG Sun Jan 27 22:50:37 2013 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id A5AA7FC; Sun, 27 Jan 2013 22:50:37 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 80313A59; Sun, 27 Jan 2013 22:50:37 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0RMobC6018210; Sun, 27 Jan 2013 22:50:37 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0RMobcA018209; Sun, 27 Jan 2013 22:50:37 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201301272250.r0RMobcA018209@svn.freebsd.org> From: Marius Strobl Date: Sun, 27 Jan 2013 22:50:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r246003 - stable/9/sys/i386/xen X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Jan 2013 22:50:37 -0000 Author: marius Date: Sun Jan 27 22:50:36 2013 New Revision: 246003 URL: http://svnweb.freebsd.org/changeset/base/246003 Log: MFC: r244987 Fix !INVARIANTS && !SMP build. Modified: stable/9/sys/i386/xen/xen_machdep.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/i386/xen/xen_machdep.c ============================================================================== --- stable/9/sys/i386/xen/xen_machdep.c Sun Jan 27 21:55:01 2013 (r246002) +++ stable/9/sys/i386/xen/xen_machdep.c Sun Jan 27 22:50:36 2013 (r246003) @@ -215,7 +215,9 @@ static mmu_update_t xpq_queue[MAX_VIRT_C #else static mmu_update_t xpq_queue[XPQUEUE_SIZE]; +#ifdef INVARIANTS static struct mmu_log xpq_queue_log[XPQUEUE_SIZE]; +#endif static int xpq_idx = 0; #define XPQ_QUEUE_LOG xpq_queue_log From owner-svn-src-stable-9@FreeBSD.ORG Sun Jan 27 22:59:59 2013 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id B43646C5; Sun, 27 Jan 2013 22:59:59 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id A6467ABC; Sun, 27 Jan 2013 22:59:59 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0RMxx41019549; Sun, 27 Jan 2013 22:59:59 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0RMxxqi019547; Sun, 27 Jan 2013 22:59:59 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201301272259.r0RMxxqi019547@svn.freebsd.org> From: Marius Strobl Date: Sun, 27 Jan 2013 22:59:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r246005 - stable/9/sys/dev/xen/control X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Jan 2013 22:59:59 -0000 Author: marius Date: Sun Jan 27 22:59:59 2013 New Revision: 246005 URL: http://svnweb.freebsd.org/changeset/base/246005 Log: MFC: r244990 - Fix !SMP build. - Replace incorrect function names in printf(9) strings with __func__. - Make xctrl_shutdown_reasons table const. - Use nitems() rather than rolling an own version. - Use DEVMETHOD_END. - Use NULL rather than 0 for pointers. Modified: stable/9/sys/dev/xen/control/control.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/xen/control/control.c ============================================================================== --- stable/9/sys/dev/xen/control/control.c Sun Jan 27 22:50:39 2013 (r246004) +++ stable/9/sys/dev/xen/control/control.c Sun Jan 27 22:59:59 2013 (r246005) @@ -125,7 +125,6 @@ __FBSDID("$FreeBSD$"); #include #endif - #include #include @@ -145,8 +144,6 @@ __FBSDID("$FreeBSD$"); #include -#define NUM_ELEMENTS(x) (sizeof(x) / sizeof(*(x))) - /*--------------------------- Forward Declarations --------------------------*/ /** Function signature for shutdown event handlers. */ typedef void (xctrl_shutdown_handler_t)(void); @@ -165,7 +162,7 @@ struct xctrl_shutdown_reason { }; /** Lookup table for shutdown event name to handler. */ -static struct xctrl_shutdown_reason xctrl_shutdown_reasons[] = { +static const struct xctrl_shutdown_reason xctrl_shutdown_reasons[] = { { "poweroff", xctrl_poweroff }, { "reboot", xctrl_reboot }, { "suspend", xctrl_suspend }, @@ -198,7 +195,6 @@ extern void xencons_resume(void); static void xctrl_suspend() { - u_int cpuid; int i, j, k, fpp; unsigned long max_pfn, start_info_mfn; @@ -207,6 +203,8 @@ xctrl_suspend() #ifdef SMP struct thread *td; cpuset_t map; + u_int cpuid; + /* * Bind us to CPU 0 and stop any other VCPUs. */ @@ -231,7 +229,7 @@ xctrl_suspend() mtx_lock(&Giant); if (DEVICE_SUSPEND(root_bus) != 0) { mtx_unlock(&Giant); - printf("xen_suspend: device_suspend failed\n"); + printf("%s: device_suspend failed\n", __func__); #ifdef SMP if (!CPU_EMPTY(&map)) restart_cpus(map); @@ -343,9 +341,9 @@ xctrl_suspend() * drivers need this. */ mtx_lock(&Giant); - if (DEVICE_SUSPEND(root_bus)) { + if (DEVICE_SUSPEND(root_bus) != 0) { mtx_unlock(&Giant); - printf("xen_suspend: device_suspend failed\n"); + printf("%s: device_suspend failed\n", __func__); return; } mtx_unlock(&Giant); @@ -396,8 +394,8 @@ xctrl_halt() static void xctrl_on_watch_event(struct xs_watch *watch, const char **vec, unsigned int len) { - struct xctrl_shutdown_reason *reason; - struct xctrl_shutdown_reason *last_reason; + const struct xctrl_shutdown_reason *reason; + const struct xctrl_shutdown_reason *last_reason; char *result; int error; int result_len; @@ -408,7 +406,7 @@ xctrl_on_watch_event(struct xs_watch *wa return; reason = xctrl_shutdown_reasons; - last_reason = reason + NUM_ELEMENTS(xctrl_shutdown_reasons); + last_reason = reason + nitems(xctrl_shutdown_reasons); while (reason < last_reason) { if (!strcmp(result, reason->name)) { @@ -511,10 +509,10 @@ static device_method_t xctrl_methods[] = DEVMETHOD(device_attach, xctrl_attach), DEVMETHOD(device_detach, xctrl_detach), - { 0, 0 } + DEVMETHOD_END }; DEFINE_CLASS_0(xctrl, xctrl_driver, xctrl_methods, sizeof(struct xctrl_softc)); devclass_t xctrl_devclass; -DRIVER_MODULE(xctrl, xenstore, xctrl_driver, xctrl_devclass, 0, 0); +DRIVER_MODULE(xctrl, xenstore, xctrl_driver, xctrl_devclass, NULL, NULL); From owner-svn-src-stable-9@FreeBSD.ORG Sun Jan 27 23:02:34 2013 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 44A2CA6F; Sun, 27 Jan 2013 23:02:34 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 36238AE9; Sun, 27 Jan 2013 23:02:34 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0RN2YDk021749; Sun, 27 Jan 2013 23:02:34 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0RN2YUW021748; Sun, 27 Jan 2013 23:02:34 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201301272302.r0RN2YUW021748@svn.freebsd.org> From: Marius Strobl Date: Sun, 27 Jan 2013 23:02:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r246007 - stable/9/sys/dev/xen/netfront X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Jan 2013 23:02:34 -0000 Author: marius Date: Sun Jan 27 23:02:33 2013 New Revision: 246007 URL: http://svnweb.freebsd.org/changeset/base/246007 Log: MFC: r244991 - Replace partially incorrect function names in panic(9) strings with __func__ and add some missing ones. - Remove a stale comment. - Remove unused NUM_ELEMENTS macro. - Remove extra empty lines. - Use DEVMETHOD_END. - Use NULL rather than 0 for pointers. Modified: stable/9/sys/dev/xen/netfront/netfront.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/xen/netfront/netfront.c ============================================================================== --- stable/9/sys/dev/xen/netfront/netfront.c Sun Jan 27 23:00:01 2013 (r246006) +++ stable/9/sys/dev/xen/netfront/netfront.c Sun Jan 27 23:02:33 2013 (r246007) @@ -24,7 +24,6 @@ * SUCH DAMAGE. */ - #include __FBSDID("$FreeBSD$"); @@ -208,8 +207,6 @@ struct xn_chain_data { struct mbuf *xn_rx_chain[NET_RX_RING_SIZE+1]; }; -#define NUM_ELEMENTS(x) (sizeof(x)/sizeof(*x)) - struct net_device_stats { u_long rx_packets; /* total packets received */ @@ -244,7 +241,6 @@ struct net_device_stats }; struct netfront_info { - struct ifnet *xn_ifp; #if __FreeBSD_version >= 700000 struct lro_ctrl xn_lro; @@ -329,12 +325,6 @@ struct netfront_rx_info { /* Access macros for acquiring freeing slots in xn_free_{tx,rx}_idxs[]. */ - - -/* - * Access macros for acquiring freeing slots in tx_skbs[]. - */ - static inline void add_id_to_freelist(struct mbuf **list, uintptr_t id) { @@ -517,7 +507,6 @@ netfront_resume(device_t dev) return (0); } - /* Common code used when first setting up, and when resuming. */ static int talk_to_backend(device_t dev, struct netfront_info *info) @@ -605,7 +594,6 @@ talk_to_backend(device_t dev, struct net return err; } - static int setup_device(device_t dev, struct netfront_info *info) { @@ -794,7 +782,7 @@ netif_release_tx_bufs(struct netfront_in add_id_to_freelist(np->tx_mbufs, i); np->xn_cdata.xn_tx_chain_cnt--; if (np->xn_cdata.xn_tx_chain_cnt < 0) { - panic("netif_release_tx_bufs: tx_chain_cnt must be >= 0"); + panic("%s: tx_chain_cnt must be >= 0", __func__); } m_free(m); } @@ -946,7 +934,6 @@ refill: reservation.domid = DOMID_SELF; if (!xen_feature(XENFEAT_auto_translated_physmap)) { - /* After all PTEs have been zapped, flush the TLB. */ sc->rx_mcl[i-1].args[MULTI_UVMFLAGS_INDEX] = UVMF_TLB_FLUSH|UVMF_ALL; @@ -958,15 +945,11 @@ refill: /* Zap PTEs and give away pages in one big multicall. */ (void)HYPERVISOR_multicall(sc->rx_mcl, i+1); - /* Check return status of HYPERVISOR_dom_mem_op(). */ - if (unlikely(sc->rx_mcl[i].result != i)) - panic("Unable to reduce memory reservation\n"); - } else { - if (HYPERVISOR_memory_op( - XENMEM_decrease_reservation, &reservation) - != i) - panic("Unable to reduce memory " - "reservation\n"); + if (unlikely(sc->rx_mcl[i].result != i || + HYPERVISOR_memory_op(XENMEM_decrease_reservation, + &reservation) != i)) + panic("%s: unable to reduce memory " + "reservation\n", __func__); } } else { wmb(); @@ -1169,8 +1152,8 @@ xn_txeof(struct netfront_info *np) ifp->if_opackets++; if (unlikely(gnttab_query_foreign_access( np->grant_tx_ref[id]) != 0)) { - panic("grant id %u still in use by the backend", - id); + panic("%s: grant id %u still in use by the " + "backend", __func__, id); } gnttab_end_foreign_access_ref( np->grant_tx_ref[id]); @@ -1210,7 +1193,6 @@ xn_txeof(struct netfront_info *np) netif_wake_queue(dev); #endif } - } static void @@ -1240,7 +1222,6 @@ xn_intr(void *xsc) xn_start(ifp); } - static void xennet_move_rx_slot(struct netfront_info *np, struct mbuf *m, grant_ref_t ref) @@ -1319,17 +1300,15 @@ xennet_get_responses(struct netfront_inf m0 = m = m_prev = xennet_get_rx_mbuf(np, *cons); - if (rx->flags & NETRXF_extra_info) { err = xennet_get_extras(np, extras, rp, cons); } - if (m0 != NULL) { m0->m_pkthdr.len = 0; m0->m_next = NULL; } - + for (;;) { u_long mfn; @@ -1468,10 +1447,8 @@ xn_tick_locked(struct netfront_info *sc) callout_reset(&sc->xn_stat_ch, hz, xn_tick, sc); /* XXX placeholder for printing debug information */ - } - static void xn_tick(void *xsc) { @@ -1481,7 +1458,6 @@ xn_tick(void *xsc) XN_RX_LOCK(sc); xn_tick_locked(sc); XN_RX_UNLOCK(sc); - } /** @@ -1595,10 +1571,12 @@ xn_assemble_tx_request(struct netfront_i tx = RING_GET_REQUEST(&sc->tx, sc->tx.req_prod_pvt); id = get_id_from_freelist(sc->tx_mbufs); if (id == 0) - panic("xn_start_locked: was allocated the freelist head!\n"); + panic("%s: was allocated the freelist head!\n", + __func__); sc->xn_cdata.xn_tx_chain_cnt++; if (sc->xn_cdata.xn_tx_chain_cnt > NET_TX_RING_SIZE) - panic("xn_start_locked: tx_chain_cnt must be <= NET_TX_RING_SIZE\n"); + panic("%s: tx_chain_cnt must be <= NET_TX_RING_SIZE\n", + __func__); sc->tx_mbufs[id] = m; tx->id = id; ref = gnttab_claim_grant_reference(&sc->gref_tx_head); @@ -1710,7 +1688,6 @@ xn_start_locked(struct ifnet *ifp) } } - static void xn_start(struct ifnet *ifp) { @@ -1744,10 +1721,8 @@ xn_ifinit_locked(struct netfront_info *s if_link_state_change(ifp, LINK_STATE_UP); callout_reset(&sc->xn_stat_ch, hz, xn_tick, sc); - } - static void xn_ifinit(void *xsc) { @@ -1756,10 +1731,8 @@ xn_ifinit(void *xsc) XN_LOCK(sc); xn_ifinit_locked(sc); XN_UNLOCK(sc); - } - static int xn_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data) { @@ -2262,7 +2235,7 @@ static device_method_t netfront_methods[ /* Xenbus interface */ DEVMETHOD(xenbus_otherend_changed, netfront_backend_changed), - { 0, 0 } + DEVMETHOD_END }; static driver_t netfront_driver = { @@ -2272,4 +2245,5 @@ static driver_t netfront_driver = { }; devclass_t netfront_devclass; -DRIVER_MODULE(xe, xenbusb_front, netfront_driver, netfront_devclass, 0, 0); +DRIVER_MODULE(xe, xenbusb_front, netfront_driver, netfront_devclass, NULL, + NULL); From owner-svn-src-stable-9@FreeBSD.ORG Sun Jan 27 23:05:22 2013 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 685DCD59; Sun, 27 Jan 2013 23:05:22 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 420A7B09; Sun, 27 Jan 2013 23:05:22 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0RN5MGM022328; Sun, 27 Jan 2013 23:05:22 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0RN5MxD022327; Sun, 27 Jan 2013 23:05:22 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201301272305.r0RN5MxD022327@svn.freebsd.org> From: Marius Strobl Date: Sun, 27 Jan 2013 23:05:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r246009 - in stable/9/sys/dev/xen: evtchn xenpci X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Jan 2013 23:05:22 -0000 Author: marius Date: Sun Jan 27 23:05:21 2013 New Revision: 246009 URL: http://svnweb.freebsd.org/changeset/base/246009 Log: MFC: r244993 Remove files not connected to the build. It's confusing enough that we still have two not quite the same evtchn.c left over. Deleted: stable/9/sys/dev/xen/evtchn/ stable/9/sys/dev/xen/xenpci/machine_reboot.c Modified: Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) From owner-svn-src-stable-9@FreeBSD.ORG Sun Jan 27 23:08:52 2013 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 6ACDAE4; Sun, 27 Jan 2013 23:08:52 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 51BCFB22; Sun, 27 Jan 2013 23:08:52 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0RN8qH4022990; Sun, 27 Jan 2013 23:08:52 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0RN8qLf022989; Sun, 27 Jan 2013 23:08:52 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201301272308.r0RN8qLf022989@svn.freebsd.org> From: Marius Strobl Date: Sun, 27 Jan 2013 23:08:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r246011 - stable/9/sys/sparc64/sparc64 X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Jan 2013 23:08:52 -0000 Author: marius Date: Sun Jan 27 23:08:51 2013 New Revision: 246011 URL: http://svnweb.freebsd.org/changeset/base/246011 Log: MFC: r245017 Revert bogus part of r241740 (MFC'ed to stable/9 in r241878). Reported by: Michael Moll Modified: stable/9/sys/sparc64/sparc64/interrupt.S Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/sparc64/sparc64/interrupt.S ============================================================================== --- stable/9/sys/sparc64/sparc64/interrupt.S Sun Jan 27 23:05:27 2013 (r246010) +++ stable/9/sys/sparc64/sparc64/interrupt.S Sun Jan 27 23:08:51 2013 (r246011) @@ -83,13 +83,13 @@ ENTRY(intr_vector) * The 2nd word points to code to execute and the 3rd is an argument * to pass. Jump to it. */ - brnz,a,pt %g3, 1f - srlx %g3, 60, %g6 + brnz,pt %g3, 1f /* * NB: Zeus CPUs set some undocumented bits in the first data word. */ - jmpl %g4, %g0 and %g3, IV_MAX - 1, %g3 + jmpl %g4, %g0 + nop /* NOTREACHED */ /* @@ -98,7 +98,8 @@ ENTRY(intr_vector) * 4 bits of the 1st data word specify a priority, and the 2nd and * 3rd a function and argument. */ -1: brnz,a,pn %g6, 2f +1: srlx %g3, 60, %g6 + brnz,a,pn %g6, 2f clr %g3 /* From owner-svn-src-stable-9@FreeBSD.ORG Sun Jan 27 23:21:48 2013 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 211BE623; Sun, 27 Jan 2013 23:21:48 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id E3C0ABD5; Sun, 27 Jan 2013 23:21:47 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0RNLlYL028158; Sun, 27 Jan 2013 23:21:47 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0RNLl0P028155; Sun, 27 Jan 2013 23:21:47 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201301272321.r0RNLl0P028155@svn.freebsd.org> From: Marius Strobl Date: Sun, 27 Jan 2013 23:21:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r246014 - in stable/9/sys/sparc64: include sparc64 X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Jan 2013 23:21:48 -0000 Author: marius Date: Sun Jan 27 23:21:47 2013 New Revision: 246014 URL: http://svnweb.freebsd.org/changeset/base/246014 Log: MFC: r245850 Revert the part of r239864 (MFC'ed to stable/9 in r241681) which removed obtaining the SMP mutex around reading registers from other CPUs. As it turns out, the hardware doesn't really like concurrent IPI'ing causing adverse effects. Also the thought deadlock when using this spin lock here and the targeted CPU(s) are also holding or in case of nested locks can't actually happen. This is due to the fact that on sparc64, spinlock_enter() only raises the PIL but doesn't disable interrupts completely. Thus direct cross calls as used for the register reading (and all other MD IPI needs) still will be executed by the targeted CPU(s) in that case. Modified: stable/9/sys/sparc64/include/smp.h stable/9/sys/sparc64/sparc64/tick.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/sparc64/include/smp.h ============================================================================== --- stable/9/sys/sparc64/include/smp.h Sun Jan 27 23:12:37 2013 (r246013) +++ stable/9/sys/sparc64/include/smp.h Sun Jan 27 23:21:47 2013 (r246014) @@ -42,6 +42,7 @@ #include #include #include +#include #include #include @@ -202,6 +203,7 @@ ipi_rd(u_int cpu, void *func, u_long *va return (NULL); sched_pin(); ira = &ipi_rd_args; + mtx_lock_spin(&smp_ipi_mtx); CPU_SETOF(cpu, &ira->ira_mask); ira->ira_val = val; cpu_ipi_single(cpu, 0, (u_long)func, (u_long)ira); @@ -298,18 +300,6 @@ ipi_wait(void *cookie) } } -static __inline void -ipi_wait_unlocked(void *cookie) -{ - volatile cpuset_t *mask; - - if ((mask = cookie) != NULL) { - while (!CPU_EMPTY(mask)) - ; - sched_unpin(); - } -} - #endif /* _MACHINE_PMAP_H_ && _SYS_MUTEX_H_ */ #endif /* !LOCORE */ @@ -368,12 +358,6 @@ ipi_wait(void *cookie __unused) } static __inline void -ipi_wait_unlocked(void *cookie __unused) -{ - -} - -static __inline void tl_ipi_cheetah_dcache_page_inval(void) { Modified: stable/9/sys/sparc64/sparc64/tick.c ============================================================================== --- stable/9/sys/sparc64/sparc64/tick.c Sun Jan 27 23:12:37 2013 (r246013) +++ stable/9/sys/sparc64/sparc64/tick.c Sun Jan 27 23:21:47 2013 (r246014) @@ -334,7 +334,7 @@ stick_get_timecount_mp(struct timecounte if (curcpu == 0) stick = rdstick(); else - ipi_wait_unlocked(ipi_rd(0, tl_ipi_stick_rd, &stick)); + ipi_wait(ipi_rd(0, tl_ipi_stick_rd, &stick)); sched_unpin(); return (stick); } @@ -348,7 +348,7 @@ tick_get_timecount_mp(struct timecounter if (curcpu == 0) tick = rd(tick); else - ipi_wait_unlocked(ipi_rd(0, tl_ipi_tick_rd, &tick)); + ipi_wait(ipi_rd(0, tl_ipi_tick_rd, &tick)); sched_unpin(); return (tick); } From owner-svn-src-stable-9@FreeBSD.ORG Mon Jan 28 00:31:33 2013 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 391F02CF; Mon, 28 Jan 2013 00:31:33 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 122E3E35; Mon, 28 Jan 2013 00:31:33 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0S0VWM1048892; Mon, 28 Jan 2013 00:31:32 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0S0VWBJ048891; Mon, 28 Jan 2013 00:31:32 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201301280031.r0S0VWBJ048891@svn.freebsd.org> From: Marius Strobl Date: Mon, 28 Jan 2013 00:31:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r246018 - stable/9/sys/dev/cas X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Jan 2013 00:31:33 -0000 Author: marius Date: Mon Jan 28 00:31:32 2013 New Revision: 246018 URL: http://svnweb.freebsd.org/changeset/base/246018 Log: MFC: r245923 - Check the return value of taskqueue_start_threads(). - At least the Saturn chips of 501-6738 cards need a delay after freezing the external GMII pins before the internal PHY is accessible again. So wait a bit after (un)freezing these. Also don't touch the other bits of that configuration register. [1] - Take advantage of nitems(). Reported and tested by: Paul Keusemann [1] Modified: stable/9/sys/dev/cas/if_cas.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/cas/if_cas.c ============================================================================== --- stable/9/sys/dev/cas/if_cas.c Mon Jan 28 00:15:44 2013 (r246017) +++ stable/9/sys/dev/cas/if_cas.c Mon Jan 28 00:31:32 2013 (r246018) @@ -214,8 +214,12 @@ cas_attach(struct cas_softc *sc) error = ENXIO; goto fail_ifnet; } - taskqueue_start_threads(&sc->sc_tq, 1, PI_NET, "%s taskq", + error = taskqueue_start_threads(&sc->sc_tq, 1, PI_NET, "%s taskq", device_get_nameunit(sc->sc_dev)); + if (error != 0) { + device_printf(sc->sc_dev, "could not start threads\n"); + goto fail_taskq; + } /* Make sure the chip is stopped. */ cas_reset(sc); @@ -339,10 +343,13 @@ cas_attach(struct cas_softc *sc) BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE); /* Enable/unfreeze the GMII pins of Saturn. */ if (sc->sc_variant == CAS_SATURN) { - CAS_WRITE_4(sc, CAS_SATURN_PCFG, 0); + CAS_WRITE_4(sc, CAS_SATURN_PCFG, + CAS_READ_4(sc, CAS_SATURN_PCFG) & + ~CAS_SATURN_PCFG_FSI); CAS_BARRIER(sc, CAS_SATURN_PCFG, 4, BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE); + DELAY(10000); } error = mii_attach(sc->sc_dev, &sc->sc_miibus, ifp, cas_mediachange, cas_mediastatus, BMSR_DEFCAPMASK, @@ -359,10 +366,12 @@ cas_attach(struct cas_softc *sc) /* Freeze the GMII pins of Saturn for saving power. */ if (sc->sc_variant == CAS_SATURN) { CAS_WRITE_4(sc, CAS_SATURN_PCFG, + CAS_READ_4(sc, CAS_SATURN_PCFG) | CAS_SATURN_PCFG_FSI); CAS_BARRIER(sc, CAS_SATURN_PCFG, 4, BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE); + DELAY(10000); } error = mii_attach(sc->sc_dev, &sc->sc_miibus, ifp, cas_mediachange, cas_mediastatus, BMSR_DEFCAPMASK, @@ -2865,7 +2874,7 @@ cas_pci_attach(device_t dev) goto fail; } i = 0; - if (lma > 1 && pci_get_slot(dev) < sizeof(enaddr) / sizeof(*enaddr)) + if (lma > 1 && pci_get_slot(dev) < nitems(enaddr)) i = pci_get_slot(dev); memcpy(sc->sc_enaddr, enaddr[i], ETHER_ADDR_LEN); @@ -2874,7 +2883,7 @@ cas_pci_attach(device_t dev) goto fail; } i = 0; - if (phy > 1 && pci_get_slot(dev) < sizeof(pcs) / sizeof(*pcs)) + if (phy > 1 && pci_get_slot(dev) < nitems(pcs)) i = pci_get_slot(dev); if (pcs[i] != 0) sc->sc_flags |= CAS_SERDES; From owner-svn-src-stable-9@FreeBSD.ORG Mon Jan 28 07:26:46 2013 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id E2AE1772; Mon, 28 Jan 2013 07:26:46 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id AFD50E10; Mon, 28 Jan 2013 07:26:46 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0S7Qktr072329; Mon, 28 Jan 2013 07:26:46 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0S7QknC072327; Mon, 28 Jan 2013 07:26:46 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201301280726.r0S7QknC072327@svn.freebsd.org> From: Hans Petter Selasky Date: Mon, 28 Jan 2013 07:26:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r246022 - in stable/9/sys/dev/usb: . quirk X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Jan 2013 07:26:47 -0000 Author: hselasky Date: Mon Jan 28 07:26:45 2013 New Revision: 246022 URL: http://svnweb.freebsd.org/changeset/base/246022 Log: MFC r245725: Add new quirk and correct old one. PR: usb/175454 MFC after: 1 week Modified: stable/9/sys/dev/usb/quirk/usb_quirk.c stable/9/sys/dev/usb/usbdevs Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/usb/quirk/usb_quirk.c ============================================================================== --- stable/9/sys/dev/usb/quirk/usb_quirk.c Mon Jan 28 07:22:44 2013 (r246021) +++ stable/9/sys/dev/usb/quirk/usb_quirk.c Mon Jan 28 07:26:45 2013 (r246022) @@ -302,7 +302,7 @@ static struct usb_quirk_entry usb_quirks UQ_MSC_FORCE_PROTO_SCSI, UQ_MSC_NO_INQUIRY), USB_QUIRK(ONSPEC, READER, 0x0000, 0xffff, UQ_MSC_FORCE_PROTO_SCSI), USB_QUIRK(ONSPEC, UCF100, 0x0000, 0xffff, UQ_MSC_FORCE_WIRE_BBB, - UQ_MSC_FORCE_PROTO_ATAPI, UQ_MSC_NO_INQUIRY | UQ_MSC_NO_GETMAXLUN), + UQ_MSC_FORCE_PROTO_ATAPI, UQ_MSC_NO_INQUIRY, UQ_MSC_NO_GETMAXLUN), USB_QUIRK(ONSPEC2, IMAGEMATE_SDDR55, 0x0000, 0xffff, UQ_MSC_FORCE_PROTO_SCSI, UQ_MSC_NO_GETMAXLUN), USB_QUIRK(PANASONIC, KXL840AN, 0x0000, 0xffff, UQ_MSC_FORCE_WIRE_BBB, @@ -338,6 +338,8 @@ static struct usb_quirk_entry usb_quirks UQ_MSC_FORCE_PROTO_SCSI, UQ_MSC_IGNORE_RESIDUE), USB_QUIRK(SANDISK, SDDR31, 0x0000, 0xffff, UQ_MSC_FORCE_WIRE_BBB, UQ_MSC_FORCE_PROTO_SCSI, UQ_MSC_READ_CAP_OFFBY1), + USB_QUIRK(SANDISK, IMAGEMATE_SDDR289, 0x0000, 0xffff, + UQ_MSC_NO_SYNC_CACHE, UQ_MSC_NO_GETMAXLUN), USB_QUIRK(SCANLOGIC, SL11R, 0x0000, 0xffff, UQ_MSC_FORCE_WIRE_BBB, UQ_MSC_FORCE_PROTO_ATAPI, UQ_MSC_NO_INQUIRY), USB_QUIRK(SHUTTLE, EUSB, 0x0000, 0xffff, UQ_MSC_FORCE_WIRE_CBI_I, Modified: stable/9/sys/dev/usb/usbdevs ============================================================================== --- stable/9/sys/dev/usb/usbdevs Mon Jan 28 07:22:44 2013 (r246021) +++ stable/9/sys/dev/usb/usbdevs Mon Jan 28 07:26:45 2013 (r246022) @@ -3558,6 +3558,7 @@ product SANDISK SDDR75 0x0810 ImageMate product SANDISK SDCZ2_256 0x7104 Cruzer Mini 256MB product SANDISK SDCZ4_128 0x7112 Cruzer Micro 128MB product SANDISK SDCZ4_256 0x7113 Cruzer Micro 256MB +product SANDISK IMAGEMATE_SDDR289 0xb6ba ImageMate SDDR-289 /* Sanwa Electric Instrument Co., Ltd. products */ product SANWA KB_USB2 0x0701 KB-USB2 multimeter cable From owner-svn-src-stable-9@FreeBSD.ORG Mon Jan 28 22:50:55 2013 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id D7565E38; Mon, 28 Jan 2013 22:50:55 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id CA15320D; Mon, 28 Jan 2013 22:50:55 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0SMotHJ049311; Mon, 28 Jan 2013 22:50:55 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0SMotWh049310; Mon, 28 Jan 2013 22:50:55 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201301282250.r0SMotWh049310@svn.freebsd.org> From: Warner Losh Date: Mon, 28 Jan 2013 22:50:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r246043 - stable/9 X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Jan 2013 22:50:55 -0000 Author: imp Date: Mon Jan 28 22:50:54 2013 New Revision: 246043 URL: http://svnweb.freebsd.org/changeset/base/246043 Log: Add notes for breakage points for traditional building of the kernel as a guide to others. buildkernel, etc was not broken at these points, so document that as well. Modified: stable/9/UPDATING Modified: stable/9/UPDATING ============================================================================== --- stable/9/UPDATING Mon Jan 28 21:10:35 2013 (r246042) +++ stable/9/UPDATING Mon Jan 28 22:50:54 2013 (r246043) @@ -35,6 +35,13 @@ Items affecting the ports and packages s Please refer to the "ZFS notes" section of this file for information on upgrading boot ZFS pools. +20121114: + The commit introducing bsd.compiler.mk breaks the traditional + building of kernels before this point. Add -m ${SRC}/share/mk + (for the right value of SRC) to your command lines to work + around; update your useland to a point after this; or use the + buildkernel/installkernel top-level targets. + 20121102: The IPFIREWALL_FORWARD kernel option has been removed. Its functionality now turned on by default. @@ -47,6 +54,12 @@ Items affecting the ports and packages s option, so the change only affects the custom kernel configurations. +20120829: + The amd64 kernel now uses xsetbv, xrstor instructions. To compile with + the traditional method, you must update your system with an installworld + before the kernel will build. The documented make buildkernel/installkernel + interfaces (coupled with fresh make kernel-toolchain) continue to work. + 20120727: The sparc64 ZFS loader has been changed to no longer try to auto- detect ZFS providers based on diskN aliases but now requires these From owner-svn-src-stable-9@FreeBSD.ORG Mon Jan 28 22:53:09 2013 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 6AE3EFAC; Mon, 28 Jan 2013 22:53:09 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 58609223; Mon, 28 Jan 2013 22:53:09 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0SMr95H051030; Mon, 28 Jan 2013 22:53:09 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0SMr9wL051029; Mon, 28 Jan 2013 22:53:09 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201301282253.r0SMr9wL051029@svn.freebsd.org> From: Warner Losh Date: Mon, 28 Jan 2013 22:53:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r246044 - stable/9 X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Jan 2013 22:53:09 -0000 Author: imp Date: Mon Jan 28 22:53:08 2013 New Revision: 246044 URL: http://svnweb.freebsd.org/changeset/base/246044 Log: Add pointer from recent breakage to old breakage. Modified: stable/9/UPDATING Modified: stable/9/UPDATING ============================================================================== --- stable/9/UPDATING Mon Jan 28 22:50:54 2013 (r246043) +++ stable/9/UPDATING Mon Jan 28 22:53:08 2013 (r246044) @@ -40,7 +40,7 @@ Items affecting the ports and packages s building of kernels before this point. Add -m ${SRC}/share/mk (for the right value of SRC) to your command lines to work around; update your useland to a point after this; or use the - buildkernel/installkernel top-level targets. + buildkernel/installkernel top-level targets. See also 20120829. 20121102: The IPFIREWALL_FORWARD kernel option has been removed. Its From owner-svn-src-stable-9@FreeBSD.ORG Mon Jan 28 23:16:48 2013 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 6F571674; Mon, 28 Jan 2013 23:16:48 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 52DFE32C; Mon, 28 Jan 2013 23:16:48 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0SNGmur057852; Mon, 28 Jan 2013 23:16:48 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0SNGl68057848; Mon, 28 Jan 2013 23:16:47 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201301282316.r0SNGl68057848@svn.freebsd.org> From: Warner Losh Date: Mon, 28 Jan 2013 23:16:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r246045 - stable/9/sys/dev/atkbdc X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Jan 2013 23:16:48 -0000 Author: imp Date: Mon Jan 28 23:16:47 2013 New Revision: 246045 URL: http://svnweb.freebsd.org/changeset/base/246045 Log: MFC: r245314 and r245315: r245315 | imp | 2013-01-11 14:42:23 -0700 (Fri, 11 Jan 2013) | 4 lines Pass the device_t into atkbd_{probe,attach}_unit and get the controller unit and keyboard unit from there. It will be needed for other things in the future as well... r245314 | imp | 2013-01-11 14:19:45 -0700 (Fri, 11 Jan 2013) | 2 lines style(9) changes before I do more real changes. Modified: stable/9/sys/dev/atkbdc/atkbd.c stable/9/sys/dev/atkbdc/atkbd_atkbdc.c stable/9/sys/dev/atkbdc/atkbdreg.h Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/atkbdc/atkbd.c ============================================================================== --- stable/9/sys/dev/atkbdc/atkbd.c Mon Jan 28 22:53:08 2013 (r246044) +++ stable/9/sys/dev/atkbdc/atkbd.c Mon Jan 28 23:16:47 2013 (r246045) @@ -66,7 +66,7 @@ static timeout_t atkbd_timeout; static void atkbd_shutdown_final(void *v); int -atkbd_probe_unit(int unit, int ctlr, int irq, int flags) +atkbd_probe_unit(device_t dev, int irq, int flags) { keyboard_switch_t *sw; int args[2]; @@ -76,27 +76,29 @@ atkbd_probe_unit(int unit, int ctlr, int if (sw == NULL) return ENXIO; - args[0] = ctlr; + args[0] = device_get_unit(device_get_parent(dev)); args[1] = irq; - error = (*sw->probe)(unit, args, flags); + error = (*sw->probe)(device_get_unit(dev), args, flags); if (error) return error; return 0; } int -atkbd_attach_unit(int unit, keyboard_t **kbd, int ctlr, int irq, int flags) +atkbd_attach_unit(device_t dev, keyboard_t **kbd, int irq, int flags) { keyboard_switch_t *sw; int args[2]; int error; + int unit; sw = kbd_get_switch(ATKBD_DRIVER_NAME); if (sw == NULL) return ENXIO; /* reset, initialize and enable the device */ - args[0] = ctlr; + unit = device_get_unit(dev); + args[0] = device_get_unit(device_get_parent(dev)); args[1] = irq; *kbd = NULL; error = (*sw->probe)(unit, args, flags); @@ -401,7 +403,7 @@ atkbd_init(int unit, keyboard_t **kbdp, bcopy(&key_map, keymap, sizeof(key_map)); bcopy(&accent_map, accmap, sizeof(accent_map)); bcopy(fkey_tab, fkeymap, - imin(fkeymap_size*sizeof(fkeymap[0]), sizeof(fkey_tab))); + imin(fkeymap_size * sizeof(fkeymap[0]), sizeof(fkey_tab))); kbd_set_maps(kbd, keymap, accmap, fkeymap, fkeymap_size); kbd->kb_data = (void *)state; @@ -424,8 +426,8 @@ atkbd_init(int unit, keyboard_t **kbdp, if (!KBD_IS_INITIALIZED(kbd) && !(flags & KB_CONF_PROBE_ONLY)) { kbd->kb_config = flags & ~KB_CONF_PROBE_ONLY; if (KBD_HAS_DEVICE(kbd) - && init_keyboard(state->kbdc, &kbd->kb_type, kbd->kb_config) - && (kbd->kb_config & KB_CONF_FAIL_IF_NO_KBD)) { + && init_keyboard(state->kbdc, &kbd->kb_type, kbd->kb_config) + && (kbd->kb_config & KB_CONF_FAIL_IF_NO_KBD)) { kbd_unregister(kbd); error = ENXIO; goto bad; @@ -485,8 +487,7 @@ atkbd_intr(keyboard_t *kbd, void *arg) * The keyboard was not detected before; * it must have been reconnected! */ - init_keyboard(state->kbdc, &kbd->kb_type, - kbd->kb_config); + init_keyboard(state->kbdc, &kbd->kb_type, kbd->kb_config); KBD_FOUND_DEVICE(kbd); atkbd_ioctl(kbd, KDSETLED, (caddr_t)&state->ks_state); get_typematic(kbd); @@ -645,7 +646,7 @@ next_code: goto next_code; } break; - case 0xE0: /* 0xE0 prefix */ + case 0xE0: /* 0xE0 prefix */ state->ks_prefix = 0; switch (keycode) { case 0x1C: /* right enter key */ @@ -655,57 +656,57 @@ next_code: keycode = 0x5A; break; case 0x35: /* keypad divide key */ - keycode = 0x5B; - break; + keycode = 0x5B; + break; case 0x37: /* print scrn key */ - keycode = 0x5C; - break; + keycode = 0x5C; + break; case 0x38: /* right alt key (alt gr) */ - keycode = 0x5D; - break; + keycode = 0x5D; + break; case 0x46: /* ctrl-pause/break on AT 101 (see below) */ keycode = 0x68; - break; + break; case 0x47: /* grey home key */ - keycode = 0x5E; - break; + keycode = 0x5E; + break; case 0x48: /* grey up arrow key */ - keycode = 0x5F; - break; + keycode = 0x5F; + break; case 0x49: /* grey page up key */ - keycode = 0x60; - break; + keycode = 0x60; + break; case 0x4B: /* grey left arrow key */ - keycode = 0x61; - break; + keycode = 0x61; + break; case 0x4D: /* grey right arrow key */ - keycode = 0x62; - break; + keycode = 0x62; + break; case 0x4F: /* grey end key */ - keycode = 0x63; - break; + keycode = 0x63; + break; case 0x50: /* grey down arrow key */ - keycode = 0x64; - break; + keycode = 0x64; + break; case 0x51: /* grey page down key */ - keycode = 0x65; - break; + keycode = 0x65; + break; case 0x52: /* grey insert key */ - keycode = 0x66; - break; + keycode = 0x66; + break; case 0x53: /* grey delete key */ - keycode = 0x67; - break; - /* the following 3 are only used on the MS "Natural" keyboard */ + keycode = 0x67; + break; + /* the following 3 are only used on the MS "Natural" keyboard */ case 0x5b: /* left Window key */ - keycode = 0x69; - break; + keycode = 0x69; + break; case 0x5c: /* right Window key */ - keycode = 0x6a; - break; + keycode = 0x6a; + break; case 0x5d: /* menu key */ - keycode = 0x6b; - break; + keycode = 0x6b; + break; case 0x5e: /* power key */ keycode = 0x6d; break; @@ -716,10 +717,10 @@ next_code: keycode = 0x6f; break; default: /* ignore everything else */ - goto next_code; + goto next_code; } break; - case 0xE1: /* 0xE1 prefix */ + case 0xE1: /* 0xE1 prefix */ /* * The pause/break key on the 101 keyboard produces: * E1-1D-45 E1-9D-C5 @@ -728,10 +729,10 @@ next_code: */ state->ks_prefix = 0; if (keycode == 0x1D) - state->ks_prefix = 0x1D; + state->ks_prefix = 0x1D; goto next_code; /* NOT REACHED */ - case 0x1D: /* pause / break */ + case 0x1D: /* pause / break */ state->ks_prefix = 0; if (keycode != 0x45) goto next_code; @@ -743,7 +744,7 @@ next_code: switch (keycode) { case 0x37: /* *(numpad)/print screen */ if (state->ks_flags & SHIFTS) - keycode = 0x5c; /* print screen */ + keycode = 0x5c; /* print screen */ break; case 0x45: /* num lock/pause */ if (state->ks_flags & CTLS) @@ -1177,7 +1178,7 @@ get_kbd_echo(KBDC kbdc) */ return ENXIO; } - + return 0; } @@ -1275,7 +1276,7 @@ init_keyboard(KBDC kbdc, int *type, int } if (bootverbose) printf("atkbd: the current kbd controller command byte %04x\n", - c); + c); #if 0 /* override the keyboard lock switch */ c |= KBD_OVERRIDE_KBD_LOCK; @@ -1415,52 +1416,49 @@ init_keyboard(KBDC kbdc, int *type, int static int write_kbd(KBDC kbdc, int command, int data) { - int s; + int s; - /* prevent the timeout routine from polling the keyboard */ - if (!kbdc_lock(kbdc, TRUE)) - return EBUSY; + /* prevent the timeout routine from polling the keyboard */ + if (!kbdc_lock(kbdc, TRUE)) + return EBUSY; - /* disable the keyboard and mouse interrupt */ - s = spltty(); + /* disable the keyboard and mouse interrupt */ + s = spltty(); #if 0 - c = get_controller_command_byte(kbdc); - if ((c == -1) - || !set_controller_command_byte(kbdc, - kbdc_get_device_mask(kbdc), - KBD_DISABLE_KBD_PORT | KBD_DISABLE_KBD_INT - | KBD_DISABLE_AUX_PORT | KBD_DISABLE_AUX_INT)) { - /* CONTROLLER ERROR */ - kbdc_lock(kbdc, FALSE); + c = get_controller_command_byte(kbdc); + if ((c == -1) + || !set_controller_command_byte(kbdc, + kbdc_get_device_mask(kbdc), + KBD_DISABLE_KBD_PORT | KBD_DISABLE_KBD_INT + | KBD_DISABLE_AUX_PORT | KBD_DISABLE_AUX_INT)) { + /* CONTROLLER ERROR */ + kbdc_lock(kbdc, FALSE); + splx(s); + return EIO; + } + /* + * Now that the keyboard controller is told not to generate + * the keyboard and mouse interrupts, call `splx()' to allow + * the other tty interrupts. The clock interrupt may also occur, + * but the timeout routine (`scrn_timer()') will be blocked + * by the lock flag set via `kbdc_lock()' + */ splx(s); - return EIO; - } - /* - * Now that the keyboard controller is told not to generate - * the keyboard and mouse interrupts, call `splx()' to allow - * the other tty interrupts. The clock interrupt may also occur, - * but the timeout routine (`scrn_timer()') will be blocked - * by the lock flag set via `kbdc_lock()' - */ - splx(s); #endif - - if (send_kbd_command_and_data(kbdc, command, data) != KBD_ACK) - send_kbd_command(kbdc, KBDC_ENABLE_KBD); - + if (send_kbd_command_and_data(kbdc, command, data) != KBD_ACK) + send_kbd_command(kbdc, KBDC_ENABLE_KBD); #if 0 - /* restore the interrupts */ - if (!set_controller_command_byte(kbdc, - kbdc_get_device_mask(kbdc), + /* restore the interrupts */ + if (!set_controller_command_byte(kbdc, kbdc_get_device_mask(kbdc), c & (KBD_KBD_CONTROL_BITS | KBD_AUX_CONTROL_BITS))) { - /* CONTROLLER ERROR */ - } + /* CONTROLLER ERROR */ + } #else - splx(s); + splx(s); #endif - kbdc_lock(kbdc, FALSE); + kbdc_lock(kbdc, FALSE); - return 0; + return 0; } static int Modified: stable/9/sys/dev/atkbdc/atkbd_atkbdc.c ============================================================================== --- stable/9/sys/dev/atkbdc/atkbd_atkbdc.c Mon Jan 28 22:53:08 2013 (r246044) +++ stable/9/sys/dev/atkbdc/atkbd_atkbdc.c Mon Jan 28 23:16:47 2013 (r246045) @@ -104,9 +104,7 @@ atkbdprobe(device_t dev) bus_release_resource(dev, SYS_RES_IRQ, rid, res); /* probe the device */ - return atkbd_probe_unit(device_get_unit(dev), - device_get_unit(device_get_parent(dev)), - irq, flags); + return atkbd_probe_unit(dev, irq, flags); } static int @@ -124,9 +122,7 @@ atkbdattach(device_t dev) rid = KBDC_RID_KBD; irq = bus_get_resource_start(dev, SYS_RES_IRQ, rid); flags = device_get_flags(dev); - error = atkbd_attach_unit(device_get_unit(dev), &kbd, - device_get_unit(device_get_parent(dev)), - irq, flags); + error = atkbd_attach_unit(dev, &kbd, irq, flags); if (error) return error; Modified: stable/9/sys/dev/atkbdc/atkbdreg.h ============================================================================== --- stable/9/sys/dev/atkbdc/atkbdreg.h Mon Jan 28 22:53:08 2013 (r246044) +++ stable/9/sys/dev/atkbdc/atkbdreg.h Mon Jan 28 23:16:47 2013 (r246045) @@ -39,9 +39,8 @@ #ifdef _KERNEL -int atkbd_probe_unit(int unit, int ctlr, int irq, int flags); -int atkbd_attach_unit(int unit, keyboard_t **kbd, - int ctlr, int irq, int flags); +int atkbd_probe_unit(device_t dev, int irq, int flags); +int atkbd_attach_unit(device_t dev, keyboard_t **kbd, int irq, int flags); #endif From owner-svn-src-stable-9@FreeBSD.ORG Tue Jan 29 01:44:15 2013 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 0D0E0BEC; Tue, 29 Jan 2013 01:44:15 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id F179FD77; Tue, 29 Jan 2013 01:44:14 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0T1iEhg002297; Tue, 29 Jan 2013 01:44:14 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0T1iDvK002290; Tue, 29 Jan 2013 01:44:13 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201301290144.r0T1iDvK002290@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Tue, 29 Jan 2013 01:44:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r246049 - stable/9/sys/fs/ext2fs X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Jan 2013 01:44:15 -0000 Author: pfg Date: Tue Jan 29 01:44:13 2013 New Revision: 246049 URL: http://svnweb.freebsd.org/changeset/base/246049 Log: MFC r245820, r245844, r245950: ext2fs: make some inode fields match the ext2 spec. Ext2fs uses unsigned fields in its dinode struct. FreeBSD can have negative values in some of those fields and the inode is meant to interact with the system so we have never respected the unsigned nature of most of those fields. Block numbers and the generation number do not need to be signed so redefine them as unsigned to better match the on-disk information. Include some fixes proposed by bde@. While here add a lot of svn mergeinfo that was missing in /sys: r239963,240060,240880,241007,241141,241143,241181,243641, 243652,244475,245121,245612,245817 Modified: stable/9/sys/fs/ext2fs/ext2_alloc.c stable/9/sys/fs/ext2fs/ext2_balloc.c stable/9/sys/fs/ext2fs/ext2_inode.c stable/9/sys/fs/ext2fs/inode.h Directory Properties: stable/9/sys/ (props changed) stable/9/sys/fs/ (props changed) Modified: stable/9/sys/fs/ext2fs/ext2_alloc.c ============================================================================== --- stable/9/sys/fs/ext2fs/ext2_alloc.c Tue Jan 29 00:11:21 2013 (r246048) +++ stable/9/sys/fs/ext2fs/ext2_alloc.c Tue Jan 29 01:44:13 2013 (r246049) @@ -169,7 +169,7 @@ ext2_reallocblks(ap) struct inode *ip; struct vnode *vp; struct buf *sbp, *ebp; - int32_t *bap, *sbap, *ebap = 0; + uint32_t *bap, *sbap, *ebap = 0; struct ext2mount *ump; struct cluster_save *buflist; struct indir start_ap[NIADDR + 1], end_ap[NIADDR + 1], *idp; Modified: stable/9/sys/fs/ext2fs/ext2_balloc.c ============================================================================== --- stable/9/sys/fs/ext2fs/ext2_balloc.c Tue Jan 29 00:11:21 2013 (r246048) +++ stable/9/sys/fs/ext2fs/ext2_balloc.c Tue Jan 29 01:44:13 2013 (r246049) @@ -69,7 +69,7 @@ ext2_balloc(ip, lbn, size, cred, bpp, fl struct buf *bp, *nbp; struct vnode *vp = ITOV(ip); struct indir indirs[NIADDR + 2]; - int32_t newb, *bap, pref; + uint32_t newb, *bap, pref; int osize, nsize, num, i, error; *bpp = NULL; Modified: stable/9/sys/fs/ext2fs/ext2_inode.c ============================================================================== --- stable/9/sys/fs/ext2fs/ext2_inode.c Tue Jan 29 00:11:21 2013 (r246048) +++ stable/9/sys/fs/ext2fs/ext2_inode.c Tue Jan 29 01:44:13 2013 (r246049) @@ -119,7 +119,7 @@ ext2_truncate(vp, length, flags, cred, t int32_t lastblock; struct inode *oip; int32_t bn, lbn, lastiblock[NIADDR], indir_lbn[NIADDR]; - int32_t oldblks[NDADDR + NIADDR], newblks[NDADDR + NIADDR]; + uint32_t oldblks[NDADDR + NIADDR], newblks[NDADDR + NIADDR]; struct bufobj *bo; struct m_ext2fs *fs; struct buf *bp; @@ -341,8 +341,9 @@ done: * Put back the real size. */ oip->i_size = length; - oip->i_blocks -= blocksreleased; - if (oip->i_blocks < 0) /* sanity */ + if (oip->i_blocks >= blocksreleased) + oip->i_blocks -= blocksreleased; + else /* sanity */ oip->i_blocks = 0; oip->i_flag |= IN_CHANGE; vnode_pager_setsize(ovp, length); Modified: stable/9/sys/fs/ext2fs/inode.h ============================================================================== --- stable/9/sys/fs/ext2fs/inode.h Tue Jan 29 00:11:21 2013 (r246048) +++ stable/9/sys/fs/ext2fs/inode.h Tue Jan 29 01:44:13 2013 (r246049) @@ -90,11 +90,11 @@ struct inode { int32_t i_atimensec; /* Last access time. */ int32_t i_ctimensec; /* Last inode change time. */ int32_t i_birthnsec; /* Inode creation time. */ - int32_t i_db[NDADDR]; /* Direct disk blocks. */ - int32_t i_ib[NIADDR]; /* Indirect disk blocks. */ + uint32_t i_db[NDADDR]; /* Direct disk blocks. */ + uint32_t i_ib[NIADDR]; /* Indirect disk blocks. */ uint32_t i_flags; /* Status flags (chflags). */ - int32_t i_blocks; /* Blocks actually held. */ - int32_t i_gen; /* Generation number. */ + uint32_t i_blocks; /* Blocks actually held. */ + uint32_t i_gen; /* Generation number. */ uint32_t i_uid; /* File owner. */ uint32_t i_gid; /* File group. */ }; @@ -163,7 +163,7 @@ struct ufid { uint16_t ufid_len; /* Length of structure. */ uint16_t ufid_pad; /* Force 32-bit alignment. */ ino_t ufid_ino; /* File number (ino). */ - int32_t ufid_gen; /* Generation number. */ + uint32_t ufid_gen; /* Generation number. */ }; #endif /* _KERNEL */ From owner-svn-src-stable-9@FreeBSD.ORG Tue Jan 29 13:49:09 2013 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 15FC833E; Tue, 29 Jan 2013 13:49:09 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 05A3CD0D; Tue, 29 Jan 2013 13:49:09 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0TDn8M7018584; Tue, 29 Jan 2013 13:49:08 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0TDn8Cb018583; Tue, 29 Jan 2013 13:49:08 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201301291349.r0TDn8Cb018583@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Tue, 29 Jan 2013 13:49:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r246069 - in stable/9: contrib/binutils/config contrib/bsnmp/lib contrib/bsnmp/snmp_target contrib/bsnmp/snmp_usm contrib/bsnmp/snmp_vacm contrib/dialog/samples/copifuncs contrib/ee con... X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Jan 2013 13:49:09 -0000 Author: pfg Date: Tue Jan 29 13:49:08 2013 New Revision: 246069 URL: http://svnweb.freebsd.org/changeset/base/246069 Log: Clean some 'svn:executable' properties in the tree. Submitted by: Christoph Mallon While here, merge some other mergeinfo properties that were left behind from my commits /head/include:r241008,241141,241181 /head/contrib/gcc:r244776,244792 /head/cddl:r238457,238509,238558 Modified: Directory Properties: stable/9/ (props changed) stable/9/cddl/ (props changed) stable/9/contrib/binutils/ (props changed) stable/9/contrib/binutils/config/acinclude.m4 (props changed) stable/9/contrib/bsnmp/ (props changed) stable/9/contrib/bsnmp/lib/tc.def (props changed) stable/9/contrib/bsnmp/snmp_target/snmp_target.3 (props changed) stable/9/contrib/bsnmp/snmp_target/target_snmp.c (props changed) stable/9/contrib/bsnmp/snmp_target/target_tree.def (props changed) stable/9/contrib/bsnmp/snmp_usm/snmp_usm.3 (props changed) stable/9/contrib/bsnmp/snmp_usm/usm_snmp.c (props changed) stable/9/contrib/bsnmp/snmp_usm/usm_tree.def (props changed) stable/9/contrib/bsnmp/snmp_vacm/snmp_vacm.3 (props changed) stable/9/contrib/bsnmp/snmp_vacm/vacm_snmp.c (props changed) stable/9/contrib/bsnmp/snmp_vacm/vacm_tree.def (props changed) stable/9/contrib/dialog/ (props changed) stable/9/contrib/dialog/samples/copifuncs/common.funcs (props changed) stable/9/contrib/dialog/samples/copifuncs/copi.ifman1 (props changed) stable/9/contrib/dialog/samples/copifuncs/copi.ifman2 (props changed) stable/9/contrib/dialog/samples/copifuncs/copi.ifmcfg2 (props changed) stable/9/contrib/dialog/samples/copifuncs/copi.ifmcfg4 (props changed) stable/9/contrib/dialog/samples/copifuncs/copi.ifmcfg5 (props changed) stable/9/contrib/dialog/samples/copifuncs/copi.ifpoll2 (props changed) stable/9/contrib/dialog/samples/copifuncs/copi.ifreq2 (props changed) stable/9/contrib/dialog/samples/copifuncs/copi.sendifm2 (props changed) stable/9/contrib/ee/ (props changed) stable/9/contrib/ee/Makefile (props changed) stable/9/contrib/ee/ee.c (props changed) stable/9/contrib/expat/ (props changed) stable/9/contrib/expat/doc/expat.png (props changed) stable/9/contrib/expat/doc/valid-xhtml10.png (props changed) stable/9/contrib/expat/lib/expat_external.h (props changed) stable/9/contrib/expat/tests/benchmark/README.txt (props changed) stable/9/contrib/expat/tests/benchmark/benchmark.c (props changed) stable/9/contrib/expat/tests/benchmark/benchmark.dsp (props changed) stable/9/contrib/expat/tests/benchmark/benchmark.dsw (props changed) stable/9/contrib/expat/tests/minicheck.c (props changed) stable/9/contrib/expat/tests/minicheck.h (props changed) stable/9/contrib/expat/tests/runtestspp.cpp (props changed) stable/9/contrib/expat/xmlwf/codepage.c (props changed) stable/9/contrib/expat/xmlwf/codepage.h (props changed) stable/9/contrib/expat/xmlwf/ct.c (props changed) stable/9/contrib/expat/xmlwf/filemap.h (props changed) stable/9/contrib/expat/xmlwf/readfilemap.c (props changed) stable/9/contrib/expat/xmlwf/unixfilemap.c (props changed) stable/9/contrib/expat/xmlwf/win32filemap.c (props changed) stable/9/contrib/expat/xmlwf/xmlfile.c (props changed) stable/9/contrib/expat/xmlwf/xmlfile.h (props changed) stable/9/contrib/expat/xmlwf/xmlmime.c (props changed) stable/9/contrib/expat/xmlwf/xmlmime.h (props changed) stable/9/contrib/expat/xmlwf/xmltchar.h (props changed) stable/9/contrib/expat/xmlwf/xmlurl.h (props changed) stable/9/contrib/expat/xmlwf/xmlwf.c (props changed) stable/9/contrib/expat/xmlwf/xmlwin32url.cxx (props changed) stable/9/contrib/gcc/ (props changed) stable/9/contrib/gcc/config/i386/host-cygwin.c (props changed) stable/9/contrib/gcc/config/i386/winnt-cxx.c (props changed) stable/9/contrib/gcc/config/i386/winnt-stubs.c (props changed) stable/9/contrib/gdb/ (props changed) stable/9/contrib/gdb/gdb/config/i386/nm-nto.h (props changed) stable/9/contrib/gdb/gdb/config/i386/nto.mh (props changed) stable/9/contrib/gdb/gdb/config/i386/nto.mt (props changed) stable/9/contrib/gdb/gdb/config/i386/tm-nto.h (props changed) stable/9/contrib/gdb/gdb/config/tm-nto.h (props changed) stable/9/contrib/gdb/gdb/i386-nto-tdep.c (props changed) stable/9/contrib/gdb/gdb/nto-procfs.c (props changed) stable/9/contrib/gdb/gdb/nto-tdep.c (props changed) stable/9/contrib/gdb/gdb/nto-tdep.h (props changed) stable/9/contrib/gdb/gdb/proc-api.c (props changed) stable/9/contrib/gdb/gdb/proc-events.c (props changed) stable/9/contrib/gdb/gdb/proc-flags.c (props changed) stable/9/contrib/gdb/gdb/proc-why.c (props changed) stable/9/contrib/gdb/gdb/uw-thread.c (props changed) stable/9/contrib/ipfilter/FreeBSD-4.0/ipv6-patch (props changed) stable/9/contrib/ipfilter/FreeBSD-4.0/ipv6-patch-4.0 (props changed) stable/9/contrib/libpcap/ (props changed) stable/9/contrib/libpcap/configure.in (props changed) stable/9/contrib/llvm/ (props changed) stable/9/contrib/llvm/lib/Target/Hexagon/HexagonAsmPrinter.h (props changed) stable/9/contrib/ntp/ (props changed) stable/9/contrib/ntp/html/drivers/driver44.html (props changed) stable/9/contrib/ntp/include/icom.h (props changed) stable/9/contrib/ntp/readme.y2kfixes (props changed) stable/9/contrib/ntp/scripts/stats/clock.awk (props changed) stable/9/contrib/ntp/scripts/stats/dupe.awk (props changed) stable/9/contrib/ntp/scripts/stats/ensemble.S (props changed) stable/9/contrib/ntp/scripts/stats/ensemble.awk (props changed) stable/9/contrib/ntp/scripts/stats/etf.S (props changed) stable/9/contrib/ntp/scripts/stats/etf.awk (props changed) stable/9/contrib/ntp/scripts/stats/itf.S (props changed) stable/9/contrib/ntp/scripts/stats/itf.awk (props changed) stable/9/contrib/ntp/scripts/stats/loop.S (props changed) stable/9/contrib/ntp/scripts/stats/loop.awk (props changed) stable/9/contrib/ntp/scripts/stats/loop_summary (props changed) stable/9/contrib/ntp/scripts/stats/peer.awk (props changed) stable/9/contrib/ntp/scripts/stats/psummary.awk (props changed) stable/9/contrib/ntp/scripts/stats/tdata.S (props changed) stable/9/contrib/ntp/scripts/stats/tdata.awk (props changed) stable/9/contrib/tcpdump/ (props changed) stable/9/contrib/tcpdump/bgp.h (props changed) stable/9/contrib/tcpdump/configure.in (props changed) stable/9/contrib/tcpdump/ipproto.c (props changed) stable/9/contrib/tcpdump/l2vpn.c (props changed) stable/9/contrib/tcpdump/l2vpn.h (props changed) stable/9/contrib/tcpdump/nlpid.c (props changed) stable/9/contrib/tcpdump/print-syslog.c (props changed) stable/9/crypto/heimdal/ (props changed) stable/9/crypto/heimdal/doc/vars.texi (props changed) stable/9/crypto/openssl/ (props changed) stable/9/crypto/openssl/crypto/bn/bn_const.c (props changed) stable/9/crypto/openssl/crypto/ocsp/ocsp_cl.c (props changed) stable/9/crypto/openssl/crypto/ocsp/ocsp_ext.c (props changed) stable/9/crypto/openssl/crypto/ocsp/ocsp_lib.c (props changed) stable/9/crypto/openssl/crypto/ocsp/ocsp_srv.c (props changed) stable/9/crypto/openssl/crypto/rand/rand_lcl.h (props changed) stable/9/crypto/openssl/util/libeay.num (props changed) stable/9/crypto/openssl/util/ssleay.num (props changed) stable/9/include/ (props changed) stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) stable/9/sys/dev/ath/ath_hal/ar5211/boss.ini (props changed) stable/9/sys/dev/bktr/CHANGELOG.TXT (props changed) stable/9/sys/dev/ixgbe/ (props changed) stable/9/sys/dev/ixgbe/ixgbe_82598.h (props changed) stable/9/sys/dev/ixgbe/ixgbe_82599.h (props changed) stable/9/sys/dev/ixgbe/ixgbe_x540.c (props changed) stable/9/sys/dev/ixgbe/ixgbe_x540.h (props changed) stable/9/sys/fs/ (props changed) stable/9/sys/fs/ext2fs/ext2_dinode.h (props changed) stable/9/sys/fs/ext2fs/ext2_dir.h (props changed) stable/9/sys/fs/ext2fs/ext2fs.h (props changed) stable/9/sys/mips/rmi/msgring_xls.cfg (props changed) stable/9/sys/modules/ (props changed) stable/9/sys/modules/digi/Makefile (props changed) stable/9/sys/modules/digi/Makefile.inc (props changed) stable/9/sys/modules/isci/Makefile (props changed) stable/9/sys/modules/sound/driver/ich/Makefile (props changed) stable/9/usr.sbin/ (props changed) stable/9/usr.sbin/bsnmpd/ (props changed) stable/9/usr.sbin/bsnmpd/modules/snmp_target/Makefile (props changed) stable/9/usr.sbin/bsnmpd/modules/snmp_usm/Makefile (props changed) stable/9/usr.sbin/bsnmpd/modules/snmp_vacm/Makefile (props changed) stable/9/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptools.c (props changed) From owner-svn-src-stable-9@FreeBSD.ORG Tue Jan 29 17:20:50 2013 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 9CDBE62C; Tue, 29 Jan 2013 17:20:50 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 8A411A29; Tue, 29 Jan 2013 17:20:50 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0THKo7e084278; Tue, 29 Jan 2013 17:20:50 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0THKoWJ084277; Tue, 29 Jan 2013 17:20:50 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201301291720.r0THKoWJ084277@svn.freebsd.org> From: Alexander Motin Date: Tue, 29 Jan 2013 17:20:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r246076 - stable/9/sys/geom/mirror X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Jan 2013 17:20:50 -0000 Author: mav Date: Tue Jan 29 17:20:49 2013 New Revision: 246076 URL: http://svnweb.freebsd.org/changeset/base/246076 Log: MFC r245443: Alike to r242314 for GRAID make GMIRROR more aggressive in marking volumes as clean on shutdown and move that action from shutdown_pre_sync stage to shutdown_post_sync to avoid extra flapping. ZFS tends to not close devices on shutdown, that doesn't allow GEOM MIRROR to shutdown gracefully. To handle that, mark volume as clean just when shutdown time comes and there are no active writes. PR: kern/113957 Modified: stable/9/sys/geom/mirror/g_mirror.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/geom/mirror/g_mirror.c ============================================================================== --- stable/9/sys/geom/mirror/g_mirror.c Tue Jan 29 17:05:21 2013 (r246075) +++ stable/9/sys/geom/mirror/g_mirror.c Tue Jan 29 17:20:49 2013 (r246076) @@ -80,7 +80,8 @@ SYSCTL_UINT(_kern_geom_mirror, OID_AUTO, G_MIRROR_DEBUG(4, "%s: Woken up %p.", __func__, (ident)); \ } while (0) -static eventhandler_tag g_mirror_pre_sync = NULL; +static eventhandler_tag g_mirror_post_sync = NULL; +static int g_mirror_shutdown = 0; static int g_mirror_destroy_geom(struct gctl_req *req, struct g_class *mp, struct g_geom *gp); @@ -814,7 +815,7 @@ g_mirror_idle(struct g_mirror_softc *sc, return (0); if (acw > 0 || (acw == -1 && sc->sc_provider->acw > 0)) { timeout = g_mirror_idletime - (time_uptime - sc->sc_last_write); - if (timeout > 0) + if (!g_mirror_shutdown && timeout > 0) return (timeout); } sc->sc_idle = 1; @@ -2820,7 +2821,7 @@ g_mirror_access(struct g_provider *pp, i error = ENXIO; goto end; } - if (dcw == 0 && !sc->sc_idle) + if (dcw == 0) g_mirror_idle(sc, dcw); if ((sc->sc_flags & G_MIRROR_DEVICE_FLAG_DESTROYING) != 0) { if (acr > 0 || acw > 0 || ace > 0) { @@ -3231,7 +3232,7 @@ g_mirror_dumpconf(struct sbuf *sb, const } static void -g_mirror_shutdown_pre_sync(void *arg, int howto) +g_mirror_shutdown_post_sync(void *arg, int howto) { struct g_class *mp; struct g_geom *gp, *gp2; @@ -3241,6 +3242,7 @@ g_mirror_shutdown_pre_sync(void *arg, in mp = arg; DROP_GIANT(); g_topology_lock(); + g_mirror_shutdown = 1; LIST_FOREACH_SAFE(gp, &mp->geom, geom, gp2) { if ((sc = gp->softc) == NULL) continue; @@ -3249,6 +3251,7 @@ g_mirror_shutdown_pre_sync(void *arg, in continue; g_topology_unlock(); sx_xlock(&sc->sc_lock); + g_mirror_idle(sc, -1); g_cancel_event(sc); error = g_mirror_destroy(sc, G_MIRROR_DESTROY_DELAYED); if (error != 0) @@ -3263,9 +3266,9 @@ static void g_mirror_init(struct g_class *mp) { - g_mirror_pre_sync = EVENTHANDLER_REGISTER(shutdown_pre_sync, - g_mirror_shutdown_pre_sync, mp, SHUTDOWN_PRI_FIRST); - if (g_mirror_pre_sync == NULL) + g_mirror_post_sync = EVENTHANDLER_REGISTER(shutdown_post_sync, + g_mirror_shutdown_post_sync, mp, SHUTDOWN_PRI_FIRST); + if (g_mirror_post_sync == NULL) G_MIRROR_DEBUG(0, "Warning! Cannot register shutdown event."); } @@ -3273,8 +3276,8 @@ static void g_mirror_fini(struct g_class *mp) { - if (g_mirror_pre_sync != NULL) - EVENTHANDLER_DEREGISTER(shutdown_pre_sync, g_mirror_pre_sync); + if (g_mirror_post_sync != NULL) + EVENTHANDLER_DEREGISTER(shutdown_post_sync, g_mirror_post_sync); } DECLARE_GEOM_CLASS(g_mirror_class, g_mirror); From owner-svn-src-stable-9@FreeBSD.ORG Tue Jan 29 17:45:06 2013 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 67615165; Tue, 29 Jan 2013 17:45:06 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 4B19DBD5; Tue, 29 Jan 2013 17:45:06 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0THj6F4090843; Tue, 29 Jan 2013 17:45:06 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0THj6sA090842; Tue, 29 Jan 2013 17:45:06 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201301291745.r0THj6sA090842@svn.freebsd.org> From: Alexander Motin Date: Tue, 29 Jan 2013 17:45:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r246079 - stable/9/sys/geom/raid3 X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Jan 2013 17:45:06 -0000 Author: mav Date: Tue Jan 29 17:45:05 2013 New Revision: 246079 URL: http://svnweb.freebsd.org/changeset/base/246079 Log: MFC r245444: Alike to r242314 for GRAID make GRAID3 more aggressive in marking volumes as clean on shutdown and move that action from shutdown_pre_sync stage to shutdown_post_sync to avoid extra flapping. ZFS tends to not close devices on shutdown, that doesn't allow GEOM RAID3 to shutdown gracefully. To handle that, mark volume as clean just when shutdown time comes and there are no active writes. Modified: stable/9/sys/geom/raid3/g_raid3.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/geom/raid3/g_raid3.c ============================================================================== --- stable/9/sys/geom/raid3/g_raid3.c Tue Jan 29 17:38:58 2013 (r246078) +++ stable/9/sys/geom/raid3/g_raid3.c Tue Jan 29 17:45:05 2013 (r246079) @@ -103,7 +103,8 @@ SYSCTL_UINT(_kern_geom_raid3_stat, OID_A G_RAID3_DEBUG(4, "%s: Woken up %p.", __func__, (ident)); \ } while (0) -static eventhandler_tag g_raid3_pre_sync = NULL; +static eventhandler_tag g_raid3_post_sync = NULL; +static int g_raid3_shutdown = 0; static int g_raid3_destroy_geom(struct gctl_req *req, struct g_class *mp, struct g_geom *gp); @@ -875,7 +876,7 @@ g_raid3_idle(struct g_raid3_softc *sc, i return (0); if (acw > 0 || (acw == -1 && sc->sc_provider->acw > 0)) { timeout = g_raid3_idletime - (time_uptime - sc->sc_last_write); - if (timeout > 0) + if (!g_raid3_shutdown && timeout > 0) return (timeout); } sc->sc_idle = 1; @@ -3097,7 +3098,7 @@ g_raid3_access(struct g_provider *pp, in error = ENXIO; goto end; } - if (dcw == 0 && !sc->sc_idle) + if (dcw == 0) g_raid3_idle(sc, dcw); if ((sc->sc_flags & G_RAID3_DEVICE_FLAG_DESTROYING) != 0) { if (acr > 0 || acw > 0 || ace > 0) { @@ -3543,7 +3544,7 @@ g_raid3_dumpconf(struct sbuf *sb, const } static void -g_raid3_shutdown_pre_sync(void *arg, int howto) +g_raid3_shutdown_post_sync(void *arg, int howto) { struct g_class *mp; struct g_geom *gp, *gp2; @@ -3553,6 +3554,7 @@ g_raid3_shutdown_pre_sync(void *arg, int mp = arg; DROP_GIANT(); g_topology_lock(); + g_raid3_shutdown = 1; LIST_FOREACH_SAFE(gp, &mp->geom, geom, gp2) { if ((sc = gp->softc) == NULL) continue; @@ -3561,6 +3563,7 @@ g_raid3_shutdown_pre_sync(void *arg, int continue; g_topology_unlock(); sx_xlock(&sc->sc_lock); + g_raid3_idle(sc, -1); g_cancel_event(sc); error = g_raid3_destroy(sc, G_RAID3_DESTROY_DELAYED); if (error != 0) @@ -3575,9 +3578,9 @@ static void g_raid3_init(struct g_class *mp) { - g_raid3_pre_sync = EVENTHANDLER_REGISTER(shutdown_pre_sync, - g_raid3_shutdown_pre_sync, mp, SHUTDOWN_PRI_FIRST); - if (g_raid3_pre_sync == NULL) + g_raid3_post_sync = EVENTHANDLER_REGISTER(shutdown_post_sync, + g_raid3_shutdown_post_sync, mp, SHUTDOWN_PRI_FIRST); + if (g_raid3_post_sync == NULL) G_RAID3_DEBUG(0, "Warning! Cannot register shutdown event."); } @@ -3585,8 +3588,8 @@ static void g_raid3_fini(struct g_class *mp) { - if (g_raid3_pre_sync != NULL) - EVENTHANDLER_DEREGISTER(shutdown_pre_sync, g_raid3_pre_sync); + if (g_raid3_post_sync != NULL) + EVENTHANDLER_DEREGISTER(shutdown_post_sync, g_raid3_post_sync); } DECLARE_GEOM_CLASS(g_raid3_class, g_raid3); From owner-svn-src-stable-9@FreeBSD.ORG Tue Jan 29 17:51:13 2013 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 5E4EA6E0; Tue, 29 Jan 2013 17:51:13 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 50360CC4; Tue, 29 Jan 2013 17:51:13 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0THpDw3093432; Tue, 29 Jan 2013 17:51:13 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0THpCWX093429; Tue, 29 Jan 2013 17:51:12 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201301291751.r0THpCWX093429@svn.freebsd.org> From: Alexander Motin Date: Tue, 29 Jan 2013 17:51:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r246081 - in stable/9: sbin/geom/class/raid3 sys/geom/raid3 X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Jan 2013 17:51:13 -0000 Author: mav Date: Tue Jan 29 17:51:12 2013 New Revision: 246081 URL: http://svnweb.freebsd.org/changeset/base/246081 Log: MFC r245456: Allow to insert new component to geom_raid3 without specifying number. PR: kern/160562 Modified: stable/9/sbin/geom/class/raid3/geom_raid3.c stable/9/sbin/geom/class/raid3/graid3.8 stable/9/sys/geom/raid3/g_raid3_ctl.c Directory Properties: stable/9/sbin/geom/class/raid3/ (props changed) stable/9/sys/ (props changed) Modified: stable/9/sbin/geom/class/raid3/geom_raid3.c ============================================================================== --- stable/9/sbin/geom/class/raid3/geom_raid3.c Tue Jan 29 17:47:07 2013 (r246080) +++ stable/9/sbin/geom/class/raid3/geom_raid3.c Tue Jan 29 17:51:12 2013 (r246081) @@ -76,7 +76,7 @@ struct g_command class_commands[] = { { "insert", G_FLAG_VERBOSE, NULL, { { 'h', "hardcode", NULL, G_TYPE_BOOL }, - { 'n', "number", NULL, G_TYPE_NUMBER }, + { 'n', "number", G_VAL_OPTIONAL, G_TYPE_NUMBER }, G_OPT_SENTINEL }, "[-hv] <-n number> name prov" Modified: stable/9/sbin/geom/class/raid3/graid3.8 ============================================================================== --- stable/9/sbin/geom/class/raid3/graid3.8 Tue Jan 29 17:47:07 2013 (r246080) +++ stable/9/sbin/geom/class/raid3/graid3.8 Tue Jan 29 17:51:12 2013 (r246081) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 5, 2010 +.Dd January 15, 2012 .Dt GRAID3 8 .Os .Sh NAME @@ -53,7 +53,7 @@ .Nm .Cm insert .Op Fl hv -.Fl n Ar number +.Op Fl n Ar number .Ar name .Ar prov .Nm @@ -171,6 +171,8 @@ Add the given component to the existing removed previously with the .Cm remove command or if one component is missing and will not be connected again. +If no number is given, new component will be added instead of first missed +component. .Pp Additional options include: .Bl -tag -width ".Fl h" Modified: stable/9/sys/geom/raid3/g_raid3_ctl.c ============================================================================== --- stable/9/sys/geom/raid3/g_raid3_ctl.c Tue Jan 29 17:47:07 2013 (r246080) +++ stable/9/sys/geom/raid3/g_raid3_ctl.c Tue Jan 29 17:51:12 2013 (r246081) @@ -404,7 +404,7 @@ g_raid3_ctl_insert(struct gctl_req *req, u_char *sector; off_t compsize; intmax_t *no; - int *hardcode, *nargs, error; + int *hardcode, *nargs, error, autono; nargs = gctl_get_paraml(req, "nargs", sizeof(*nargs)); if (nargs == NULL) { @@ -425,11 +425,10 @@ g_raid3_ctl_insert(struct gctl_req *req, gctl_error(req, "No 'arg%u' argument.", 1); return; } - no = gctl_get_paraml(req, "number", sizeof(*no)); - if (no == NULL) { - gctl_error(req, "No '%s' argument.", "no"); - return; - } + if (gctl_get_param(req, "number", NULL) != NULL) + no = gctl_get_paraml(req, "number", sizeof(*no)); + else + no = NULL; if (strncmp(name, "/dev/", 5) == 0) name += 5; g_topology_lock(); @@ -465,16 +464,30 @@ g_raid3_ctl_insert(struct gctl_req *req, gctl_error(req, "No such device: %s.", name); goto end; } - if (*no >= sc->sc_ndisks) { - sx_xunlock(&sc->sc_lock); - gctl_error(req, "Invalid component number."); - goto end; - } - disk = &sc->sc_disks[*no]; - if (disk->d_state != G_RAID3_DISK_STATE_NODISK) { - sx_xunlock(&sc->sc_lock); - gctl_error(req, "Component %jd is already connected.", *no); - goto end; + if (no != NULL) { + if (*no < 0 || *no >= sc->sc_ndisks) { + sx_xunlock(&sc->sc_lock); + gctl_error(req, "Invalid component number."); + goto end; + } + disk = &sc->sc_disks[*no]; + if (disk->d_state != G_RAID3_DISK_STATE_NODISK) { + sx_xunlock(&sc->sc_lock); + gctl_error(req, "Component %jd is already connected.", + *no); + goto end; + } + } else { + disk = NULL; + for (autono = 0; autono < sc->sc_ndisks && disk == NULL; autono++) + if (sc->sc_disks[autono].d_state == + G_RAID3_DISK_STATE_NODISK) + disk = &sc->sc_disks[autono]; + if (disk == NULL) { + sx_xunlock(&sc->sc_lock); + gctl_error(req, "No disconnected components."); + goto end; + } } if (((sc->sc_sectorsize / (sc->sc_ndisks - 1)) % pp->sectorsize) != 0) { sx_xunlock(&sc->sc_lock); From owner-svn-src-stable-9@FreeBSD.ORG Thu Jan 31 01:15:12 2013 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id CEC8BDDC; Thu, 31 Jan 2013 01:15:12 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id B61B7FE; Thu, 31 Jan 2013 01:15:12 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0V1FC6I065041; Thu, 31 Jan 2013 01:15:12 GMT (envelope-from mjg@svn.freebsd.org) Received: (from mjg@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0V1FCVD065040; Thu, 31 Jan 2013 01:15:12 GMT (envelope-from mjg@svn.freebsd.org) Message-Id: <201301310115.r0V1FCVD065040@svn.freebsd.org> From: Mateusz Guzik Date: Thu, 31 Jan 2013 01:15:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r246142 - stable/9/usr.bin/truss X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 31 Jan 2013 01:15:12 -0000 Author: mjg Date: Thu Jan 31 01:15:12 2013 New Revision: 246142 URL: http://svnweb.freebsd.org/changeset/base/246142 Log: MFC r245956: truss: if file requested with -o flag could not be opened print the reason Modified: stable/9/usr.bin/truss/main.c Directory Properties: stable/9/usr.bin/truss/ (props changed) Modified: stable/9/usr.bin/truss/main.c ============================================================================== --- stable/9/usr.bin/truss/main.c Thu Jan 31 00:14:25 2013 (r246141) +++ stable/9/usr.bin/truss/main.c Thu Jan 31 01:15:12 2013 (r246142) @@ -235,7 +235,7 @@ main(int ac, char **av) if (fname != NULL) { /* Use output file */ if ((trussinfo->outfile = fopen(fname, "w")) == NULL) - errx(1, "cannot open %s", fname); + err(1, "cannot open %s", fname); /* * Set FD_CLOEXEC, so that the output file is not shared with * the traced process. From owner-svn-src-stable-9@FreeBSD.ORG Thu Jan 31 19:24:34 2013 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id B7AD0E2F; Thu, 31 Jan 2013 19:24:34 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 9DBBFCB5; Thu, 31 Jan 2013 19:24:34 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0VJOYxC095035; Thu, 31 Jan 2013 19:24:34 GMT (envelope-from sbruno@svn.freebsd.org) Received: (from sbruno@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0VJOYgp095032; Thu, 31 Jan 2013 19:24:34 GMT (envelope-from sbruno@svn.freebsd.org) Message-Id: <201301311924.r0VJOYgp095032@svn.freebsd.org> From: Sean Bruno Date: Thu, 31 Jan 2013 19:24:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r246152 - stable/9/sys/dev/ciss X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 31 Jan 2013 19:24:34 -0000 Author: sbruno Date: Thu Jan 31 19:24:33 2013 New Revision: 246152 URL: http://svnweb.freebsd.org/changeset/base/246152 Log: MFC r245459 Satisfy the intent of kern/151564: [ciss] ciss(4) should increase CISS_MAX_LOGICAL to 107 Submitter wanted to increase the number of logical disks supported by ciss(4) by simply raising the CISS_MAX_LOGICAL value even higher. Instead, consult the documentation for the raid controller (OPENCISS) and poke the controller bits to ask it for how many logical/physical disks it can handle. Revert svn R242089 that raised CISS_MAX_LOGICAL to 64 for all controllers. For older controllers that don't support this mechanism, fallback to the old value of 16 logical disks. Tested on P420, P410, P400 and 6i model ciss(4) controllers. This should will be MFC'd back to stable/9 stable/8 and stable/7 after the MFC period. Modified: stable/9/sys/dev/ciss/ciss.c stable/9/sys/dev/ciss/cissreg.h stable/9/sys/dev/ciss/cissvar.h Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/ciss/ciss.c ============================================================================== --- stable/9/sys/dev/ciss/ciss.c Thu Jan 31 18:56:58 2013 (r246151) +++ stable/9/sys/dev/ciss/ciss.c Thu Jan 31 19:24:33 2013 (r246152) @@ -1202,13 +1202,21 @@ ciss_identify_adapter(struct ciss_softc /* XXX only really required for old 5300 adapters? */ sc->ciss_flags |= CISS_FLAG_BMIC_ABORT; + /* + * Earlier controller specs do not contain these config + * entries, so assume that a 0 means its old and assign + * these values to the defaults that were established + * when this driver was developed for them + */ + if (sc->ciss_cfg->max_logical_supported == 0) + sc->ciss_cfg->max_logical_supported = CISS_MAX_LOGICAL; + if (sc->ciss_cfg->max_physical_supported == 0) + sc->ciss_cfg->max_physical_supported = CISS_MAX_PHYSICAL; /* print information */ if (bootverbose) { -#if 0 /* XXX proxy volumes??? */ ciss_printf(sc, " %d logical drive%s configured\n", sc->ciss_id->configured_logical_drives, (sc->ciss_id->configured_logical_drives == 1) ? "" : "s"); -#endif ciss_printf(sc, " firmware %4.4s\n", sc->ciss_id->running_firmware_revision); ciss_printf(sc, " %d SCSI channels\n", sc->ciss_id->scsi_bus_count); @@ -1231,6 +1239,9 @@ ciss_identify_adapter(struct ciss_softc "\20\1ultra2\2ultra3\10fibre1\11fibre2\n"); ciss_printf(sc, " server name '%.16s'\n", sc->ciss_cfg->server_name); ciss_printf(sc, " heartbeat 0x%x\n", sc->ciss_cfg->heartbeat); + ciss_printf(sc, " max logical logical volumes: %d\n", sc->ciss_cfg->max_logical_supported); + ciss_printf(sc, " max physical disks supported: %d\n", sc->ciss_cfg->max_physical_supported); + ciss_printf(sc, " max physical disks per logical volume: %d\n", sc->ciss_cfg->max_physical_per_logical); } out: @@ -1318,7 +1329,7 @@ ciss_report_luns(struct ciss_softc *sc, break; case CISS_CMD_STATUS_DATA_OVERRUN: ciss_printf(sc, "WARNING: more units than driver limit (%d)\n", - CISS_MAX_LOGICAL); + sc->ciss_cfg->max_logical_supported); break; default: ciss_printf(sc, "error detecting logical drive configuration (%s)\n", @@ -1352,7 +1363,7 @@ ciss_init_logical(struct ciss_softc *sc) debug_called(1); cll = ciss_report_luns(sc, CISS_OPCODE_REPORT_LOGICAL_LUNS, - CISS_MAX_LOGICAL); + sc->ciss_cfg->max_logical_supported); if (cll == NULL) { error = ENXIO; goto out; @@ -1360,9 +1371,9 @@ ciss_init_logical(struct ciss_softc *sc) /* sanity-check reply */ ndrives = (ntohl(cll->list_size) / sizeof(union ciss_device_address)); - if ((ndrives < 0) || (ndrives > CISS_MAX_LOGICAL)) { + if ((ndrives < 0) || (ndrives > sc->ciss_cfg->max_logical_supported)) { ciss_printf(sc, "adapter claims to report absurd number of logical drives (%d > %d)\n", - ndrives, CISS_MAX_LOGICAL); + ndrives, sc->ciss_cfg->max_logical_supported); error = ENXIO; goto out; } @@ -1385,19 +1396,20 @@ ciss_init_logical(struct ciss_softc *sc) for (i = 0; i <= sc->ciss_max_logical_bus; i++) { sc->ciss_logical[i] = - malloc(CISS_MAX_LOGICAL * sizeof(struct ciss_ldrive), + malloc(sc->ciss_cfg->max_logical_supported * + sizeof(struct ciss_ldrive), CISS_MALLOC_CLASS, M_NOWAIT | M_ZERO); if (sc->ciss_logical[i] == NULL) { error = ENXIO; goto out; } - for (j = 0; j < CISS_MAX_LOGICAL; j++) + for (j = 0; j < sc->ciss_cfg->max_logical_supported; j++) sc->ciss_logical[i][j].cl_status = CISS_LD_NONEXISTENT; } - for (i = 0; i < CISS_MAX_LOGICAL; i++) { + for (i = 0; i < sc->ciss_cfg->max_logical_supported; i++) { if (i < ndrives) { struct ciss_ldrive *ld; int bus, target; @@ -1439,7 +1451,7 @@ ciss_init_physical(struct ciss_softc *sc target = 0; cll = ciss_report_luns(sc, CISS_OPCODE_REPORT_PHYSICAL_LUNS, - CISS_MAX_PHYSICAL); + sc->ciss_cfg->max_physical_supported); if (cll == NULL) { error = ENXIO; goto out; @@ -1982,7 +1994,7 @@ ciss_free(struct ciss_softc *sc) bus_dma_tag_destroy(sc->ciss_parent_dmat); if (sc->ciss_logical) { for (i = 0; i <= sc->ciss_max_logical_bus; i++) { - for (j = 0; j < CISS_MAX_LOGICAL; j++) { + for (j = 0; j < sc->ciss_cfg->max_logical_supported; j++) { if (sc->ciss_logical[i][j].cl_ldrive) free(sc->ciss_logical[i][j].cl_ldrive, CISS_MALLOC_CLASS); if (sc->ciss_logical[i][j].cl_lstatus) @@ -2965,9 +2977,9 @@ ciss_cam_action(struct cam_sim *sim, uni cpi->hba_inquiry = PI_TAG_ABLE; /* XXX is this correct? */ cpi->target_sprt = 0; cpi->hba_misc = 0; - cpi->max_target = CISS_MAX_LOGICAL; + cpi->max_target = sc->ciss_cfg->max_logical_supported; cpi->max_lun = 0; /* 'logical drive' channel only */ - cpi->initiator_id = CISS_MAX_LOGICAL; + cpi->initiator_id = sc->ciss_cfg->max_logical_supported; strncpy(cpi->sim_vid, "FreeBSD", SIM_IDLEN); strncpy(cpi->hba_vid, "msmith@freebsd.org", HBA_IDLEN); strncpy(cpi->dev_name, cam_sim_name(sim), DEV_IDLEN); @@ -3878,7 +3890,7 @@ ciss_notify_rescan_logical(struct ciss_s * drive address. */ cll = ciss_report_luns(sc, CISS_OPCODE_REPORT_LOGICAL_LUNS, - CISS_MAX_LOGICAL); + sc->ciss_cfg->max_logical_supported); if (cll == NULL) return; @@ -3889,7 +3901,7 @@ ciss_notify_rescan_logical(struct ciss_s * firmware. */ for (i = 0; i < sc->ciss_max_logical_bus; i++) { - for (j = 0; j < CISS_MAX_LOGICAL; j++) { + for (j = 0; j < sc->ciss_cfg->max_logical_supported; j++) { ld = &sc->ciss_logical[i][j]; if (ld->cl_update == 0) @@ -4058,7 +4070,7 @@ ciss_notify_hotplug(struct ciss_softc *s * Rescan the physical lun list for new items */ cll = ciss_report_luns(sc, CISS_OPCODE_REPORT_PHYSICAL_LUNS, - CISS_MAX_PHYSICAL); + sc->ciss_cfg->max_physical_supported); if (cll == NULL) { ciss_printf(sc, "Warning, cannot get physical lun list\n"); break; @@ -4306,7 +4318,7 @@ ciss_print_adapter(struct ciss_softc *sc "\20\1notify_ok\2control_open\3aborting\4running\21fake_synch\22bmic_abort\n"); for (i = 0; i < sc->ciss_max_logical_bus; i++) { - for (j = 0; j < CISS_MAX_LOGICAL; j++) { + for (j = 0; j < sc->ciss_cfg->max_logical_supported; j++) { ciss_printf(sc, "LOGICAL DRIVE %d: ", i); ciss_print_ldrive(sc, &sc->ciss_logical[i][j]); } Modified: stable/9/sys/dev/ciss/cissreg.h ============================================================================== --- stable/9/sys/dev/ciss/cissreg.h Thu Jan 31 18:56:58 2013 (r246151) +++ stable/9/sys/dev/ciss/cissreg.h Thu Jan 31 19:24:33 2013 (r246152) @@ -425,6 +425,15 @@ struct ciss_config_table #define CISS_DRIVER_DAUGHTER_ATTACHED (1<<8) #define CISS_DRIVER_SCSI_PREFETCH (1<<9) u_int32_t max_sg_length; /* 31 in older firmware */ +/* + * these fields appear in OpenCISS Spec 1.06 + * http://cciss.sourceforge.net/#docs + */ + u_int32_t max_logical_supported; + u_int32_t max_physical_supported; + u_int32_t max_physical_per_logical; + u_int32_t max_perfomant_mode_cmds; + u_int32_t max_block_fetch_count; } __packed; /* Modified: stable/9/sys/dev/ciss/cissvar.h ============================================================================== --- stable/9/sys/dev/ciss/cissvar.h Thu Jan 31 18:56:58 2013 (r246151) +++ stable/9/sys/dev/ciss/cissvar.h Thu Jan 31 19:24:33 2013 (r246152) @@ -45,8 +45,11 @@ typedef STAILQ_HEAD(, ciss_request) cr_q /* * Maximum number of logical drives we support. + * If the controller does not indicate a maximum + * value. This is a compatibiliy value to support + * older ciss controllers (e.g. model 6i) */ -#define CISS_MAX_LOGICAL 63 +#define CISS_MAX_LOGICAL 16 /* * Maximum number of physical devices we support. From owner-svn-src-stable-9@FreeBSD.ORG Thu Jan 31 20:47:35 2013 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id D827A67D; Thu, 31 Jan 2013 20:47:35 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id B21A696; Thu, 31 Jan 2013 20:47:35 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0VKlZs0019816; Thu, 31 Jan 2013 20:47:35 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0VKlZKl019815; Thu, 31 Jan 2013 20:47:35 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201301312047.r0VKlZKl019815@svn.freebsd.org> From: Alexander Motin Date: Thu, 31 Jan 2013 20:47:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r246156 - stable/9/sys/dev/ahci X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 31 Jan 2013 20:47:35 -0000 Author: mav Date: Thu Jan 31 20:47:35 2013 New Revision: 246156 URL: http://svnweb.freebsd.org/changeset/base/246156 Log: MFC r245875: Disable MSI interrupts for SB600 chipset. According to the report they are not functional. PR: kern/174880, kern/174985, kern/175002 Modified: stable/9/sys/dev/ahci/ahci.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/ahci/ahci.c ============================================================================== --- stable/9/sys/dev/ahci/ahci.c Thu Jan 31 20:32:11 2013 (r246155) +++ stable/9/sys/dev/ahci/ahci.c Thu Jan 31 20:47:35 2013 (r246156) @@ -120,8 +120,9 @@ static struct { #define AHCI_Q_NOAA 512 #define AHCI_Q_NOCOUNT 1024 #define AHCI_Q_ALTSIG 2048 +#define AHCI_Q_NOMSI 4096 } ahci_ids[] = { - {0x43801002, 0x00, "ATI IXP600", 0}, + {0x43801002, 0x00, "ATI IXP600", AHCI_Q_NOMSI}, {0x43901002, 0x00, "ATI IXP700", 0}, {0x43911002, 0x00, "ATI IXP700", 0}, {0x43921002, 0x00, "ATI IXP700", 0}, @@ -638,6 +639,8 @@ ahci_setup_interrupt(device_t dev) int i, msi = 1; /* Process hints. */ + if (ctlr->quirks & AHCI_Q_NOMSI) + msi = 0; resource_int_value(device_get_name(dev), device_get_unit(dev), "msi", &msi); if (msi < 0) From owner-svn-src-stable-9@FreeBSD.ORG Thu Jan 31 21:24:39 2013 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 7F7A65C6; Thu, 31 Jan 2013 21:24:39 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 6D13B26D; Thu, 31 Jan 2013 21:24:39 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0VLOcAm032013; Thu, 31 Jan 2013 21:24:38 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0VLOcNK032012; Thu, 31 Jan 2013 21:24:38 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201301312124.r0VLOcNK032012@svn.freebsd.org> From: Alexander Motin Date: Thu, 31 Jan 2013 21:24:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r246160 - stable/9/sys/geom/raid X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 31 Jan 2013 21:24:39 -0000 Author: mav Date: Thu Jan 31 21:24:38 2013 New Revision: 246160 URL: http://svnweb.freebsd.org/changeset/base/246160 Log: MFC r245519: Recalculate volume size only for real CONCATs. For SINGLE trust volume size given by metadata, as it should be correct and in some cases can be smaller then subdisk size. Modified: stable/9/sys/geom/raid/tr_concat.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/geom/raid/tr_concat.c ============================================================================== --- stable/9/sys/geom/raid/tr_concat.c Thu Jan 31 21:01:42 2013 (r246159) +++ stable/9/sys/geom/raid/tr_concat.c Thu Jan 31 21:24:38 2013 (r246160) @@ -124,7 +124,8 @@ g_raid_tr_update_state_concat(struct g_r * Some metadata modules may not know CONCAT volume * mediasize until all disks connected. Recalculate. */ - if (G_RAID_VOLUME_S_ALIVE(s) && + if (vol->v_raid_level == G_RAID_VOLUME_RL_CONCAT && + G_RAID_VOLUME_S_ALIVE(s) && !G_RAID_VOLUME_S_ALIVE(vol->v_state)) { size = 0; for (i = 0; i < vol->v_disks_count; i++) { From owner-svn-src-stable-9@FreeBSD.ORG Thu Jan 31 22:05:19 2013 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 2A8EF386; Thu, 31 Jan 2013 22:05:19 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 0F1A168E; Thu, 31 Jan 2013 22:05:19 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0VM5IgC043961; Thu, 31 Jan 2013 22:05:18 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0VM5ILq043959; Thu, 31 Jan 2013 22:05:18 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201301312205.r0VM5ILq043959@svn.freebsd.org> From: Alexander Motin Date: Thu, 31 Jan 2013 22:05:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r246164 - in stable/9: sbin/geom/class/raid sys/geom/raid X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 31 Jan 2013 22:05:19 -0000 Author: mav Date: Thu Jan 31 22:05:18 2013 New Revision: 246164 URL: http://svnweb.freebsd.org/changeset/base/246164 Log: MFC r245522, r245533: For Promise/AMD metadata add support for disks with capacity above 2TiB and for volumes with sector size above 512 bytes. Modified: stable/9/sbin/geom/class/raid/graid.8 stable/9/sys/geom/raid/md_promise.c Directory Properties: stable/9/sbin/geom/class/raid/ (props changed) stable/9/sys/ (props changed) Modified: stable/9/sbin/geom/class/raid/graid.8 ============================================================================== --- stable/9/sbin/geom/class/raid/graid.8 Thu Jan 31 21:53:55 2013 (r246163) +++ stable/9/sbin/geom/class/raid/graid.8 Thu Jan 31 22:05:18 2013 (r246164) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 13, 2012 +.Dd January 16, 2013 .Dt GRAID 8 .Os .Sh NAME @@ -274,7 +274,6 @@ complete it there. Do not run GEOM RAID class on migrating volumes under pain of possible data corruption! .Sh 2TiB BARRIERS -Promise metadata format does not support disks above 2TiB. NVIDIA metadata format does not support volumes above 2TiB. .Sh SYSCTL VARIABLES The following Modified: stable/9/sys/geom/raid/md_promise.c ============================================================================== --- stable/9/sys/geom/raid/md_promise.c Thu Jan 31 21:53:55 2013 (r246163) +++ stable/9/sys/geom/raid/md_promise.c Thu Jan 31 22:05:18 2013 (r246164) @@ -84,7 +84,7 @@ struct promise_raid_conf { struct promise_raid_disk disk; /* This subdisk info. */ uint32_t disk_offset; /* Subdisk offset. */ uint32_t disk_sectors; /* Subdisk size */ - uint32_t rebuild_lba; /* Rebuild position. */ + uint32_t disk_rebuild; /* Rebuild position. */ uint16_t generation; /* Generation number. */ uint8_t status; /* Volume status. */ #define PROMISE_S_VALID 0x01 @@ -123,7 +123,18 @@ struct promise_raid_conf { uint32_t magic_4; uint32_t magic_5; uint32_t total_sectors_high; - uint32_t filler3[324]; + uint8_t magic_6; + uint8_t sector_size; + uint16_t magic_7; + uint32_t magic_8[31]; + uint32_t backup_time; + uint16_t magic_9; + uint32_t disk_offset_high; + uint32_t disk_sectors_high; + uint32_t disk_rebuild_high; + uint16_t magic_10; + uint32_t magic_11[3]; + uint32_t filler3[284]; uint32_t checksum; } __packed; @@ -191,7 +202,7 @@ g_raid_md_promise_print(struct promise_r meta->disk.device, meta->disk.id); printf("disk_offset %u\n", meta->disk_offset); printf("disk_sectors %u\n", meta->disk_sectors); - printf("rebuild_lba %u\n", meta->rebuild_lba); + printf("disk_rebuild %u\n", meta->disk_rebuild); printf("generation %u\n", meta->generation); printf("status 0x%02x\n", meta->status); printf("type %u\n", meta->type); @@ -217,6 +228,11 @@ g_raid_md_promise_print(struct promise_r printf("magic_4 0x%08x\n", meta->magic_4); printf("magic_5 0x%08x\n", meta->magic_5); printf("total_sectors_high 0x%08x\n", meta->total_sectors_high); + printf("sector_size %u\n", meta->sector_size); + printf("backup_time %d\n", meta->backup_time); + printf("disk_offset_high 0x%08x\n", meta->disk_offset_high); + printf("disk_sectors_high 0x%08x\n", meta->disk_sectors_high); + printf("disk_rebuild_high 0x%08x\n", meta->disk_rebuild_high); printf("=================================================\n"); } @@ -244,9 +260,9 @@ promise_meta_find_disk(struct promise_ra static int promise_meta_unused_range(struct promise_raid_conf **metaarr, int nsd, - uint32_t sectors, uint32_t *off, uint32_t *size) + off_t sectors, off_t *off, off_t *size) { - uint32_t coff, csize; + off_t coff, csize, tmp; int i, j; sectors -= 131072; @@ -257,10 +273,10 @@ promise_meta_unused_range(struct promise i = 0; while (1) { for (j = 0; j < nsd; j++) { - if (metaarr[j]->disk_offset >= coff) { - csize = MIN(csize, - metaarr[j]->disk_offset - coff); - } + tmp = ((off_t)metaarr[j]->disk_offset_high << 32) + + metaarr[j]->disk_offset; + if (tmp >= coff) + csize = MIN(csize, tmp - coff); } if (csize > *size) { *off = coff; @@ -268,7 +284,10 @@ promise_meta_unused_range(struct promise } if (i >= nsd) break; - coff = metaarr[i]->disk_offset + metaarr[i]->disk_sectors; + coff = ((off_t)metaarr[i]->disk_offset_high << 32) + + metaarr[i]->disk_offset + + ((off_t)metaarr[i]->disk_sectors_high << 32) + + metaarr[i]->disk_sectors; csize = sectors - coff; i++; }; @@ -369,6 +388,26 @@ next: return (subdisks); } + /* Remove filler garbage from fields used in newer metadata. */ + if (meta->disk_offset_high == 0x8b8c8d8e && + meta->disk_sectors_high == 0x8788898a && + meta->disk_rebuild_high == 0x83848586) { + meta->disk_offset_high = 0; + meta->disk_sectors_high = 0; + if (meta->disk_rebuild == UINT32_MAX) + meta->disk_rebuild_high = UINT32_MAX; + else + meta->disk_rebuild_high = 0; + if (meta->total_sectors_high == 0x15161718) { + meta->total_sectors_high = 0; + meta->backup_time = 0; + if (meta->rebuild_lba64 == 0x2122232425262728) + meta->rebuild_lba64 = UINT64_MAX; + } + } + if (meta->sector_size < 1 || meta->sector_size > 8) + meta->sector_size = 1; + /* Save this part and look for next. */ *metaarr = meta; metaarr++; @@ -386,8 +425,9 @@ promise_meta_write(struct g_consumer *cp struct g_provider *pp; struct promise_raid_conf *meta; char *buf; + off_t off, size; int error, i, subdisk, fake; - uint32_t checksum, *ptr, off, size; + uint32_t checksum, *ptr; pp = cp->provider; subdisk = 0; @@ -409,9 +449,12 @@ next: meta->disk.flags = PROMISE_F_ONLINE | PROMISE_F_VALID; meta->disk.number = 0xff; arc4rand(&meta->disk.id, sizeof(meta->disk.id), 0); - meta->disk_offset = off; - meta->disk_sectors = size; - meta->rebuild_lba = UINT32_MAX; + meta->disk_offset_high = off >> 32; + meta->disk_offset = (uint32_t)off; + meta->disk_sectors_high = size >> 32; + meta->disk_sectors = (uint32_t)size; + meta->disk_rebuild_high = UINT32_MAX; + meta->disk_rebuild = UINT32_MAX; fake = 1; } if (meta != NULL) { @@ -464,6 +507,7 @@ static int promise_meta_write_spare(struct g_consumer *cp) { struct promise_raid_conf *meta; + off_t tmp; int error; meta = malloc(sizeof(*meta), M_MD_PROMISE, M_WAITOK | M_ZERO); @@ -473,9 +517,11 @@ promise_meta_write_spare(struct g_consum meta->disk.flags = PROMISE_F_SPARE | PROMISE_F_ONLINE | PROMISE_F_VALID; meta->disk.number = 0xff; arc4rand(&meta->disk.id, sizeof(meta->disk.id), 0); - meta->disk_sectors = cp->provider->mediasize / cp->provider->sectorsize; - meta->disk_sectors -= 131072; - meta->rebuild_lba = UINT32_MAX; + tmp = cp->provider->mediasize / cp->provider->sectorsize - 131072; + meta->disk_sectors_high = tmp >> 32; + meta->disk_sectors = (uint32_t)tmp; + meta->disk_rebuild_high = UINT32_MAX; + meta->disk_rebuild = UINT32_MAX; error = promise_meta_write(cp, &meta, 1); free(meta, M_MD_PROMISE); return (error); @@ -617,9 +663,8 @@ g_raid_md_promise_start_disk(struct g_ra struct g_raid_md_promise_perdisk *pd; struct g_raid_md_promise_pervolume *pv; struct promise_raid_conf *meta; - off_t size; + off_t eoff, esize, size; int disk_pos, md_disk_pos, i, resurrection = 0; - uint32_t eoff, esize; sc = disk->d_softc; pd = (struct g_raid_md_promise_perdisk *)disk->d_md_data; @@ -729,8 +774,10 @@ nofit: sd->sd_offset = (off_t)eoff * 512; sd->sd_size = (off_t)esize * 512; } else { - sd->sd_offset = (off_t)pd->pd_meta[sdn]->disk_offset * 512; - sd->sd_size = (off_t)pd->pd_meta[sdn]->disk_sectors * 512; + sd->sd_offset = (((off_t)pd->pd_meta[sdn]->disk_offset_high + << 32) + pd->pd_meta[sdn]->disk_offset) * 512; + sd->sd_size = (((off_t)pd->pd_meta[sdn]->disk_sectors_high + << 32) + pd->pd_meta[sdn]->disk_sectors) * 512; } if (resurrection) { @@ -749,7 +796,8 @@ nofit: sd->sd_rebuild_pos = 0; else { sd->sd_rebuild_pos = - (off_t)pd->pd_meta[sdn]->rebuild_lba * 512; + (((off_t)pd->pd_meta[sdn]->disk_rebuild_high << 32) + + pd->pd_meta[sdn]->disk_rebuild) * 512; } } else if (!(meta->disks[md_disk_pos].flags & PROMISE_F_ONLINE)) { /* Rebuilding disk. */ @@ -875,13 +923,15 @@ g_raid_md_promise_start(struct g_raid_vo vol->v_disks_count = meta->total_disks; vol->v_mediasize = (off_t)meta->total_sectors * 512; //ZZZ if (meta->total_sectors_high < 256) /* If value looks sane. */ - vol->v_mediasize |= + vol->v_mediasize += ((off_t)meta->total_sectors_high << 32) * 512; //ZZZ - vol->v_sectorsize = 512; //ZZZ + vol->v_sectorsize = 512 * meta->sector_size; for (i = 0; i < vol->v_disks_count; i++) { sd = &vol->v_subdisks[i]; - sd->sd_offset = (off_t)meta->disk_offset * 512; //ZZZ - sd->sd_size = (off_t)meta->disk_sectors * 512; //ZZZ + sd->sd_offset = (((off_t)meta->disk_offset_high << 32) + + meta->disk_offset) * 512; + sd->sd_size = (((off_t)meta->disk_sectors_high << 32) + + meta->disk_sectors) * 512; } g_raid_start_volume(vol); @@ -1213,9 +1263,8 @@ g_raid_md_ctl_promise(struct g_raid_md_o const char *nodename, *verb, *volname, *levelname, *diskname; char *tmp; int *nargs, *force; - off_t size, sectorsize, strip; + off_t esize, offs[PROMISE_MAX_DISKS], size, sectorsize, strip; intmax_t *sizearg, *striparg; - uint32_t offs[PROMISE_MAX_DISKS], esize; int numdisks, i, len, level, qual; int error; @@ -1323,13 +1372,6 @@ g_raid_md_ctl_promise(struct g_raid_md_o cp->private = disk; g_topology_unlock(); - if (pp->mediasize / pp->sectorsize > UINT32_MAX) { - gctl_error(req, - "Disk '%s' is too big.", diskname); - error = -8; - break; - } - g_raid_get_disk_info(disk); /* Reserve some space for metadata. */ @@ -1394,10 +1436,6 @@ g_raid_md_ctl_promise(struct g_raid_md_o gctl_error(req, "Size too small."); return (-13); } - if (size > 0xffffffffllu * sectorsize) { - gctl_error(req, "Size too big."); - return (-14); - } /* We have all we need, create things: volume, ... */ pv = malloc(sizeof(*pv), M_MD_PROMISE, M_WAITOK | M_ZERO); @@ -1629,14 +1667,6 @@ g_raid_md_ctl_promise(struct g_raid_md_o pp = cp->provider; g_topology_unlock(); - if (pp->mediasize / pp->sectorsize > UINT32_MAX) { - gctl_error(req, - "Disk '%s' is too big.", diskname); - g_raid_kill_consumer(sc, cp); - error = -8; - break; - } - pd = malloc(sizeof(*pd), M_MD_PROMISE, M_WAITOK | M_ZERO); disk = g_raid_create_disk(sc); @@ -1733,9 +1763,9 @@ g_raid_md_write_promise(struct g_raid_md vol->v_raid_level == G_RAID_VOLUME_RL_RAID1E) meta->array_width /= 2; meta->array_number = vol->v_global_id; - meta->total_sectors = vol->v_mediasize / vol->v_sectorsize; - meta->total_sectors_high = - (vol->v_mediasize / vol->v_sectorsize) >> 32; + meta->total_sectors = vol->v_mediasize / 512; + meta->total_sectors_high = (vol->v_mediasize / 512) >> 32; + meta->sector_size = vol->v_sectorsize / 512; meta->cylinders = meta->total_sectors / (255 * 63) - 1; meta->heads = 254; meta->sectors = 63; @@ -1828,15 +1858,24 @@ g_raid_md_write_promise(struct g_raid_md pd->pd_meta[j] = promise_meta_copy(meta); pd->pd_meta[j]->disk = meta->disks[pos]; pd->pd_meta[j]->disk.number = pos; + pd->pd_meta[j]->disk_offset_high = + (sd->sd_offset / 512) >> 32; pd->pd_meta[j]->disk_offset = sd->sd_offset / 512; + pd->pd_meta[j]->disk_sectors_high = + (sd->sd_size / 512) >> 32; pd->pd_meta[j]->disk_sectors = sd->sd_size / 512; if (sd->sd_state == G_RAID_SUBDISK_S_REBUILD) { - pd->pd_meta[j]->rebuild_lba = + pd->pd_meta[j]->disk_rebuild_high = + (sd->sd_rebuild_pos / 512) >> 32; + pd->pd_meta[j]->disk_rebuild = sd->sd_rebuild_pos / 512; - } else if (sd->sd_state < G_RAID_SUBDISK_S_REBUILD) - pd->pd_meta[j]->rebuild_lba = 0; - else - pd->pd_meta[j]->rebuild_lba = UINT32_MAX; + } else if (sd->sd_state < G_RAID_SUBDISK_S_REBUILD) { + pd->pd_meta[j]->disk_rebuild_high = 0; + pd->pd_meta[j]->disk_rebuild = 0; + } else { + pd->pd_meta[j]->disk_rebuild_high = UINT32_MAX; + pd->pd_meta[j]->disk_rebuild = UINT32_MAX; + } pd->pd_updated = 1; } } From owner-svn-src-stable-9@FreeBSD.ORG Thu Jan 31 22:12:26 2013 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 59F389C5; Thu, 31 Jan 2013 22:12:26 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 3236E6E2; Thu, 31 Jan 2013 22:12:26 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0VMCQE7046947; Thu, 31 Jan 2013 22:12:26 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0VMCP3S046944; Thu, 31 Jan 2013 22:12:25 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201301312212.r0VMCP3S046944@svn.freebsd.org> From: Alexander Motin Date: Thu, 31 Jan 2013 22:12:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r246168 - stable/9/sys/geom/raid X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 31 Jan 2013 22:12:26 -0000 Author: mav Date: Thu Jan 31 22:12:25 2013 New Revision: 246168 URL: http://svnweb.freebsd.org/changeset/base/246168 Log: MFC r245326: Add basic support for Intel Rapid Recover Technology (Intel RRT). It is alike to RAID1, but with dedicating master and recovery disks and providing manual control over synchronization. It allows to use recovery disk as snapshot of the master disk from the time of the last sync. This implementation is not functionaly complete comparing to Windows, but it is better then silent conversion to RAID1 on first boot. Modified: stable/9/sys/geom/raid/g_raid.c stable/9/sys/geom/raid/g_raid.h stable/9/sys/geom/raid/md_intel.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/geom/raid/g_raid.c ============================================================================== --- stable/9/sys/geom/raid/g_raid.c Thu Jan 31 22:10:57 2013 (r246167) +++ stable/9/sys/geom/raid/g_raid.c Thu Jan 31 22:12:25 2013 (r246168) @@ -163,6 +163,8 @@ g_raid_disk_state2str(int state) return ("NONE"); case G_RAID_DISK_S_OFFLINE: return ("OFFLINE"); + case G_RAID_DISK_S_DISABLED: + return ("DISABLED"); case G_RAID_DISK_S_FAILED: return ("FAILED"); case G_RAID_DISK_S_STALE_FAILED: @@ -535,7 +537,9 @@ g_raid_report_disk_state(struct g_raid_d if (disk->d_consumer == NULL) return; - if (disk->d_state == G_RAID_DISK_S_FAILED || + if (disk->d_state == G_RAID_DISK_S_DISABLED) { + ; + } else if (disk->d_state == G_RAID_DISK_S_FAILED || disk->d_state == G_RAID_DISK_S_STALE_FAILED) { s = G_STATE_FAILED; } else { Modified: stable/9/sys/geom/raid/g_raid.h ============================================================================== --- stable/9/sys/geom/raid/g_raid.h Thu Jan 31 22:10:57 2013 (r246167) +++ stable/9/sys/geom/raid/g_raid.h Thu Jan 31 22:12:25 2013 (r246168) @@ -140,11 +140,12 @@ struct g_raid_event { }; #define G_RAID_DISK_S_NONE 0x00 /* State is unknown. */ #define G_RAID_DISK_S_OFFLINE 0x01 /* Missing disk placeholder. */ -#define G_RAID_DISK_S_FAILED 0x02 /* Failed. */ -#define G_RAID_DISK_S_STALE_FAILED 0x03 /* Old failed. */ -#define G_RAID_DISK_S_SPARE 0x04 /* Hot-spare. */ -#define G_RAID_DISK_S_STALE 0x05 /* Old disk, unused now. */ -#define G_RAID_DISK_S_ACTIVE 0x06 /* Operational. */ +#define G_RAID_DISK_S_DISABLED 0x02 /* Disabled. */ +#define G_RAID_DISK_S_FAILED 0x03 /* Failed. */ +#define G_RAID_DISK_S_STALE_FAILED 0x04 /* Old failed. */ +#define G_RAID_DISK_S_SPARE 0x05 /* Hot-spare. */ +#define G_RAID_DISK_S_STALE 0x06 /* Old disk, unused now. */ +#define G_RAID_DISK_S_ACTIVE 0x07 /* Operational. */ #define G_RAID_DISK_E_DISCONNECTED 0x01 Modified: stable/9/sys/geom/raid/md_intel.c ============================================================================== --- stable/9/sys/geom/raid/md_intel.c Thu Jan 31 22:10:57 2013 (r246167) +++ stable/9/sys/geom/raid/md_intel.c Thu Jan 31 22:12:25 2013 (r246168) @@ -98,6 +98,8 @@ struct intel_raid_vol { uint8_t cng_master_disk; uint16_t cache_policy; uint8_t cng_state; +#define INTEL_SNGST_NEEDS_UPDATE 1 +#define INTEL_SNGST_MASTER_MISSING 2 uint8_t cng_sub_state; uint32_t filler_0[10]; @@ -130,6 +132,7 @@ struct intel_raid_disk { #define INTEL_F_ASSIGNED 0x02 #define INTEL_F_FAILED 0x04 #define INTEL_F_ONLINE 0x08 +#define INTEL_F_DISABLED 0x80 uint32_t owner_cfg_num; uint32_t sectors_hi; uint32_t filler[3]; @@ -187,6 +190,13 @@ struct g_raid_md_intel_perdisk { struct intel_raid_disk pd_disk_meta; }; +struct g_raid_md_intel_pervolume { + int pv_volume_pos; + int pv_cng; + int pv_cng_man_sync; + int pv_cng_master_disk; +}; + struct g_raid_md_intel_object { struct g_raid_md_object mdio_base; uint32_t mdio_config_id; @@ -206,6 +216,7 @@ static g_raid_md_ctl_t g_raid_md_ctl_int static g_raid_md_write_t g_raid_md_write_intel; static g_raid_md_fail_disk_t g_raid_md_fail_disk_intel; static g_raid_md_free_disk_t g_raid_md_free_disk_intel; +static g_raid_md_free_volume_t g_raid_md_free_volume_intel; static g_raid_md_free_t g_raid_md_free_intel; static kobj_method_t g_raid_md_intel_methods[] = { @@ -216,6 +227,7 @@ static kobj_method_t g_raid_md_intel_met KOBJMETHOD(g_raid_md_write, g_raid_md_write_intel), KOBJMETHOD(g_raid_md_fail_disk, g_raid_md_fail_disk_intel), KOBJMETHOD(g_raid_md_free_disk, g_raid_md_free_disk_intel), + KOBJMETHOD(g_raid_md_free_volume, g_raid_md_free_volume_intel), KOBJMETHOD(g_raid_md_free, g_raid_md_free_intel), { 0, 0 } }; @@ -369,8 +381,15 @@ g_raid_md_intel_print(struct intel_raid_ printf(" ****** Volume %d ******\n", i); printf(" name %.16s\n", mvol->name); printf(" total_sectors %ju\n", mvol->total_sectors); - printf(" state %u\n", mvol->state); + printf(" state 0x%08x\n", mvol->state); printf(" reserved %u\n", mvol->reserved); + printf(" migr_priority %u\n", mvol->migr_priority); + printf(" num_sub_vols %u\n", mvol->num_sub_vols); + printf(" tid %u\n", mvol->tid); + printf(" cng_master_disk %u\n", mvol->cng_master_disk); + printf(" cache_policy %u\n", mvol->cache_policy); + printf(" cng_state %u\n", mvol->cng_state); + printf(" cng_sub_state %u\n", mvol->cng_sub_state); printf(" curr_migr_unit %u\n", mvol->curr_migr_unit); printf(" curr_migr_unit_hi %u\n", mvol->curr_migr_unit_hi); printf(" checkpoint_id %u\n", mvol->checkpoint_id); @@ -699,9 +718,11 @@ static struct g_raid_volume * g_raid_md_intel_get_volume(struct g_raid_softc *sc, int id) { struct g_raid_volume *mvol; + struct g_raid_md_intel_pervolume *pv; TAILQ_FOREACH(mvol, &sc->sc_volumes, v_next) { - if ((intptr_t)(mvol->v_md_data) == id) + pv = mvol->v_md_data; + if (pv->pv_volume_pos == id) break; } return (mvol); @@ -715,6 +736,7 @@ g_raid_md_intel_start_disk(struct g_raid struct g_raid_disk *olddisk, *tmpdisk; struct g_raid_md_object *md; struct g_raid_md_intel_object *mdi; + struct g_raid_md_intel_pervolume *pv; struct g_raid_md_intel_perdisk *pd, *oldpd; struct intel_raid_conf *meta; struct intel_raid_vol *mvol; @@ -732,6 +754,11 @@ g_raid_md_intel_start_disk(struct g_raid disk_pos = intel_meta_find_disk(meta, pd->pd_disk_meta.serial); if (disk_pos < 0) { G_RAID_DEBUG1(1, sc, "Unknown, probably new or stale disk"); + /* Disabled disk is useless for us. */ + if (pd->pd_disk_meta.flags & INTEL_F_DISABLED) { + g_raid_change_disk_state(disk, G_RAID_DISK_S_DISABLED); + return (0); + } /* Failed stale disk is useless for us. */ if (pd->pd_disk_meta.flags & INTEL_F_FAILED) { g_raid_change_disk_state(disk, G_RAID_DISK_S_STALE_FAILED); @@ -826,6 +853,8 @@ nofit: /* Welcome the new disk. */ if (resurrection) g_raid_change_disk_state(disk, G_RAID_DISK_S_ACTIVE); + else if (meta->disk[disk_pos].flags & INTEL_F_DISABLED) + g_raid_change_disk_state(disk, G_RAID_DISK_S_DISABLED); else if (meta->disk[disk_pos].flags & INTEL_F_FAILED) g_raid_change_disk_state(disk, G_RAID_DISK_S_FAILED); else if (meta->disk[disk_pos].flags & INTEL_F_SPARE) @@ -833,8 +862,8 @@ nofit: else g_raid_change_disk_state(disk, G_RAID_DISK_S_ACTIVE); TAILQ_FOREACH(sd, &disk->d_subdisks, sd_next) { - mvol = intel_get_volume(meta, - (uintptr_t)(sd->sd_volume->v_md_data)); + pv = sd->sd_volume->v_md_data; + mvol = intel_get_volume(meta, pv->pv_volume_pos); mmap0 = intel_get_map(mvol, 0); if (mvol->migr_state) mmap1 = intel_get_map(mvol, 1); @@ -845,12 +874,17 @@ nofit: /* Stale disk, almost same as new. */ g_raid_change_subdisk_state(sd, G_RAID_SUBDISK_S_NEW); + } else if (meta->disk[disk_pos].flags & INTEL_F_DISABLED) { + /* Disabled disk, useless. */ + g_raid_change_subdisk_state(sd, + G_RAID_SUBDISK_S_NONE); } else if (meta->disk[disk_pos].flags & INTEL_F_FAILED) { /* Failed disk, almost useless. */ g_raid_change_subdisk_state(sd, G_RAID_SUBDISK_S_FAILED); } else if (mvol->migr_state == 0) { - if (mmap0->status == INTEL_S_UNINITIALIZED) { + if (mmap0->status == INTEL_S_UNINITIALIZED && + (!pv->pv_cng || pv->pv_cng_master_disk != disk_pos)) { /* Freshly created uninitialized volume. */ g_raid_change_subdisk_state(sd, G_RAID_SUBDISK_S_UNINITIALIZED); @@ -858,7 +892,8 @@ nofit: /* Freshly inserted disk. */ g_raid_change_subdisk_state(sd, G_RAID_SUBDISK_S_NEW); - } else if (mvol->dirty) { + } else if (mvol->dirty && (!pv->pv_cng || + pv->pv_cng_master_disk != disk_pos)) { /* Dirty volume (unclean shutdown). */ g_raid_change_subdisk_state(sd, G_RAID_SUBDISK_S_STALE); @@ -885,7 +920,8 @@ nofit: sd->sd_volume->v_strip_size * mmap0->total_domains; } - } else if (mvol->dirty) { + } else if (mvol->dirty && (!pv->pv_cng || + pv->pv_cng_master_disk != disk_pos)) { /* Dirty volume (unclean shutdown). */ g_raid_change_subdisk_state(sd, G_RAID_SUBDISK_S_STALE); @@ -1014,6 +1050,7 @@ g_raid_md_intel_start(struct g_raid_soft { struct g_raid_md_object *md; struct g_raid_md_intel_object *mdi; + struct g_raid_md_intel_pervolume *pv; struct g_raid_md_intel_perdisk *pd; struct intel_raid_conf *meta; struct intel_raid_vol *mvol; @@ -1032,7 +1069,13 @@ g_raid_md_intel_start(struct g_raid_soft mvol = intel_get_volume(meta, i); mmap = intel_get_map(mvol, 0); vol = g_raid_create_volume(sc, mvol->name, -1); - vol->v_md_data = (void *)(intptr_t)i; + pv = malloc(sizeof(*pv), M_MD_INTEL, M_WAITOK | M_ZERO); + pv->pv_volume_pos = i; + pv->pv_cng = (mvol->state & INTEL_ST_CLONE_N_GO) != 0; + pv->pv_cng_man_sync = (mvol->state & INTEL_ST_CLONE_MAN_SYNC) != 0; + if (mvol->cng_master_disk < mmap->total_disks) + pv->pv_cng_master_disk = mvol->cng_master_disk; + vol->v_md_data = pv; vol->v_raid_level_qualifier = G_RAID_VOLUME_RLQ_NONE; if (mmap->type == INTEL_T_RAID0) vol->v_raid_level = G_RAID_VOLUME_RL_RAID0; @@ -1450,6 +1493,7 @@ g_raid_md_ctl_intel(struct g_raid_md_obj struct g_raid_subdisk *sd; struct g_raid_disk *disk; struct g_raid_md_intel_object *mdi; + struct g_raid_md_intel_pervolume *pv; struct g_raid_md_intel_perdisk *pd; struct g_consumer *cp; struct g_provider *pp; @@ -1621,7 +1665,9 @@ g_raid_md_ctl_intel(struct g_raid_md_obj /* We have all we need, create things: volume, ... */ mdi->mdio_started = 1; vol = g_raid_create_volume(sc, volname, -1); - vol->v_md_data = (void *)(intptr_t)0; + pv = malloc(sizeof(*pv), M_MD_INTEL, M_WAITOK | M_ZERO); + pv->pv_volume_pos = 0; + vol->v_md_data = pv; vol->v_raid_level = level; vol->v_raid_level_qualifier = qual; vol->v_strip_size = strip; @@ -1814,7 +1860,9 @@ g_raid_md_ctl_intel(struct g_raid_md_obj /* We have all we need, create things: volume, ... */ vol = g_raid_create_volume(sc, volname, -1); - vol->v_md_data = (void *)(intptr_t)i; + pv = malloc(sizeof(*pv), M_MD_INTEL, M_WAITOK | M_ZERO); + pv->pv_volume_pos = i; + vol->v_md_data = pv; vol->v_raid_level = level; vol->v_raid_level_qualifier = qual; vol->v_strip_size = strip; @@ -2105,6 +2153,7 @@ g_raid_md_write_intel(struct g_raid_md_o struct g_raid_subdisk *sd; struct g_raid_disk *disk; struct g_raid_md_intel_object *mdi; + struct g_raid_md_intel_pervolume *pv; struct g_raid_md_intel_perdisk *pd; struct intel_raid_conf *meta; struct intel_raid_vol *mvol; @@ -2133,7 +2182,11 @@ g_raid_md_write_intel(struct g_raid_md_o pd->pd_disk_meta.flags = INTEL_F_ONLINE | INTEL_F_ASSIGNED; } else if (disk->d_state == G_RAID_DISK_S_FAILED) { - pd->pd_disk_meta.flags = INTEL_F_FAILED | INTEL_F_ASSIGNED; + pd->pd_disk_meta.flags = INTEL_F_FAILED | + INTEL_F_ASSIGNED; + } else if (disk->d_state == G_RAID_DISK_S_DISABLED) { + pd->pd_disk_meta.flags = INTEL_F_FAILED | + INTEL_F_ASSIGNED | INTEL_F_DISABLED; } else { pd->pd_disk_meta.flags = INTEL_F_ASSIGNED; if (pd->pd_disk_meta.id != 0xffffffff) { @@ -2165,12 +2218,13 @@ g_raid_md_write_intel(struct g_raid_md_o vi = 0; version = INTEL_VERSION_1000; TAILQ_FOREACH(vol, &sc->sc_volumes, v_next) { + pv = vol->v_md_data; if (vol->v_stopping) continue; mvol = intel_get_volume(meta, vi); /* New metadata may have different volumes order. */ - vol->v_md_data = (void *)(intptr_t)vi; + pv->pv_volume_pos = vi; for (sdi = 0; sdi < vol->v_disks_count; sdi++) { sd = &vol->v_subdisks[sdi]; @@ -2192,8 +2246,8 @@ g_raid_md_write_intel(struct g_raid_md_o if (meta->attributes & INTEL_ATTR_2TB) cv = INTEL_VERSION_1300; -// else if (dev->status == DEV_CLONE_N_GO) -// cv = INTEL_VERSION_1206; + else if (pv->pv_cng) + cv = INTEL_VERSION_1206; else if (vol->v_disks_count > 4) cv = INTEL_VERSION_1204; else if (vol->v_raid_level == G_RAID_VOLUME_RL_RAID5) @@ -2211,6 +2265,17 @@ g_raid_md_write_intel(struct g_raid_md_o strlcpy(&mvol->name[0], vol->v_name, sizeof(mvol->name)); mvol->total_sectors = vol->v_mediasize / sectorsize; + if (pv->pv_cng) { + mvol->state |= INTEL_ST_CLONE_N_GO; + if (pv->pv_cng_man_sync) + mvol->state |= INTEL_ST_CLONE_MAN_SYNC; + mvol->cng_master_disk = pv->pv_cng_master_disk; + if (vol->v_subdisks[pv->pv_cng_master_disk].sd_state == + G_RAID_SUBDISK_S_NONE) + mvol->cng_state = INTEL_SNGST_MASTER_MISSING; + else if (vol->v_state != G_RAID_VOLUME_S_OPTIMAL) + mvol->cng_state = INTEL_SNGST_NEEDS_UPDATE; + } /* Check for any recovery in progress. */ state = G_RAID_SUBDISK_S_ACTIVE; @@ -2403,6 +2468,18 @@ g_raid_md_free_disk_intel(struct g_raid_ } static int +g_raid_md_free_volume_intel(struct g_raid_md_object *md, + struct g_raid_volume *vol) +{ + struct g_raid_md_intel_pervolume *pv; + + pv = (struct g_raid_md_intel_pervolume *)vol->v_md_data; + free(pv, M_MD_INTEL); + vol->v_md_data = NULL; + return (0); +} + +static int g_raid_md_free_intel(struct g_raid_md_object *md) { struct g_raid_md_intel_object *mdi; From owner-svn-src-stable-9@FreeBSD.ORG Thu Jan 31 22:15:51 2013 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 5743016B; Thu, 31 Jan 2013 22:15:48 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 3973373F; Thu, 31 Jan 2013 22:15:48 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0VMFmGF047718; Thu, 31 Jan 2013 22:15:48 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0VMFmnN047717; Thu, 31 Jan 2013 22:15:48 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201301312215.r0VMFmnN047717@svn.freebsd.org> From: Alexander Motin Date: Thu, 31 Jan 2013 22:15:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r246173 - stable/9/sys/geom/raid X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 31 Jan 2013 22:15:51 -0000 Author: mav Date: Thu Jan 31 22:15:47 2013 New Revision: 246173 URL: http://svnweb.freebsd.org/changeset/base/246173 Log: MFC r245338: Implement migration from single disk to RAID1/IRRT for Intel metadata. Windows driver uses such migration when it creates new arrays. While GEOM RAID has no mechanism to implement migration in general case, this specifc case still can be handled easily via degraded RAID1 creation followed by regular rebuild. Modified: stable/9/sys/geom/raid/md_intel.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/geom/raid/md_intel.c ============================================================================== --- stable/9/sys/geom/raid/md_intel.c Thu Jan 31 22:15:41 2013 (r246172) +++ stable/9/sys/geom/raid/md_intel.c Thu Jan 31 22:15:47 2013 (r246173) @@ -171,8 +171,13 @@ struct intel_raid_conf { uint8_t total_disks; uint8_t total_volumes; - uint8_t dummy_2[2]; - uint32_t filler_0[39]; + uint8_t error_log_pos; + uint8_t dummy_2[1]; + uint32_t cache_size; + uint32_t orig_family_num; + uint32_t pwr_cycle_count; + uint32_t bbm_log_size; + uint32_t filler_0[35]; struct intel_raid_disk disk[1]; /* total_disks entries. */ /* Here goes total_volumes of struct intel_raid_vol. */ } __packed; @@ -366,9 +371,12 @@ g_raid_md_intel_print(struct intel_raid_ printf("config_size 0x%08x\n", meta->config_size); printf("config_id 0x%08x\n", meta->config_id); printf("generation 0x%08x\n", meta->generation); + printf("error_log_size %d\n", meta->error_log_size); printf("attributes 0x%08x\n", meta->attributes); printf("total_disks %u\n", meta->total_disks); printf("total_volumes %u\n", meta->total_volumes); + printf("orig_family_num 0x%08x\n", meta->orig_family_num); + printf("bbm_log_size %u\n", meta->bbm_log_size); printf("DISK# serial disk_sectors disk_sectors_hi disk_id flags\n"); for (i = 0; i < meta->total_disks; i++ ) { printf(" %d <%.16s> %u %u 0x%08x 0x%08x\n", i, @@ -451,7 +459,7 @@ intel_meta_read(struct g_consumer *cp) struct g_provider *pp; struct intel_raid_conf *meta; struct intel_raid_vol *mvol; - struct intel_raid_map *mmap; + struct intel_raid_map *mmap, *mmap1; char *buf; int error, i, j, k, left, size; uint32_t checksum, *ptr; @@ -544,6 +552,8 @@ badsize: } } + g_raid_md_intel_print(meta); + /* Validate disk indexes. */ for (i = 0; i < meta->total_volumes; i++) { mvol = intel_get_volume(meta, i); @@ -566,16 +576,39 @@ badsize: /* Validate migration types. */ for (i = 0; i < meta->total_volumes; i++) { mvol = intel_get_volume(meta, i); + /* Deny unknown migration types. */ if (mvol->migr_state && mvol->migr_type != INTEL_MT_INIT && mvol->migr_type != INTEL_MT_REBUILD && mvol->migr_type != INTEL_MT_VERIFY && + mvol->migr_type != INTEL_MT_GEN_MIGR && mvol->migr_type != INTEL_MT_REPAIR) { G_RAID_DEBUG(1, "Intel metadata has unsupported" " migration type %d", mvol->migr_type); free(meta, M_MD_INTEL); return (NULL); } + /* Deny general migrations except SINGLE->RAID1. */ + if (mvol->migr_state && + mvol->migr_type == INTEL_MT_GEN_MIGR) { + mmap = intel_get_map(mvol, 0); + mmap1 = intel_get_map(mvol, 1); + if (mmap1->total_disks != 1 || + mmap->type != INTEL_T_RAID1 || + mmap->total_disks != 2 || + mmap->offset != mmap1->offset || + mmap->disk_sectors != mmap1->disk_sectors || + mmap->total_domains != mmap->total_disks || + mmap->offset_hi != mmap1->offset_hi || + mmap->disk_sectors_hi != mmap1->disk_sectors_hi || + (mmap->disk_idx[0] != mmap1->disk_idx[0] && + mmap->disk_idx[0] != mmap1->disk_idx[1])) { + G_RAID_DEBUG(1, "Intel metadata has unsupported" + " variant of general migration"); + free(meta, M_MD_INTEL); + return (NULL); + } + } } return (meta); @@ -957,6 +990,16 @@ nofit: g_raid_change_subdisk_state(sd, G_RAID_SUBDISK_S_ACTIVE); } + } else if (mvol->migr_type == INTEL_MT_GEN_MIGR) { + if ((mmap1->disk_idx[0] & INTEL_DI_IDX) != disk_pos) { + /* Freshly inserted disk. */ + g_raid_change_subdisk_state(sd, + G_RAID_SUBDISK_S_NEW); + } else { + /* Up to date disk. */ + g_raid_change_subdisk_state(sd, + G_RAID_SUBDISK_S_ACTIVE); + } } g_raid_event_send(sd, G_RAID_SUBDISK_E_NEW, G_RAID_EVENT_SUBDISK); @@ -1337,8 +1380,6 @@ g_raid_md_taste_intel(struct g_raid_md_o goto fail1; } - /* Metadata valid. Print it. */ - g_raid_md_intel_print(meta); G_RAID_DEBUG(1, "Intel disk position %d", disk_pos); spare = meta->disk[disk_pos].flags & INTEL_F_SPARE; @@ -2370,7 +2411,8 @@ g_raid_md_write_intel(struct g_raid_md_o mmap1->disk_idx[sdi] |= INTEL_DI_RBLD; } if ((sd->sd_state == G_RAID_SUBDISK_S_NONE || - sd->sd_state == G_RAID_SUBDISK_S_FAILED) && + sd->sd_state == G_RAID_SUBDISK_S_FAILED || + sd->sd_state == G_RAID_SUBDISK_S_REBUILD) && mmap0->failed_disk_num == 0xff) { mmap0->failed_disk_num = sdi; if (mvol->migr_state) From owner-svn-src-stable-9@FreeBSD.ORG Thu Jan 31 22:18:41 2013 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id C8924581; Thu, 31 Jan 2013 22:18:41 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 8AE13782; Thu, 31 Jan 2013 22:18:41 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0VMIfH3048564; Thu, 31 Jan 2013 22:18:41 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0VMIf5n048563; Thu, 31 Jan 2013 22:18:41 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201301312218.r0VMIf5n048563@svn.freebsd.org> From: Alexander Motin Date: Thu, 31 Jan 2013 22:18:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r246175 - stable/9/sys/geom/raid X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 31 Jan 2013 22:18:41 -0000 Author: mav Date: Thu Jan 31 22:18:40 2013 New Revision: 246175 URL: http://svnweb.freebsd.org/changeset/base/246175 Log: MFC r245341: Windows handles INIT and VERIFY as array-wide and it doesn't specify which disks should be rebuilt. Our rebuild code is same time disk-centric. To handle this situation properly check all disks for RBLD flags, and if no disk specified try rebuild/resync all of them except newly inserted. Modified: stable/9/sys/geom/raid/md_intel.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/geom/raid/md_intel.c ============================================================================== --- stable/9/sys/geom/raid/md_intel.c Thu Jan 31 22:16:52 2013 (r246174) +++ stable/9/sys/geom/raid/md_intel.c Thu Jan 31 22:18:40 2013 (r246175) @@ -774,7 +774,7 @@ g_raid_md_intel_start_disk(struct g_raid struct intel_raid_conf *meta; struct intel_raid_vol *mvol; struct intel_raid_map *mmap0, *mmap1; - int disk_pos, resurrection = 0; + int disk_pos, resurrection = 0, migr_global, i; sc = disk->d_softc; md = sc->sc_md; @@ -903,6 +903,13 @@ nofit: else mmap1 = mmap0; + migr_global = 1; + for (i = 0; i < mmap0->total_disks; i++) { + if ((mmap0->disk_idx[i] & INTEL_DI_RBLD) == 0 && + (mmap1->disk_idx[i] & INTEL_DI_RBLD) != 0) + migr_global = 0; + } + if (resurrection) { /* Stale disk, almost same as new. */ g_raid_change_subdisk_state(sd, @@ -953,6 +960,11 @@ nofit: sd->sd_volume->v_strip_size * mmap0->total_domains; } + } else if (mvol->migr_type == INTEL_MT_INIT && + migr_global) { + /* Freshly created uninitialized volume. */ + g_raid_change_subdisk_state(sd, + G_RAID_SUBDISK_S_UNINITIALIZED); } else if (mvol->dirty && (!pv->pv_cng || pv->pv_cng_master_disk != disk_pos)) { /* Dirty volume (unclean shutdown). */ @@ -969,7 +981,8 @@ nofit: /* Freshly inserted disk. */ g_raid_change_subdisk_state(sd, G_RAID_SUBDISK_S_NEW); - } else if (mmap1->disk_idx[sd->sd_pos] & INTEL_DI_RBLD) { + } else if ((mmap1->disk_idx[sd->sd_pos] & INTEL_DI_RBLD) || + migr_global) { /* Resyncing disk. */ g_raid_change_subdisk_state(sd, G_RAID_SUBDISK_S_RESYNC); From owner-svn-src-stable-9@FreeBSD.ORG Thu Jan 31 22:21:40 2013 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 628F2A06; Thu, 31 Jan 2013 22:21:40 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 540357B1; Thu, 31 Jan 2013 22:21:40 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0VMLdtC050689; Thu, 31 Jan 2013 22:21:39 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0VMLddw050687; Thu, 31 Jan 2013 22:21:39 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201301312221.r0VMLddw050687@svn.freebsd.org> From: Alexander Motin Date: Thu, 31 Jan 2013 22:21:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r246178 - stable/9/sys/geom/raid X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 31 Jan 2013 22:21:40 -0000 Author: mav Date: Thu Jan 31 22:21:39 2013 New Revision: 246178 URL: http://svnweb.freebsd.org/changeset/base/246178 Log: MFC r245363: Improve support for disabled disks. If disabled disk disconnected and then reconnected back, leave it as disabled. If new disk inserted instead of disabled, rebuild it and leave as enabled. Modified: stable/9/sys/geom/raid/g_raid.c stable/9/sys/geom/raid/md_intel.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/geom/raid/g_raid.c ============================================================================== --- stable/9/sys/geom/raid/g_raid.c Thu Jan 31 22:20:05 2013 (r246177) +++ stable/9/sys/geom/raid/g_raid.c Thu Jan 31 22:21:39 2013 (r246178) @@ -538,7 +538,7 @@ g_raid_report_disk_state(struct g_raid_d if (disk->d_consumer == NULL) return; if (disk->d_state == G_RAID_DISK_S_DISABLED) { - ; + s = G_STATE_ACTIVE; /* XXX */ } else if (disk->d_state == G_RAID_DISK_S_FAILED || disk->d_state == G_RAID_DISK_S_STALE_FAILED) { s = G_STATE_FAILED; Modified: stable/9/sys/geom/raid/md_intel.c ============================================================================== --- stable/9/sys/geom/raid/md_intel.c Thu Jan 31 22:20:05 2013 (r246177) +++ stable/9/sys/geom/raid/md_intel.c Thu Jan 31 22:21:39 2013 (r246178) @@ -787,13 +787,9 @@ g_raid_md_intel_start_disk(struct g_raid disk_pos = intel_meta_find_disk(meta, pd->pd_disk_meta.serial); if (disk_pos < 0) { G_RAID_DEBUG1(1, sc, "Unknown, probably new or stale disk"); - /* Disabled disk is useless for us. */ - if (pd->pd_disk_meta.flags & INTEL_F_DISABLED) { - g_raid_change_disk_state(disk, G_RAID_DISK_S_DISABLED); - return (0); - } /* Failed stale disk is useless for us. */ - if (pd->pd_disk_meta.flags & INTEL_F_FAILED) { + if ((pd->pd_disk_meta.flags & INTEL_F_FAILED) && + !(pd->pd_disk_meta.flags & INTEL_F_DISABLED)) { g_raid_change_disk_state(disk, G_RAID_DISK_S_STALE_FAILED); return (0); } @@ -884,10 +880,11 @@ nofit: } /* Welcome the new disk. */ - if (resurrection) - g_raid_change_disk_state(disk, G_RAID_DISK_S_ACTIVE); - else if (meta->disk[disk_pos].flags & INTEL_F_DISABLED) + if ((meta->disk[disk_pos].flags & INTEL_F_DISABLED) && + !(pd->pd_disk_meta.flags & INTEL_F_SPARE)) g_raid_change_disk_state(disk, G_RAID_DISK_S_DISABLED); + else if (resurrection) + g_raid_change_disk_state(disk, G_RAID_DISK_S_ACTIVE); else if (meta->disk[disk_pos].flags & INTEL_F_FAILED) g_raid_change_disk_state(disk, G_RAID_DISK_S_FAILED); else if (meta->disk[disk_pos].flags & INTEL_F_SPARE) @@ -910,14 +907,15 @@ nofit: migr_global = 0; } - if (resurrection) { - /* Stale disk, almost same as new. */ - g_raid_change_subdisk_state(sd, - G_RAID_SUBDISK_S_NEW); - } else if (meta->disk[disk_pos].flags & INTEL_F_DISABLED) { + if ((meta->disk[disk_pos].flags & INTEL_F_DISABLED) && + !(pd->pd_disk_meta.flags & INTEL_F_SPARE)) { /* Disabled disk, useless. */ g_raid_change_subdisk_state(sd, G_RAID_SUBDISK_S_NONE); + } else if (resurrection) { + /* Stale disk, almost same as new. */ + g_raid_change_subdisk_state(sd, + G_RAID_SUBDISK_S_NEW); } else if (meta->disk[disk_pos].flags & INTEL_F_FAILED) { /* Failed disk, almost useless. */ g_raid_change_subdisk_state(sd, @@ -1021,7 +1019,8 @@ nofit: /* Update status of our need for spare. */ if (mdi->mdio_started) { mdi->mdio_incomplete = - (g_raid_ndisks(sc, G_RAID_DISK_S_ACTIVE) < + (g_raid_ndisks(sc, G_RAID_DISK_S_ACTIVE) + + g_raid_ndisks(sc, G_RAID_DISK_S_DISABLED) < meta->total_disks); } @@ -1053,7 +1052,8 @@ g_raid_md_intel_refill(struct g_raid_sof update = 0; do { /* Make sure we miss anything. */ - na = g_raid_ndisks(sc, G_RAID_DISK_S_ACTIVE); + na = g_raid_ndisks(sc, G_RAID_DISK_S_ACTIVE) + + g_raid_ndisks(sc, G_RAID_DISK_S_DISABLED); if (na == meta->total_disks) break; @@ -1065,7 +1065,8 @@ g_raid_md_intel_refill(struct g_raid_sof TAILQ_FOREACH(disk, &sc->sc_disks, d_next) { if (disk->d_state == G_RAID_DISK_S_STALE) { update += g_raid_md_intel_start_disk(disk); - if (disk->d_state == G_RAID_DISK_S_ACTIVE) + if (disk->d_state == G_RAID_DISK_S_ACTIVE || + disk->d_state == G_RAID_DISK_S_DISABLED) break; } } @@ -1089,8 +1090,8 @@ g_raid_md_intel_refill(struct g_raid_sof } /* Update status of our need for spare. */ - mdi->mdio_incomplete = (g_raid_ndisks(sc, G_RAID_DISK_S_ACTIVE) < - meta->total_disks); + mdi->mdio_incomplete = (g_raid_ndisks(sc, G_RAID_DISK_S_ACTIVE) + + g_raid_ndisks(sc, G_RAID_DISK_S_DISABLED) < meta->total_disks); /* Request retaste hoping to find spare. */ if (mdi->mdio_incomplete) { @@ -2242,7 +2243,8 @@ g_raid_md_write_intel(struct g_raid_md_o pd->pd_disk_meta.flags = INTEL_F_FAILED | INTEL_F_ASSIGNED | INTEL_F_DISABLED; } else { - pd->pd_disk_meta.flags = INTEL_F_ASSIGNED; + if (!(pd->pd_disk_meta.flags & INTEL_F_DISABLED)) + pd->pd_disk_meta.flags = INTEL_F_ASSIGNED; if (pd->pd_disk_meta.id != 0xffffffff) { pd->pd_disk_meta.id = 0xffffffff; len = strlen(pd->pd_disk_meta.serial); From owner-svn-src-stable-9@FreeBSD.ORG Thu Jan 31 22:24:06 2013 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 76573DC8; Thu, 31 Jan 2013 22:24:06 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 5DB217D4; Thu, 31 Jan 2013 22:24:06 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0VMO6pH051233; Thu, 31 Jan 2013 22:24:06 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0VMO6Yb051232; Thu, 31 Jan 2013 22:24:06 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201301312224.r0VMO6Yb051232@svn.freebsd.org> From: Alexander Motin Date: Thu, 31 Jan 2013 22:24:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r246180 - stable/9/sys/geom/raid X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 31 Jan 2013 22:24:06 -0000 Author: mav Date: Thu Jan 31 22:24:05 2013 New Revision: 246180 URL: http://svnweb.freebsd.org/changeset/base/246180 Log: MFC r245398: - Add checks for Intel metadata version and attributes. Ignore disks with unsupported metadata types like Intel Smart Response to not corrupt them. - Improve setting of these things during metadata writing to protect from incapable BIOS'es and other implementations. Modified: stable/9/sys/geom/raid/md_intel.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/geom/raid/md_intel.c ============================================================================== --- stable/9/sys/geom/raid/md_intel.c Thu Jan 31 22:22:22 2013 (r246179) +++ stable/9/sys/geom/raid/md_intel.c Thu Jan 31 22:24:05 2013 (r246180) @@ -165,6 +165,11 @@ struct intel_raid_conf { #define INTEL_ATTR_RAID1E 0x00000008 #define INTEL_ATTR_RAID5 0x00000010 #define INTEL_ATTR_RAIDCNG 0x00000020 +#define INTEL_ATTR_EXT_STRIP 0x00000040 +#define INTEL_ATTR_NVM_CACHE 0x02000000 +#define INTEL_ATTR_2TB_DISK 0x04000000 +#define INTEL_ATTR_BBM 0x08000000 +#define INTEL_ATTR_NVM_CACHE2 0x10000000 #define INTEL_ATTR_2TB 0x20000000 #define INTEL_ATTR_PM 0x40000000 #define INTEL_ATTR_CHECKSUM 0x80000000 @@ -182,6 +187,11 @@ struct intel_raid_conf { /* Here goes total_volumes of struct intel_raid_vol. */ } __packed; +#define INTEL_ATTR_SUPPORTED ( INTEL_ATTR_RAID0 | INTEL_ATTR_RAID1 | \ + INTEL_ATTR_RAID10 | INTEL_ATTR_RAID1E | INTEL_ATTR_RAID5 | \ + INTEL_ATTR_RAIDCNG | INTEL_ATTR_EXT_STRIP | INTEL_ATTR_2TB_DISK | \ + INTEL_ATTR_2TB | INTEL_ATTR_PM | INTEL_ATTR_CHECKSUM ) + #define INTEL_MAX_MD_SIZE(ndisks) \ (sizeof(struct intel_raid_conf) + \ sizeof(struct intel_raid_disk) * (ndisks - 1) + \ @@ -554,6 +564,21 @@ badsize: g_raid_md_intel_print(meta); + if (strncmp(meta->version, INTEL_VERSION_1300, 6) > 0) { + G_RAID_DEBUG(1, "Intel unsupported version: '%.6s'", + meta->version); + free(meta, M_MD_INTEL); + return (NULL); + } + + if (strncmp(meta->version, INTEL_VERSION_1300, 6) >= 0 && + (meta->attributes & ~INTEL_ATTR_SUPPORTED) != 0) { + G_RAID_DEBUG(1, "Intel unsupported attributes: 0x%08x", + meta->attributes & ~INTEL_ATTR_SUPPORTED); + free(meta, M_MD_INTEL); + return (NULL); + } + /* Validate disk indexes. */ for (i = 0; i < meta->total_volumes; i++) { mvol = intel_get_volume(meta, i); @@ -2268,6 +2293,8 @@ g_raid_md_write_intel(struct g_raid_md_o if (pd->pd_disk_pos < 0) continue; meta->disk[pd->pd_disk_pos] = pd->pd_disk_meta; + if (pd->pd_disk_meta.sectors_hi != 0) + meta->attributes |= INTEL_ATTR_2TB_DISK; } /* Fill volumes and maps. */ @@ -2297,12 +2324,16 @@ g_raid_md_write_intel(struct g_raid_md_o meta->attributes |= INTEL_ATTR_RAID1; else if (vol->v_raid_level == G_RAID_VOLUME_RL_RAID5) meta->attributes |= INTEL_ATTR_RAID5; - else + else if ((vol->v_disks_count & 1) == 0) meta->attributes |= INTEL_ATTR_RAID10; + else + meta->attributes |= INTEL_ATTR_RAID1E; + if (pv->pv_cng) + meta->attributes |= INTEL_ATTR_RAIDCNG; + if (vol->v_strip_size > 131072) + meta->attributes |= INTEL_ATTR_EXT_STRIP; - if (meta->attributes & INTEL_ATTR_2TB) - cv = INTEL_VERSION_1300; - else if (pv->pv_cng) + if (pv->pv_cng) cv = INTEL_VERSION_1206; else if (vol->v_disks_count > 4) cv = INTEL_VERSION_1204; @@ -2310,8 +2341,6 @@ g_raid_md_write_intel(struct g_raid_md_o cv = INTEL_VERSION_1202; else if (vol->v_disks_count > 2) cv = INTEL_VERSION_1201; - else if (vi > 0) - cv = INTEL_VERSION_1200; else if (vol->v_raid_level == G_RAID_VOLUME_RL_RAID1) cv = INTEL_VERSION_1100; else @@ -2321,6 +2350,8 @@ g_raid_md_write_intel(struct g_raid_md_o strlcpy(&mvol->name[0], vol->v_name, sizeof(mvol->name)); mvol->total_sectors = vol->v_mediasize / sectorsize; + mvol->state = (INTEL_ST_READ_COALESCING | + INTEL_ST_WRITE_COALESCING); if (pv->pv_cng) { mvol->state |= INTEL_ST_CLONE_N_GO; if (pv->pv_cng_man_sync) @@ -2437,7 +2468,10 @@ g_raid_md_write_intel(struct g_raid_md_o vi++; } meta->total_volumes = vi; - if (strcmp(version, INTEL_VERSION_1300) != 0) + if (vi > 1 || meta->attributes & + (INTEL_ATTR_EXT_STRIP | INTEL_ATTR_2TB_DISK | INTEL_ATTR_2TB)) + version = INTEL_VERSION_1300; + if (strcmp(version, INTEL_VERSION_1300) < 0) meta->attributes &= INTEL_ATTR_CHECKSUM; memcpy(&meta->version[0], version, sizeof(INTEL_VERSION_1000) - 1); From owner-svn-src-stable-9@FreeBSD.ORG Thu Jan 31 22:26:49 2013 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 901C8371; Thu, 31 Jan 2013 22:26:49 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 6970E82A; Thu, 31 Jan 2013 22:26:49 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0VMQn2V051781; Thu, 31 Jan 2013 22:26:49 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0VMQnjm051780; Thu, 31 Jan 2013 22:26:49 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201301312226.r0VMQnjm051780@svn.freebsd.org> From: Alexander Motin Date: Thu, 31 Jan 2013 22:26:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r246182 - stable/9/sys/geom/raid X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 31 Jan 2013 22:26:49 -0000 Author: mav Date: Thu Jan 31 22:26:48 2013 New Revision: 246182 URL: http://svnweb.freebsd.org/changeset/base/246182 Log: MFC r245400: Windows driver writes relative volume IDs to metadata field. Use that value as a hint for raid/rX device number to make it persistent across reboots. Modified: stable/9/sys/geom/raid/md_intel.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/geom/raid/md_intel.c ============================================================================== --- stable/9/sys/geom/raid/md_intel.c Thu Jan 31 22:24:46 2013 (r246181) +++ stable/9/sys/geom/raid/md_intel.c Thu Jan 31 22:26:48 2013 (r246182) @@ -1150,7 +1150,7 @@ g_raid_md_intel_start(struct g_raid_soft for (i = 0; i < meta->total_volumes; i++) { mvol = intel_get_volume(meta, i); mmap = intel_get_map(mvol, 0); - vol = g_raid_create_volume(sc, mvol->name, -1); + vol = g_raid_create_volume(sc, mvol->name, mvol->tid - 1); pv = malloc(sizeof(*pv), M_MD_INTEL, M_WAITOK | M_ZERO); pv->pv_volume_pos = i; pv->pv_cng = (mvol->state & INTEL_ST_CLONE_N_GO) != 0; @@ -2352,6 +2352,7 @@ g_raid_md_write_intel(struct g_raid_md_o mvol->total_sectors = vol->v_mediasize / sectorsize; mvol->state = (INTEL_ST_READ_COALESCING | INTEL_ST_WRITE_COALESCING); + mvol->tid = vol->v_global_id + 1; if (pv->pv_cng) { mvol->state |= INTEL_ST_CLONE_N_GO; if (pv->pv_cng_man_sync) From owner-svn-src-stable-9@FreeBSD.ORG Thu Jan 31 22:30:24 2013 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 30758725; Thu, 31 Jan 2013 22:30:24 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 147E3862; Thu, 31 Jan 2013 22:30:24 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0VMUNsO052537; Thu, 31 Jan 2013 22:30:23 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0VMUNYK052528; Thu, 31 Jan 2013 22:30:23 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201301312230.r0VMUNYK052528@svn.freebsd.org> From: Alexander Motin Date: Thu, 31 Jan 2013 22:30:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r246184 - stable/9/sys/geom/raid X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 31 Jan 2013 22:30:24 -0000 Author: mav Date: Thu Jan 31 22:30:23 2013 New Revision: 246184 URL: http://svnweb.freebsd.org/changeset/base/246184 Log: MFC r245423, r245425, r245433: - Print some more metadata fields. - Small cosmetic tuning of the IRRT status constants. - Keep value of orig_config_id metadata field. Windows driver writes there previous value of config_id when it is changed in some cases. I guess it may be used do avoid some split-brain conditions. Modified: stable/9/sys/geom/raid/md_intel.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/geom/raid/md_intel.c ============================================================================== --- stable/9/sys/geom/raid/md_intel.c Thu Jan 31 22:27:31 2013 (r246183) +++ stable/9/sys/geom/raid/md_intel.c Thu Jan 31 22:30:23 2013 (r246184) @@ -98,8 +98,9 @@ struct intel_raid_vol { uint8_t cng_master_disk; uint16_t cache_policy; uint8_t cng_state; -#define INTEL_SNGST_NEEDS_UPDATE 1 -#define INTEL_SNGST_MASTER_MISSING 2 +#define INTEL_CNGST_UPDATED 0 +#define INTEL_CNGST_NEEDS_UPDATE 1 +#define INTEL_CNGST_MASTER_MISSING 2 uint8_t cng_sub_state; uint32_t filler_0[10]; @@ -179,7 +180,7 @@ struct intel_raid_conf { uint8_t error_log_pos; uint8_t dummy_2[1]; uint32_t cache_size; - uint32_t orig_family_num; + uint32_t orig_config_id; uint32_t pwr_cycle_count; uint32_t bbm_log_size; uint32_t filler_0[35]; @@ -215,6 +216,7 @@ struct g_raid_md_intel_pervolume { struct g_raid_md_intel_object { struct g_raid_md_object mdio_base; uint32_t mdio_config_id; + uint32_t mdio_orig_config_id; uint32_t mdio_generation; struct intel_raid_conf *mdio_meta; struct callout mdio_start_co; /* STARTING state timer. */ @@ -385,14 +387,17 @@ g_raid_md_intel_print(struct intel_raid_ printf("attributes 0x%08x\n", meta->attributes); printf("total_disks %u\n", meta->total_disks); printf("total_volumes %u\n", meta->total_volumes); - printf("orig_family_num 0x%08x\n", meta->orig_family_num); + printf("error_log_pos %u\n", meta->error_log_pos); + printf("cache_size %u\n", meta->cache_size); + printf("orig_config_id 0x%08x\n", meta->orig_config_id); + printf("pwr_cycle_count %u\n", meta->pwr_cycle_count); printf("bbm_log_size %u\n", meta->bbm_log_size); - printf("DISK# serial disk_sectors disk_sectors_hi disk_id flags\n"); + printf("DISK# serial disk_sectors disk_sectors_hi disk_id flags owner\n"); for (i = 0; i < meta->total_disks; i++ ) { - printf(" %d <%.16s> %u %u 0x%08x 0x%08x\n", i, + printf(" %d <%.16s> %u %u 0x%08x 0x%08x %08x\n", i, meta->disk[i].serial, meta->disk[i].sectors, - meta->disk[i].sectors_hi, - meta->disk[i].id, meta->disk[i].flags); + meta->disk[i].sectors_hi, meta->disk[i].id, + meta->disk[i].flags, meta->disk[i].owner_cfg_num); } for (i = 0; i < meta->total_volumes; i++) { mvol = intel_get_volume(meta, i); @@ -414,6 +419,9 @@ g_raid_md_intel_print(struct intel_raid_ printf(" migr_state %u\n", mvol->migr_state); printf(" migr_type %u\n", mvol->migr_type); printf(" dirty %u\n", mvol->dirty); + printf(" fs_state %u\n", mvol->fs_state); + printf(" verify_errors %u\n", mvol->verify_errors); + printf(" bad_blocks %u\n", mvol->bad_blocks); for (j = 0; j < (mvol->migr_state ? 2 : 1); j++) { printf(" *** Map %d ***\n", j); @@ -710,7 +718,7 @@ intel_meta_write_spare(struct g_consumer memcpy(&meta->version[0], INTEL_VERSION_1000, sizeof(INTEL_VERSION_1000) - 1); meta->config_size = INTEL_MAX_MD_SIZE(1); - meta->config_id = arc4random(); + meta->config_id = meta->orig_config_id = arc4random(); meta->generation = 1; meta->total_disks = 1; meta->disk[0] = *d; @@ -1311,7 +1319,7 @@ g_raid_md_create_intel(struct g_raid_md_ char name[16]; mdi = (struct g_raid_md_intel_object *)md; - mdi->mdio_config_id = arc4random(); + mdi->mdio_config_id = mdi->mdio_orig_config_id = arc4random(); mdi->mdio_generation = 0; snprintf(name, sizeof(name), "Intel-%08x", mdi->mdio_config_id); sc = g_raid_create_node(mp, name, md); @@ -1456,6 +1464,7 @@ search: } else { /* Not found matching node -- create one. */ result = G_RAID_MD_TASTE_NEW; mdi->mdio_config_id = meta->config_id; + mdi->mdio_orig_config_id = meta->orig_config_id; snprintf(name, sizeof(name), "Intel-%08x", meta->config_id); sc = g_raid_create_node(mp, name, md); md->mdo_softc = sc; @@ -2285,6 +2294,7 @@ g_raid_md_write_intel(struct g_raid_md_o memcpy(&meta->intel_id[0], INTEL_MAGIC, sizeof(INTEL_MAGIC) - 1); meta->config_size = INTEL_MAX_MD_SIZE(numdisks); meta->config_id = mdi->mdio_config_id; + meta->orig_config_id = mdi->mdio_orig_config_id; meta->generation = mdi->mdio_generation; meta->attributes = INTEL_ATTR_CHECKSUM; meta->total_disks = numdisks; @@ -2360,9 +2370,11 @@ g_raid_md_write_intel(struct g_raid_md_o mvol->cng_master_disk = pv->pv_cng_master_disk; if (vol->v_subdisks[pv->pv_cng_master_disk].sd_state == G_RAID_SUBDISK_S_NONE) - mvol->cng_state = INTEL_SNGST_MASTER_MISSING; + mvol->cng_state = INTEL_CNGST_MASTER_MISSING; else if (vol->v_state != G_RAID_VOLUME_S_OPTIMAL) - mvol->cng_state = INTEL_SNGST_NEEDS_UPDATE; + mvol->cng_state = INTEL_CNGST_NEEDS_UPDATE; + else + mvol->cng_state = INTEL_CNGST_UPDATED; } /* Check for any recovery in progress. */ From owner-svn-src-stable-9@FreeBSD.ORG Fri Feb 1 00:32:02 2013 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 2B106BD0; Fri, 1 Feb 2013 00:32:02 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 039D6DBB; Fri, 1 Feb 2013 00:32:02 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r110W1xR090382; Fri, 1 Feb 2013 00:32:01 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r110W1ZY090381; Fri, 1 Feb 2013 00:32:01 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201302010032.r110W1ZY090381@svn.freebsd.org> From: Xin LI Date: Fri, 1 Feb 2013 00:32:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r246187 - stable/9/sys/fs/nfsserver X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 01 Feb 2013 00:32:02 -0000 Author: delphij Date: Fri Feb 1 00:32:01 2013 New Revision: 246187 URL: http://svnweb.freebsd.org/changeset/base/246187 Log: MFC r245613: Make it possible to force async at server side on new NFS server, similar to the old one's nfs.nfsrv.async. Please note that by enabling this option (default is disabled), the system could potentionally have silent data corruption if the server crashes before write is committed to non-volatile storage, as the client side have no way to tell if the data is already written. Submitted by: rmacklem Modified: stable/9/sys/fs/nfsserver/nfs_nfsdserv.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/fs/ (props changed) Modified: stable/9/sys/fs/nfsserver/nfs_nfsdserv.c ============================================================================== --- stable/9/sys/fs/nfsserver/nfs_nfsdserv.c Thu Jan 31 22:43:38 2013 (r246186) +++ stable/9/sys/fs/nfsserver/nfs_nfsdserv.c Fri Feb 1 00:32:01 2013 (r246187) @@ -55,6 +55,11 @@ extern int nfs_rootfhset; extern int nfsrv_enable_crossmntpt; #endif /* !APPLEKEXT */ +static int nfs_async = 0; +SYSCTL_DECL(_vfs_nfsd); +SYSCTL_INT(_vfs_nfsd, OID_AUTO, async, CTLFLAG_RW, &nfs_async, 0, + "Tell client that writes were synced even though they were not"); + /* * This list defines the GSS mechanisms supported. * (Don't ask me how you get these strings from the RFC stuff like @@ -912,7 +917,13 @@ nfsrvd_write(struct nfsrv_descript *nd, goto out; NFSM_BUILD(tl, u_int32_t *, 4 * NFSX_UNSIGNED); *tl++ = txdr_unsigned(retlen); - if (stable == NFSWRITE_UNSTABLE) + /* + * If nfs_async is set, then pretend the write was FILESYNC. + * Warning: Doing this violates RFC1813 and runs a risk + * of data written by a client being lost when the server + * crashes/reboots. + */ + if (stable == NFSWRITE_UNSTABLE && nfs_async == 0) *tl++ = txdr_unsigned(stable); else *tl++ = txdr_unsigned(NFSWRITE_FILESYNC); From owner-svn-src-stable-9@FreeBSD.ORG Fri Feb 1 07:36:22 2013 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id D77DA267; Fri, 1 Feb 2013 07:36:22 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id C99F46A; Fri, 1 Feb 2013 07:36:22 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r117aMDS017112; Fri, 1 Feb 2013 07:36:22 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r117aMU5017111; Fri, 1 Feb 2013 07:36:22 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201302010736.r117aMU5017111@svn.freebsd.org> From: Xin LI Date: Fri, 1 Feb 2013 07:36:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r246197 - stable/9/lib/libc/gen X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 01 Feb 2013 07:36:22 -0000 Author: delphij Date: Fri Feb 1 07:36:22 2013 New Revision: 246197 URL: http://svnweb.freebsd.org/changeset/base/246197 Log: MFC r244568: - Reduce buffer size from LINE_MAX to PATH_MAX, there is no point to store path longer than this. - Fix an unreached case of check against sizeof buf, which in turn leads to an off-by-one nul byte write on the stack. The original condition can never be satisfied because the passed boundary is the maximum value that can be returned, so code was harmless. Modified: stable/9/lib/libc/gen/check_utility_compat.c Directory Properties: stable/9/lib/libc/ (props changed) Modified: stable/9/lib/libc/gen/check_utility_compat.c ============================================================================== --- stable/9/lib/libc/gen/check_utility_compat.c Fri Feb 1 07:26:25 2013 (r246196) +++ stable/9/lib/libc/gen/check_utility_compat.c Fri Feb 1 07:36:22 2013 (r246197) @@ -35,32 +35,28 @@ __FBSDID("$FreeBSD$"); * are threaded, so I'm not concerned about cancellation points or other * niceties. */ +#include + #include #include #include #include -#ifndef LINE_MAX -#define LINE_MAX _POSIX2_LINE_MAX -#endif - #define _PATH_UTIL_COMPAT "/etc/compat-FreeBSD-4-util" #define _ENV_UTIL_COMPAT "_COMPAT_FreeBSD_4" int check_utility_compat(const char *utility) { - char buf[LINE_MAX]; + char buf[PATH_MAX]; char *p, *bp; int len; if ((p = getenv(_ENV_UTIL_COMPAT)) != NULL) { strlcpy(buf, p, sizeof buf); } else { - if ((len = readlink(_PATH_UTIL_COMPAT, buf, sizeof buf)) < 0) + if ((len = readlink(_PATH_UTIL_COMPAT, buf, sizeof(buf) - 1)) < 0) return 0; - if (len > sizeof buf) - len = sizeof buf; buf[len] = '\0'; } if (buf[0] == '\0') From owner-svn-src-stable-9@FreeBSD.ORG Fri Feb 1 07:40:47 2013 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 73CE9576; Fri, 1 Feb 2013 07:40:47 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 5BFC7A8; Fri, 1 Feb 2013 07:40:47 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r117elnj018005; Fri, 1 Feb 2013 07:40:47 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r117elIC018002; Fri, 1 Feb 2013 07:40:47 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201302010740.r117elIC018002@svn.freebsd.org> From: Xin LI Date: Fri, 1 Feb 2013 07:40:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r246199 - stable/9/usr.bin/apply X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 01 Feb 2013 07:40:47 -0000 Author: delphij Date: Fri Feb 1 07:40:46 2013 New Revision: 246199 URL: http://svnweb.freebsd.org/changeset/base/246199 Log: MFC r245048: Constify arguments. While I'm there, also add a static for usage(). Modified: stable/9/usr.bin/apply/apply.c Directory Properties: stable/9/usr.bin/apply/ (props changed) Modified: stable/9/usr.bin/apply/apply.c ============================================================================== --- stable/9/usr.bin/apply/apply.c Fri Feb 1 07:38:26 2013 (r246198) +++ stable/9/usr.bin/apply/apply.c Fri Feb 1 07:40:46 2013 (r246199) @@ -55,7 +55,7 @@ __FBSDID("$FreeBSD$"); #define EXEC "exec " -static int exec_shell(const char *, char *, char *); +static int exec_shell(const char *, const char *, const char *); static void usage(void); int @@ -222,7 +222,7 @@ main(int argc, char *argv[]) * arguments. */ static int -exec_shell(const char *command, char *use_shell, char *use_name) +exec_shell(const char *command, const char *use_shell, const char *use_name) { pid_t pid; int omask, pstat; @@ -250,7 +250,7 @@ exec_shell(const char *command, char *us return(pid == -1 ? -1 : pstat); } -void +static void usage(void) { From owner-svn-src-stable-9@FreeBSD.ORG Fri Feb 1 07:48:14 2013 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 831129B6; Fri, 1 Feb 2013 07:48:14 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 6695811B; Fri, 1 Feb 2013 07:48:14 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r117mEN3020527; Fri, 1 Feb 2013 07:48:14 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r117mEfT020526; Fri, 1 Feb 2013 07:48:14 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201302010748.r117mEfT020526@svn.freebsd.org> From: Xin LI Date: Fri, 1 Feb 2013 07:48:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r246200 - stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 01 Feb 2013 07:48:14 -0000 Author: delphij Date: Fri Feb 1 07:48:13 2013 New Revision: 246200 URL: http://svnweb.freebsd.org/changeset/base/246200 Log: MFC r245511: Improve the comment in txg.c Obtained from: Illumos (13910:f3454e0a097c) Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/txg.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/txg.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/txg.c Fri Feb 1 07:40:46 2013 (r246199) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/txg.c Fri Feb 1 07:48:13 2013 (r246200) @@ -21,7 +21,7 @@ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * Portions Copyright 2011 Martin Matuska - * Copyright (c) 2012 by Delphix. All rights reserved. + * Copyright (c) 2013 by Delphix. All rights reserved. */ #include @@ -33,7 +33,76 @@ #include /* - * Pool-wide transaction groups. + * ZFS Transaction Groups + * ---------------------- + * + * ZFS transaction groups are, as the name implies, groups of transactions + * that act on persistent state. ZFS asserts consistency at the granularity of + * these transaction groups. Each successive transaction group (txg) is + * assigned a 64-bit consecutive identifier. There are three active + * transaction group states: open, quiescing, or syncing. At any given time, + * there may be an active txg associated with each state; each active txg may + * either be processing, or blocked waiting to enter the next state. There may + * be up to three active txgs, and there is always a txg in the open state + * (though it may be blocked waiting to enter the quiescing state). In broad + * strokes, transactions — operations that change in-memory structures — are + * accepted into the txg in the open state, and are completed while the txg is + * in the open or quiescing states. The accumulated changes are written to + * disk in the syncing state. + * + * Open + * + * When a new txg becomes active, it first enters the open state. New + * transactions — updates to in-memory structures — are assigned to the + * currently open txg. There is always a txg in the open state so that ZFS can + * accept new changes (though the txg may refuse new changes if it has hit + * some limit). ZFS advances the open txg to the next state for a variety of + * reasons such as it hitting a time or size threshold, or the execution of an + * administrative action that must be completed in the syncing state. + * + * Quiescing + * + * After a txg exits the open state, it enters the quiescing state. The + * quiescing state is intended to provide a buffer between accepting new + * transactions in the open state and writing them out to stable storage in + * the syncing state. While quiescing, transactions can continue their + * operation without delaying either of the other states. Typically, a txg is + * in the quiescing state very briefly since the operations are bounded by + * software latencies rather than, say, slower I/O latencies. After all + * transactions complete, the txg is ready to enter the next state. + * + * Syncing + * + * In the syncing state, the in-memory state built up during the open and (to + * a lesser degree) the quiescing states is written to stable storage. The + * process of writing out modified data can, in turn modify more data. For + * example when we write new blocks, we need to allocate space for them; those + * allocations modify metadata (space maps)... which themselves must be + * written to stable storage. During the sync state, ZFS iterates, writing out + * data until it converges and all in-memory changes have been written out. + * The first such pass is the largest as it encompasses all the modified user + * data (as opposed to filesystem metadata). Subsequent passes typically have + * far less data to write as they consist exclusively of filesystem metadata. + * + * To ensure convergence, after a certain number of passes ZFS begins + * overwriting locations on stable storage that had been allocated earlier in + * the syncing state (and subsequently freed). ZFS usually allocates new + * blocks to optimize for large, continuous, writes. For the syncing state to + * converge however it must complete a pass where no new blocks are allocated + * since each allocation requires a modification of persistent metadata. + * Further, to hasten convergence, after a prescribed number of passes, ZFS + * also defers frees, and stops compressing. + * + * In addition to writing out user data, we must also execute synctasks during + * the syncing context. A synctask is the mechanism by which some + * administrative activities work such as creating and destroying snapshots or + * datasets. Note that when a synctask is initiated it enters the open txg, + * and ZFS then pushes that txg as quickly as possible to completion of the + * syncing state in order to reduce the latency of the administrative + * activity. To complete the syncing state, ZFS writes out a new uberblock, + * the root of the tree of blocks that comprise all state stored on the ZFS + * pool. Finally, if there is a quiesced txg waiting, we signal that it can + * now transition to the syncing state. */ static void txg_sync_thread(void *arg); From owner-svn-src-stable-9@FreeBSD.ORG Sat Feb 2 01:11:03 2013 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 81B66A40; Sat, 2 Feb 2013 01:11:03 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 71B098D8; Sat, 2 Feb 2013 01:11:03 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r121B3wA039116; Sat, 2 Feb 2013 01:11:03 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r121B3X8039110; Sat, 2 Feb 2013 01:11:03 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201302020111.r121B3X8039110@svn.freebsd.org> From: Glen Barber Date: Sat, 2 Feb 2013 01:11:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r246224 - stable/9/share/man/man7 X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 02 Feb 2013 01:11:03 -0000 Author: gjb (doc,ports committer) Date: Sat Feb 2 01:11:02 2013 New Revision: 246224 URL: http://svnweb.freebsd.org/changeset/base/246224 Log: MFC r246153, r246154: r246153: - Update svn port directory in release(7). r246154: - Force commit to mark MFC for r246153. Modified: stable/9/share/man/man7/release.7 Directory Properties: stable/9/share/man/man7/ (props changed) Modified: stable/9/share/man/man7/release.7 ============================================================================== --- stable/9/share/man/man7/release.7 Fri Feb 1 22:55:27 2013 (r246223) +++ stable/9/share/man/man7/release.7 Sat Feb 2 01:11:02 2013 (r246224) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 16, 2012 +.Dd January 31, 2013 .Dt RELEASE 7 .Os .Sh NAME @@ -310,7 +310,7 @@ directory. .Xr cc 1 , .Xr install 1 , .Xr make 1 , -.Xr svn 1 Pq Pa ports/devel/subversion-freebsd , +.Xr svn 1 Pq Pa ports/devel/subversion , .Xr uname 1 , .Xr md 4 , .Xr make.conf 5 , From owner-svn-src-stable-9@FreeBSD.ORG Sat Feb 2 09:57:36 2013 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id A8F6668E; Sat, 2 Feb 2013 09:57:36 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 7FBE6858; Sat, 2 Feb 2013 09:57:36 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r129vaA7094910; Sat, 2 Feb 2013 09:57:36 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r129vY6f094897; Sat, 2 Feb 2013 09:57:34 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201302020957.r129vY6f094897@svn.freebsd.org> From: Edward Tomasz Napierala Date: Sat, 2 Feb 2013 09:57:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r246234 - in stable/9: include sys/boot/powerpc/boot1.chrp sys/boot/sparc64/boot1 sys/conf sys/modules/ufs sys/ufs/ffs sys/ufs/ufs X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 02 Feb 2013 09:57:36 -0000 Author: trasz Date: Sat Feb 2 09:57:34 2013 New Revision: 246234 URL: http://svnweb.freebsd.org/changeset/base/246234 Log: MFC r243245: Add UFS writesuspension mechanism, designed to allow userland processes to modify on-disk metadata for filesystems mounted for write. Reviewed by: kib, mckusick Sponsored by: FreeBSD Foundation MFC r243247: Add change missed in 243245. MFC r243250: Fix build of kdump(1). MFC r243254: Fix build on powerpc. Reviewed by: nwhitehorn MFC r243305 by marius: Fix build after r243245. Submitted by: trasz MFC r243339 by kib: Fix module build after r243245. Added: stable/9/sys/ufs/ffs/ffs_suspend.c - copied unchanged from r243245, head/sys/ufs/ffs/ffs_suspend.c Modified: stable/9/include/paths.h stable/9/sys/boot/powerpc/boot1.chrp/boot1.c stable/9/sys/boot/sparc64/boot1/boot1.c stable/9/sys/conf/files stable/9/sys/modules/ufs/Makefile stable/9/sys/ufs/ffs/ffs_extern.h stable/9/sys/ufs/ffs/ffs_vfsops.c stable/9/sys/ufs/ffs/fs.h stable/9/sys/ufs/ufs/ufsmount.h Directory Properties: stable/9/include/ (props changed) stable/9/sys/ (props changed) stable/9/sys/boot/ (props changed) stable/9/sys/boot/powerpc/boot1.chrp/ (props changed) stable/9/sys/conf/ (props changed) stable/9/sys/modules/ (props changed) Modified: stable/9/include/paths.h ============================================================================== --- stable/9/include/paths.h Sat Feb 2 09:35:14 2013 (r246233) +++ stable/9/include/paths.h Sat Feb 2 09:57:34 2013 (r246234) @@ -85,6 +85,7 @@ #define _PATH_SHELLS "/etc/shells" #define _PATH_TTY "/dev/tty" #define _PATH_UNIX "don't use _PATH_UNIX" +#define _PATH_UFSSUSPEND "/dev/ufssuspend" #define _PATH_VI "/usr/bin/vi" #define _PATH_WALL "/usr/bin/wall" Modified: stable/9/sys/boot/powerpc/boot1.chrp/boot1.c ============================================================================== --- stable/9/sys/boot/powerpc/boot1.chrp/boot1.c Sat Feb 2 09:35:14 2013 (r246233) +++ stable/9/sys/boot/powerpc/boot1.chrp/boot1.c Sat Feb 2 09:57:34 2013 (r246234) @@ -62,7 +62,7 @@ static void usage(void); static void bcopy(const void *src, void *dst, size_t len); static void bzero(void *b, size_t len); -static int mount(const char *device, int quiet); +static int domount(const char *device, int quiet); static void panic(const char *fmt, ...) __dead2; static int printf(const char *fmt, ...); @@ -432,7 +432,7 @@ main(int ac, char **av) bootpath_full[len+2] = '\0'; } - if (mount(bootpath_full,1) >= 0) + if (domount(bootpath_full,1) >= 0) break; if (bootdev > 0) @@ -440,10 +440,10 @@ main(int ac, char **av) } if (i >= 16) - panic("mount"); + panic("domount"); } else { - if (mount(bootpath_full,0) == -1) - panic("mount"); + if (domount(bootpath_full,0) == -1) + panic("domount"); } printf(" Boot volume: %s\n",bootpath_full); @@ -470,17 +470,17 @@ exit(int code) static struct dmadat __dmadat; static int -mount(const char *device, int quiet) +domount(const char *device, int quiet) { dmadat = &__dmadat; if ((bootdev = ofw_open(device)) == -1) { - printf("mount: can't open device\n"); + printf("domount: can't open device\n"); return (-1); } if (fsread(0, NULL, 0)) { if (!quiet) - printf("mount: can't read superblock\n"); + printf("domount: can't read superblock\n"); return (-1); } return (0); Modified: stable/9/sys/boot/sparc64/boot1/boot1.c ============================================================================== --- stable/9/sys/boot/sparc64/boot1/boot1.c Sat Feb 2 09:35:14 2013 (r246233) +++ stable/9/sys/boot/sparc64/boot1/boot1.c Sat Feb 2 09:57:34 2013 (r246234) @@ -60,7 +60,7 @@ static void load(const char *); static void bcopy(const void *src, void *dst, size_t len); static void bzero(void *b, size_t len); -static int mount(const char *device); +static int domount(const char *device); static int dskread(void *buf, u_int64_t lba, int nblk); static void panic(const char *fmt, ...) __dead2; @@ -347,8 +347,8 @@ main(int ac, char **av) " Boot loader: %s\n", bootpath, path); #endif - if (mount(bootpath) == -1) - panic("mount"); + if (domount(bootpath) == -1) + panic("domount"); #ifdef ZFSBOOT loadzfs(); @@ -498,17 +498,17 @@ load(const char *fname) #endif /* ZFSBOOT */ static int -mount(const char *device) +domount(const char *device) { if ((bootdev = ofw_open(device)) == -1) { - printf("mount: can't open device\n"); + printf("domount: can't open device\n"); return (-1); } #ifndef ZFSBOOT dmadat = &__dmadat; if (fsread(0, NULL, 0)) { - printf("mount: can't read superblock\n"); + printf("domount: can't read superblock\n"); return (-1); } #endif Modified: stable/9/sys/conf/files ============================================================================== --- stable/9/sys/conf/files Sat Feb 2 09:35:14 2013 (r246233) +++ stable/9/sys/conf/files Sat Feb 2 09:57:34 2013 (r246234) @@ -3385,6 +3385,7 @@ ufs/ffs/ffs_tables.c optional ffs ufs/ffs/ffs_vfsops.c optional ffs ufs/ffs/ffs_vnops.c optional ffs ufs/ffs/ffs_rawread.c optional directio +ufs/ffs/ffs_suspend.c optional ffs ufs/ufs/ufs_acl.c optional ffs ufs/ufs/ufs_bmap.c optional ffs ufs/ufs/ufs_dirhash.c optional ffs Modified: stable/9/sys/modules/ufs/Makefile ============================================================================== --- stable/9/sys/modules/ufs/Makefile Sat Feb 2 09:35:14 2013 (r246233) +++ stable/9/sys/modules/ufs/Makefile Sat Feb 2 09:57:34 2013 (r246234) @@ -7,7 +7,8 @@ SRCS= opt_ddb.h opt_directio.h opt_ffs.h vnode_if.h ufs_acl.c ufs_bmap.c ufs_dirhash.c ufs_extattr.c \ ufs_gjournal.c ufs_inode.c ufs_lookup.c ufs_quota.c ufs_vfsops.c \ ufs_vnops.c ffs_alloc.c ffs_balloc.c ffs_inode.c ffs_snapshot.c \ - ffs_softdep.c ffs_subr.c ffs_tables.c ffs_vfsops.c ffs_vnops.c + ffs_softdep.c ffs_subr.c ffs_suspend.c ffs_tables.c ffs_vfsops.c \ + ffs_vnops.c .if !defined(KERNBUILDDIR) CFLAGS+= -DSOFTUPDATES -DUFS_DIRHASH Modified: stable/9/sys/ufs/ffs/ffs_extern.h ============================================================================== --- stable/9/sys/ufs/ffs/ffs_extern.h Sat Feb 2 09:35:14 2013 (r246233) +++ stable/9/sys/ufs/ffs/ffs_extern.h Sat Feb 2 09:57:34 2013 (r246234) @@ -79,9 +79,11 @@ int ffs_isfreeblock(struct fs *, u_char void ffs_load_inode(struct buf *, struct inode *, struct fs *, ino_t); int ffs_mountroot(void); void ffs_oldfscompat_write(struct fs *, struct ufsmount *); +int ffs_own_mount(const struct mount *mp); int ffs_reallocblks(struct vop_reallocblks_args *); int ffs_realloccg(struct inode *, ufs2_daddr_t, ufs2_daddr_t, ufs2_daddr_t, int, int, int, struct ucred *, struct buf **); +int ffs_reload(struct mount *, struct thread *, int); int ffs_sbupdate(struct ufsmount *, int, int); void ffs_setblock(struct fs *, u_char *, ufs1_daddr_t); int ffs_snapblkfree(struct fs *, struct vnode *, ufs2_daddr_t, long, ino_t, @@ -100,6 +102,8 @@ int ffs_valloc(struct vnode *, int, stru int ffs_vfree(struct vnode *, ino_t, int); vfs_vget_t ffs_vget; int ffs_vgetf(struct mount *, ino_t, int, struct vnode **, int); +void ffs_susp_initialize(void); +void ffs_susp_uninitialize(void); #define FFSV_FORCEINSMQ 0x0001 Copied: stable/9/sys/ufs/ffs/ffs_suspend.c (from r243245, head/sys/ufs/ffs/ffs_suspend.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/9/sys/ufs/ffs/ffs_suspend.c Sat Feb 2 09:57:34 2013 (r246234, copy of r243245, head/sys/ufs/ffs/ffs_suspend.c) @@ -0,0 +1,338 @@ +/*- + * Copyright (c) 2012 The FreeBSD Foundation + * All rights reserved. + * + * This software was developed by Edward Tomasz Napierala under sponsorship + * from the FreeBSD Foundation. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include +#include +#include +#include + +#include +#include + +static d_open_t ffs_susp_open; +static d_write_t ffs_susp_rdwr; +static d_ioctl_t ffs_susp_ioctl; + +static struct cdevsw ffs_susp_cdevsw = { + .d_version = D_VERSION, + .d_open = ffs_susp_open, + .d_read = ffs_susp_rdwr, + .d_write = ffs_susp_rdwr, + .d_ioctl = ffs_susp_ioctl, + .d_name = "ffs_susp", +}; + +static struct cdev *ffs_susp_dev; +static struct sx ffs_susp_lock; + +static int +ffs_susp_suspended(struct mount *mp) +{ + struct ufsmount *ump; + + sx_assert(&ffs_susp_lock, SA_LOCKED); + + ump = VFSTOUFS(mp); + if (ump->um_writesuspended) + return (1); + return (0); +} + +static int +ffs_susp_open(struct cdev *dev __unused, int flags __unused, + int fmt __unused, struct thread *td __unused) +{ + + return (0); +} + +static int +ffs_susp_rdwr(struct cdev *dev, struct uio *uio, int ioflag) +{ + int error, i; + struct vnode *devvp; + struct mount *mp; + struct ufsmount *ump; + struct buf *bp; + void *base; + size_t len; + ssize_t cnt; + struct fs *fs; + + sx_slock(&ffs_susp_lock); + + error = devfs_get_cdevpriv((void **)&mp); + if (error != 0) { + sx_sunlock(&ffs_susp_lock); + return (ENXIO); + } + + ump = VFSTOUFS(mp); + devvp = ump->um_devvp; + fs = ump->um_fs; + + if (ffs_susp_suspended(mp) == 0) { + sx_sunlock(&ffs_susp_lock); + return (ENXIO); + } + + KASSERT(uio->uio_rw == UIO_READ || uio->uio_rw == UIO_WRITE, + ("neither UIO_READ or UIO_WRITE")); + KASSERT(uio->uio_segflg == UIO_USERSPACE, + ("uio->uio_segflg != UIO_USERSPACE")); + + cnt = uio->uio_resid; + + for (i = 0; i < uio->uio_iovcnt; i++) { + while (uio->uio_iov[i].iov_len) { + base = uio->uio_iov[i].iov_base; + len = uio->uio_iov[i].iov_len; + if (len > fs->fs_bsize) + len = fs->fs_bsize; + if (fragoff(fs, uio->uio_offset) != 0 || + fragoff(fs, len) != 0) { + error = EINVAL; + goto out; + } + error = bread(devvp, btodb(uio->uio_offset), len, + NOCRED, &bp); + if (error != 0) + goto out; + if (uio->uio_rw == UIO_WRITE) { + error = copyin(base, bp->b_data, len); + if (error != 0) { + bp->b_flags |= B_INVAL | B_NOCACHE; + brelse(bp); + goto out; + } + error = bwrite(bp); + if (error != 0) + goto out; + } else { + error = copyout(bp->b_data, base, len); + brelse(bp); + if (error != 0) + goto out; + } + uio->uio_iov[i].iov_base = + (char *)uio->uio_iov[i].iov_base + len; + uio->uio_iov[i].iov_len -= len; + uio->uio_resid -= len; + uio->uio_offset += len; + } + } + +out: + sx_sunlock(&ffs_susp_lock); + + if (uio->uio_resid < cnt) + return (0); + + return (error); +} + +static int +ffs_susp_suspend(struct mount *mp) +{ + struct fs *fs; + struct ufsmount *ump; + int error; + + sx_assert(&ffs_susp_lock, SA_XLOCKED); + + if (!ffs_own_mount(mp)) + return (EINVAL); + if (ffs_susp_suspended(mp)) + return (EBUSY); + + ump = VFSTOUFS(mp); + fs = ump->um_fs; + + /* + * Make sure the calling thread is permitted to access the mounted + * device. The permissions can change after we unlock the vnode; + * it's harmless. + */ + vn_lock(ump->um_devvp, LK_EXCLUSIVE | LK_RETRY); + error = VOP_ACCESS(ump->um_devvp, VREAD | VWRITE, + curthread->td_ucred, curthread); + VOP_UNLOCK(ump->um_devvp, 0); + if (error != 0) + return (error); +#ifdef MAC + if (mac_mount_check_stat(curthread->td_ucred, mp) != 0) + return (EPERM); +#endif + + if ((error = vfs_write_suspend(mp)) != 0) + return (error); + + ump->um_writesuspended = 1; + + return (0); +} + +static void +ffs_susp_dtor(void *data) +{ + struct fs *fs; + struct ufsmount *ump; + struct mount *mp; + int error; + + sx_xlock(&ffs_susp_lock); + + mp = (struct mount *)data; + ump = VFSTOUFS(mp); + fs = ump->um_fs; + + if (ffs_susp_suspended(mp) == 0) { + sx_xunlock(&ffs_susp_lock); + return; + } + + KASSERT((mp->mnt_kern_flag & MNTK_SUSPEND) != 0, + ("MNTK_SUSPEND not set")); + + error = ffs_reload(mp, curthread, 1); + if (error != 0) + panic("failed to unsuspend writes on %s", fs->fs_fsmnt); + + /* + * XXX: The status is kept per-process; the vfs_write_resume() routine + * asserts that the resuming thread is the same one that called + * vfs_write_suspend(). The cdevpriv data, however, is attached + * to the file descriptor, e.g. is inherited during fork. Thus, + * it's possible that the resuming process will be different from + * the one that started the suspension. + * + * Work around by fooling the check in vfs_write_resume(). + */ + mp->mnt_susp_owner = curthread; + + vfs_write_resume(mp); + vfs_unbusy(mp); + ump->um_writesuspended = 0; + + sx_xunlock(&ffs_susp_lock); +} + +static int +ffs_susp_ioctl(struct cdev *dev, u_long cmd, caddr_t addr, int flags, + struct thread *td) +{ + struct mount *mp; + fsid_t *fsidp; + int error; + + /* + * No suspend inside the jail. Allowing it would require making + * sure that e.g. the devfs ruleset for that jail permits access + * to the devvp. + */ + if (jailed(td->td_ucred)) + return (EPERM); + + sx_xlock(&ffs_susp_lock); + + switch (cmd) { + case UFSSUSPEND: + fsidp = (fsid_t *)addr; + mp = vfs_getvfs(fsidp); + if (mp == NULL) { + error = ENOENT; + break; + } + error = vfs_busy(mp, 0); + vfs_rel(mp); + if (error != 0) + break; + error = ffs_susp_suspend(mp); + if (error != 0) { + vfs_unbusy(mp); + break; + } + error = devfs_set_cdevpriv(mp, ffs_susp_dtor); + KASSERT(error == 0, ("devfs_set_cdevpriv failed")); + break; + case UFSRESUME: + error = devfs_get_cdevpriv((void **)&mp); + if (error != 0) + break; + /* + * This calls ffs_susp_dtor, which in turn unsuspends the fs. + * The dtor expects to be called without lock held, because + * sometimes it's called from here, and sometimes due to the + * file being closed or process exiting. + */ + sx_xunlock(&ffs_susp_lock); + devfs_clear_cdevpriv(); + return (0); + default: + error = ENXIO; + break; + } + + sx_xunlock(&ffs_susp_lock); + + return (error); +} + +void +ffs_susp_initialize(void) +{ + + sx_init(&ffs_susp_lock, "ffs_susp"); + ffs_susp_dev = make_dev(&ffs_susp_cdevsw, 0, UID_ROOT, GID_WHEEL, 0600, + "ufssuspend"); +} + +void +ffs_susp_uninitialize(void) +{ + + destroy_dev(ffs_susp_dev); + sx_destroy(&ffs_susp_lock); +} Modified: stable/9/sys/ufs/ffs/ffs_vfsops.c ============================================================================== --- stable/9/sys/ufs/ffs/ffs_vfsops.c Sat Feb 2 09:35:14 2013 (r246233) +++ stable/9/sys/ufs/ffs/ffs_vfsops.c Sat Feb 2 09:57:34 2013 (r246234) @@ -49,6 +49,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -75,7 +76,6 @@ __FBSDID("$FreeBSD$"); static uma_zone_t uma_inode, uma_ufs1, uma_ufs2; -static int ffs_reload(struct mount *, struct thread *); static int ffs_mountfs(struct vnode *, struct mount *, struct thread *); static void ffs_oldfscompat_read(struct fs *, struct ufsmount *, ufs2_daddr_t); @@ -333,7 +333,7 @@ ffs_mount(struct mount *mp) vfs_write_resume(mp); } if ((mp->mnt_flag & MNT_RELOAD) && - (error = ffs_reload(mp, td)) != 0) + (error = ffs_reload(mp, td, 0)) != 0) return (error); if (fs->fs_ronly && !vfs_flagopt(mp->mnt_optnew, "ro", NULL, 0)) { @@ -595,8 +595,8 @@ ffs_cmount(struct mntarg *ma, void *data /* * Reload all incore data for a filesystem (used after running fsck on - * the root filesystem and finding things to fix). The filesystem must - * be mounted read-only. + * the root filesystem and finding things to fix). If the 'force' flag + * is 0, the filesystem must be mounted read-only. * * Things to do to update the mount: * 1) invalidate all cached meta-data. @@ -606,8 +606,8 @@ ffs_cmount(struct mntarg *ma, void *data * 5) invalidate all cached file data. * 6) re-read inode data for all active vnodes. */ -static int -ffs_reload(struct mount *mp, struct thread *td) +int +ffs_reload(struct mount *mp, struct thread *td, int force) { struct vnode *vp, *mvp, *devvp; struct inode *ip; @@ -619,9 +619,15 @@ ffs_reload(struct mount *mp, struct thre int i, blks, size, error; int32_t *lp; - if ((mp->mnt_flag & MNT_RDONLY) == 0) - return (EINVAL); ump = VFSTOUFS(mp); + + MNT_ILOCK(mp); + if ((mp->mnt_flag & MNT_RDONLY) == 0 && force == 0) { + MNT_IUNLOCK(mp); + return (EINVAL); + } + MNT_IUNLOCK(mp); + /* * Step 1: invalidate all cached meta-data. */ @@ -655,8 +661,7 @@ ffs_reload(struct mount *mp, struct thre newfs->fs_maxcluster = fs->fs_maxcluster; newfs->fs_contigdirs = fs->fs_contigdirs; newfs->fs_active = fs->fs_active; - /* The file system is still read-only. */ - newfs->fs_ronly = 1; + newfs->fs_ronly = fs->fs_ronly; sblockloc = fs->fs_sblockloc; bcopy(newfs, fs, (u_int)fs->fs_sbsize); brelse(bp); @@ -711,6 +716,13 @@ ffs_reload(struct mount *mp, struct thre loop: MNT_VNODE_FOREACH_ALL(vp, mp, mvp) { /* + * Skip syncer vnode. + */ + if (vp->v_type == VNON) { + VI_UNLOCK(vp); + continue; + } + /* * Step 4: invalidate all cached file data. */ if (vget(vp, LK_EXCLUSIVE | LK_INTERLOCK, td)) { @@ -1834,6 +1846,7 @@ ffs_init(vfsp) struct vfsconf *vfsp; { + ffs_susp_initialize(); softdep_initialize(); return (ufs_init(vfsp)); } @@ -1849,6 +1862,7 @@ ffs_uninit(vfsp) ret = ufs_uninit(vfsp); softdep_uninitialize(); + ffs_susp_uninitialize(); return (ret); } @@ -2198,6 +2212,15 @@ ffs_geom_strategy(struct bufobj *bo, str g_vfs_strategy(bo, bp); } +int +ffs_own_mount(const struct mount *mp) +{ + + if (mp->mnt_op == &ufs_vfsops) + return (1); + return (0); +} + #ifdef DDB static void Modified: stable/9/sys/ufs/ffs/fs.h ============================================================================== --- stable/9/sys/ufs/ffs/fs.h Sat Feb 2 09:35:14 2013 (r246233) +++ stable/9/sys/ufs/ffs/fs.h Sat Feb 2 09:57:34 2013 (r246234) @@ -33,6 +33,9 @@ #ifndef _UFS_FFS_FS_H_ #define _UFS_FFS_FS_H_ +#include +#include + /* * Each disk drive contains some number of filesystems. * A filesystem consists of a number of cylinder groups. @@ -762,4 +765,10 @@ CTASSERT(sizeof(union jrec) == JREC_SIZE extern int inside[], around[]; extern u_char *fragtbl[]; +/* + * IOCTLs used for filesystem write suspension. + */ +#define UFSSUSPEND _IOW('U', 1, fsid_t) +#define UFSRESUME _IO('U', 2) + #endif Modified: stable/9/sys/ufs/ufs/ufsmount.h ============================================================================== --- stable/9/sys/ufs/ufs/ufsmount.h Sat Feb 2 09:35:14 2013 (r246233) +++ stable/9/sys/ufs/ufs/ufsmount.h Sat Feb 2 09:57:34 2013 (r246234) @@ -98,6 +98,7 @@ struct ufsmount { char um_qflags[MAXQUOTAS]; /* quota specific flags */ int64_t um_savedmaxfilesize; /* XXX - limit maxfilesize */ int um_candelete; /* devvp supports TRIM */ + int um_writesuspended; /* suspension in progress */ int (*um_balloc)(struct vnode *, off_t, int, struct ucred *, int, struct buf **); int (*um_blkatoff)(struct vnode *, off_t, char **, struct buf **); int (*um_truncate)(struct vnode *, off_t, int, struct ucred *, struct thread *); From owner-svn-src-stable-9@FreeBSD.ORG Sat Feb 2 10:00:47 2013 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 89A2482E; Sat, 2 Feb 2013 10:00:47 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 6D85E87A; Sat, 2 Feb 2013 10:00:47 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r12A0lMD095621; Sat, 2 Feb 2013 10:00:47 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r12A0lTQ095619; Sat, 2 Feb 2013 10:00:47 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201302021000.r12A0lTQ095619@svn.freebsd.org> From: Edward Tomasz Napierala Date: Sat, 2 Feb 2013 10:00:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r246235 - stable/9/sbin/growfs X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 02 Feb 2013 10:00:47 -0000 Author: trasz Date: Sat Feb 2 10:00:46 2013 New Revision: 246235 URL: http://svnweb.freebsd.org/changeset/base/246235 Log: MFC r243246: Make it possible to resize filesystems mounted read-write, using newly introduced UFS write suspension mechanism. Reviewed by: kib, mckusick Sponsored by: FreeBSD Foundation Modified: stable/9/sbin/growfs/growfs.8 stable/9/sbin/growfs/growfs.c Directory Properties: stable/9/sbin/growfs/ (props changed) Modified: stable/9/sbin/growfs/growfs.8 ============================================================================== --- stable/9/sbin/growfs/growfs.8 Sat Feb 2 09:57:34 2013 (r246234) +++ stable/9/sbin/growfs/growfs.8 Sat Feb 2 10:00:46 2013 (r246235) @@ -115,11 +115,17 @@ The .Nm utility first appeared in .Fx 4.4 . +The ability to resize mounted filesystems was added in +.Fx 10.0 . .Sh AUTHORS .An Christoph Herrmann Aq chm@FreeBSD.org .An Thomas-Henning von Kamptz Aq tomsoft@FreeBSD.org .An The GROWFS team Aq growfs@Tomsoft.COM .An Edward Tomasz Napierala Aq trasz@FreeBSD.org +.Sh CAVEATS +.Pp +When expanding a file system mounted read-write, any writes to that file system +will be temporarily suspended until the expansion is finished. .Sh BUGS .Pp Normally Modified: stable/9/sbin/growfs/growfs.c ============================================================================== --- stable/9/sbin/growfs/growfs.c Sat Feb 2 09:57:34 2013 (r246234) +++ stable/9/sbin/growfs/growfs.c Sat Feb 2 10:00:46 2013 (r246235) @@ -69,6 +69,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -1523,8 +1524,9 @@ main(int argc, char **argv) if (yflag == 0 && Nflag == 0) { if (statfsp != NULL && (statfsp->f_flags & MNT_RDONLY) == 0) - errx(1, "%s is mounted read-write on %s", - statfsp->f_mntfromname, statfsp->f_mntonname); + printf("Device is mounted read-write; resizing will " + "result in temporary write suspension for %s.\n", + statfsp->f_mntonname); printf("It's strongly recommended to make a backup " "before growing the file system.\n" "OK to grow filesystem on %s", device); @@ -1553,9 +1555,18 @@ main(int argc, char **argv) if (Nflag) { fso = -1; } else { - fso = open(device, O_WRONLY); - if (fso < 0) - err(1, "%s", device); + if (statfsp != NULL && (statfsp->f_flags & MNT_RDONLY) == 0) { + fso = open(_PATH_UFSSUSPEND, O_RDWR); + if (fso == -1) + err(1, "unable to open %s", _PATH_UFSSUSPEND); + error = ioctl(fso, UFSSUSPEND, &statfsp->f_fsid); + if (error != 0) + err(1, "UFSSUSPEND"); + } else { + fso = open(device, O_WRONLY); + if (fso < 0) + err(1, "%s", device); + } } /* @@ -1625,12 +1636,17 @@ main(int argc, char **argv) close(fsi); if (fso > -1) { + if (statfsp != NULL && (statfsp->f_flags & MNT_RDONLY) == 0) { + error = ioctl(fso, UFSRESUME); + if (error != 0) + err(1, "UFSRESUME"); + } error = close(fso); if (error != 0) err(1, "close"); + if (statfsp != NULL && (statfsp->f_flags & MNT_RDONLY) != 0) + mount_reload(statfsp); } - if (statfsp != NULL) - mount_reload(statfsp); DBG_CLOSE; From owner-svn-src-stable-9@FreeBSD.ORG Sat Feb 2 10:02:26 2013 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id CB4E09DE; Sat, 2 Feb 2013 10:02:26 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id BD4E9889; Sat, 2 Feb 2013 10:02:26 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r12A2Qvj097417; Sat, 2 Feb 2013 10:02:26 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r12A2QnC097415; Sat, 2 Feb 2013 10:02:26 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201302021002.r12A2QnC097415@svn.freebsd.org> From: Edward Tomasz Napierala Date: Sat, 2 Feb 2013 10:02:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r246236 - stable/9/sbin/growfs X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 02 Feb 2013 10:02:26 -0000 Author: trasz Date: Sat Feb 2 10:02:26 2013 New Revision: 246236 URL: http://svnweb.freebsd.org/changeset/base/246236 Log: MFC r244243: Fix extending filesystems of weird size by making sure the actual size is always multiple of fragment size. Modified: stable/9/sbin/growfs/growfs.c Directory Properties: stable/9/sbin/growfs/ (props changed) Modified: stable/9/sbin/growfs/growfs.c ============================================================================== --- stable/9/sbin/growfs/growfs.c Sat Feb 2 10:00:46 2013 (r246235) +++ stable/9/sbin/growfs/growfs.c Sat Feb 2 10:02:26 2013 (r246236) @@ -1486,6 +1486,12 @@ main(int argc, char **argv) } } + /* + * Make sure the new size is a multiple of fs_fsize; /dev/ufssuspend + * only supports fragment-aligned IO requests. + */ + size -= size % osblock.fs_fsize; + if (size <= (uint64_t)(osblock.fs_size * osblock.fs_fsize)) { humanize_number(oldsizebuf, sizeof(oldsizebuf), osblock.fs_size * osblock.fs_fsize, From owner-svn-src-stable-9@FreeBSD.ORG Sat Feb 2 10:04:24 2013 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 166A9C8A; Sat, 2 Feb 2013 10:04:24 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id F240B89E; Sat, 2 Feb 2013 10:04:23 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r12A4N8I097820; Sat, 2 Feb 2013 10:04:23 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r12A4N9x097819; Sat, 2 Feb 2013 10:04:23 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201302021004.r12A4N9x097819@svn.freebsd.org> From: Edward Tomasz Napierala Date: Sat, 2 Feb 2013 10:04:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r246237 - stable/9/sbin/growfs X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 02 Feb 2013 10:04:24 -0000 Author: trasz Date: Sat Feb 2 10:04:23 2013 New Revision: 246237 URL: http://svnweb.freebsd.org/changeset/base/246237 Log: MFC r244295: When growing a filesystem, don't leave unused space at the end if there is not enough room for a full cylinder group. Reviewed by: mckusick@ Modified: stable/9/sbin/growfs/growfs.c Directory Properties: stable/9/sbin/growfs/ (props changed) Modified: stable/9/sbin/growfs/growfs.c ============================================================================== --- stable/9/sbin/growfs/growfs.c Sat Feb 2 10:02:26 2013 (r246236) +++ stable/9/sbin/growfs/growfs.c Sat Feb 2 10:04:23 2013 (r246237) @@ -1609,17 +1609,20 @@ main(int argc, char **argv) } sblock.fs_ncg = howmany(sblock.fs_size, sblock.fs_fpg); + /* + * Allocate last cylinder group only if there is enough room + * for at least one data block. + */ if (sblock.fs_size % sblock.fs_fpg != 0 && - sblock.fs_size % sblock.fs_fpg < cgdmin(&sblock, sblock.fs_ncg)) { - /* - * The space in the new last cylinder group is too small, - * so revert back. - */ + sblock.fs_size <= cgdmin(&sblock, sblock.fs_ncg - 1)) { + humanize_number(oldsizebuf, sizeof(oldsizebuf), + (sblock.fs_size % sblock.fs_fpg) * sblock.fs_fsize, + "B", HN_AUTOSCALE, HN_B | HN_NOSPACE | HN_DECIMAL); + warnx("no room to allocate last cylinder group; " + "leaving %s unused", oldsizebuf); sblock.fs_ncg--; if (sblock.fs_magic == FS_UFS1_MAGIC) sblock.fs_old_ncyl = sblock.fs_ncg * sblock.fs_old_cpg; - printf("Warning: %jd sector(s) cannot be allocated.\n", - (intmax_t)fsbtodb(&sblock, sblock.fs_size % sblock.fs_fpg)); sblock.fs_size = sblock.fs_ncg * sblock.fs_fpg; } From owner-svn-src-stable-9@FreeBSD.ORG Sat Feb 2 11:25:10 2013 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id C2E158E1; Sat, 2 Feb 2013 11:25:10 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id B06A9B12; Sat, 2 Feb 2013 11:25:10 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r12BPAal022177; Sat, 2 Feb 2013 11:25:10 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r12BPA1F022176; Sat, 2 Feb 2013 11:25:10 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201302021125.r12BPA1F022176@svn.freebsd.org> From: Andriy Gapon Date: Sat, 2 Feb 2013 11:25:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r246240 - stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 02 Feb 2013 11:25:10 -0000 Author: avg Date: Sat Feb 2 11:25:10 2013 New Revision: 246240 URL: http://svnweb.freebsd.org/changeset/base/246240 Log: MFC r245945: spa_generate_rootconf: add support for old vdev labels Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Sat Feb 2 11:20:36 2013 (r246239) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Sat Feb 2 11:25:10 2013 (r246240) @@ -3775,9 +3775,8 @@ spa_generate_rootconf(const char *name) /* * Multi-vdev root pool configuration discovery is not supported yet. */ - nchildren = 0; - VERIFY(nvlist_lookup_uint64(best_cfg, ZPOOL_CONFIG_VDEV_CHILDREN, - &nchildren) == 0); + nchildren = 1; + nvlist_lookup_uint64(best_cfg, ZPOOL_CONFIG_VDEV_CHILDREN, &nchildren); holes = NULL; nvlist_lookup_uint64_array(best_cfg, ZPOOL_CONFIG_HOLE_ARRAY, &holes, &nholes); From owner-svn-src-stable-9@FreeBSD.ORG Sat Feb 2 11:30:53 2013 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id D79B4AB6; Sat, 2 Feb 2013 11:30:53 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id C937BB3C; Sat, 2 Feb 2013 11:30:53 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r12BUr9V022991; Sat, 2 Feb 2013 11:30:53 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r12BUrup022990; Sat, 2 Feb 2013 11:30:53 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201302021130.r12BUrup022990@svn.freebsd.org> From: Andriy Gapon Date: Sat, 2 Feb 2013 11:30:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r246241 - stable/9/sys/geom/mirror X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 02 Feb 2013 11:30:53 -0000 Author: avg Date: Sat Feb 2 11:30:53 2013 New Revision: 246241 URL: http://svnweb.freebsd.org/changeset/base/246241 Log: MFC r245946: g_mirror: g_getattr() failure should not be fatal PR: kern/175323 Modified: stable/9/sys/geom/mirror/g_mirror.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/geom/mirror/g_mirror.c ============================================================================== --- stable/9/sys/geom/mirror/g_mirror.c Sat Feb 2 11:25:10 2013 (r246240) +++ stable/9/sys/geom/mirror/g_mirror.c Sat Feb 2 11:30:53 2013 (r246241) @@ -456,9 +456,7 @@ g_mirror_init_disk(struct g_mirror_softc disk->d_priority = md->md_priority; disk->d_flags = md->md_dflags; error = g_getattr("GEOM::candelete", disk->d_consumer, &i); - if (error != 0) - goto fail; - if (i) + if (error == 0 && i != 0) disk->d_flags |= G_MIRROR_DISK_FLAG_CANDELETE; if (md->md_provider[0] != '\0') disk->d_flags |= G_MIRROR_DISK_FLAG_HARDCODED; From owner-svn-src-stable-9@FreeBSD.ORG Sat Feb 2 12:08:28 2013 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id BB27E15F; Sat, 2 Feb 2013 12:08:28 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id A3A62DEF; Sat, 2 Feb 2013 12:08:28 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r12C8SfB034903; Sat, 2 Feb 2013 12:08:28 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r12C8S3M034902; Sat, 2 Feb 2013 12:08:28 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201302021208.r12C8S3M034902@svn.freebsd.org> From: Dimitry Andric Date: Sat, 2 Feb 2013 12:08:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r246249 - stable/9/share/mk X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 02 Feb 2013 12:08:28 -0000 Author: dim Date: Sat Feb 2 12:08:28 2013 New Revision: 246249 URL: http://svnweb.freebsd.org/changeset/base/246249 Log: MFC r246131: Fix a problem introduced in r231057: in bsd.own.mk, move the test for whether clang is enabled to just after the last place where it could have been forced to "no". Modified: stable/9/share/mk/bsd.own.mk Directory Properties: stable/9/share/mk/ (props changed) Modified: stable/9/share/mk/bsd.own.mk ============================================================================== --- stable/9/share/mk/bsd.own.mk Sat Feb 2 12:04:32 2013 (r246248) +++ stable/9/share/mk/bsd.own.mk Sat Feb 2 12:08:28 2013 (r246249) @@ -531,10 +531,6 @@ MK_ZFS:= no MK_CTF:= no .endif -.if ${MK_CLANG} == "no" -MK_CLANG_EXTRAS:= no -.endif - .if ${MK_CRYPT} == "no" MK_OPENSSL:= no MK_OPENSSH:= no @@ -581,6 +577,7 @@ MK_GDB:= no .endif .if ${MK_CLANG} == "no" +MK_CLANG_EXTRAS:= no MK_CLANG_IS_CC:= no .endif From owner-svn-src-stable-9@FreeBSD.ORG Sat Feb 2 13:47:35 2013 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 39D0CD35; Sat, 2 Feb 2013 13:47:35 +0000 (UTC) (envelope-from antoine@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 2AB081E0; Sat, 2 Feb 2013 13:47:35 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r12DlZRo064754; Sat, 2 Feb 2013 13:47:35 GMT (envelope-from antoine@svn.freebsd.org) Received: (from antoine@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r12DlYWZ064753; Sat, 2 Feb 2013 13:47:34 GMT (envelope-from antoine@svn.freebsd.org) Message-Id: <201302021347.r12DlYWZ064753@svn.freebsd.org> From: Antoine Brodin Date: Sat, 2 Feb 2013 13:47:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r246253 - stable/9/libexec/tftpd X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 02 Feb 2013 13:47:35 -0000 Author: antoine Date: Sat Feb 2 13:47:34 2013 New Revision: 246253 URL: http://svnweb.freebsd.org/changeset/base/246253 Log: MFC r244686 to stable/9: Use correct size in snprintf. Remove unused buffer. PR: 174631 Submitted by: Henning Petersen Modified: stable/9/libexec/tftpd/tftp-io.c Directory Properties: stable/9/libexec/tftpd/ (props changed) Modified: stable/9/libexec/tftpd/tftp-io.c ============================================================================== --- stable/9/libexec/tftpd/tftp-io.c Sat Feb 2 12:52:43 2013 (r246252) +++ stable/9/libexec/tftpd/tftp-io.c Sat Feb 2 13:47:34 2013 (r246253) @@ -87,14 +87,13 @@ errtomsg(int error) { static char ebuf[40]; struct errmsg *pe; - char buf[MAXPKTSIZE]; if (error == 0) return ("success"); for (pe = errmsgs; pe->e_code >= 0; pe++) if (pe->e_code == error) return (pe->e_msg); - snprintf(ebuf, sizeof(buf), "error %d", error); + snprintf(ebuf, sizeof(ebuf), "error %d", error); return (ebuf); } From owner-svn-src-stable-9@FreeBSD.ORG Sat Feb 2 23:01:55 2013 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 7D5ED93C; Sat, 2 Feb 2013 23:01:55 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 5B38DA1C; Sat, 2 Feb 2013 23:01:55 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r12N1tat032690; Sat, 2 Feb 2013 23:01:55 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r12N1shK032685; Sat, 2 Feb 2013 23:01:54 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201302022301.r12N1shK032685@svn.freebsd.org> From: Eitan Adler Date: Sat, 2 Feb 2013 23:01:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r246264 - in stable/9: share/mk tools/build/mk tools/build/options usr.sbin X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 02 Feb 2013 23:01:55 -0000 Author: eadler Date: Sat Feb 2 23:01:54 2013 New Revision: 246264 URL: http://svnweb.freebsd.org/changeset/base/246264 Log: MFC r245606: Add option to make pc-sysinstall optional PR: bin/173931 Approved by: cperciva (implicit) Added: stable/9/tools/build/options/WITHOUT_PC_SYSINSTALL - copied unchanged from r245606, head/tools/build/options/WITHOUT_PC_SYSINSTALL Modified: stable/9/share/mk/bsd.own.mk stable/9/tools/build/mk/OptionalObsoleteFiles.inc stable/9/usr.sbin/Makefile (contents, props changed) Directory Properties: stable/9/share/mk/ (props changed) stable/9/tools/build/ (props changed) stable/9/tools/build/options/ (props changed) stable/9/usr.sbin/ (props changed) Modified: stable/9/share/mk/bsd.own.mk ============================================================================== --- stable/9/share/mk/bsd.own.mk Sat Feb 2 22:52:24 2013 (r246263) +++ stable/9/share/mk/bsd.own.mk Sat Feb 2 23:01:54 2013 (r246264) @@ -385,6 +385,7 @@ __DEFAULT_YES_OPTIONS = \ OPENSSH \ OPENSSL \ PAM \ + PC_SYSINSTALL \ PF \ PKGTOOLS \ PMC \ Modified: stable/9/tools/build/mk/OptionalObsoleteFiles.inc ============================================================================== --- stable/9/tools/build/mk/OptionalObsoleteFiles.inc Sat Feb 2 22:52:24 2013 (r246263) +++ stable/9/tools/build/mk/OptionalObsoleteFiles.inc Sat Feb 2 23:01:54 2013 (r246264) @@ -3089,6 +3089,95 @@ OLD_FILES+=usr/share/man/man8/ntptime.8. # to be filled in #.endif +.if ${MK_PC_SYSINSTALL} == no +# backend-partmanager +OLD_FILES+=usr/share/pc-sysinstall/backend-partmanager/create-part.sh +OLD_FILES+=usr/share/pc-sysinstall/backend-partmanager/delete-part.sh +# backend-query +OLD_FILES+=usr/share/pc-sysinstall/backend-query/detect-emulation.sh +OLD_FILES+=usr/share/pc-sysinstall/backend-query/detect-laptop.sh +OLD_FILES+=usr/share/pc-sysinstall/backend-query/detect-nics.sh +OLD_FILES+=usr/share/pc-sysinstall/backend-query/disk-info.sh +OLD_FILES+=usr/share/pc-sysinstall/backend-query/disk-list.sh +OLD_FILES+=usr/share/pc-sysinstall/backend-query/disk-part.sh +OLD_FILES+=usr/share/pc-sysinstall/backend-query/enable-net.sh +OLD_FILES+=usr/share/pc-sysinstall/backend-query/get-packages.sh +OLD_FILES+=usr/share/pc-sysinstall/backend-query/list-components.sh +OLD_FILES+=usr/share/pc-sysinstall/backend-query/list-config.sh +OLD_FILES+=usr/share/pc-sysinstall/backend-query/list-mirrors.sh +OLD_FILES+=usr/share/pc-sysinstall/backend-query/list-packages.sh +OLD_FILES+=usr/share/pc-sysinstall/backend-query/list-rsync-backups.sh +OLD_FILES+=usr/share/pc-sysinstall/backend-query/list-tzones.sh +OLD_FILES+=usr/share/pc-sysinstall/backend-query/query-langs.sh +OLD_FILES+=usr/share/pc-sysinstall/backend-query/send-logs.sh +OLD_FILES+=usr/share/pc-sysinstall/backend-query/setup-ssh-keys.sh +OLD_FILES+=usr/share/pc-sysinstall/backend-query/set-mirror.sh +OLD_FILES+=usr/share/pc-sysinstall/backend-query/sys-mem.sh +OLD_FILES+=usr/share/pc-sysinstall/backend-query/test-live.sh +OLD_FILES+=usr/share/pc-sysinstall/backend-query/test-netup.sh +OLD_FILES+=usr/share/pc-sysinstall/backend-query/update-part-list.sh +OLD_FILES+=usr/share/pc-sysinstall/backend-query/xkeyboard-layouts.sh +OLD_FILES+=usr/share/pc-sysinstall/backend-query/xkeyboard-models.sh +OLD_FILES+=usr/share/pc-sysinstall/backend-query/xkeyboard-variants.sh +# backend +OLD_FILES+=usr/share/pc-sysinstall/backend/functions-bsdlabel.sh +OLD_FILES+=usr/share/pc-sysinstall/backend/functions-cleanup.sh +OLD_FILES+=usr/share/pc-sysinstall/backend/functions-disk.sh +OLD_FILES+=usr/share/pc-sysinstall/backend/functions-extractimage.sh +OLD_FILES+=usr/share/pc-sysinstall/backend/functions-ftp.sh +OLD_FILES+=usr/share/pc-sysinstall/backend/functions-installcomponents.sh +OLD_FILES+=usr/share/pc-sysinstall/backend/functions-installpackages.sh +OLD_FILES+=usr/share/pc-sysinstall/backend/functions-localize.sh +OLD_FILES+=usr/share/pc-sysinstall/backend/functions-mountdisk.sh +OLD_FILES+=usr/share/pc-sysinstall/backend/functions-mountoptical.sh +OLD_FILES+=usr/share/pc-sysinstall/backend/functions-networking.sh +OLD_FILES+=usr/share/pc-sysinstall/backend/functions-newfs.sh +OLD_FILES+=usr/share/pc-sysinstall/backend/functions-parse.sh +OLD_FILES+=usr/share/pc-sysinstall/backend/functions-packages.sh +OLD_FILES+=usr/share/pc-sysinstall/backend/functions-runcommands.sh +OLD_FILES+=usr/share/pc-sysinstall/backend/functions-unmount.sh +OLD_FILES+=usr/share/pc-sysinstall/backend/functions-upgrade.sh +OLD_FILES+=usr/share/pc-sysinstall/backend/functions-users.sh +OLD_FILES+=usr/share/pc-sysinstall/backend/functions.sh +OLD_FILES+=usr/share/pc-sysinstall/backend/installimage.sh +OLD_FILES+=usr/share/pc-sysinstall/backend/parseconfig.sh +OLD_FILES+=usr/share/pc-sysinstall/backend/startautoinstall.sh +# conf +OLD_FILES+=usr/share/pc-sysinstall/conf/avail-langs +OLD_FILES+=usr/share/pc-sysinstall/conf/exclude-from-upgrade +OLD_FILES+=usr/share/pc-sysinstall/conf/license/bsd-en.txt +OLD_FILES+=usr/share/pc-sysinstall/conf/license/intel-en.txt +OLD_FILES+=usr/share/pc-sysinstall/conf/license/nvidia-en.txt +OLD_FILES+=usr/share/pc-sysinstall/conf/pc-sysinstall.conf +# doc +OLD_FILES+=usr/share/pc-sysinstall/doc/help-disk-list +OLD_FILES+=usr/share/pc-sysinstall/doc/help-disk-size +OLD_FILES+=usr/share/pc-sysinstall/doc/help-index +OLD_FILES+=usr/share/pc-sysinstall/doc/help-start-autoinstall +# examples +OLD_FILES+=usr/share/examples/pc-sysinstall/README +OLD_FILES+=usr/share/examples/pc-sysinstall/pc-autoinstall.conf +OLD_FILES+=usr/share/examples/pc-sysinstall/pcinstall.cfg.fbsd-netinstall +OLD_FILES+=usr/share/examples/pc-sysinstall/pcinstall.cfg.geli +OLD_FILES+=usr/share/examples/pc-sysinstall/pcinstall.cfg.gmirror +OLD_FILES+=usr/share/examples/pc-sysinstall/pcinstall.cfg.netinstall +OLD_FILES+=usr/share/examples/pc-sysinstall/pcinstall.cfg.restore +OLD_FILES+=usr/share/examples/pc-sysinstall/pcinstall.cfg.rsync +OLD_FILES+=usr/share/examples/pc-sysinstall/pcinstall.cfg.upgrade +OLD_FILES+=usr/share/examples/pc-sysinstall/pcinstall.cfg.zfs +# pc-sysinstall +OLD_FILES+=usr/sbin/pc-sysinstall +OLD_FILES+=usr/share/man/man8/pc-sysinstall.8.gz +OLD_DIRS+=usr/share/pc-sysinstall/backend +OLD_DIRS+=usr/share/pc-sysinstall/backend-partmanager +OLD_DIRS+=usr/share/pc-sysinstall/backend-query +OLD_DIRS+=usr/share/pc-sysinstall/conf/license +OLD_DIRS+=usr/share/pc-sysinstall/conf +OLD_DIRS+=usr/share/pc-sysinstall/doc +OLD_DIRS+=usr/share/pc-sysinstall +OLD_DIRS+=usr/share/examples/pc-sysinstall +.endif + .if ${MK_PF} == no OLD_FILES+=etc/periodic/security/520.pfdenied OLD_FILES+=etc/pf.os Copied: stable/9/tools/build/options/WITHOUT_PC_SYSINSTALL (from r245606, head/tools/build/options/WITHOUT_PC_SYSINSTALL) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/9/tools/build/options/WITHOUT_PC_SYSINSTALL Sat Feb 2 23:01:54 2013 (r246264, copy of r245606, head/tools/build/options/WITHOUT_PC_SYSINSTALL) @@ -0,0 +1,4 @@ +.\" $FreeBSD$ +Set to not build +.Xr pc-sysinstall 8 +and related programs. Modified: stable/9/usr.sbin/Makefile ============================================================================== --- stable/9/usr.sbin/Makefile Sat Feb 2 22:52:24 2013 (r246263) +++ stable/9/usr.sbin/Makefile Sat Feb 2 23:01:54 2013 (r246264) @@ -56,7 +56,7 @@ SUBDIR= adduser \ nfsuserd \ nmtree \ nologin \ - pc-sysinstall \ + ${_pc_sysinstall} \ pciconf \ periodic \ powerd \ @@ -254,6 +254,10 @@ SUBDIR+= ntp SUBDIR+= keyserv .endif +.if ${MK_PC_SYSINSTALL} != "no" +_pc_sysinstall= pc-sysinstall +.endif + .if ${MK_PF} != "no" SUBDIR+= ftp-proxy .endif From owner-svn-src-stable-9@FreeBSD.ORG Sat Feb 2 23:11:21 2013 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 990F7CC6; Sat, 2 Feb 2013 23:11:21 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 8105CA67; Sat, 2 Feb 2013 23:11:21 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r12NBLv5036120; Sat, 2 Feb 2013 23:11:21 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r12NBLiR036119; Sat, 2 Feb 2013 23:11:21 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201302022311.r12NBLiR036119@svn.freebsd.org> From: Eitan Adler Date: Sat, 2 Feb 2013 23:11:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r246266 - stable/9/bin/cp X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 02 Feb 2013 23:11:21 -0000 Author: eadler Date: Sat Feb 2 23:11:20 2013 New Revision: 246266 URL: http://svnweb.freebsd.org/changeset/base/246266 Log: MFC r245535: Remove useless variable 'Pflag': -P is an alternative to -H and -L, and it is implemented using the Hflag and Lflag variables. Approved by: cperciva (mentor, implicit) Modified: stable/9/bin/cp/cp.c Directory Properties: stable/9/bin/cp/ (props changed) Modified: stable/9/bin/cp/cp.c ============================================================================== --- stable/9/bin/cp/cp.c Sat Feb 2 23:11:16 2013 (r246265) +++ stable/9/bin/cp/cp.c Sat Feb 2 23:11:20 2013 (r246266) @@ -98,30 +98,28 @@ main(int argc, char *argv[]) { struct stat to_stat, tmp_stat; enum op type; - int Hflag, Lflag, Pflag, ch, fts_options, r, have_trailing_slash; + int Hflag, Lflag, ch, fts_options, r, have_trailing_slash; char *target; fts_options = FTS_NOCHDIR | FTS_PHYSICAL; - Hflag = Lflag = Pflag = 0; + Hflag = Lflag = 0; while ((ch = getopt(argc, argv, "HLPRafilnprvx")) != -1) switch (ch) { case 'H': Hflag = 1; - Lflag = Pflag = 0; + Lflag = 0; break; case 'L': Lflag = 1; - Hflag = Pflag = 0; + Hflag = 0; break; case 'P': - Pflag = 1; Hflag = Lflag = 0; break; case 'R': Rflag = 1; break; case 'a': - Pflag = 1; pflag = 1; Rflag = 1; Hflag = Lflag = 0; @@ -146,7 +144,7 @@ main(int argc, char *argv[]) break; case 'r': rflag = Lflag = 1; - Hflag = Pflag = 0; + Hflag = 0; break; case 'v': vflag = 1; From owner-svn-src-stable-9@FreeBSD.ORG Sat Feb 2 23:22:28 2013 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 8AB8810B; Sat, 2 Feb 2013 23:22:28 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 63057AAF; Sat, 2 Feb 2013 23:22:28 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r12NMSjg039182; Sat, 2 Feb 2013 23:22:28 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r12NMSkL039181; Sat, 2 Feb 2013 23:22:28 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201302022322.r12NMSkL039181@svn.freebsd.org> From: Eitan Adler Date: Sat, 2 Feb 2013 23:22:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r246267 - stable/9/share/examples/etc X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 02 Feb 2013 23:22:28 -0000 Author: eadler Date: Sat Feb 2 23:22:27 2013 New Revision: 246267 URL: http://svnweb.freebsd.org/changeset/base/246267 Log: MFC r244122: Remove 'dangerous' instructions from the example make.conf. Clarify when and why these might be used and that this isn't a supported configuration. PR: docs/144488 Approved by: cperciva (mentor, implicit) Modified: stable/9/share/examples/etc/make.conf Directory Properties: stable/9/share/examples/ (props changed) stable/9/share/examples/etc/ (props changed) Modified: stable/9/share/examples/etc/make.conf ============================================================================== --- stable/9/share/examples/etc/make.conf Sat Feb 2 23:11:20 2013 (r246266) +++ stable/9/share/examples/etc/make.conf Sat Feb 2 23:22:27 2013 (r246267) @@ -51,21 +51,20 @@ # CFLAGS controls the compiler settings used when compiling C code. # Note that optimization settings other than -O and -O2 are not recommended # or supported for compiling the world or the kernel - please revert any -# nonstandard optimization settings to "-O" or "-O2 -fno-strict-aliasing" +# nonstandard optimization settings # before submitting bug reports without patches to the developers. # -# Compiling with -fstrict-aliasing optimization breaks some [notable] ports. -# GCC turns on -fstrict-aliasing optimization at all levels above -O[1], so -# explicitly turn it off when using compiling with the -O2 optimization level. -# -#CFLAGS= -O2 -fno-strict-aliasing -pipe -# # CXXFLAGS controls the compiler settings used when compiling C++ code. # Note that CXXFLAGS is initially set to the value of CFLAGS. If you wish # to add to CXXFLAGS value, "+=" must be used rather than "=". Using "=" # alone will remove the often needed contents of CFLAGS from CXXFLAGS. # -#CXXFLAGS+= -fconserve-space +# Additional compiler flags can be specified that extend or override +# default ones. However, neither the base system nor ports are guaranteed +# to build and function without problems with non-default settings. +# +# CFLAGS+= -msse3 +# CXXFLAGS+= -msse3 # # MAKE_SHELL controls the shell used internally by make(1) to process the # command scripts in makefiles. Three shells are supported, sh, ksh, and From owner-svn-src-stable-9@FreeBSD.ORG Sat Feb 2 23:30:59 2013 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 263DD6F5; Sat, 2 Feb 2013 23:30:59 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 09AD6AF8; Sat, 2 Feb 2013 23:30:59 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r12NUwnZ041980; Sat, 2 Feb 2013 23:30:58 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r12NUwqq041979; Sat, 2 Feb 2013 23:30:58 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201302022330.r12NUwqq041979@svn.freebsd.org> From: Eitan Adler Date: Sat, 2 Feb 2013 23:30:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r246270 - stable/9/sbin/devd X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 02 Feb 2013 23:30:59 -0000 Author: eadler Date: Sat Feb 2 23:30:58 2013 New Revision: 246270 URL: http://svnweb.freebsd.org/changeset/base/246270 Log: MFC r243931: Avoid the creation of a temporary object by using the prefix operator for non-primitive types. Approved by: cperciva (mentor, implicit) Modified: stable/9/sbin/devd/devd.cc Directory Properties: stable/9/sbin/devd/ (props changed) Modified: stable/9/sbin/devd/devd.cc ============================================================================== --- stable/9/sbin/devd/devd.cc Sat Feb 2 23:22:39 2013 (r246269) +++ stable/9/sbin/devd/devd.cc Sat Feb 2 23:30:58 2013 (r246270) @@ -127,7 +127,7 @@ delete_and_clear(vector &v) { typename vector::const_iterator i; - for (i = v.begin(); i != v.end(); i++) + for (i = v.begin(); i != v.end(); ++i) delete *i; v.clear(); } @@ -155,7 +155,7 @@ event_proc::matches(config &c) { vector::const_iterator i; - for (i = _epsvec.begin(); i != _epsvec.end(); i++) + for (i = _epsvec.begin(); i != _epsvec.end(); ++i) if (!(*i)->do_match(c)) return (false); return (true); @@ -166,7 +166,7 @@ event_proc::run(config &c) { vector::const_iterator i; - for (i = _epsvec.begin(); i != _epsvec.end(); i++) + for (i = _epsvec.begin(); i != _epsvec.end(); ++i) if (!(*i)->do_action(c)) return (false); return (true); @@ -291,7 +291,7 @@ media::media(config &, const char *var, { -1, "unknown" }, { 0, NULL }, }; - for (int i = 0; media_types[i].ifmt_string != NULL; i++) + for (int i = 0; media_types[i].ifmt_string != NULL; ++i) if (strcasecmp(type, media_types[i].ifmt_string) == 0) { _type = media_types[i].ifmt_word; break; @@ -444,7 +444,7 @@ config::parse(void) vector::const_iterator i; parse_one_file(configfile); - for (i = _dir_list.begin(); i != _dir_list.end(); i++) + for (i = _dir_list.begin(); i != _dir_list.end(); ++i) parse_files_in_dir((*i).c_str()); sort_vector(_attach_list); sort_vector(_detach_list); @@ -559,7 +559,7 @@ config::get_variable(const string &var) { vector::reverse_iterator i; - for (i = _var_list_table.rbegin(); i != _var_list_table.rend(); i++) { + for (i = _var_list_table.rbegin(); i != _var_list_table.rend(); ++i) { if ((*i)->is_set(var)) return ((*i)->get_variable(var)); } @@ -716,7 +716,7 @@ config::find_and_execute(char type) } if (Dflag) fprintf(stderr, "Processing %s event\n", s); - for (i = l->begin(); i != l->end(); i++) { + for (i = l->begin(); i != l->end(); ++i) { if ((*i)->matches(*this)) { (*i)->run(*this); break; @@ -813,14 +813,14 @@ notify_clients(const char *data, int len list bad; list::const_iterator i; - for (i = clients.begin(); i != clients.end(); i++) { + for (i = clients.begin(); i != clients.end(); ++i) { if (write(*i, data, len) <= 0) { bad.push_back(*i); close(*i); } } - for (i = bad.begin(); i != bad.end(); i++) + for (i = bad.begin(); i != bad.end(); ++i) clients.erase(find(clients.begin(), clients.end(), *i)); }