From owner-svn-src-projects@FreeBSD.ORG Mon Jan 24 06:03:59 2011 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0B789106564A; Mon, 24 Jan 2011 06:03:59 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EDD508FC08; Mon, 24 Jan 2011 06:03:58 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0O63w1q080047; Mon, 24 Jan 2011 06:03:58 GMT (envelope-from jeff@svn.freebsd.org) Received: (from jeff@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0O63wVC080041; Mon, 24 Jan 2011 06:03:58 GMT (envelope-from jeff@svn.freebsd.org) Message-Id: <201101240603.p0O63wVC080041@svn.freebsd.org> From: Jeff Roberson Date: Mon, 24 Jan 2011 06:03:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217768 - projects/ofed/head/sys/ofed/drivers/infiniband/ulp/sdp X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Jan 2011 06:03:59 -0000 Author: jeff Date: Mon Jan 24 06:03:58 2011 New Revision: 217768 URL: http://svn.freebsd.org/changeset/base/217768 Log: - Fix flow control issues with nagle and recv buffer posting. - re-arm the tx cq according to the sockbuffer character count rather than any waiters. - Prevent sdp_append() from creating buffers with too many discontiguous mbufs. - Honor xmit_size_goal. - Add a task to handle shutdown so operations which are not safe to call from a timer may proceed. - Rework a significant amount of the sdp shutdown state machine to be more compliant with tcp. Sponsored by: Isilon Systems, iX Systems, and Panasas. Modified: projects/ofed/head/sys/ofed/drivers/infiniband/ulp/sdp/sdp.h projects/ofed/head/sys/ofed/drivers/infiniband/ulp/sdp/sdp_bcopy.c projects/ofed/head/sys/ofed/drivers/infiniband/ulp/sdp/sdp_main.c projects/ofed/head/sys/ofed/drivers/infiniband/ulp/sdp/sdp_rx.c projects/ofed/head/sys/ofed/drivers/infiniband/ulp/sdp/sdp_tx.c Modified: projects/ofed/head/sys/ofed/drivers/infiniband/ulp/sdp/sdp.h ============================================================================== --- projects/ofed/head/sys/ofed/drivers/infiniband/ulp/sdp/sdp.h Mon Jan 24 04:32:59 2011 (r217767) +++ projects/ofed/head/sys/ofed/drivers/infiniband/ulp/sdp/sdp.h Mon Jan 24 06:03:58 2011 (r217768) @@ -54,6 +54,8 @@ #define CONFIG_INFINIBAND_SDP_DEBUG 1 #define CONFIG_INFINIBAND_SDP_DEBUG_DATA 1 +#define SDP_DEBUG + #include "sdp_dbg.h" #undef LIST_HEAD @@ -88,9 +90,6 @@ struct name { #define SDP_MAX_RDMA_READ_LEN (PAGE_SIZE * (SDP_FMR_SIZE - 2)) -#define SDP_MAX_RECV_SGES 9 /* 1 for sdp header + 8 for payload */ -#define SDP_MAX_SEND_SGES 9 /* same as above */ - /* mb inlined data len - rest will be rx'ed into frags */ #define SDP_HEAD_SIZE (sizeof(struct sdp_bsdh)) @@ -100,6 +99,9 @@ struct name { #define SDP_MAX_PACKET (1 << 16) #define SDP_MAX_PAYLOAD (SDP_MAX_PACKET - SDP_HEAD_SIZE) +#define SDP_MAX_RECV_SGES (SDP_MAX_PACKET / MCLBYTES) +#define SDP_MAX_SEND_SGES (SDP_MAX_PACKET / MCLBYTES) + 2 + #define SDP_NUM_WC 4 #define SDP_DEF_ZCOPY_THRESH 64*1024 @@ -366,11 +368,12 @@ struct sdp_moderation { #define SDP_NODELAY 0x0008 /* Disble nagle. */ #define SDP_NEEDFIN 0x0010 /* Send a fin on the next tx. */ #define SDP_DREQWAIT 0x0020 /* Waiting on DREQ. */ -#define SDP_HAVEOOB 0x0040 /* Have OOB data. */ +#define SDP_DESTROY 0x0040 /* Being destroyed. */ +#define SDP_DISCON 0x0080 /* rdma_disconnect is owed. */ /* These are oobflags */ #define SDP_HADOOB 0x0001 /* Had OOB data. */ -#define SDP_DESTROY 0x0002 /* Being destroyed. */ +#define SDP_HAVEOOB 0x0002 /* Have OOB data. */ struct sdp_sock { LIST_ENTRY(sdp_sock) list; @@ -429,6 +432,7 @@ struct sdp_sock { unsigned long tx_bytes; unsigned long rx_bytes; struct sdp_moderation auto_mod; + struct task shutdown_task; #ifdef SDP_ZCOPY struct tx_srcavail_state *tx_sa; struct rx_srcavail_state *rx_sa; @@ -713,5 +717,6 @@ int sdp_post_sendsm(struct socket *sk); void srcavail_cancel_timeout(struct work_struct *work); void sdp_abort_srcavail(struct socket *sk); void sdp_abort_rdma_read(struct socket *sk); +int sdp_process_rx(struct sdp_sock *ssk); #endif Modified: projects/ofed/head/sys/ofed/drivers/infiniband/ulp/sdp/sdp_bcopy.c ============================================================================== --- projects/ofed/head/sys/ofed/drivers/infiniband/ulp/sdp/sdp_bcopy.c Mon Jan 24 04:32:59 2011 (r217767) +++ projects/ofed/head/sys/ofed/drivers/infiniband/ulp/sdp/sdp_bcopy.c Mon Jan 24 06:03:58 2011 (r217768) @@ -115,7 +115,7 @@ sdp_nagle_off(struct sdp_sock *ssk, stru unlikely(h->mid != SDP_MID_DATA) || (ssk->flags & SDP_NODELAY) || !ssk->nagle_last_unacked || - mb->m_pkthdr.len >= ssk->xmit_size_goal || + mb->m_pkthdr.len >= ssk->xmit_size_goal / 4 || (mb->m_flags & M_PUSH); if (send_now) { @@ -208,9 +208,10 @@ sdp_post_sends(struct sdp_sock *ssk, int SOCKBUF_LOCK(&sk->so_snd); sk->so_snd.sb_sndptr = mb->m_nextpkt; sk->so_snd.sb_mb = mb->m_nextpkt; - for (n = mb; n != NULL; n = mb->m_next) - sbfree(&sk->so_snd, mb); + mb->m_nextpkt = NULL; SB_EMPTY_FIXUP(&sk->so_snd); + for (n = mb; n != NULL; n = n->m_next) + sbfree(&sk->so_snd, n); SOCKBUF_UNLOCK(&sk->so_snd); sdp_post_send(ssk, mb); post_count++; Modified: projects/ofed/head/sys/ofed/drivers/infiniband/ulp/sdp/sdp_main.c ============================================================================== --- projects/ofed/head/sys/ofed/drivers/infiniband/ulp/sdp/sdp_main.c Mon Jan 24 04:32:59 2011 (r217767) +++ projects/ofed/head/sys/ofed/drivers/infiniband/ulp/sdp/sdp_main.c Mon Jan 24 06:03:58 2011 (r217768) @@ -87,6 +87,8 @@ RW_SYSINIT(sdplockinit, &sdp_lock, "SDP MALLOC_DEFINE(M_SDP, "sdp", "Socket Direct Protocol"); +static void sdp_stop_keepalive_timer(struct socket *so); + /* * SDP protocol interface to socket abstraction. */ @@ -99,6 +101,19 @@ u_long sdp_recvspace = 1024*64; static int sdp_count; +/* + * Disable async. CMA events for sockets which are being torn down. + */ +static void +sdp_destroy_cma(struct sdp_sock *ssk) +{ + + if (ssk->id == NULL) + return; + rdma_destroy_id(ssk->id); + ssk->id = NULL; +} + static int sdp_pcbbind(struct sdp_sock *ssk, struct sockaddr *nam, struct ucred *cred) { @@ -128,30 +143,15 @@ sdp_pcbbind(struct sdp_sock *ssk, struct } error = -rdma_bind_addr(ssk->id, nam); SDP_WLOCK(ssk); - if (error) { - rdma_destroy_id(ssk->id); - ssk->id = NULL; - } else { + if (error == 0) { sin = (struct sockaddr_in *)&ssk->id->route.addr.src_addr; ssk->laddr = sin->sin_addr.s_addr; ssk->lport = sin->sin_port; - } + } else + sdp_destroy_cma(ssk); return (error); } -/* - * Disable async. CMA events for sockets which are being torn down. - */ -static void -sdp_destroy_cma(struct sdp_sock *ssk) -{ - - if (ssk->id == NULL) - return; - rdma_destroy_id(ssk->id); - ssk->id = NULL; -} - static void sdp_pcbfree(struct sdp_sock *ssk) { @@ -176,6 +176,7 @@ sdp_pcbfree(struct sdp_sock *ssk) sdp_rx_ring_destroy(ssk); rw_destroy(&ssk->rx_ring.destroyed_lock); uma_zfree(sdp_zone, ssk); + rw_destroy(&ssk->lock); } /* @@ -267,6 +268,85 @@ sdp_apply_all(void (*func)(struct sdp_so #endif static void +sdp_output_reset(struct sdp_sock *ssk) +{ + struct rdma_cm_id *id; + + SDP_WLOCK_ASSERT(ssk); + if (ssk->id) { + id = ssk->id; + ssk->qp_active = 0; + SDP_WUNLOCK(ssk); + rdma_disconnect(id); + SDP_WLOCK(ssk); + } + ssk->state = TCPS_CLOSED; +} + +/* + * Attempt to close a SDP socket, marking it as dropped, and freeing + * the socket if we hold the only reference. + */ +static struct sdp_sock * +sdp_closed(struct sdp_sock *ssk) +{ + struct socket *so; + + SDP_WLOCK_ASSERT(ssk); + + ssk->flags |= SDP_DROPPED; + so = ssk->socket; + soisdisconnected(so); + if (ssk->flags & SDP_SOCKREF) { + KASSERT(so->so_state & SS_PROTOREF, + ("sdp_closed: !SS_PROTOREF")); + ssk->flags &= ~SDP_SOCKREF; + SDP_WUNLOCK(ssk); + ACCEPT_LOCK(); + SOCK_LOCK(so); + so->so_state &= ~SS_PROTOREF; + sofree(so); + return (NULL); + } + return (ssk); +} + +/* + * Perform timer based shutdowns which can not operate in + * callout context. + */ +static void +sdp_shutdown_task(void *data, int pending) +{ + struct sdp_sock *ssk; + + ssk = data; + SDP_WLOCK(ssk); + /* + * I don't think this can race with another call to pcbfree() + * because SDP_TIMEWAIT protects it. SDP_DESTROY may be redundant. + */ + if (ssk->flags & SDP_DESTROY) + panic("sdp_shutdown_task: Racing with pcbfree for ssk %p", + ssk); + if (ssk->flags & SDP_DISCON) + sdp_output_reset(ssk); + /* We have to clear this so sdp_detach() will call pcbfree(). */ + ssk->flags &= ~(SDP_TIMEWAIT | SDP_DREQWAIT); + if ((ssk->flags & SDP_DROPPED) == 0 && + sdp_closed(ssk) == NULL) + return; + if (ssk->socket == NULL) { + sdp_pcbfree(ssk); + return; + } + SDP_WUNLOCK(ssk); +} + +/* + * 2msl has expired, schedule the shutdown task. + */ +static void sdp_2msl_timeout(void *data) { struct sdp_sock *ssk; @@ -277,15 +357,17 @@ sdp_2msl_timeout(void *data) goto out; callout_deactivate(&ssk->keep2msl); /* Should be impossible, defensive programming. */ - if ((ssk->flags & (SDP_TIMEWAIT | SDP_DROPPED)) == 0) + if ((ssk->flags & SDP_TIMEWAIT) == 0) goto out; - sdp_pcbfree(ssk); - return; + taskqueue_enqueue(taskqueue_thread, &ssk->shutdown_task); out: SDP_WUNLOCK(ssk); return; } +/* + * Schedule the 2msl wait timer. + */ static void sdp_2msl_wait(struct sdp_sock *ssk) { @@ -293,9 +375,13 @@ sdp_2msl_wait(struct sdp_sock *ssk) SDP_WLOCK_ASSERT(ssk); ssk->flags |= SDP_TIMEWAIT; ssk->state = TCPS_TIME_WAIT; + soisdisconnected(ssk->socket); callout_reset(&ssk->keep2msl, TCPTV_MSL, sdp_2msl_timeout, ssk); } +/* + * Timed out waiting for the final fin/ack from rdma_disconnect(). + */ static void sdp_dreq_timeout(void *data) { @@ -314,21 +400,16 @@ sdp_dreq_timeout(void *data) if ((ssk->flags & SDP_DREQWAIT) == 0) goto out; ssk->flags &= ~SDP_DREQWAIT; + ssk->flags |= SDP_DISCON; sdp_2msl_wait(ssk); ssk->qp_active = 0; - if (ssk->id) { - struct rdma_cm_id *id; - - id = ssk->id; - ssk->id = NULL; - SDP_WUNLOCK(ssk); - rdma_disconnect(id); - return; - } out: SDP_WUNLOCK(ssk); } +/* + * Received the final fin/ack. Cancel the 2msl. + */ void sdp_cancel_dreq_wait_timeout(struct sdp_sock *ssk) { @@ -345,6 +426,7 @@ sdp_init_sock(struct socket *sk) sdp_dbg(sk, "%s\n", __func__); callout_init_rw(&ssk->keep2msl, &ssk->lock, CALLOUT_RETURNUNLOCKED); + TASK_INIT(&ssk->shutdown_task, 0, sdp_shutdown_task, ssk); #ifdef SDP_ZCOPY INIT_DELAYED_WORK(&ssk->srcavail_cancel_work, srcavail_cancel_timeout); ssk->zcopy_thresh = -1; /* use global sdp_zcopy_thresh */ @@ -375,9 +457,10 @@ sdp_attach(struct socket *so, int proto, } so->so_rcv.sb_flags |= SB_AUTOSIZE; so->so_snd.sb_flags |= SB_AUTOSIZE; - ssk = uma_zalloc(sdp_zone, M_NOWAIT); + ssk = uma_zalloc(sdp_zone, M_NOWAIT | M_ZERO); if (ssk == NULL) return (ENOBUFS); + rw_init(&ssk->lock, "sdpsock"); ssk->socket = so; ssk->cred = crhold(so->so_cred); so->so_pcb = (caddr_t)ssk; @@ -409,7 +492,7 @@ sdp_detach(struct socket *so) KASSERT(ssk->socket != NULL, ("sdp_detach: socket is NULL")); ssk->socket->so_pcb = NULL; ssk->socket = NULL; - if (ssk->flags & SDP_TIMEWAIT) + if (ssk->flags & (SDP_TIMEWAIT | SDP_DREQWAIT)) SDP_WUNLOCK(ssk); else if (ssk->flags & SDP_DROPPED || ssk->state < TCPS_SYN_SENT) sdp_pcbfree(ssk); @@ -545,51 +628,6 @@ sdp_connect(struct socket *so, struct so } /* - * Attempt to close a SDP socket, marking it as dropped, and freeing - * the socket if we hold the only reference. - */ -static struct sdp_sock * -sdp_closed(struct sdp_sock *ssk) -{ - struct socket *so; - - SDP_WLOCK_ASSERT(ssk); - - ssk->flags |= SDP_DROPPED; - so = ssk->socket; - soisdisconnected(so); - if (ssk->flags & SDP_SOCKREF) { - KASSERT(so->so_state & SS_PROTOREF, - ("sdp_closed: !SS_PROTOREF")); - ssk->flags &= ~SDP_SOCKREF; - SDP_WUNLOCK(ssk); - ACCEPT_LOCK(); - SOCK_LOCK(so); - so->so_state &= ~SS_PROTOREF; - sofree(so); - return (NULL); - } - return (ssk); -} - -static void -sdp_output_reset(struct sdp_sock *ssk) -{ - struct rdma_cm_id *id; - - SDP_WLOCK_ASSERT(ssk); - if (ssk->id) { - id = ssk->id; - ssk->qp_active = 0; - ssk->id = NULL; - SDP_WUNLOCK(ssk); - rdma_disconnect(id); - SDP_WLOCK(ssk); - } - ssk->state = TCPS_CLOSED; -} - -/* * Drop a SDP socket, reporting * the specified error. If connection is synchronized, * then send a RST to peer. @@ -627,10 +665,12 @@ sdp_usrclosed(struct sdp_sock *ssk) switch (ssk->state) { case TCPS_LISTEN: + ssk->state = TCPS_CLOSED; + SDP_WUNLOCK(ssk); sdp_destroy_cma(ssk); + SDP_WLOCK(ssk); /* FALLTHROUGH */ case TCPS_CLOSED: - ssk->state = TCPS_CLOSED; ssk = sdp_closed(ssk); /* * sdp_closed() should never return NULL here as the socket is @@ -641,13 +681,13 @@ sdp_usrclosed(struct sdp_sock *ssk) break; case TCPS_SYN_SENT: - sdp_destroy_cma(ssk); /* FALLTHROUGH */ case TCPS_SYN_RECEIVED: ssk->flags |= SDP_NEEDFIN; break; case TCPS_ESTABLISHED: + ssk->flags |= SDP_NEEDFIN; ssk->state = TCPS_FIN_WAIT_1; break; @@ -656,10 +696,11 @@ sdp_usrclosed(struct sdp_sock *ssk) break; } if (ssk->state >= TCPS_FIN_WAIT_2) { - soisdisconnected(ssk->socket); /* Prevent the connection hanging in FIN_WAIT_2 forever. */ if (ssk->state == TCPS_FIN_WAIT_2) sdp_2msl_wait(ssk); + else + soisdisconnected(ssk->socket); } } @@ -686,9 +727,11 @@ static void sdp_start_disconnect(struct sdp_sock *ssk) { struct socket *so; + int unread; so = ssk->socket; SDP_WLOCK_ASSERT(ssk); + sdp_stop_keepalive_timer(so); /* * Neither sdp_closed() nor sdp_drop() should return NULL, as the * socket is still open. @@ -703,10 +746,15 @@ sdp_start_disconnect(struct sdp_sock *ss ("sdp_start_disconnect: sdp_drop() returned NULL")); } else { soisdisconnecting(so); + unread = so->so_rcv.sb_cc; sbflush(&so->so_rcv); sdp_usrclosed(ssk); - if (!(ssk->flags & SDP_DROPPED)) - sdp_output_disconnect(ssk); + if (!(ssk->flags & SDP_DROPPED)) { + if (unread) + sdp_output_reset(ssk); + else + sdp_output_disconnect(ssk); + } } } @@ -756,6 +804,8 @@ sdp_accept(struct socket *so, struct soc if (so->so_state & SS_ISDISCONNECTED) return (ECONNABORTED); + port = 0; + addr.s_addr = 0; error = 0; ssk = sdp_sk(so); SDP_WLOCK(ssk); @@ -799,9 +849,10 @@ out: } static void -sdp_append(struct sockbuf *sb, struct mbuf *mb) +sdp_append(struct sdp_sock *ssk, struct sockbuf *sb, struct mbuf *mb, int cnt) { struct mbuf *n; + int ncnt; SOCKBUF_LOCK_ASSERT(sb); SBLASTRECORDCHK(sb) @@ -820,24 +871,31 @@ sdp_append(struct sockbuf *sb, struct mb return; } /* + * Count the number of mbufs in the current tail. + */ + for (ncnt = 0; n->m_next; n = n->m_next) + ncnt++; + n = sb->sb_lastrecord; + /* * If the two chains can fit in a single sdp packet and * the last record has not been sent yet (WRITABLE) coalesce * them. The lastrecord remains the same but we must strip the * packet header and then let sbcompress do the hard part. */ - if (M_WRITABLE(n) && + if (M_WRITABLE(n) && ncnt + cnt < SDP_MAX_SEND_SGES && n->m_pkthdr.len + mb->m_pkthdr.len - SDP_HEAD_SIZE < - SDP_MAX_PAYLOAD) { + ssk->xmit_size_goal) { + m_adj(mb, SDP_HEAD_SIZE); n->m_pkthdr.len += mb->m_pkthdr.len; n->m_flags |= mb->m_flags & (M_PUSH | M_URG); m_demote(mb, 1); - m_adj(mb, SDP_HEAD_SIZE); - sbcompress(sb, mb, n); + sbcompress(sb, mb, sb->sb_mbtail); return; } /* - * Not compressable, just append to the end and adjust counters. + * Not compressible, just append to the end and adjust counters. */ + sb->sb_lastrecord->m_flags |= M_PUSH; sb->sb_lastrecord->m_nextpkt = mb; sb->sb_lastrecord = mb; if (sb->sb_sndptr == NULL) @@ -861,14 +919,29 @@ static int sdp_send(struct socket *so, int flags, struct mbuf *m, struct sockaddr *nam, struct mbuf *control, struct thread *td) { - int error = 0; struct sdp_sock *ssk; + struct mbuf *n; + int error; + int cnt; + error = 0; ssk = sdp_sk(so); KASSERT(m->m_flags & M_PKTHDR, ("sdp_send: %p no packet header", m)); - M_PREPEND(m, sizeof(struct sdp_bsdh), M_WAIT); + M_PREPEND(m, SDP_HEAD_SIZE, M_WAIT); mtod(m, struct sdp_bsdh *)->mid = SDP_MID_DATA; + for (n = m, cnt = 0; n->m_next; n = n->m_next) + cnt++; + if (cnt > SDP_MAX_SEND_SGES) { + n = m_collapse(m, M_WAIT, SDP_MAX_SEND_SGES); + if (n == NULL) { + m_freem(m); + return (EMSGSIZE); + } + m = n; + for (cnt = 0; n->m_next; n = n->m_next) + cnt++; + } SDP_WLOCK(ssk); if (ssk->flags & (SDP_TIMEWAIT | SDP_DROPPED)) { if (control) @@ -891,7 +964,7 @@ sdp_send(struct socket *so, int flags, s } if (!(flags & PRUS_OOB)) { SOCKBUF_LOCK(&so->so_snd); - sdp_append(&so->so_snd, m); + sdp_append(ssk, &so->so_snd, m, cnt); SOCKBUF_UNLOCK(&so->so_snd); if (nam && ssk->state < TCPS_SYN_SENT) { /* @@ -908,8 +981,10 @@ sdp_send(struct socket *so, int flags, s */ socantsendmore(so); sdp_usrclosed(ssk); - } - if (!(ssk->flags & SDP_DROPPED) && !(flags & PRUS_MORETOCOME)) + if (!(ssk->flags & SDP_DROPPED)) + sdp_output_disconnect(ssk); + } else if (!(ssk->flags & SDP_DROPPED) && + !(flags & PRUS_MORETOCOME)) sdp_post_sends(ssk, M_NOWAIT); SDP_WUNLOCK(ssk); return (0); @@ -929,7 +1004,8 @@ sdp_send(struct socket *so, int flags, s * of data past the urgent section. * Otherwise, snd_up should be one lower. */ - sdp_append(&so->so_snd, m); + m->m_flags |= M_URG | M_PUSH; + sdp_append(ssk, &so->so_snd, m, cnt); SOCKBUF_UNLOCK(&so->so_snd); if (nam && ssk->state < TCPS_SYN_SENT) { /* @@ -939,7 +1015,6 @@ sdp_send(struct socket *so, int flags, s if (error) goto out; } - m->m_flags |= M_URG | M_PUSH; sdp_post_sends(ssk, M_NOWAIT); SDP_WUNLOCK(ssk); return (0); @@ -968,6 +1043,7 @@ static int sdp_sosend(struct socket *so, struct sockaddr *addr, struct uio *uio, struct mbuf *top, struct mbuf *control, int flags, struct thread *td) { + struct sdp_sock *ssk; long space, resid; int atomic; int error; @@ -1005,6 +1081,7 @@ sdp_sosend(struct socket *so, struct soc if (td != NULL) td->td_ru.ru_msgsnd++; + ssk = sdp_sk(so); error = sblock(&so->so_snd, SBLOCKWAIT(flags)); if (error) goto out; @@ -1031,7 +1108,7 @@ restart: space = sbspace(&so->so_snd); if (flags & MSG_OOB) space += 1024; - if (atomic && resid > SDP_MAX_PAYLOAD) { + if (atomic && resid > ssk->xmit_size_goal - SDP_HEAD_SIZE) { SOCKBUF_UNLOCK(&so->so_snd); error = EMSGSIZE; goto release; @@ -1061,10 +1138,10 @@ restart: * chain. If no data is to be copied in, * a single empty mbuf is returned. */ - /* XXX Should be tx target? */ - copy = min(space, SDP_MAX_PAYLOAD); + copy = min(space, + ssk->xmit_size_goal - SDP_HEAD_SIZE); top = m_uiotombuf(uio, M_WAITOK, copy, - sizeof(struct sdp_bsdh), M_PKTHDR | + 0, M_PKTHDR | ((flags & MSG_EOR) ? M_EOR : 0)); if (top == NULL) { /* only possible error */ @@ -1144,6 +1221,7 @@ sdp_sorecv(struct socket *so, struct soc int len = 0, error = 0, flags, oresid; struct sockbuf *sb; struct mbuf *m, *n = NULL; + struct sdp_sock *ssk; /* We only do stream sockets. */ if (so->so_type != SOCK_STREAM) @@ -1162,6 +1240,7 @@ sdp_sorecv(struct socket *so, struct soc *mp0 = NULL; sb = &so->so_rcv; + ssk = sdp_sk(so); /* Prevent other readers from entering the socket. */ error = sblock(sb, SBLOCKWAIT(flags)); @@ -1310,9 +1389,9 @@ deliver: (((flags & MSG_WAITALL) && uio->uio_resid > 0) || !(flags & MSG_SOCALLBCK))) { SOCKBUF_UNLOCK(sb); - SDP_WLOCK(sdp_sk(so)); - sdp_do_posts(sdp_sk(so)); - SDP_WUNLOCK(sdp_sk(so)); + SDP_WLOCK(ssk); + sdp_do_posts(ssk); + SDP_WUNLOCK(ssk); SOCKBUF_LOCK(sb); } } @@ -1424,15 +1503,6 @@ out: return (error); } -static int -sdp_sock_init(void *mem, int size, int flags) -{ - struct sdp_sock *ssk = mem; - - rw_init(&ssk->lock, "sdpsock"); - return (0); -} - void sdp_urg(struct sdp_sock *ssk, struct mbuf *mb) { @@ -1531,11 +1601,9 @@ sdp_start_keepalive_timer(struct socket struct sdp_sock *ssk; ssk = sdp_sk(so); - SDP_WLOCK(ssk); if (!callout_pending(&ssk->keep2msl)) callout_reset(&ssk->keep2msl, SDP_KEEPALIVE_TIME, sdp_keepalive_timeout, ssk); - SDP_WUNLOCK(ssk); } static void @@ -1544,9 +1612,7 @@ sdp_stop_keepalive_timer(struct socket * struct sdp_sock *ssk; ssk = sdp_sk(so); - SDP_WLOCK(ssk); callout_stop(&ssk->keep2msl); - SDP_WUNLOCK(ssk); } /* @@ -1572,10 +1638,12 @@ sdp_ctloutput(struct socket *so, struct error = 0; ssk = sdp_sk(so); if (sopt->sopt_level == SOL_SOCKET && sopt->sopt_name == SO_KEEPALIVE) { + SDP_WLOCK(ssk); if (so->so_options & SO_KEEPALIVE) sdp_start_keepalive_timer(so); else sdp_stop_keepalive_timer(so); + SDP_WUNLOCK(ssk); } if (sopt->sopt_level != IPPROTO_TCP) return (error); @@ -1602,6 +1670,7 @@ sdp_ctloutput(struct socket *so, struct ssk->flags |= opt; else ssk->flags &= ~opt; + sdp_do_posts(ssk); SDP_WUNLOCK(ssk); break; @@ -1756,8 +1825,10 @@ sdp_pcblist(SYSCTL_HANDLER_ARGS) ssk->socket); else error = EINVAL; - if (error) + if (error) { + error = 0; goto next; + } bzero(&xt, sizeof(xt)); xt.xt_len = sizeof xt; @@ -1775,6 +1846,8 @@ sdp_pcblist(SYSCTL_HANDLER_ARGS) xt.xt_socket.xso_protocol = IPPROTO_TCP; SDP_RUNLOCK(ssk); error = SYSCTL_OUT(req, &xt, sizeof xt); + if (error) + break; i++; continue; next: @@ -1815,7 +1888,7 @@ sdp_init(void) LIST_INIT(&sdp_list); sdp_zone = uma_zcreate("sdp_sock", sizeof(struct sdp_sock), - NULL, NULL, sdp_sock_init, NULL, UMA_ALIGN_PTR, UMA_ZONE_NOFREE); + NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, UMA_ZONE_NOFREE); uma_zone_set_max(sdp_zone, maxsockets); EVENTHANDLER_REGISTER(maxsockets_change, sdp_zone_change, NULL, EVENTHANDLER_PRI_ANY); Modified: projects/ofed/head/sys/ofed/drivers/infiniband/ulp/sdp/sdp_rx.c ============================================================================== --- projects/ofed/head/sys/ofed/drivers/infiniband/ulp/sdp/sdp_rx.c Mon Jan 24 04:32:59 2011 (r217767) +++ projects/ofed/head/sys/ofed/drivers/infiniband/ulp/sdp/sdp_rx.c Mon Jan 24 06:03:58 2011 (r217768) @@ -65,7 +65,6 @@ sdp_handle_disconn(struct sdp_sock *ssk) struct rdma_cm_id *id; id = ssk->id; - ssk->id = NULL; SDP_WUNLOCK(ssk); rdma_disconnect(id); SDP_WLOCK(ssk); @@ -177,8 +176,7 @@ sdp_post_recvs_needed(struct sdp_sock *s unsigned long bytes_in_process = (rx_ring_posted(ssk) - SDP_MIN_TX_CREDITS) * buffer_size; - bytes_in_process += rcv_nxt(ssk); - + bytes_in_process += ssk->socket->so_rcv.sb_cc; if (bytes_in_process >= max_bytes) { sdp_prf(ssk->socket, NULL, "bytes_in_process:%ld > max_bytes:%ld", @@ -645,7 +643,7 @@ sdp_do_posts(struct sdp_sock *ssk) } -static void +int sdp_process_rx(struct sdp_sock *ssk) { int wc_processed = 0; @@ -653,7 +651,7 @@ sdp_process_rx(struct sdp_sock *ssk) if (!rx_ring_trylock(&ssk->rx_ring)) { sdp_dbg(ssk->socket, "ring destroyed. not polling it\n"); - return; + return 0; } credits_before = tx_credits(ssk); @@ -669,6 +667,8 @@ sdp_process_rx(struct sdp_sock *ssk) sdp_arm_rx_cq(ssk); rx_ring_unlock(&ssk->rx_ring); + + return (wc_processed); } static void @@ -722,6 +722,7 @@ sdp_rx_ring_create(struct sdp_sock *ssk, sdp_dbg(ssk->socket, "rx ring created"); + INIT_WORK(&ssk->rx_comp_work, sdp_rx_comp_work); atomic_set(&ssk->rx_ring.head, 1); atomic_set(&ssk->rx_ring.tail, 1); @@ -745,9 +746,6 @@ sdp_rx_ring_create(struct sdp_sock *ssk, } sdp_sk(ssk->socket)->rx_ring.cq = rx_cq; - - INIT_WORK(&ssk->rx_comp_work, sdp_rx_comp_work); - sdp_arm_rx_cq(ssk); return 0; Modified: projects/ofed/head/sys/ofed/drivers/infiniband/ulp/sdp/sdp_tx.c ============================================================================== --- projects/ofed/head/sys/ofed/drivers/infiniband/ulp/sdp/sdp_tx.c Mon Jan 24 04:32:59 2011 (r217767) +++ projects/ofed/head/sys/ofed/drivers/infiniband/ulp/sdp/sdp_tx.c Mon Jan 24 06:03:58 2011 (r217768) @@ -307,11 +307,10 @@ sdp_process_tx_cq(struct sdp_sock *ssk) sowwakeup(ssk->socket); /* * If there is no room in the tx queue we arm the tx cq - * to force an interrupt. sb_notify() isn't a precise - * measure if being out of space but is very cheap and - * should be close enough. + * to force an interrupt. */ - if (tx_ring_posted(ssk) && sb_notify(&sk->so_snd)) { + if (tx_ring_posted(ssk) && sk->so_snd.sb_cc >= + sk->so_snd.sb_mbmax - ssk->xmit_size_goal) { sdp_prf(ssk->socket, NULL, "pending tx - rearming"); sdp_arm_tx_cq(ssk); } @@ -462,6 +461,7 @@ sdp_tx_ring_create(struct sdp_sock *ssk, } ssk->tx_ring.cq = tx_cq; ssk->tx_ring.poll_cnt = 0; + sdp_arm_tx_cq(ssk); return 0; @@ -481,6 +481,8 @@ sdp_tx_ring_destroy(struct sdp_sock *ssk callout_stop(&ssk->tx_ring.timer); callout_stop(&ssk->nagle_timer); SDP_WUNLOCK(ssk); + callout_drain(&ssk->tx_ring.timer); + callout_drain(&ssk->nagle_timer); if (ssk->tx_ring.buffer) { sdp_tx_ring_purge(ssk); From owner-svn-src-projects@FreeBSD.ORG Mon Jan 24 13:51:59 2011 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9BC111065670; Mon, 24 Jan 2011 13:51:59 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 70E0B8FC08; Mon, 24 Jan 2011 13:51:59 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0ODpxtw092408; Mon, 24 Jan 2011 13:51:59 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0ODpxdH092406; Mon, 24 Jan 2011 13:51:59 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <201101241351.p0ODpxdH092406@svn.freebsd.org> From: Attilio Rao Date: Mon, 24 Jan 2011 13:51:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217778 - projects/sv/sys/netinet X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Jan 2011 13:51:59 -0000 Author: attilio Date: Mon Jan 24 13:51:59 2011 New Revision: 217778 URL: http://svn.freebsd.org/changeset/base/217778 Log: Switch sysclt_ip() into an appropriate sysctl_handle_inaddr(), using convenience function sysctl_handle_string() underwear. Discussed with: rwatson Modified: projects/sv/sys/netinet/netdump_client.c Modified: projects/sv/sys/netinet/netdump_client.c ============================================================================== --- projects/sv/sys/netinet/netdump_client.c Mon Jan 24 11:06:40 2011 (r217777) +++ projects/sv/sys/netinet/netdump_client.c Mon Jan 24 13:51:59 2011 (r217778) @@ -114,7 +114,7 @@ static int netdump_udp_output(struct mb #ifdef NETDUMP_CLIENT_DEBUG static int sysctl_force_crash(SYSCTL_HANDLER_ARGS); #endif -static int sysctl_ip(SYSCTL_HANDLER_ARGS); +static int sysctl_handle_inaddr(SYSCTL_HANDLER_ARGS); static int sysctl_nic(SYSCTL_HANDLER_ARGS); static eventhandler_tag nd_tag = NULL; /* record of our shutdown event */ @@ -164,7 +164,7 @@ netdump_supported_nic(struct ifnet *ifp) */ /* - * [sysctl_ip] + * [sysctl_handle_inaddr] * * sysctl handler to deal with converting a string sysctl to/from an in_addr * @@ -177,32 +177,21 @@ netdump_supported_nic(struct ifnet *ifp) * int see errno.h, 0 for success */ static int -sysctl_ip(SYSCTL_HANDLER_ARGS) +sysctl_handle_inaddr(SYSCTL_HANDLER_ARGS) { struct in_addr addr; char buf[INET_ADDRSTRLEN]; int error; - int len=req->newlen - req->newidx; inet_ntoa_r(*(struct in_addr *)arg1, buf); - error = SYSCTL_OUT(req, buf, strlen(buf)+1); - - if (error || !req->newptr) - return error; - - if (len >= INET_ADDRSTRLEN) { - error = EINVAL; - } else { - error = SYSCTL_IN(req, buf, len); - buf[len]='\0'; - if (error) - return error; + error = sysctl_handle_string(oidp, buf, sizeof(buf), req); + if (error == 0) { if (!inet_aton(buf, &addr)) - return EINVAL; - *(struct in_addr *)arg1 = addr; + error = EINVAL; + else + *(struct in_addr *)arg1 = addr; } - - return error; + return (error); } /* @@ -302,11 +291,11 @@ sysctl_force_crash(SYSCTL_HANDLER_ARGS) SYSCTL_NODE(_net, OID_AUTO, dump, CTLFLAG_RW, 0, "netdump"); SYSCTL_PROC(_net_dump, OID_AUTO, server, CTLTYPE_STRING|CTLFLAG_RW, &nd_server, - 0, sysctl_ip, "A", "dump server"); + 0, sysctl_handle_inaddr, "A", "dump server"); SYSCTL_PROC(_net_dump, OID_AUTO, client, CTLTYPE_STRING|CTLFLAG_RW, &nd_client, - 0, sysctl_ip, "A", "dump client"); + 0, sysctl_handle_inaddr, "A", "dump client"); SYSCTL_PROC(_net_dump, OID_AUTO, gateway, CTLTYPE_STRING|CTLFLAG_RW, &nd_gw, - 0, sysctl_ip, "A", "dump default gateway"); + 0, sysctl_handle_inaddr, "A", "dump default gateway"); SYSCTL_PROC(_net_dump, OID_AUTO, nic, CTLTYPE_STRING|CTLFLAG_RW, &nd_ifp, IFNAMSIZ, sysctl_nic, "A", "NIC to dump on"); SYSCTL_INT(_net_dump, OID_AUTO, polls, CTLTYPE_INT|CTLFLAG_RW, &nd_polls, 0, From owner-svn-src-projects@FreeBSD.ORG Mon Jan 24 14:45:17 2011 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4870E1065675; Mon, 24 Jan 2011 14:45:17 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 379788FC08; Mon, 24 Jan 2011 14:45:17 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0OEjHEM093840; Mon, 24 Jan 2011 14:45:17 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0OEjHGt093838; Mon, 24 Jan 2011 14:45:17 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <201101241445.p0OEjHGt093838@svn.freebsd.org> From: Attilio Rao Date: Mon, 24 Jan 2011 14:45:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217781 - projects/sv/sys/netinet X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Jan 2011 14:45:17 -0000 Author: attilio Date: Mon Jan 24 14:45:16 2011 New Revision: 217781 URL: http://svn.freebsd.org/changeset/base/217781 Log: Perform the dumping ifp lookup differently: - The string name of the interface is stored in a global array - On dumping activity the lookup is performed and the ifp pointer is eventually found and used That makes the sysclt_nic() unuseful and it can be removed. Additively, use s/strcmp/strncmp in another place, besides new lookup point. That action makes the window for races narrower. Requested by and discussed with: rwatson Modified: projects/sv/sys/netinet/netdump_client.c Modified: projects/sv/sys/netinet/netdump_client.c ============================================================================== --- projects/sv/sys/netinet/netdump_client.c Mon Jan 24 14:24:10 2011 (r217780) +++ projects/sv/sys/netinet/netdump_client.c Mon Jan 24 14:45:16 2011 (r217781) @@ -115,7 +115,6 @@ static int netdump_udp_output(struct mb static int sysctl_force_crash(SYSCTL_HANDLER_ARGS); #endif static int sysctl_handle_inaddr(SYSCTL_HANDLER_ARGS); -static int sysctl_nic(SYSCTL_HANDLER_ARGS); static eventhandler_tag nd_tag = NULL; /* record of our shutdown event */ static uint32_t nd_seqno = 1; /* current sequence number */ @@ -128,6 +127,7 @@ static unsigned char buf[MAXDUMPPGS*PAGE static struct ether_addr nd_gw_mac; static int nd_enable = 0; /* if we should perform a network dump */ +static char nd_ifp_str[IFNAMSIZ]; /* String rappresenting the interface */ static struct in_addr nd_server = {INADDR_ANY}; /* server address */ static struct in_addr nd_client = {INADDR_ANY}; /* client (our) address */ static struct in_addr nd_gw = {INADDR_ANY}; /* gw, if set */ @@ -194,66 +194,6 @@ sysctl_handle_inaddr(SYSCTL_HANDLER_ARGS return (error); } -/* - * [sysctl_nic] - * - * sysctl handler to deal with converting a string sysctl to/from an interface - * - * Parameters: - * SYSCTL_HANDLER_ARGS - * - arg1 is a pointer to the struct ifnet to the interface - * - arg2 is the maximum string length (IFNAMSIZ) - * - * Returns: - * int see errno.h, 0 for success - */ -static int -sysctl_nic(SYSCTL_HANDLER_ARGS) -{ - struct ifnet *ifp; - char buf[arg2+1]; - int error; - int len; - int invalid; - - invalid = 0; - if (*(struct ifnet **)arg1) { - error = SYSCTL_OUT(req, - (*(struct ifnet **)arg1)->if_xname, - strlen((*(struct ifnet **)arg1)->if_xname)); - } else - invalid = 1; - - if (error || !req->newptr) - return error; - - len = req->newlen - req->newidx; - if (len >= arg2) { - error = EINVAL; - } else { - if (invalid != 0) - ifp = NULL; - else { - error = SYSCTL_IN(req, buf, len); - buf[len]='\0'; - if (error) - return error; - IFNET_RLOCK_NOSLEEP(); - if ((ifp = TAILQ_FIRST(&V_ifnet)) != NULL) do { - if (!strcmp(ifp->if_xname, buf)) break; - } while ((ifp = TAILQ_NEXT(ifp, if_link)) != NULL); - IFNET_RUNLOCK_NOSLEEP(); - - if (!ifp) return ENODEV; - if (!netdump_supported_nic(ifp)) return EINVAL; - } - - (*(struct ifnet **)arg1) = ifp; - } - - return error; -} - #ifdef NETDUMP_CLIENT_DEBUG static int sysctl_force_crash(SYSCTL_HANDLER_ARGS) @@ -296,8 +236,8 @@ SYSCTL_PROC(_net_dump, OID_AUTO, client, 0, sysctl_handle_inaddr, "A", "dump client"); SYSCTL_PROC(_net_dump, OID_AUTO, gateway, CTLTYPE_STRING|CTLFLAG_RW, &nd_gw, 0, sysctl_handle_inaddr, "A", "dump default gateway"); -SYSCTL_PROC(_net_dump, OID_AUTO, nic, CTLTYPE_STRING|CTLFLAG_RW, &nd_ifp, - IFNAMSIZ, sysctl_nic, "A", "NIC to dump on"); +SYSCTL_STRING(_net_dump, OID_AUTO, nic, CTLFLAG_RW, nd_ifp_str, + sizeof(nd_ifp_str), "dumping interface string"); SYSCTL_INT(_net_dump, OID_AUTO, polls, CTLTYPE_INT|CTLFLAG_RW, &nd_polls, 0, "times to poll NIC per retry"); SYSCTL_INT(_net_dump, OID_AUTO, retries, CTLTYPE_INT|CTLFLAG_RW, &nd_retries, 0, @@ -415,6 +355,8 @@ netdump_udp_output(struct mbuf *m) struct udpiphdr *ui; struct ip *ip; + MPASS(nd_ifp != NULL); + M_PREPEND(m, sizeof(struct udpiphdr), M_DONTWAIT); if (m == 0) { printf("netdump_udp_output: Out of mbufs\n"); @@ -476,6 +418,8 @@ netdump_send_arp() struct arphdr *ah; struct ether_addr bcast; + MPASS(nd_ifp != NULL); + /* Fill-up a broadcast address. */ memset(&bcast, 0xFF, ETHER_ADDR_LEN); MGETHDR(m, M_DONTWAIT, MT_DATA); @@ -567,6 +511,8 @@ netdump_send(uint32_t type, off_t offset rcvd_acks = 0; + MPASS(nd_ifp != NULL); + retransmit: /* We might get chunks too big to fit in packets. Yuck. */ for (i=sent_so_far=0; sent_so_far < datalen || (i==0 && datalen==0); @@ -1051,6 +997,8 @@ static void netdump_network_poll() { + MPASS(nd_ifp != NULL); + #if defined(KDB) && !defined(KDB_UNATTENDED) if (panicstr != NULL) nd_ifp->if_ndumpfuncs->ne_poll_unlocked(nd_ifp, @@ -1135,15 +1083,34 @@ netdump_trigger(void *arg, int howto) { struct dumperinfo dumper; void (*old_if_input)(struct ifnet *, struct mbuf *)=NULL; + int found; if ((howto&(RB_HALT|RB_DUMP))!=RB_DUMP || !nd_enable || cold || dumping) return; - if (!nd_ifp) { - printf("netdump_trigger: Can't netdump: no NIC given\n"); + found = 0; +#if defined(KDB) && !defined(KDB_UNATTENDED) + if (panicstr == NULL) +#endif + IFNET_RLOCK_NOSLEEP(); + TAILQ_FOREACH(nd_ifp, &V_ifnet, if_link) { + if (!strncmp(nd_ifp->if_xname, nd_ifp_str, + strlen(nd_ifp->if_xname))) { + found = 1; + break; + } + } +#if defined(KDB) && !defined(KDB_UNATTENDED) + if (panicstr == NULL) +#endif + IFNET_RUNLOCK_NOSLEEP(); + + if (found == 0) { + printf("netdump_trigger: Can't netdump: no valid NIC given\n"); return; } + MPASS(nd_ifp != NULL); if (nd_server.s_addr == INADDR_ANY) { printf("netdump_trigger: Can't netdump; no server IP given\n"); @@ -1274,7 +1241,8 @@ netdump_config_defaults() found = 0; IFNET_RLOCK_NOSLEEP(); TAILQ_FOREACH(ifp, &V_ifnet, if_link) { - if (!strcmp(ifp->if_xname, nd_nic_tun)) { + if (!strncmp(ifp->if_xname, nd_nic_tun, + strlen(ifp->if_xname))) { found = 1; break; } From owner-svn-src-projects@FreeBSD.ORG Mon Jan 24 14:53:10 2011 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8A7391065675; Mon, 24 Jan 2011 14:53:10 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5FC018FC12; Mon, 24 Jan 2011 14:53:10 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0OErAxl094060; Mon, 24 Jan 2011 14:53:10 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0OErAn5094058; Mon, 24 Jan 2011 14:53:10 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <201101241453.p0OErAn5094058@svn.freebsd.org> From: Attilio Rao Date: Mon, 24 Jan 2011 14:53:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217782 - projects/sv/sys/netinet X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Jan 2011 14:53:10 -0000 Author: attilio Date: Mon Jan 24 14:53:10 2011 New Revision: 217782 URL: http://svn.freebsd.org/changeset/base/217782 Log: Simplify locking conditional code. Modified: projects/sv/sys/netinet/netdump_client.c Modified: projects/sv/sys/netinet/netdump_client.c ============================================================================== --- projects/sv/sys/netinet/netdump_client.c Mon Jan 24 14:45:16 2011 (r217781) +++ projects/sv/sys/netinet/netdump_client.c Mon Jan 24 14:53:10 2011 (r217782) @@ -1083,16 +1083,19 @@ netdump_trigger(void *arg, int howto) { struct dumperinfo dumper; void (*old_if_input)(struct ifnet *, struct mbuf *)=NULL; - int found; + int found, must_lock; if ((howto&(RB_HALT|RB_DUMP))!=RB_DUMP || !nd_enable || cold || dumping) return; found = 0; + must_lock = 1; #if defined(KDB) && !defined(KDB_UNATTENDED) - if (panicstr == NULL) + if (panicstr != NULL) + must_lock = 0; #endif + if (must_lock != 0) IFNET_RLOCK_NOSLEEP(); TAILQ_FOREACH(nd_ifp, &V_ifnet, if_link) { if (!strncmp(nd_ifp->if_xname, nd_ifp_str, @@ -1101,9 +1104,7 @@ netdump_trigger(void *arg, int howto) break; } } -#if defined(KDB) && !defined(KDB_UNATTENDED) - if (panicstr == NULL) -#endif + if (must_lock != 0) IFNET_RUNLOCK_NOSLEEP(); if (found == 0) { @@ -1139,12 +1140,8 @@ netdump_trigger(void *arg, int howto) * first time it gets called. Adjust it accordingly. */ nd_server_port = NETDUMP_PORT; - if ((nd_ifp->if_capenable & IFCAP_POLLING) == 0) { -#if defined(KDB) && !defined(KDB_UNATTENDED) - if (panicstr == NULL) -#endif - nd_ifp->if_ndumpfuncs->ne_disable_intr(nd_ifp); - } + if ((nd_ifp->if_capenable & IFCAP_POLLING) == 0 && must_lock != 0) + nd_ifp->if_ndumpfuncs->ne_disable_intr(nd_ifp); /* Make the card use *our* receive callback */ old_if_input = nd_ifp->if_input; @@ -1194,12 +1191,8 @@ netdump_trigger(void *arg, int howto) trig_abort: if (old_if_input) nd_ifp->if_input = old_if_input; - if ((nd_ifp->if_capenable & IFCAP_POLLING) == 0) { -#if defined(KDB) && !defined(KDB_UNATTENDED) - if (panicstr == NULL) -#endif - nd_ifp->if_ndumpfuncs->ne_enable_intr(nd_ifp); - } + if ((nd_ifp->if_capenable & IFCAP_POLLING) == 0 && must_lock != 0) + nd_ifp->if_ndumpfuncs->ne_enable_intr(nd_ifp); dumping--; } From owner-svn-src-projects@FreeBSD.ORG Mon Jan 24 16:39:20 2011 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CF0FA106566C; Mon, 24 Jan 2011 16:39:20 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BECD18FC13; Mon, 24 Jan 2011 16:39:20 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0OGdKeP098786; Mon, 24 Jan 2011 16:39:20 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0OGdKDe098784; Mon, 24 Jan 2011 16:39:20 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <201101241639.p0OGdKDe098784@svn.freebsd.org> From: Attilio Rao Date: Mon, 24 Jan 2011 16:39:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217789 - projects/sv/sys/netinet X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Jan 2011 16:39:20 -0000 Author: attilio Date: Mon Jan 24 16:39:20 2011 New Revision: 217789 URL: http://svn.freebsd.org/changeset/base/217789 Log: Ignore packets with IP options rather than stripping them off. Requested and reviewed by: gnn Modified: projects/sv/sys/netinet/netdump_client.c Modified: projects/sv/sys/netinet/netdump_client.c ============================================================================== --- projects/sv/sys/netinet/netdump_client.c Mon Jan 24 15:18:18 2011 (r217788) +++ projects/sv/sys/netinet/netdump_client.c Mon Jan 24 16:39:20 2011 (r217789) @@ -706,11 +706,10 @@ nd_handle_ip(struct mbuf **mb) m_adj(m, ip->ip_len - m->m_pkthdr.len); } - /* We would process IP options here, but we'll ignore them instead. */ - /* Strip IP options */ + /* Ignore packets with IP options. */ if (hlen > sizeof(struct ip)) { - ip_stripoptions(m, NULL); - hlen = sizeof(struct ip); + NETDDEBUG("nd_handle_ip: Drop packet with IP options\n"); + return; } /* Check that the source is the server's IP */ From owner-svn-src-projects@FreeBSD.ORG Mon Jan 24 17:04:21 2011 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C72EA106566B; Mon, 24 Jan 2011 17:04:21 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B30178FC1C; Mon, 24 Jan 2011 17:04:21 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0OH4LXv099501; Mon, 24 Jan 2011 17:04:21 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0OH4Lr2099482; Mon, 24 Jan 2011 17:04:21 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <201101241704.p0OH4Lr2099482@svn.freebsd.org> From: Attilio Rao Date: Mon, 24 Jan 2011 17:04:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217791 - in projects/sv: . contrib/top etc/periodic/daily gnu/usr.bin/gdb/kgdb lib/libkvm sbin/dump sbin/fdisk sbin/fsck_ffs sbin/fsdb sbin/fsirand sbin/geom/class/virstor sbin/hastd s... X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Jan 2011 17:04:21 -0000 Author: attilio Date: Mon Jan 24 17:04:21 2011 New Revision: 217791 URL: http://svn.freebsd.org/changeset/base/217791 Log: MFC @ 217789 Added: projects/sv/sys/modules/khelp/ - copied from r217789, head/sys/modules/khelp/ projects/sv/sys/netinet/sctp_ss_functions.c - copied unchanged from r217789, head/sys/netinet/sctp_ss_functions.c projects/sv/tools/tools/ath/ath_ee_v4k_print/ - copied from r217789, head/tools/tools/ath/ath_ee_v4k_print/ projects/sv/tools/tools/ath/ath_prom_read/ - copied from r217789, head/tools/tools/ath/ath_prom_read/ Modified: projects/sv/Makefile projects/sv/etc/periodic/daily/800.scrub-zfs projects/sv/gnu/usr.bin/gdb/kgdb/main.c projects/sv/lib/libkvm/Makefile projects/sv/lib/libkvm/kvm.c projects/sv/lib/libkvm/kvm.h projects/sv/lib/libkvm/kvm_amd64.c projects/sv/lib/libkvm/kvm_arm.c projects/sv/lib/libkvm/kvm_cptime.c projects/sv/lib/libkvm/kvm_file.c projects/sv/lib/libkvm/kvm_getloadavg.c projects/sv/lib/libkvm/kvm_getswapinfo.c projects/sv/lib/libkvm/kvm_i386.c projects/sv/lib/libkvm/kvm_ia64.c projects/sv/lib/libkvm/kvm_minidump_amd64.c projects/sv/lib/libkvm/kvm_minidump_arm.c projects/sv/lib/libkvm/kvm_minidump_i386.c projects/sv/lib/libkvm/kvm_minidump_mips.c projects/sv/lib/libkvm/kvm_mips.c projects/sv/lib/libkvm/kvm_pcpu.c projects/sv/lib/libkvm/kvm_powerpc.c projects/sv/lib/libkvm/kvm_powerpc64.c projects/sv/lib/libkvm/kvm_proc.c projects/sv/lib/libkvm/kvm_sparc64.c projects/sv/lib/libkvm/kvm_vnet.c projects/sv/sbin/dump/itime.c projects/sv/sbin/dump/main.c projects/sv/sbin/dump/optr.c projects/sv/sbin/dump/tape.c projects/sv/sbin/fdisk/fdisk.c projects/sv/sbin/fsck_ffs/inode.c projects/sv/sbin/fsck_ffs/main.c projects/sv/sbin/fsck_ffs/suj.c projects/sv/sbin/fsdb/fsdb.c projects/sv/sbin/fsirand/fsirand.c projects/sv/sbin/geom/class/virstor/gvirstor.8 projects/sv/sbin/hastd/control.c projects/sv/sbin/hastd/control.h projects/sv/sbin/hastd/hastd.c projects/sv/sbin/hastd/hastd.h projects/sv/sbin/hastd/nv.c projects/sv/sbin/hastd/nv.h projects/sv/sbin/hastd/pjdlog.c projects/sv/sbin/hastd/pjdlog.h projects/sv/sbin/hastd/primary.c projects/sv/sbin/init/init.8 projects/sv/sbin/init/init.c projects/sv/sbin/newfs/mkfs.c projects/sv/share/man/man5/rc.conf.5 projects/sv/share/man/man7/build.7 projects/sv/sys/compat/linux/linux_signal.c projects/sv/sys/conf/files projects/sv/sys/conf/options projects/sv/sys/dev/ata/chipsets/ata-intel.c projects/sv/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c projects/sv/sys/dev/ath/ath_hal/ar9002/ar9280v2.ini projects/sv/sys/dev/re/if_re.c projects/sv/sys/modules/Makefile projects/sv/sys/netinet/cc/cc.c projects/sv/sys/netinet/sctp.h projects/sv/sys/netinet/sctp_input.c projects/sv/sys/netinet/sctp_output.c projects/sv/sys/netinet/sctp_output.h projects/sv/sys/netinet/sctp_pcb.c projects/sv/sys/netinet/sctp_pcb.h projects/sv/sys/netinet/sctp_structs.h projects/sv/sys/netinet/sctp_sysctl.c projects/sv/sys/netinet/sctp_sysctl.h projects/sv/sys/netinet/sctp_timer.c projects/sv/sys/netinet/sctp_uio.h projects/sv/sys/netinet/sctp_usrreq.c projects/sv/sys/netinet/sctputil.c projects/sv/sys/powerpc/powermac/ata_kauai.c projects/sv/sys/sys/pioctl.h projects/sv/tools/tools/ath/Makefile projects/sv/tools/tools/ath/athstats/Makefile projects/sv/tools/tools/ath/athstats/athstats.c projects/sv/usr.bin/netstat/netisr.c projects/sv/usr.bin/top/top.local.1 projects/sv/usr.sbin/freebsd-update/freebsd-update.sh projects/sv/usr.sbin/makefs/ffs.c projects/sv/usr.sbin/makefs/makefs.c projects/sv/usr.sbin/quot/quot.c Directory Properties: projects/sv/ (props changed) projects/sv/cddl/contrib/opensolaris/ (props changed) projects/sv/contrib/bind9/ (props changed) projects/sv/contrib/binutils/ (props changed) projects/sv/contrib/bzip2/ (props changed) projects/sv/contrib/dialog/ (props changed) projects/sv/contrib/ee/ (props changed) projects/sv/contrib/expat/ (props changed) projects/sv/contrib/file/ (props changed) projects/sv/contrib/gdb/ (props changed) projects/sv/contrib/gdtoa/ (props changed) projects/sv/contrib/gnu-sort/ (props changed) projects/sv/contrib/groff/ (props changed) projects/sv/contrib/less/ (props changed) projects/sv/contrib/libpcap/ (props changed) projects/sv/contrib/llvm/ (props changed) projects/sv/contrib/llvm/tools/clang/ (props changed) projects/sv/contrib/ncurses/ (props changed) projects/sv/contrib/netcat/ (props changed) projects/sv/contrib/ntp/ (props changed) projects/sv/contrib/one-true-awk/ (props changed) projects/sv/contrib/openbsm/ (props changed) projects/sv/contrib/openpam/ (props changed) projects/sv/contrib/pf/ (props changed) projects/sv/contrib/sendmail/ (props changed) projects/sv/contrib/tcpdump/ (props changed) projects/sv/contrib/tcsh/ (props changed) projects/sv/contrib/top/ (props changed) projects/sv/contrib/top/install-sh (props changed) projects/sv/contrib/tzcode/stdtime/ (props changed) projects/sv/contrib/tzcode/zic/ (props changed) projects/sv/contrib/tzdata/ (props changed) projects/sv/contrib/wpa/ (props changed) projects/sv/contrib/xz/ (props changed) projects/sv/crypto/openssh/ (props changed) projects/sv/crypto/openssl/ (props changed) projects/sv/lib/libc/ (props changed) projects/sv/lib/libc/stdtime/ (props changed) projects/sv/lib/libutil/ (props changed) projects/sv/lib/libz/ (props changed) projects/sv/sbin/ (props changed) projects/sv/sbin/ipfw/ (props changed) projects/sv/share/mk/bsd.arch.inc.mk (props changed) projects/sv/share/zoneinfo/ (props changed) projects/sv/sys/ (props changed) projects/sv/sys/amd64/include/xen/ (props changed) projects/sv/sys/cddl/contrib/opensolaris/ (props changed) projects/sv/sys/contrib/dev/acpica/ (props changed) projects/sv/sys/contrib/octeon-sdk/ (props changed) projects/sv/sys/contrib/pf/ (props changed) projects/sv/sys/contrib/x86emu/ (props changed) projects/sv/usr.bin/calendar/ (props changed) projects/sv/usr.bin/csup/ (props changed) projects/sv/usr.bin/procstat/ (props changed) projects/sv/usr.sbin/zic/ (props changed) Modified: projects/sv/Makefile ============================================================================== --- projects/sv/Makefile Mon Jan 24 17:03:22 2011 (r217790) +++ projects/sv/Makefile Mon Jan 24 17:04:21 2011 (r217791) @@ -5,7 +5,8 @@ # # universe - *Really* build *everything* (buildworld and # all kernels on all architectures). -# tinderbox - Same as universe, but stop on first failure. +# tinderbox - Same as universe, but presents a list of failed build +# targets and exits with an error if there were any. # buildworld - Rebuild *everything*, including glue to help do # upgrades. # installworld - Install everything built by "buildworld". @@ -274,7 +275,7 @@ make: .PHONY ${MMAKE} install DESTDIR=${MAKEPATH} BINDIR= tinderbox: - cd ${.CURDIR} && \ + @cd ${.CURDIR} && \ DOING_TINDERBOX=YES ${MAKE} JFLAG=${JFLAG} universe # @@ -296,7 +297,7 @@ TARGET_ARCHES_${target}?= ${target} .endfor targets: - @echo "Supported TARGET/TARGET_ARCH pairs" + @echo "Supported TARGETS/TARGET_ARCH pairs" .for target in ${TARGETS} .for target_arch in ${TARGET_ARCHES_${target}} @echo " ${target}/${target_arch}" @@ -304,7 +305,7 @@ targets: .endfor .if defined(DOING_TINDERBOX) -FAILFILE=tinderbox.failed +FAILFILE=${.CURDIR}/_.tinderbox.failed MAKEFAIL=tee -a ${FAILFILE} .else MAKEFAIL=cat @@ -316,7 +317,7 @@ universe_prologue: @echo ">>> make universe started on ${STARTTIME}" @echo "--------------------------------------------------------------" .if defined(DOING_TINDERBOX) - rm -f ${FAILFILE} + @rm -f ${FAILFILE} .endif .for target in ${TARGETS} universe: universe_${target} Modified: projects/sv/etc/periodic/daily/800.scrub-zfs ============================================================================== --- projects/sv/etc/periodic/daily/800.scrub-zfs Mon Jan 24 17:03:22 2011 (r217790) +++ projects/sv/etc/periodic/daily/800.scrub-zfs Mon Jan 24 17:04:21 2011 (r217791) @@ -24,13 +24,17 @@ case "$daily_scrub_zfs_enable" in for pool in ${daily_scrub_zfs_pools}; do # sanity check - zpool list ${pool} >/dev/null 2>&1 + _status=$(zpool list ${pool} | sed -n -e '$p') if [ $? -ne 0 ]; then echo " WARNING: pool '${pool}' specified in" echo " '/etc/periodic.conf:daily_scrub_zfs_pools'" echo " does not exist" continue fi + if echo ${_status} | grep -q FAULTED; then + echo "Skipping faulted pool: ${pool}" + continue + fi # successful only if there is at least one pool to scrub rc=0 Modified: projects/sv/gnu/usr.bin/gdb/kgdb/main.c ============================================================================== --- projects/sv/gnu/usr.bin/gdb/kgdb/main.c Mon Jan 24 17:03:22 2011 (r217790) +++ projects/sv/gnu/usr.bin/gdb/kgdb/main.c Mon Jan 24 17:04:21 2011 (r217791) @@ -129,7 +129,7 @@ kernel_from_dumpnr(int nr) snprintf(path, sizeof(path), "%s/info.%d", crashdir, nr); info = fopen(path, "r"); if (info == NULL) { - warn(path); + warn("%s", path); return; } while (fgets(path, sizeof(path), info) != NULL) { @@ -408,7 +408,7 @@ main(int argc, char *argv[]) if (dumpnr >= 0) { snprintf(path, sizeof(path), "%s/vmcore.%d", crashdir, dumpnr); if (stat(path, &st) == -1) - err(1, path); + err(1, "%s", path); if (!S_ISREG(st.st_mode)) errx(1, "%s: not a regular file", path); vmcore = strdup(path); Modified: projects/sv/lib/libkvm/Makefile ============================================================================== --- projects/sv/lib/libkvm/Makefile Mon Jan 24 17:03:22 2011 (r217790) +++ projects/sv/lib/libkvm/Makefile Mon Jan 24 17:04:21 2011 (r217791) @@ -15,7 +15,7 @@ KVM_ARCH=${MACHINE_ARCH} KVM_ARCH=${MACHINE_CPUARCH} .endif -WARNS?= 0 +WARNS?= 3 SRCS= kvm.c kvm_${KVM_ARCH}.c kvm_cptime.c kvm_file.c kvm_getloadavg.c \ kvm_getswapinfo.c kvm_pcpu.c kvm_proc.c kvm_vnet.c Modified: projects/sv/lib/libkvm/kvm.c ============================================================================== --- projects/sv/lib/libkvm/kvm.c Mon Jan 24 17:03:22 2011 (r217790) +++ projects/sv/lib/libkvm/kvm.c Mon Jan 24 17:04:21 2011 (r217791) @@ -77,8 +77,7 @@ static char sccsid[] = "@(#)kvm.c 8.2 (B int __fdnlist(int, struct nlist *); char * -kvm_geterr(kd) - kvm_t *kd; +kvm_geterr(kvm_t *kd) { return (kd->errbuf); } @@ -103,7 +102,7 @@ _kvm_err(kvm_t *kd, const char *program, (void)fputc('\n', stderr); } else (void)vsnprintf(kd->errbuf, - sizeof(kd->errbuf), (char *)fmt, ap); + sizeof(kd->errbuf), fmt, ap); va_end(ap); } @@ -122,7 +121,7 @@ _kvm_syserr(kvm_t *kd, const char *progr } else { char *cp = kd->errbuf; - (void)vsnprintf(cp, sizeof(kd->errbuf), (char *)fmt, ap); + (void)vsnprintf(cp, sizeof(kd->errbuf), fmt, ap); n = strlen(cp); (void)snprintf(&cp[n], sizeof(kd->errbuf) - n, ": %s", strerror(errno)); @@ -131,25 +130,18 @@ _kvm_syserr(kvm_t *kd, const char *progr } void * -_kvm_malloc(kd, n) - kvm_t *kd; - size_t n; +_kvm_malloc(kvm_t *kd, size_t n) { void *p; if ((p = calloc(n, sizeof(char))) == NULL) - _kvm_err(kd, kd->program, "can't allocate %u bytes: %s", + _kvm_err(kd, kd->program, "can't allocate %zu bytes: %s", n, strerror(errno)); return (p); } static kvm_t * -_kvm_open(kd, uf, mf, flag, errout) - kvm_t *kd; - const char *uf; - const char *mf; - int flag; - char *errout; +_kvm_open(kvm_t *kd, const char *uf, const char *mf, int flag, char *errout) { struct stat st; @@ -242,12 +234,8 @@ failed: } kvm_t * -kvm_openfiles(uf, mf, sf, flag, errout) - const char *uf; - const char *mf; - const char *sf __unused; - int flag; - char *errout; +kvm_openfiles(const char *uf, const char *mf, const char *sf __unused, int flag, + char *errout) { kvm_t *kd; @@ -260,12 +248,8 @@ kvm_openfiles(uf, mf, sf, flag, errout) } kvm_t * -kvm_open(uf, mf, sf, flag, errstr) - const char *uf; - const char *mf; - const char *sf __unused; - int flag; - const char *errstr; +kvm_open(const char *uf, const char *mf, const char *sf __unused, int flag, + const char *errstr) { kvm_t *kd; @@ -280,8 +264,7 @@ kvm_open(uf, mf, sf, flag, errstr) } int -kvm_close(kd) - kvm_t *kd; +kvm_close(kvm_t *kd) { int error = 0; @@ -316,8 +299,9 @@ kvm_fdnlist_prefix(kvm_t *kd, struct nli { struct nlist *n, *np, *p; char *cp, *ce; + const char *ccp; size_t len; - int unresolved; + int slen, unresolved; /* * Calculate the space we need to malloc for nlist and names. @@ -355,13 +339,13 @@ kvm_fdnlist_prefix(kvm_t *kd, struct nli continue; bcopy(p, np, sizeof(struct nlist)); /* Save the new\0orig. name so we can later match it again. */ - len = snprintf(cp, ce - cp, "%s%s%c%s", prefix, + slen = snprintf(cp, ce - cp, "%s%s%c%s", prefix, (prefix[0] != '\0' && p->n_name[0] == '_') ? (p->n_name + 1) : p->n_name, '\0', p->n_name); - if (len >= ce - cp) + if (slen < 0 || slen >= ce - cp) continue; np->n_name = cp; - cp += len + 1; + cp += slen + 1; np++; unresolved++; } @@ -385,8 +369,8 @@ kvm_fdnlist_prefix(kvm_t *kd, struct nli if (p->n_type != N_UNDF) continue; /* Skip expanded name and compare to orig. one. */ - cp = np->n_name + strlen(np->n_name) + 1; - if (strcmp(cp, p->n_name)) + ccp = np->n_name + strlen(np->n_name) + 1; + if (strcmp(ccp, p->n_name) != 0) continue; /* Update nlist with new, translated results. */ p->n_type = np->n_type; @@ -416,7 +400,8 @@ _kvm_nlist(kvm_t *kd, struct nlist *nl, int nvalid; struct kld_sym_lookup lookup; int error; - char *prefix = "", symname[1024]; /* XXX-BZ symbol name length limit? */ + const char *prefix = ""; + char symname[1024]; /* XXX-BZ symbol name length limit? */ int tried_vnet, tried_dpcpu; /* @@ -458,9 +443,8 @@ again: error = snprintf(symname, sizeof(symname), "%s%s", prefix, (prefix[0] != '\0' && p->n_name[0] == '_') ? (p->n_name + 1) : p->n_name); - if (error >= sizeof(symname)) + if (error < 0 || error >= (int)sizeof(symname)) continue; - lookup.symname = symname; if (lookup.symname[0] == '_') lookup.symname++; @@ -470,11 +454,11 @@ again: p->n_other = 0; p->n_desc = 0; if (_kvm_vnet_initialized(kd, initialize) && - !strcmp(prefix, VNET_SYMPREFIX)) + !strcmp(prefix, VNET_SYMPREFIX) == 0) p->n_value = _kvm_vnet_validaddr(kd, lookup.symvalue); else if (_kvm_dpcpu_initialized(kd, initialize) && - !strcmp(prefix, DPCPU_SYMPREFIX)) + !strcmp(prefix, DPCPU_SYMPREFIX) == 0) p->n_value = _kvm_dpcpu_validaddr(kd, lookup.symvalue); else @@ -511,9 +495,7 @@ again: } int -kvm_nlist(kd, nl) - kvm_t *kd; - struct nlist *nl; +kvm_nlist(kvm_t *kd, struct nlist *nl) { /* @@ -524,13 +506,11 @@ kvm_nlist(kd, nl) } ssize_t -kvm_read(kd, kva, buf, len) - kvm_t *kd; - u_long kva; - void *buf; - size_t len; +kvm_read(kvm_t *kd, u_long kva, void *buf, size_t len) { int cc; + ssize_t cr; + off_t pa; char *cp; if (ISALIVE(kd)) { @@ -540,59 +520,52 @@ kvm_read(kd, kva, buf, len) */ errno = 0; if (lseek(kd->vmfd, (off_t)kva, 0) == -1 && errno != 0) { - _kvm_err(kd, 0, "invalid address (%x)", kva); + _kvm_err(kd, 0, "invalid address (%lx)", kva); return (-1); } - cc = read(kd->vmfd, buf, len); - if (cc < 0) { + cr = read(kd->vmfd, buf, len); + if (cr < 0) { _kvm_syserr(kd, 0, "kvm_read"); return (-1); - } else if (cc < len) + } else if (cr < (ssize_t)len) _kvm_err(kd, kd->program, "short read"); - return (cc); - } else { - cp = buf; - while (len > 0) { - off_t pa; - - cc = _kvm_kvatop(kd, kva, &pa); - if (cc == 0) - return (-1); - if (cc > len) - cc = len; - errno = 0; - if (lseek(kd->pmfd, pa, 0) == -1 && errno != 0) { - _kvm_syserr(kd, 0, _PATH_MEM); - break; - } - cc = read(kd->pmfd, cp, cc); - if (cc < 0) { - _kvm_syserr(kd, kd->program, "kvm_read"); - break; - } - /* - * If kvm_kvatop returns a bogus value or our core - * file is truncated, we might wind up seeking beyond - * the end of the core file in which case the read will - * return 0 (EOF). - */ - if (cc == 0) - break; - cp += cc; - kva += cc; - len -= cc; + return (cr); + } + + cp = buf; + while (len > 0) { + cc = _kvm_kvatop(kd, kva, &pa); + if (cc == 0) + return (-1); + if (cc > (ssize_t)len) + cc = len; + errno = 0; + if (lseek(kd->pmfd, pa, 0) == -1 && errno != 0) { + _kvm_syserr(kd, 0, _PATH_MEM); + break; + } + cr = read(kd->pmfd, cp, cc); + if (cr < 0) { + _kvm_syserr(kd, kd->program, "kvm_read"); + break; } - return (cp - (char *)buf); + /* + * If kvm_kvatop returns a bogus value or our core file is + * truncated, we might wind up seeking beyond the end of the + * core file in which case the read will return 0 (EOF). + */ + if (cr == 0) + break; + cp += cr; + kva += cr; + len -= cr; } - /* NOTREACHED */ + + return (cp - (char *)buf); } ssize_t -kvm_write(kd, kva, buf, len) - kvm_t *kd; - u_long kva; - const void *buf; - size_t len; +kvm_write(kvm_t *kd, u_long kva, const void *buf, size_t len) { int cc; @@ -602,14 +575,14 @@ kvm_write(kd, kva, buf, len) */ errno = 0; if (lseek(kd->vmfd, (off_t)kva, 0) == -1 && errno != 0) { - _kvm_err(kd, 0, "invalid address (%x)", kva); + _kvm_err(kd, 0, "invalid address (%lx)", kva); return (-1); } cc = write(kd->vmfd, buf, len); if (cc < 0) { _kvm_syserr(kd, 0, "kvm_write"); return (-1); - } else if (cc < len) + } else if ((size_t)cc < len) _kvm_err(kd, kd->program, "short write"); return (cc); } else { Modified: projects/sv/lib/libkvm/kvm.h ============================================================================== --- projects/sv/lib/libkvm/kvm.h Mon Jan 24 17:03:22 2011 (r217790) +++ projects/sv/lib/libkvm/kvm.h Mon Jan 24 17:04:21 2011 (r217791) @@ -88,7 +88,7 @@ kvm_t *kvm_openfiles (const char *, const char *, const char *, int, char *); ssize_t kvm_read(kvm_t *, unsigned long, void *, size_t); ssize_t kvm_uread - (kvm_t *, struct kinfo_proc *, unsigned long, char *, size_t); + (kvm_t *, const struct kinfo_proc *, unsigned long, char *, size_t); ssize_t kvm_write(kvm_t *, unsigned long, const void *, size_t); __END_DECLS Modified: projects/sv/lib/libkvm/kvm_amd64.c ============================================================================== --- projects/sv/lib/libkvm/kvm_amd64.c Mon Jan 24 17:03:22 2011 (r217790) +++ projects/sv/lib/libkvm/kvm_amd64.c Mon Jan 24 17:04:21 2011 (r217791) @@ -147,7 +147,7 @@ _kvm_freevtop(kvm_t *kd) int _kvm_initvtop(kvm_t *kd) { - struct nlist nlist[2]; + struct nlist nl[2]; u_long pa; u_long kernbase; pml4_entry_t *PML4; @@ -176,23 +176,23 @@ _kvm_initvtop(kvm_t *kd) return (-1); } - nlist[0].n_name = "kernbase"; - nlist[1].n_name = 0; + nl[0].n_name = "kernbase"; + nl[1].n_name = 0; - if (kvm_nlist(kd, nlist) != 0) { + if (kvm_nlist(kd, nl) != 0) { _kvm_err(kd, kd->program, "bad namelist - no kernbase"); return (-1); } - kernbase = nlist[0].n_value; + kernbase = nl[0].n_value; - nlist[0].n_name = "KPML4phys"; - nlist[1].n_name = 0; + nl[0].n_name = "KPML4phys"; + nl[1].n_name = 0; - if (kvm_nlist(kd, nlist) != 0) { + if (kvm_nlist(kd, nl) != 0) { _kvm_err(kd, kd->program, "bad namelist - no KPML4phys"); return (-1); } - if (kvm_read(kd, (nlist[0].n_value - kernbase), &pa, sizeof(pa)) != + if (kvm_read(kd, (nl[0].n_value - kernbase), &pa, sizeof(pa)) != sizeof(pa)) { _kvm_err(kd, kd->program, "cannot read KPML4phys"); return (-1); @@ -222,7 +222,6 @@ _kvm_vatop(kvm_t *kd, u_long va, off_t * u_long pdpeindex; u_long pdeindex; u_long pteindex; - int i; u_long a; off_t ofs; size_t s; Modified: projects/sv/lib/libkvm/kvm_arm.c ============================================================================== --- projects/sv/lib/libkvm/kvm_arm.c Mon Jan 24 17:03:22 2011 (r217790) +++ projects/sv/lib/libkvm/kvm_arm.c Mon Jan 24 17:04:21 2011 (r217791) @@ -124,7 +124,7 @@ int _kvm_initvtop(kvm_t *kd) { struct vmstate *vm; - struct nlist nlist[2]; + struct nlist nl[2]; u_long kernbase, physaddr, pa; pd_entry_t *l1pt; Elf32_Ehdr *ehdr; @@ -154,25 +154,25 @@ _kvm_initvtop(kvm_t *kd) hdrsz = ehdr->e_phoff + ehdr->e_phentsize * ehdr->e_phnum; if (_kvm_maphdrs(kd, hdrsz) == -1) return (-1); - nlist[0].n_name = "kernbase"; - nlist[1].n_name = NULL; - if (kvm_nlist(kd, nlist) != 0) + nl[0].n_name = "kernbase"; + nl[1].n_name = NULL; + if (kvm_nlist(kd, nl) != 0) kernbase = KERNBASE; else - kernbase = nlist[0].n_value; + kernbase = nl[0].n_value; - nlist[0].n_name = "physaddr"; - if (kvm_nlist(kd, nlist) != 0) { + nl[0].n_name = "physaddr"; + if (kvm_nlist(kd, nl) != 0) { _kvm_err(kd, kd->program, "couldn't get phys addr"); return (-1); } - physaddr = nlist[0].n_value; - nlist[0].n_name = "kernel_l1pa"; - if (kvm_nlist(kd, nlist) != 0) { + physaddr = nl[0].n_value; + nl[0].n_name = "kernel_l1pa"; + if (kvm_nlist(kd, nl) != 0) { _kvm_err(kd, kd->program, "bad namelist"); return (-1); } - if (kvm_read(kd, (nlist[0].n_value - kernbase + physaddr), &pa, + if (kvm_read(kd, (nl[0].n_value - kernbase + physaddr), &pa, sizeof(pa)) != sizeof(pa)) { _kvm_err(kd, kd->program, "cannot read kernel_l1pa"); return (-1); @@ -205,7 +205,6 @@ _kvm_initvtop(kvm_t *kd) int _kvm_kvatop(kvm_t *kd, u_long va, off_t *pa) { - u_long offset = va & (PAGE_SIZE - 1); struct vmstate *vm = kd->vmst; pd_entry_t pd; pt_entry_t pte; @@ -244,7 +243,7 @@ _kvm_kvatop(kvm_t *kd, u_long va, off_t *pa = (pte & L2_S_FRAME) | (va & L2_S_OFFSET); return (_kvm_pa2off(kd, *pa, pa, PAGE_SIZE)); invalid: - _kvm_err(kd, 0, "Invalid address (%x)", va); + _kvm_err(kd, 0, "Invalid address (%lx)", va); return 0; } @@ -253,16 +252,15 @@ invalid: * not just those for a kernel crash dump. Some architectures * have to deal with these NOT being constants! (i.e. m68k) */ +#ifdef FBSD_NOT_YET int -_kvm_mdopen(kd) - kvm_t *kd; +_kvm_mdopen(kvm_t *kd) { -#ifdef FBSD_NOT_YET kd->usrstack = USRSTACK; kd->min_uva = VM_MIN_ADDRESS; kd->max_uva = VM_MAXUSER_ADDRESS; -#endif return (0); } +#endif Modified: projects/sv/lib/libkvm/kvm_cptime.c ============================================================================== --- projects/sv/lib/libkvm/kvm_cptime.c Mon Jan 24 17:03:22 2011 (r217790) +++ projects/sv/lib/libkvm/kvm_cptime.c Mon Jan 24 17:04:21 2011 (r217791) @@ -44,8 +44,8 @@ __FBSDID("$FreeBSD$"); #include "kvm_private.h" static struct nlist kvm_cp_time_nl[] = { - { "_cp_time" }, /* (deprecated) */ - { NULL }, + { .n_name = "_cp_time" }, /* (deprecated) */ + { .n_name = NULL }, }; #define NL_CP_TIME 0 @@ -59,6 +59,7 @@ _kvm_cp_time_init(kvm_t *kd) if (kvm_nlist(kd, kvm_cp_time_nl) < 0) return (-1); kvm_cp_time_cached = 1; + return (0); } static int Modified: projects/sv/lib/libkvm/kvm_file.c ============================================================================== --- projects/sv/lib/libkvm/kvm_file.c Mon Jan 24 17:03:22 2011 (r217790) +++ projects/sv/lib/libkvm/kvm_file.c Mon Jan 24 17:04:21 2011 (r217791) @@ -69,16 +69,14 @@ static char sccsid[] = "@(#)kvm_file.c 8 (kvm_read(kd, addr, obj, sizeof(*obj)) != sizeof(*obj)) #define KREADN(kd, addr, obj, cnt) \ - (kvm_read(kd, addr, obj, (cnt)) != (cnt)) + (kvm_read(kd, addr, obj, (cnt)) != (ssize_t)(cnt)) /* * Get file structures. */ static int -kvm_deadfiles(kd, op, arg, allproc_o, nprocs) - kvm_t *kd; - int op, arg, nprocs; - long allproc_o; +kvm_deadfiles(kvm_t *kd, int op __unused, int arg __unused, long allproc_o, + int nprocs __unused) { struct proc proc; struct filedesc filed; @@ -88,7 +86,7 @@ kvm_deadfiles(kd, op, arg, allproc_o, np struct proc *p; char *where = kd->argspc; - if (buflen < sizeof (struct file *) + sizeof (struct file)) + if (buflen < (int)(sizeof(struct file *) + sizeof(struct file))) return (0); if (KREAD(kd, allproc_o, &p)) { _kvm_err(kd, kd->program, "cannot read allproc"); @@ -96,7 +94,7 @@ kvm_deadfiles(kd, op, arg, allproc_o, np } for (; p != NULL; p = LIST_NEXT(&proc, p_list)) { if (KREAD(kd, (u_long)p, &proc)) { - _kvm_err(kd, kd->program, "can't read proc at %x", p); + _kvm_err(kd, kd->program, "can't read proc at %p", p); goto fail; } if (proc.p_state == PRS_NEW) @@ -104,7 +102,7 @@ kvm_deadfiles(kd, op, arg, allproc_o, np if (proc.p_fd == NULL) continue; if (KREAD(kd, (u_long)p->p_fd, &filed)) { - _kvm_err(kd, kd->program, "can't read filedesc at %x", + _kvm_err(kd, kd->program, "can't read filedesc at %p", p->p_fd); goto fail; } @@ -118,7 +116,7 @@ kvm_deadfiles(kd, op, arg, allproc_o, np } if (KREADN(kd, (u_long)filed.fd_ofiles, ofiles, ocnt * sizeof(struct file *))) { - _kvm_err(kd, kd->program, "can't read ofiles at %x", + _kvm_err(kd, kd->program, "can't read ofiles at %p", filed.fd_ofiles); return (0); } @@ -135,7 +133,7 @@ kvm_deadfiles(kd, op, arg, allproc_o, np where += sizeof (fp); once = 1; } - if (buflen < sizeof (struct file)) + if (buflen < (int)sizeof(struct file)) goto fail; if (KREAD(kd, (long)fp, ((struct file *)where))) { _kvm_err(kd, kd->program, "can't read kfp"); @@ -156,10 +154,7 @@ fail: } char * -kvm_getfiles(kd, op, arg, cnt) - kvm_t *kd; - int op, arg; - int *cnt; +kvm_getfiles(kvm_t *kd, int op, int arg, int *cnt) { int mib[2], st, n, nfiles, nprocs; size_t size; @@ -177,7 +172,7 @@ kvm_getfiles(kd, op, arg, cnt) } if (kd->argspc == 0) kd->argspc = (char *)_kvm_malloc(kd, size); - else if (kd->arglen < size) + else if (kd->arglen < (int)size) kd->argspc = (char *)_kvm_realloc(kd, kd->argspc, size); if (kd->argspc == 0) return (0); @@ -214,7 +209,7 @@ kvm_getfiles(kd, op, arg, cnt) size = sizeof(void *) + (nfiles + 10) * sizeof(struct file); if (kd->argspc == 0) kd->argspc = (char *)_kvm_malloc(kd, size); - else if (kd->arglen < size) + else if (kd->arglen < (int)size) kd->argspc = (char *)_kvm_realloc(kd, kd->argspc, size); if (kd->argspc == 0) return (0); Modified: projects/sv/lib/libkvm/kvm_getloadavg.c ============================================================================== --- projects/sv/lib/libkvm/kvm_getloadavg.c Mon Jan 24 17:03:22 2011 (r217790) +++ projects/sv/lib/libkvm/kvm_getloadavg.c Mon Jan 24 17:04:21 2011 (r217791) @@ -48,11 +48,11 @@ static char sccsid[] = "@(#)kvm_getloada #include "kvm_private.h" static struct nlist nl[] = { - { "_averunnable" }, + { .n_name = "_averunnable" }, #define X_AVERUNNABLE 0 - { "_fscale" }, + { .n_name = "_fscale" }, #define X_FSCALE 1 - { "" }, + { .n_name = "" }, }; /* @@ -62,10 +62,7 @@ static struct nlist nl[] = { * Return number of samples retrieved, or -1 on error. */ int -kvm_getloadavg(kd, loadavg, nelem) - kvm_t *kd; - double loadavg[]; - int nelem; +kvm_getloadavg(kvm_t *kd, double loadavg[], int nelem) { struct loadavg loadinfo; struct nlist *p; @@ -95,7 +92,7 @@ kvm_getloadavg(kd, loadavg, nelem) if (!KREAD(kd, nl[X_FSCALE].n_value, &fscale)) loadinfo.fscale = fscale; - nelem = MIN(nelem, sizeof(loadinfo.ldavg) / sizeof(fixpt_t)); + nelem = MIN(nelem, (int)(sizeof(loadinfo.ldavg) / sizeof(fixpt_t))); for (i = 0; i < nelem; i++) loadavg[i] = (double) loadinfo.ldavg[i] / loadinfo.fscale; return (nelem); Modified: projects/sv/lib/libkvm/kvm_getswapinfo.c ============================================================================== --- projects/sv/lib/libkvm/kvm_getswapinfo.c Mon Jan 24 17:03:22 2011 (r217790) +++ projects/sv/lib/libkvm/kvm_getswapinfo.c Mon Jan 24 17:04:21 2011 (r217791) @@ -51,9 +51,9 @@ __FBSDID("$FreeBSD$"); #include "kvm_private.h" static struct nlist kvm_swap_nl[] = { - { "_swtailq" }, /* list of swap devices and sizes */ - { "_dmmax" }, /* maximum size of a swap block */ - { NULL } + { .n_name = "_swtailq" }, /* list of swap devices and sizes */ + { .n_name = "_dmmax" }, /* maximum size of a swap block */ + { .n_name = NULL } }; #define NL_SWTAILQ 0 @@ -66,7 +66,7 @@ static int dmmax; static int kvm_getswapinfo_kvm(kvm_t *, struct kvm_swap *, int, int); static int kvm_getswapinfo_sysctl(kvm_t *, struct kvm_swap *, int, int); static int nlist_init(kvm_t *); -static int getsysctl(kvm_t *, char *, void *, size_t); +static int getsysctl(kvm_t *, const char *, void *, size_t); #define KREAD(kd, addr, obj) \ (kvm_read(kd, addr, (char *)(obj), sizeof(*obj)) != sizeof(*obj)) @@ -90,12 +90,8 @@ static int getsysctl(kvm_t *, char *, v } int -kvm_getswapinfo( - kvm_t *kd, - struct kvm_swap *swap_ary, - int swap_max, - int flags -) { +kvm_getswapinfo(kvm_t *kd, struct kvm_swap *swap_ary, int swap_max, int flags) +{ /* * clear cache @@ -113,12 +109,9 @@ kvm_getswapinfo( } int -kvm_getswapinfo_kvm( - kvm_t *kd, - struct kvm_swap *swap_ary, - int swap_max, - int flags -) { +kvm_getswapinfo_kvm(kvm_t *kd, struct kvm_swap *swap_ary, int swap_max, + int flags) +{ int i, ttl; TAILQ_HEAD(, swdevt) swtailq; struct swdevt *sp, swinfo; @@ -161,12 +154,9 @@ kvm_getswapinfo_kvm( #define SWI_MAXMIB 3 int -kvm_getswapinfo_sysctl( - kvm_t *kd, - struct kvm_swap *swap_ary, - int swap_max, - int flags -) { +kvm_getswapinfo_sysctl(kvm_t *kd, struct kvm_swap *swap_ary, int swap_max, + int flags) +{ int ti, ttl; size_t mibi, len; int soid[SWI_MAXMIB]; @@ -229,8 +219,6 @@ kvm_getswapinfo_sysctl( static int nlist_init(kvm_t *kd) { - TAILQ_HEAD(, swdevt) swtailq; - struct swdevt *sp, swinfo; if (kvm_swap_nl_cached) return (1); @@ -257,12 +245,8 @@ nlist_init(kvm_t *kd) } static int -getsysctl ( - kvm_t *kd, - char *name, - void *ptr, - size_t len -) { +getsysctl(kvm_t *kd, const char *name, void *ptr, size_t len) +{ size_t nlen = len; if (sysctlbyname(name, ptr, &nlen, NULL, 0) == -1) { _kvm_err(kd, kd->program, "cannot read sysctl %s:%s", name, Modified: projects/sv/lib/libkvm/kvm_i386.c ============================================================================== --- projects/sv/lib/libkvm/kvm_i386.c Mon Jan 24 17:03:22 2011 (r217790) +++ projects/sv/lib/libkvm/kvm_i386.c Mon Jan 24 17:04:21 2011 (r217791) @@ -153,7 +153,7 @@ _kvm_freevtop(kvm_t *kd) int _kvm_initvtop(kvm_t *kd) { - struct nlist nlist[2]; + struct nlist nl[2]; u_long pa; u_long kernbase; char *PTD; @@ -183,21 +183,21 @@ _kvm_initvtop(kvm_t *kd) return (-1); } - nlist[0].n_name = "kernbase"; - nlist[1].n_name = 0; + nl[0].n_name = "kernbase"; + nl[1].n_name = 0; - if (kvm_nlist(kd, nlist) != 0) + if (kvm_nlist(kd, nl) != 0) kernbase = KERNBASE; /* for old kernels */ else - kernbase = nlist[0].n_value; + kernbase = nl[0].n_value; - nlist[0].n_name = "IdlePDPT"; - nlist[1].n_name = 0; + nl[0].n_name = "IdlePDPT"; + nl[1].n_name = 0; - if (kvm_nlist(kd, nlist) == 0) { + if (kvm_nlist(kd, nl) == 0) { uint64_t pa64; - if (kvm_read(kd, (nlist[0].n_value - kernbase), &pa, + if (kvm_read(kd, (nl[0].n_value - kernbase), &pa, sizeof(pa)) != sizeof(pa)) { _kvm_err(kd, kd->program, "cannot read IdlePDPT"); return (-1); @@ -220,14 +220,14 @@ _kvm_initvtop(kvm_t *kd) kd->vmst->PTD = PTD; kd->vmst->pae = 1; } else { - nlist[0].n_name = "IdlePTD"; - nlist[1].n_name = 0; + nl[0].n_name = "IdlePTD"; + nl[1].n_name = 0; - if (kvm_nlist(kd, nlist) != 0) { + if (kvm_nlist(kd, nl) != 0) { _kvm_err(kd, kd->program, "bad namelist"); return (-1); } - if (kvm_read(kd, (nlist[0].n_value - kernbase), &pa, + if (kvm_read(kd, (nl[0].n_value - kernbase), &pa, sizeof(pa)) != sizeof(pa)) { _kvm_err(kd, kd->program, "cannot read IdlePTD"); return (-1); Modified: projects/sv/lib/libkvm/kvm_ia64.c ============================================================================== --- projects/sv/lib/libkvm/kvm_ia64.c Mon Jan 24 17:03:22 2011 (r217790) +++ projects/sv/lib/libkvm/kvm_ia64.c Mon Jan 24 17:04:21 2011 (r217791) @@ -32,6 +32,7 @@ #include #include +#include #include #include @@ -123,7 +124,7 @@ _kvm_freevtop(kvm_t *kd) int _kvm_initvtop(kvm_t *kd) { - struct nlist nlist[2]; + struct nlist nl[2]; uint64_t va; Elf64_Ehdr *ehdr; size_t hdrsz; @@ -150,15 +151,15 @@ _kvm_initvtop(kvm_t *kd) * addresses/values. */ - nlist[0].n_name = "ia64_kptdir"; - nlist[1].n_name = 0; + nl[0].n_name = "ia64_kptdir"; + nl[1].n_name = 0; - if (kvm_nlist(kd, nlist) != 0) { + if (kvm_nlist(kd, nl) != 0) { _kvm_err(kd, kd->program, "bad namelist"); return (-1); } - if (kvm_read(kd, (nlist[0].n_value), &va, sizeof(va)) != sizeof(va)) { + if (kvm_read(kd, (nl[0].n_value), &va, sizeof(va)) != sizeof(va)) { _kvm_err(kd, kd->program, "cannot read kptdir"); return (-1); } Modified: projects/sv/lib/libkvm/kvm_minidump_amd64.c ============================================================================== --- projects/sv/lib/libkvm/kvm_minidump_amd64.c Mon Jan 24 17:03:22 2011 (r217790) +++ projects/sv/lib/libkvm/kvm_minidump_amd64.c Mon Jan 24 17:04:21 2011 (r217791) @@ -136,7 +136,6 @@ _kvm_minidump_freevtop(kvm_t *kd) int _kvm_minidump_initvtop(kvm_t *kd) { - u_long pa; struct vmstate *vmst; off_t off; @@ -207,7 +206,6 @@ _kvm_minidump_vatop_v1(kvm_t *kd, u_long u_long offset; pt_entry_t pte; u_long pteindex; - int i; u_long a; off_t ofs; @@ -258,7 +256,6 @@ _kvm_minidump_vatop(kvm_t *kd, u_long va pd_entry_t pte; u_long pteindex; u_long pdeindex; - int i; u_long a; off_t ofs; Modified: projects/sv/lib/libkvm/kvm_minidump_arm.c ============================================================================== --- projects/sv/lib/libkvm/kvm_minidump_arm.c Mon Jan 24 17:03:22 2011 (r217790) +++ projects/sv/lib/libkvm/kvm_minidump_arm.c Mon Jan 24 17:04:21 2011 (r217791) @@ -138,7 +138,6 @@ _kvm_minidump_freevtop(kvm_t *kd) int _kvm_minidump_initvtop(kvm_t *kd) { - u_long pa; struct vmstate *vmst; off_t off; @@ -179,7 +178,7 @@ _kvm_minidump_initvtop(kvm_t *kd) } if (pread(kd->pmfd, vmst->bitmap, vmst->hdr.bitmapsize, off) != - vmst->hdr.bitmapsize) { + (ssize_t)vmst->hdr.bitmapsize) { _kvm_err(kd, kd->program, "cannot read %d bytes for page bitmap", vmst->hdr.bitmapsize); return (-1); @@ -194,7 +193,7 @@ _kvm_minidump_initvtop(kvm_t *kd) } if (pread(kd->pmfd, vmst->ptemap, vmst->hdr.ptesize, off) != - vmst->hdr.ptesize) { + (ssize_t)vmst->hdr.ptesize) { _kvm_err(kd, kd->program, "cannot read %d bytes for ptemap", vmst->hdr.ptesize); return (-1); @@ -216,7 +215,6 @@ _kvm_minidump_kvatop(kvm_t *kd, u_long v u_long offset, pteindex, a; off_t ofs; uint32_t *ptemap; - int i; if (ISALIVE(kd)) { _kvm_err(kd, 0, "kvm_kvatop called in live kernel!"); Modified: projects/sv/lib/libkvm/kvm_minidump_i386.c ============================================================================== --- projects/sv/lib/libkvm/kvm_minidump_i386.c Mon Jan 24 17:03:22 2011 (r217790) +++ projects/sv/lib/libkvm/kvm_minidump_i386.c Mon Jan 24 17:04:21 2011 (r217791) @@ -138,7 +138,6 @@ _kvm_minidump_freevtop(kvm_t *kd) int _kvm_minidump_initvtop(kvm_t *kd) { - u_long pa; struct vmstate *vmst; off_t off; @@ -173,7 +172,7 @@ _kvm_minidump_initvtop(kvm_t *kd) return (-1); } if (pread(kd->pmfd, vmst->bitmap, vmst->hdr.bitmapsize, off) != - vmst->hdr.bitmapsize) { + (ssize_t)vmst->hdr.bitmapsize) { _kvm_err(kd, kd->program, "cannot read %d bytes for page bitmap", vmst->hdr.bitmapsize); return (-1); } @@ -185,7 +184,7 @@ _kvm_minidump_initvtop(kvm_t *kd) return (-1); } if (pread(kd->pmfd, vmst->ptemap, vmst->hdr.ptesize, off) != - vmst->hdr.ptesize) { + (ssize_t)vmst->hdr.ptesize) { _kvm_err(kd, kd->program, "cannot read %d bytes for ptemap", vmst->hdr.ptesize); return (-1); } *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-projects@FreeBSD.ORG Mon Jan 24 20:59:23 2011 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B9868106564A; Mon, 24 Jan 2011 20:59:23 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A46D58FC12; Mon, 24 Jan 2011 20:59:23 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0OKxNad006192; Mon, 24 Jan 2011 20:59:23 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0OKxNm2006173; Mon, 24 Jan 2011 20:59:23 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201101242059.p0OKxNm2006173@svn.freebsd.org> From: Dimitry Andric Date: Mon, 24 Jan 2011 20:59:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217802 - in projects/binutils-2.17: . contrib/top etc/periodic/daily gnu/usr.bin/gdb/kgdb lib/libc/sys lib/libkvm libexec/rtld-elf sbin/dump sbin/fdisk sbin/fsck_ffs sbin/fsdb sbin/fsi... X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Jan 2011 20:59:23 -0000 Author: dim Date: Mon Jan 24 20:59:23 2011 New Revision: 217802 URL: http://svn.freebsd.org/changeset/base/217802 Log: Sync: merge r217652 through r217801 from ^/head. Added: projects/binutils-2.17/sys/modules/khelp/ - copied from r217801, head/sys/modules/khelp/ projects/binutils-2.17/sys/netinet/sctp_ss_functions.c - copied unchanged from r217801, head/sys/netinet/sctp_ss_functions.c projects/binutils-2.17/tools/tools/ath/ath_ee_v14_print/ - copied from r217801, head/tools/tools/ath/ath_ee_v14_print/ projects/binutils-2.17/tools/tools/ath/ath_ee_v4k_print/ - copied from r217801, head/tools/tools/ath/ath_ee_v4k_print/ projects/binutils-2.17/tools/tools/ath/ath_prom_read/ - copied from r217801, head/tools/tools/ath/ath_prom_read/ Deleted: projects/binutils-2.17/sys/conf/ldscript.mips.64.cfe Modified: projects/binutils-2.17/Makefile projects/binutils-2.17/etc/periodic/daily/800.scrub-zfs projects/binutils-2.17/gnu/usr.bin/gdb/kgdb/main.c projects/binutils-2.17/lib/libc/sys/getgroups.2 projects/binutils-2.17/lib/libkvm/Makefile projects/binutils-2.17/lib/libkvm/kvm.c projects/binutils-2.17/lib/libkvm/kvm.h projects/binutils-2.17/lib/libkvm/kvm_amd64.c projects/binutils-2.17/lib/libkvm/kvm_arm.c projects/binutils-2.17/lib/libkvm/kvm_cptime.c projects/binutils-2.17/lib/libkvm/kvm_file.c projects/binutils-2.17/lib/libkvm/kvm_getloadavg.c projects/binutils-2.17/lib/libkvm/kvm_getswapinfo.c projects/binutils-2.17/lib/libkvm/kvm_i386.c projects/binutils-2.17/lib/libkvm/kvm_ia64.c projects/binutils-2.17/lib/libkvm/kvm_minidump_amd64.c projects/binutils-2.17/lib/libkvm/kvm_minidump_arm.c projects/binutils-2.17/lib/libkvm/kvm_minidump_i386.c projects/binutils-2.17/lib/libkvm/kvm_minidump_mips.c projects/binutils-2.17/lib/libkvm/kvm_mips.c projects/binutils-2.17/lib/libkvm/kvm_pcpu.c projects/binutils-2.17/lib/libkvm/kvm_powerpc.c projects/binutils-2.17/lib/libkvm/kvm_powerpc64.c projects/binutils-2.17/lib/libkvm/kvm_proc.c projects/binutils-2.17/lib/libkvm/kvm_sparc64.c projects/binutils-2.17/lib/libkvm/kvm_vnet.c projects/binutils-2.17/libexec/rtld-elf/rtld.c projects/binutils-2.17/sbin/dump/itime.c projects/binutils-2.17/sbin/dump/main.c projects/binutils-2.17/sbin/dump/optr.c projects/binutils-2.17/sbin/dump/tape.c projects/binutils-2.17/sbin/fdisk/fdisk.c projects/binutils-2.17/sbin/fsck_ffs/inode.c projects/binutils-2.17/sbin/fsck_ffs/main.c projects/binutils-2.17/sbin/fsck_ffs/suj.c projects/binutils-2.17/sbin/fsdb/fsdb.c projects/binutils-2.17/sbin/fsirand/fsirand.c projects/binutils-2.17/sbin/geom/class/virstor/gvirstor.8 projects/binutils-2.17/sbin/growfs/growfs.c projects/binutils-2.17/sbin/hastd/control.c projects/binutils-2.17/sbin/hastd/control.h projects/binutils-2.17/sbin/hastd/hastd.c projects/binutils-2.17/sbin/hastd/hastd.h projects/binutils-2.17/sbin/hastd/nv.c projects/binutils-2.17/sbin/hastd/nv.h projects/binutils-2.17/sbin/hastd/pjdlog.c projects/binutils-2.17/sbin/hastd/pjdlog.h projects/binutils-2.17/sbin/hastd/primary.c projects/binutils-2.17/sbin/init/init.8 projects/binutils-2.17/sbin/init/init.c projects/binutils-2.17/sbin/newfs/mkfs.c projects/binutils-2.17/share/man/man5/devfs.5 projects/binutils-2.17/share/man/man5/rc.conf.5 projects/binutils-2.17/share/man/man7/build.7 projects/binutils-2.17/share/man/man9/make_dev.9 projects/binutils-2.17/sys/amd64/amd64/machdep.c projects/binutils-2.17/sys/arm/at91/at91_machdep.c projects/binutils-2.17/sys/arm/econa/econa_machdep.c projects/binutils-2.17/sys/arm/mv/mv_machdep.c projects/binutils-2.17/sys/arm/s3c2xx0/s3c24x0_machdep.c projects/binutils-2.17/sys/arm/xscale/i80321/ep80219_machdep.c projects/binutils-2.17/sys/arm/xscale/i80321/iq31244_machdep.c projects/binutils-2.17/sys/arm/xscale/i8134x/crb_machdep.c projects/binutils-2.17/sys/arm/xscale/ixp425/avila_machdep.c projects/binutils-2.17/sys/arm/xscale/pxa/pxa_machdep.c projects/binutils-2.17/sys/boot/arm/at91/boot0/linker.cfg projects/binutils-2.17/sys/boot/arm/at91/linker.cfg projects/binutils-2.17/sys/boot/common/loader.8 projects/binutils-2.17/sys/boot/forth/loader.conf projects/binutils-2.17/sys/boot/powerpc/ofw/ldscript.powerpc projects/binutils-2.17/sys/boot/powerpc/ps3/ldscript.powerpc projects/binutils-2.17/sys/compat/linux/linux_signal.c projects/binutils-2.17/sys/conf/files projects/binutils-2.17/sys/conf/ldscript.mips.cfe projects/binutils-2.17/sys/conf/ldscript.mips.mips64 projects/binutils-2.17/sys/conf/ldscript.mips.octeon1 projects/binutils-2.17/sys/conf/ldscript.powerpc projects/binutils-2.17/sys/conf/ldscript.powerpc64 projects/binutils-2.17/sys/conf/ldscript.sparc64 projects/binutils-2.17/sys/conf/options projects/binutils-2.17/sys/dev/ata/chipsets/ata-intel.c projects/binutils-2.17/sys/dev/ath/ath_hal/ah.h projects/binutils-2.17/sys/dev/ath/ath_hal/ah_eeprom_v14.c projects/binutils-2.17/sys/dev/ath/ath_hal/ah_eeprom_v4k.c projects/binutils-2.17/sys/dev/ath/ath_hal/ar5210/ar5210.h projects/binutils-2.17/sys/dev/ath/ath_hal/ar5210/ar5210_attach.c projects/binutils-2.17/sys/dev/ath/ath_hal/ar5210/ar5210_misc.c projects/binutils-2.17/sys/dev/ath/ath_hal/ar5211/ar5211.h projects/binutils-2.17/sys/dev/ath/ath_hal/ar5211/ar5211_attach.c projects/binutils-2.17/sys/dev/ath/ath_hal/ar5211/ar5211_misc.c projects/binutils-2.17/sys/dev/ath/ath_hal/ar5212/ar5212.h projects/binutils-2.17/sys/dev/ath/ath_hal/ar5212/ar5212_ani.c projects/binutils-2.17/sys/dev/ath/ath_hal/ar5212/ar5212_attach.c projects/binutils-2.17/sys/dev/ath/ath_hal/ar5416/ar5416.h projects/binutils-2.17/sys/dev/ath/ath_hal/ar5416/ar5416_ani.c projects/binutils-2.17/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c projects/binutils-2.17/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c projects/binutils-2.17/sys/dev/ath/ath_hal/ar9002/ar9280_attach.c projects/binutils-2.17/sys/dev/ath/ath_hal/ar9002/ar9280v2.ini projects/binutils-2.17/sys/dev/ath/if_ath.c projects/binutils-2.17/sys/dev/ath/if_athioctl.h projects/binutils-2.17/sys/dev/ath/if_athvar.h projects/binutils-2.17/sys/dev/if_ndis/if_ndis_usb.c projects/binutils-2.17/sys/dev/ixgbe/ixgbe.c projects/binutils-2.17/sys/dev/nfe/if_nfe.c projects/binutils-2.17/sys/dev/re/if_re.c projects/binutils-2.17/sys/dev/uart/uart_tty.c projects/binutils-2.17/sys/dev/usb/usb_freebsd.h projects/binutils-2.17/sys/fs/ext2fs/ext2_dinode.h projects/binutils-2.17/sys/fs/ext2fs/ext2_vfsops.c projects/binutils-2.17/sys/fs/ext2fs/ext2fs.h projects/binutils-2.17/sys/i386/i386/machdep.c projects/binutils-2.17/sys/i386/i386/pmap.c projects/binutils-2.17/sys/i386/xen/pmap.c projects/binutils-2.17/sys/ia64/ia64/machdep.c projects/binutils-2.17/sys/kern/subr_param.c projects/binutils-2.17/sys/kern/vfs_mount.c projects/binutils-2.17/sys/mips/cavium/octe/ethernet-defines.h projects/binutils-2.17/sys/mips/cavium/octe/ethernet-rx.c projects/binutils-2.17/sys/mips/cavium/octe/ethernet-tx.c projects/binutils-2.17/sys/mips/cavium/octe/ethernet.c projects/binutils-2.17/sys/mips/conf/OCTEON1 projects/binutils-2.17/sys/mips/conf/SWARM64 projects/binutils-2.17/sys/mips/conf/SWARM64_SMP projects/binutils-2.17/sys/mips/mips/machdep.c projects/binutils-2.17/sys/mips/mips/pmap.c projects/binutils-2.17/sys/modules/Makefile projects/binutils-2.17/sys/netinet/cc/cc.c projects/binutils-2.17/sys/netinet/cc/cc_cubic.c projects/binutils-2.17/sys/netinet/sctp.h projects/binutils-2.17/sys/netinet/sctp_input.c projects/binutils-2.17/sys/netinet/sctp_output.c projects/binutils-2.17/sys/netinet/sctp_output.h projects/binutils-2.17/sys/netinet/sctp_pcb.c projects/binutils-2.17/sys/netinet/sctp_pcb.h projects/binutils-2.17/sys/netinet/sctp_structs.h projects/binutils-2.17/sys/netinet/sctp_sysctl.c projects/binutils-2.17/sys/netinet/sctp_sysctl.h projects/binutils-2.17/sys/netinet/sctp_timer.c projects/binutils-2.17/sys/netinet/sctp_uio.h projects/binutils-2.17/sys/netinet/sctp_usrreq.c projects/binutils-2.17/sys/netinet/sctputil.c projects/binutils-2.17/sys/pc98/pc98/machdep.c projects/binutils-2.17/sys/powerpc/aim/machdep.c projects/binutils-2.17/sys/powerpc/aim/mmu_oea.c projects/binutils-2.17/sys/powerpc/aim/mmu_oea64.c projects/binutils-2.17/sys/powerpc/booke/machdep.c projects/binutils-2.17/sys/powerpc/booke/pmap.c projects/binutils-2.17/sys/powerpc/powermac/ata_kauai.c projects/binutils-2.17/sys/powerpc/powermac/cpcht.c projects/binutils-2.17/sys/powerpc/powermac/grackle.c projects/binutils-2.17/sys/powerpc/powermac/gracklevar.h projects/binutils-2.17/sys/powerpc/powermac/uninorthpci.c projects/binutils-2.17/sys/powerpc/powermac/uninorthvar.h projects/binutils-2.17/sys/sparc64/sparc64/machdep.c projects/binutils-2.17/sys/sparc64/sparc64/pmap.c projects/binutils-2.17/sys/sun4v/sun4v/machdep.c projects/binutils-2.17/sys/sun4v/sun4v/pmap.c projects/binutils-2.17/sys/sys/msgbuf.h projects/binutils-2.17/sys/sys/pioctl.h projects/binutils-2.17/sys/vm/vm_page.c projects/binutils-2.17/tools/tools/ath/Makefile projects/binutils-2.17/tools/tools/ath/Makefile.inc projects/binutils-2.17/tools/tools/ath/athdebug/athdebug.c projects/binutils-2.17/tools/tools/ath/athdecode/main.c projects/binutils-2.17/tools/tools/ath/athprom/athprom.c projects/binutils-2.17/tools/tools/ath/athrd/athrd.c projects/binutils-2.17/tools/tools/ath/athregs/dumpregs.c projects/binutils-2.17/tools/tools/ath/athstats/Makefile projects/binutils-2.17/tools/tools/ath/athstats/athstats.c projects/binutils-2.17/tools/tools/ath/athstats/main.c projects/binutils-2.17/usr.bin/netstat/netisr.c projects/binutils-2.17/usr.bin/top/top.local.1 projects/binutils-2.17/usr.bin/unifdef/unifdef.c projects/binutils-2.17/usr.sbin/freebsd-update/freebsd-update.sh projects/binutils-2.17/usr.sbin/makefs/ffs.c projects/binutils-2.17/usr.sbin/makefs/makefs.c projects/binutils-2.17/usr.sbin/quot/quot.c Directory Properties: projects/binutils-2.17/ (props changed) projects/binutils-2.17/cddl/contrib/opensolaris/ (props changed) projects/binutils-2.17/contrib/bind9/ (props changed) projects/binutils-2.17/contrib/binutils/ (props changed) projects/binutils-2.17/contrib/bzip2/ (props changed) projects/binutils-2.17/contrib/dialog/ (props changed) projects/binutils-2.17/contrib/ee/ (props changed) projects/binutils-2.17/contrib/expat/ (props changed) projects/binutils-2.17/contrib/file/ (props changed) projects/binutils-2.17/contrib/gdb/ (props changed) projects/binutils-2.17/contrib/gdtoa/ (props changed) projects/binutils-2.17/contrib/gnu-sort/ (props changed) projects/binutils-2.17/contrib/groff/ (props changed) projects/binutils-2.17/contrib/less/ (props changed) projects/binutils-2.17/contrib/libpcap/ (props changed) projects/binutils-2.17/contrib/llvm/ (props changed) projects/binutils-2.17/contrib/llvm/tools/clang/ (props changed) projects/binutils-2.17/contrib/ncurses/ (props changed) projects/binutils-2.17/contrib/netcat/ (props changed) projects/binutils-2.17/contrib/ntp/ (props changed) projects/binutils-2.17/contrib/one-true-awk/ (props changed) projects/binutils-2.17/contrib/openbsm/ (props changed) projects/binutils-2.17/contrib/openpam/ (props changed) projects/binutils-2.17/contrib/pf/ (props changed) projects/binutils-2.17/contrib/sendmail/ (props changed) projects/binutils-2.17/contrib/tcpdump/ (props changed) projects/binutils-2.17/contrib/tcsh/ (props changed) projects/binutils-2.17/contrib/top/ (props changed) projects/binutils-2.17/contrib/top/install-sh (props changed) projects/binutils-2.17/contrib/tzcode/stdtime/ (props changed) projects/binutils-2.17/contrib/tzcode/zic/ (props changed) projects/binutils-2.17/contrib/tzdata/ (props changed) projects/binutils-2.17/contrib/wpa/ (props changed) projects/binutils-2.17/contrib/xz/ (props changed) projects/binutils-2.17/crypto/openssh/ (props changed) projects/binutils-2.17/crypto/openssl/ (props changed) projects/binutils-2.17/lib/libc/ (props changed) projects/binutils-2.17/lib/libc/stdtime/ (props changed) projects/binutils-2.17/lib/libutil/ (props changed) projects/binutils-2.17/lib/libz/ (props changed) projects/binutils-2.17/sbin/ (props changed) projects/binutils-2.17/sbin/ipfw/ (props changed) projects/binutils-2.17/share/mk/bsd.arch.inc.mk (props changed) projects/binutils-2.17/share/zoneinfo/ (props changed) projects/binutils-2.17/sys/ (props changed) projects/binutils-2.17/sys/amd64/include/xen/ (props changed) projects/binutils-2.17/sys/cddl/contrib/opensolaris/ (props changed) projects/binutils-2.17/sys/contrib/dev/acpica/ (props changed) projects/binutils-2.17/sys/contrib/octeon-sdk/ (props changed) projects/binutils-2.17/sys/contrib/pf/ (props changed) projects/binutils-2.17/sys/contrib/x86emu/ (props changed) projects/binutils-2.17/usr.bin/calendar/ (props changed) projects/binutils-2.17/usr.bin/csup/ (props changed) projects/binutils-2.17/usr.bin/procstat/ (props changed) projects/binutils-2.17/usr.sbin/zic/ (props changed) Modified: projects/binutils-2.17/Makefile ============================================================================== --- projects/binutils-2.17/Makefile Mon Jan 24 20:07:14 2011 (r217801) +++ projects/binutils-2.17/Makefile Mon Jan 24 20:59:23 2011 (r217802) @@ -5,7 +5,8 @@ # # universe - *Really* build *everything* (buildworld and # all kernels on all architectures). -# tinderbox - Same as universe, but stop on first failure. +# tinderbox - Same as universe, but presents a list of failed build +# targets and exits with an error if there were any. # buildworld - Rebuild *everything*, including glue to help do # upgrades. # installworld - Install everything built by "buildworld". @@ -274,7 +275,7 @@ make: .PHONY ${MMAKE} install DESTDIR=${MAKEPATH} BINDIR= tinderbox: - cd ${.CURDIR} && \ + @cd ${.CURDIR} && \ DOING_TINDERBOX=YES ${MAKE} JFLAG=${JFLAG} universe # @@ -296,7 +297,7 @@ TARGET_ARCHES_${target}?= ${target} .endfor targets: - @echo "Supported TARGET/TARGET_ARCH pairs" + @echo "Supported TARGETS/TARGET_ARCH pairs" .for target in ${TARGETS} .for target_arch in ${TARGET_ARCHES_${target}} @echo " ${target}/${target_arch}" @@ -304,7 +305,7 @@ targets: .endfor .if defined(DOING_TINDERBOX) -FAILFILE=tinderbox.failed +FAILFILE=${.CURDIR}/_.tinderbox.failed MAKEFAIL=tee -a ${FAILFILE} .else MAKEFAIL=cat @@ -316,7 +317,7 @@ universe_prologue: @echo ">>> make universe started on ${STARTTIME}" @echo "--------------------------------------------------------------" .if defined(DOING_TINDERBOX) - rm -f ${FAILFILE} + @rm -f ${FAILFILE} .endif .for target in ${TARGETS} universe: universe_${target} Modified: projects/binutils-2.17/etc/periodic/daily/800.scrub-zfs ============================================================================== --- projects/binutils-2.17/etc/periodic/daily/800.scrub-zfs Mon Jan 24 20:07:14 2011 (r217801) +++ projects/binutils-2.17/etc/periodic/daily/800.scrub-zfs Mon Jan 24 20:59:23 2011 (r217802) @@ -24,13 +24,17 @@ case "$daily_scrub_zfs_enable" in for pool in ${daily_scrub_zfs_pools}; do # sanity check - zpool list ${pool} >/dev/null 2>&1 + _status=$(zpool list ${pool} | sed -n -e '$p') if [ $? -ne 0 ]; then echo " WARNING: pool '${pool}' specified in" echo " '/etc/periodic.conf:daily_scrub_zfs_pools'" echo " does not exist" continue fi + if echo ${_status} | grep -q FAULTED; then + echo "Skipping faulted pool: ${pool}" + continue + fi # successful only if there is at least one pool to scrub rc=0 Modified: projects/binutils-2.17/gnu/usr.bin/gdb/kgdb/main.c ============================================================================== --- projects/binutils-2.17/gnu/usr.bin/gdb/kgdb/main.c Mon Jan 24 20:07:14 2011 (r217801) +++ projects/binutils-2.17/gnu/usr.bin/gdb/kgdb/main.c Mon Jan 24 20:59:23 2011 (r217802) @@ -129,7 +129,7 @@ kernel_from_dumpnr(int nr) snprintf(path, sizeof(path), "%s/info.%d", crashdir, nr); info = fopen(path, "r"); if (info == NULL) { - warn(path); + warn("%s", path); return; } while (fgets(path, sizeof(path), info) != NULL) { @@ -408,7 +408,7 @@ main(int argc, char *argv[]) if (dumpnr >= 0) { snprintf(path, sizeof(path), "%s/vmcore.%d", crashdir, dumpnr); if (stat(path, &st) == -1) - err(1, path); + err(1, "%s", path); if (!S_ISREG(st.st_mode)) errx(1, "%s: not a regular file", path); vmcore = strdup(path); Modified: projects/binutils-2.17/lib/libc/sys/getgroups.2 ============================================================================== --- projects/binutils-2.17/lib/libc/sys/getgroups.2 Mon Jan 24 20:07:14 2011 (r217801) +++ projects/binutils-2.17/lib/libc/sys/getgroups.2 Mon Jan 24 20:59:23 2011 (r217802) @@ -28,7 +28,7 @@ .\" @(#)getgroups.2 8.2 (Berkeley) 4/16/94 .\" $FreeBSD$ .\" -.Dd March 5, 1999 +.Dd January 21, 2011 .Dt GETGROUPS 2 .Os .Sh NAME @@ -37,7 +37,6 @@ .Sh LIBRARY .Lb libc .Sh SYNOPSIS -.In sys/param.h .In unistd.h .Ft int .Fn getgroups "int gidsetlen" "gid_t *gidset" @@ -66,6 +65,12 @@ is zero, returns the number of supplementary group IDs associated with the calling process without modifying the array pointed to by .Fa gidset . +.Pp +The value of +.Dv {NGROUPS_MAX} +should be obtained using +.Xr sysconf 3 +to avoid hard-coding it into the executable. .Sh RETURN VALUES A successful call returns the number of groups in the group set. A value of -1 indicates that an error occurred, and the error @@ -88,7 +93,8 @@ an invalid address. .El .Sh SEE ALSO .Xr setgroups 2 , -.Xr initgroups 3 +.Xr initgroups 3 , +.Xr sysconf 3 .Sh STANDARDS The .Fn getgroups Modified: projects/binutils-2.17/lib/libkvm/Makefile ============================================================================== --- projects/binutils-2.17/lib/libkvm/Makefile Mon Jan 24 20:07:14 2011 (r217801) +++ projects/binutils-2.17/lib/libkvm/Makefile Mon Jan 24 20:59:23 2011 (r217802) @@ -15,7 +15,7 @@ KVM_ARCH=${MACHINE_ARCH} KVM_ARCH=${MACHINE_CPUARCH} .endif -WARNS?= 0 +WARNS?= 3 SRCS= kvm.c kvm_${KVM_ARCH}.c kvm_cptime.c kvm_file.c kvm_getloadavg.c \ kvm_getswapinfo.c kvm_pcpu.c kvm_proc.c kvm_vnet.c Modified: projects/binutils-2.17/lib/libkvm/kvm.c ============================================================================== --- projects/binutils-2.17/lib/libkvm/kvm.c Mon Jan 24 20:07:14 2011 (r217801) +++ projects/binutils-2.17/lib/libkvm/kvm.c Mon Jan 24 20:59:23 2011 (r217802) @@ -77,8 +77,7 @@ static char sccsid[] = "@(#)kvm.c 8.2 (B int __fdnlist(int, struct nlist *); char * -kvm_geterr(kd) - kvm_t *kd; +kvm_geterr(kvm_t *kd) { return (kd->errbuf); } @@ -103,7 +102,7 @@ _kvm_err(kvm_t *kd, const char *program, (void)fputc('\n', stderr); } else (void)vsnprintf(kd->errbuf, - sizeof(kd->errbuf), (char *)fmt, ap); + sizeof(kd->errbuf), fmt, ap); va_end(ap); } @@ -122,7 +121,7 @@ _kvm_syserr(kvm_t *kd, const char *progr } else { char *cp = kd->errbuf; - (void)vsnprintf(cp, sizeof(kd->errbuf), (char *)fmt, ap); + (void)vsnprintf(cp, sizeof(kd->errbuf), fmt, ap); n = strlen(cp); (void)snprintf(&cp[n], sizeof(kd->errbuf) - n, ": %s", strerror(errno)); @@ -131,25 +130,18 @@ _kvm_syserr(kvm_t *kd, const char *progr } void * -_kvm_malloc(kd, n) - kvm_t *kd; - size_t n; +_kvm_malloc(kvm_t *kd, size_t n) { void *p; if ((p = calloc(n, sizeof(char))) == NULL) - _kvm_err(kd, kd->program, "can't allocate %u bytes: %s", + _kvm_err(kd, kd->program, "can't allocate %zu bytes: %s", n, strerror(errno)); return (p); } static kvm_t * -_kvm_open(kd, uf, mf, flag, errout) - kvm_t *kd; - const char *uf; - const char *mf; - int flag; - char *errout; +_kvm_open(kvm_t *kd, const char *uf, const char *mf, int flag, char *errout) { struct stat st; @@ -242,12 +234,8 @@ failed: } kvm_t * -kvm_openfiles(uf, mf, sf, flag, errout) - const char *uf; - const char *mf; - const char *sf __unused; - int flag; - char *errout; +kvm_openfiles(const char *uf, const char *mf, const char *sf __unused, int flag, + char *errout) { kvm_t *kd; @@ -260,12 +248,8 @@ kvm_openfiles(uf, mf, sf, flag, errout) } kvm_t * -kvm_open(uf, mf, sf, flag, errstr) - const char *uf; - const char *mf; - const char *sf __unused; - int flag; - const char *errstr; +kvm_open(const char *uf, const char *mf, const char *sf __unused, int flag, + const char *errstr) { kvm_t *kd; @@ -280,8 +264,7 @@ kvm_open(uf, mf, sf, flag, errstr) } int -kvm_close(kd) - kvm_t *kd; +kvm_close(kvm_t *kd) { int error = 0; @@ -316,8 +299,9 @@ kvm_fdnlist_prefix(kvm_t *kd, struct nli { struct nlist *n, *np, *p; char *cp, *ce; + const char *ccp; size_t len; - int unresolved; + int slen, unresolved; /* * Calculate the space we need to malloc for nlist and names. @@ -355,13 +339,13 @@ kvm_fdnlist_prefix(kvm_t *kd, struct nli continue; bcopy(p, np, sizeof(struct nlist)); /* Save the new\0orig. name so we can later match it again. */ - len = snprintf(cp, ce - cp, "%s%s%c%s", prefix, + slen = snprintf(cp, ce - cp, "%s%s%c%s", prefix, (prefix[0] != '\0' && p->n_name[0] == '_') ? (p->n_name + 1) : p->n_name, '\0', p->n_name); - if (len >= ce - cp) + if (slen < 0 || slen >= ce - cp) continue; np->n_name = cp; - cp += len + 1; + cp += slen + 1; np++; unresolved++; } @@ -385,8 +369,8 @@ kvm_fdnlist_prefix(kvm_t *kd, struct nli if (p->n_type != N_UNDF) continue; /* Skip expanded name and compare to orig. one. */ - cp = np->n_name + strlen(np->n_name) + 1; - if (strcmp(cp, p->n_name)) + ccp = np->n_name + strlen(np->n_name) + 1; + if (strcmp(ccp, p->n_name) != 0) continue; /* Update nlist with new, translated results. */ p->n_type = np->n_type; @@ -416,7 +400,8 @@ _kvm_nlist(kvm_t *kd, struct nlist *nl, int nvalid; struct kld_sym_lookup lookup; int error; - char *prefix = "", symname[1024]; /* XXX-BZ symbol name length limit? */ + const char *prefix = ""; + char symname[1024]; /* XXX-BZ symbol name length limit? */ int tried_vnet, tried_dpcpu; /* @@ -458,9 +443,8 @@ again: error = snprintf(symname, sizeof(symname), "%s%s", prefix, (prefix[0] != '\0' && p->n_name[0] == '_') ? (p->n_name + 1) : p->n_name); - if (error >= sizeof(symname)) + if (error < 0 || error >= (int)sizeof(symname)) continue; - lookup.symname = symname; if (lookup.symname[0] == '_') lookup.symname++; @@ -470,11 +454,11 @@ again: p->n_other = 0; p->n_desc = 0; if (_kvm_vnet_initialized(kd, initialize) && - !strcmp(prefix, VNET_SYMPREFIX)) + !strcmp(prefix, VNET_SYMPREFIX) == 0) p->n_value = _kvm_vnet_validaddr(kd, lookup.symvalue); else if (_kvm_dpcpu_initialized(kd, initialize) && - !strcmp(prefix, DPCPU_SYMPREFIX)) + !strcmp(prefix, DPCPU_SYMPREFIX) == 0) p->n_value = _kvm_dpcpu_validaddr(kd, lookup.symvalue); else @@ -511,9 +495,7 @@ again: } int -kvm_nlist(kd, nl) - kvm_t *kd; - struct nlist *nl; +kvm_nlist(kvm_t *kd, struct nlist *nl) { /* @@ -524,13 +506,11 @@ kvm_nlist(kd, nl) } ssize_t -kvm_read(kd, kva, buf, len) - kvm_t *kd; - u_long kva; - void *buf; - size_t len; +kvm_read(kvm_t *kd, u_long kva, void *buf, size_t len) { int cc; + ssize_t cr; + off_t pa; char *cp; if (ISALIVE(kd)) { @@ -540,59 +520,52 @@ kvm_read(kd, kva, buf, len) */ errno = 0; if (lseek(kd->vmfd, (off_t)kva, 0) == -1 && errno != 0) { - _kvm_err(kd, 0, "invalid address (%x)", kva); + _kvm_err(kd, 0, "invalid address (%lx)", kva); return (-1); } - cc = read(kd->vmfd, buf, len); - if (cc < 0) { + cr = read(kd->vmfd, buf, len); + if (cr < 0) { _kvm_syserr(kd, 0, "kvm_read"); return (-1); - } else if (cc < len) + } else if (cr < (ssize_t)len) _kvm_err(kd, kd->program, "short read"); - return (cc); - } else { - cp = buf; - while (len > 0) { - off_t pa; - - cc = _kvm_kvatop(kd, kva, &pa); - if (cc == 0) - return (-1); - if (cc > len) - cc = len; - errno = 0; - if (lseek(kd->pmfd, pa, 0) == -1 && errno != 0) { - _kvm_syserr(kd, 0, _PATH_MEM); - break; - } - cc = read(kd->pmfd, cp, cc); - if (cc < 0) { - _kvm_syserr(kd, kd->program, "kvm_read"); - break; - } - /* - * If kvm_kvatop returns a bogus value or our core - * file is truncated, we might wind up seeking beyond - * the end of the core file in which case the read will - * return 0 (EOF). - */ - if (cc == 0) - break; - cp += cc; - kva += cc; - len -= cc; + return (cr); + } + + cp = buf; + while (len > 0) { + cc = _kvm_kvatop(kd, kva, &pa); + if (cc == 0) + return (-1); + if (cc > (ssize_t)len) + cc = len; + errno = 0; + if (lseek(kd->pmfd, pa, 0) == -1 && errno != 0) { + _kvm_syserr(kd, 0, _PATH_MEM); + break; + } + cr = read(kd->pmfd, cp, cc); + if (cr < 0) { + _kvm_syserr(kd, kd->program, "kvm_read"); + break; } - return (cp - (char *)buf); + /* + * If kvm_kvatop returns a bogus value or our core file is + * truncated, we might wind up seeking beyond the end of the + * core file in which case the read will return 0 (EOF). + */ + if (cr == 0) + break; + cp += cr; + kva += cr; + len -= cr; } - /* NOTREACHED */ + + return (cp - (char *)buf); } ssize_t -kvm_write(kd, kva, buf, len) - kvm_t *kd; - u_long kva; - const void *buf; - size_t len; +kvm_write(kvm_t *kd, u_long kva, const void *buf, size_t len) { int cc; @@ -602,14 +575,14 @@ kvm_write(kd, kva, buf, len) */ errno = 0; if (lseek(kd->vmfd, (off_t)kva, 0) == -1 && errno != 0) { - _kvm_err(kd, 0, "invalid address (%x)", kva); + _kvm_err(kd, 0, "invalid address (%lx)", kva); return (-1); } cc = write(kd->vmfd, buf, len); if (cc < 0) { _kvm_syserr(kd, 0, "kvm_write"); return (-1); - } else if (cc < len) + } else if ((size_t)cc < len) _kvm_err(kd, kd->program, "short write"); return (cc); } else { Modified: projects/binutils-2.17/lib/libkvm/kvm.h ============================================================================== --- projects/binutils-2.17/lib/libkvm/kvm.h Mon Jan 24 20:07:14 2011 (r217801) +++ projects/binutils-2.17/lib/libkvm/kvm.h Mon Jan 24 20:59:23 2011 (r217802) @@ -88,7 +88,7 @@ kvm_t *kvm_openfiles (const char *, const char *, const char *, int, char *); ssize_t kvm_read(kvm_t *, unsigned long, void *, size_t); ssize_t kvm_uread - (kvm_t *, struct kinfo_proc *, unsigned long, char *, size_t); + (kvm_t *, const struct kinfo_proc *, unsigned long, char *, size_t); ssize_t kvm_write(kvm_t *, unsigned long, const void *, size_t); __END_DECLS Modified: projects/binutils-2.17/lib/libkvm/kvm_amd64.c ============================================================================== --- projects/binutils-2.17/lib/libkvm/kvm_amd64.c Mon Jan 24 20:07:14 2011 (r217801) +++ projects/binutils-2.17/lib/libkvm/kvm_amd64.c Mon Jan 24 20:59:23 2011 (r217802) @@ -147,7 +147,7 @@ _kvm_freevtop(kvm_t *kd) int _kvm_initvtop(kvm_t *kd) { - struct nlist nlist[2]; + struct nlist nl[2]; u_long pa; u_long kernbase; pml4_entry_t *PML4; @@ -176,23 +176,23 @@ _kvm_initvtop(kvm_t *kd) return (-1); } - nlist[0].n_name = "kernbase"; - nlist[1].n_name = 0; + nl[0].n_name = "kernbase"; + nl[1].n_name = 0; - if (kvm_nlist(kd, nlist) != 0) { + if (kvm_nlist(kd, nl) != 0) { _kvm_err(kd, kd->program, "bad namelist - no kernbase"); return (-1); } - kernbase = nlist[0].n_value; + kernbase = nl[0].n_value; - nlist[0].n_name = "KPML4phys"; - nlist[1].n_name = 0; + nl[0].n_name = "KPML4phys"; + nl[1].n_name = 0; - if (kvm_nlist(kd, nlist) != 0) { + if (kvm_nlist(kd, nl) != 0) { _kvm_err(kd, kd->program, "bad namelist - no KPML4phys"); return (-1); } - if (kvm_read(kd, (nlist[0].n_value - kernbase), &pa, sizeof(pa)) != + if (kvm_read(kd, (nl[0].n_value - kernbase), &pa, sizeof(pa)) != sizeof(pa)) { _kvm_err(kd, kd->program, "cannot read KPML4phys"); return (-1); @@ -222,7 +222,6 @@ _kvm_vatop(kvm_t *kd, u_long va, off_t * u_long pdpeindex; u_long pdeindex; u_long pteindex; - int i; u_long a; off_t ofs; size_t s; Modified: projects/binutils-2.17/lib/libkvm/kvm_arm.c ============================================================================== --- projects/binutils-2.17/lib/libkvm/kvm_arm.c Mon Jan 24 20:07:14 2011 (r217801) +++ projects/binutils-2.17/lib/libkvm/kvm_arm.c Mon Jan 24 20:59:23 2011 (r217802) @@ -124,7 +124,7 @@ int _kvm_initvtop(kvm_t *kd) { struct vmstate *vm; - struct nlist nlist[2]; + struct nlist nl[2]; u_long kernbase, physaddr, pa; pd_entry_t *l1pt; Elf32_Ehdr *ehdr; @@ -154,25 +154,25 @@ _kvm_initvtop(kvm_t *kd) hdrsz = ehdr->e_phoff + ehdr->e_phentsize * ehdr->e_phnum; if (_kvm_maphdrs(kd, hdrsz) == -1) return (-1); - nlist[0].n_name = "kernbase"; - nlist[1].n_name = NULL; - if (kvm_nlist(kd, nlist) != 0) + nl[0].n_name = "kernbase"; + nl[1].n_name = NULL; + if (kvm_nlist(kd, nl) != 0) kernbase = KERNBASE; else - kernbase = nlist[0].n_value; + kernbase = nl[0].n_value; - nlist[0].n_name = "physaddr"; - if (kvm_nlist(kd, nlist) != 0) { + nl[0].n_name = "physaddr"; + if (kvm_nlist(kd, nl) != 0) { _kvm_err(kd, kd->program, "couldn't get phys addr"); return (-1); } - physaddr = nlist[0].n_value; - nlist[0].n_name = "kernel_l1pa"; - if (kvm_nlist(kd, nlist) != 0) { + physaddr = nl[0].n_value; + nl[0].n_name = "kernel_l1pa"; + if (kvm_nlist(kd, nl) != 0) { _kvm_err(kd, kd->program, "bad namelist"); return (-1); } - if (kvm_read(kd, (nlist[0].n_value - kernbase + physaddr), &pa, + if (kvm_read(kd, (nl[0].n_value - kernbase + physaddr), &pa, sizeof(pa)) != sizeof(pa)) { _kvm_err(kd, kd->program, "cannot read kernel_l1pa"); return (-1); @@ -205,7 +205,6 @@ _kvm_initvtop(kvm_t *kd) int _kvm_kvatop(kvm_t *kd, u_long va, off_t *pa) { - u_long offset = va & (PAGE_SIZE - 1); struct vmstate *vm = kd->vmst; pd_entry_t pd; pt_entry_t pte; @@ -244,7 +243,7 @@ _kvm_kvatop(kvm_t *kd, u_long va, off_t *pa = (pte & L2_S_FRAME) | (va & L2_S_OFFSET); return (_kvm_pa2off(kd, *pa, pa, PAGE_SIZE)); invalid: - _kvm_err(kd, 0, "Invalid address (%x)", va); + _kvm_err(kd, 0, "Invalid address (%lx)", va); return 0; } @@ -253,16 +252,15 @@ invalid: * not just those for a kernel crash dump. Some architectures * have to deal with these NOT being constants! (i.e. m68k) */ +#ifdef FBSD_NOT_YET int -_kvm_mdopen(kd) - kvm_t *kd; +_kvm_mdopen(kvm_t *kd) { -#ifdef FBSD_NOT_YET kd->usrstack = USRSTACK; kd->min_uva = VM_MIN_ADDRESS; kd->max_uva = VM_MAXUSER_ADDRESS; -#endif return (0); } +#endif Modified: projects/binutils-2.17/lib/libkvm/kvm_cptime.c ============================================================================== --- projects/binutils-2.17/lib/libkvm/kvm_cptime.c Mon Jan 24 20:07:14 2011 (r217801) +++ projects/binutils-2.17/lib/libkvm/kvm_cptime.c Mon Jan 24 20:59:23 2011 (r217802) @@ -44,8 +44,8 @@ __FBSDID("$FreeBSD$"); #include "kvm_private.h" static struct nlist kvm_cp_time_nl[] = { - { "_cp_time" }, /* (deprecated) */ - { NULL }, + { .n_name = "_cp_time" }, /* (deprecated) */ + { .n_name = NULL }, }; #define NL_CP_TIME 0 @@ -59,6 +59,7 @@ _kvm_cp_time_init(kvm_t *kd) if (kvm_nlist(kd, kvm_cp_time_nl) < 0) return (-1); kvm_cp_time_cached = 1; + return (0); } static int Modified: projects/binutils-2.17/lib/libkvm/kvm_file.c ============================================================================== --- projects/binutils-2.17/lib/libkvm/kvm_file.c Mon Jan 24 20:07:14 2011 (r217801) +++ projects/binutils-2.17/lib/libkvm/kvm_file.c Mon Jan 24 20:59:23 2011 (r217802) @@ -69,16 +69,14 @@ static char sccsid[] = "@(#)kvm_file.c 8 (kvm_read(kd, addr, obj, sizeof(*obj)) != sizeof(*obj)) #define KREADN(kd, addr, obj, cnt) \ - (kvm_read(kd, addr, obj, (cnt)) != (cnt)) + (kvm_read(kd, addr, obj, (cnt)) != (ssize_t)(cnt)) /* * Get file structures. */ static int -kvm_deadfiles(kd, op, arg, allproc_o, nprocs) - kvm_t *kd; - int op, arg, nprocs; - long allproc_o; +kvm_deadfiles(kvm_t *kd, int op __unused, int arg __unused, long allproc_o, + int nprocs __unused) { struct proc proc; struct filedesc filed; @@ -88,7 +86,7 @@ kvm_deadfiles(kd, op, arg, allproc_o, np struct proc *p; char *where = kd->argspc; - if (buflen < sizeof (struct file *) + sizeof (struct file)) + if (buflen < (int)(sizeof(struct file *) + sizeof(struct file))) return (0); if (KREAD(kd, allproc_o, &p)) { _kvm_err(kd, kd->program, "cannot read allproc"); @@ -96,7 +94,7 @@ kvm_deadfiles(kd, op, arg, allproc_o, np } for (; p != NULL; p = LIST_NEXT(&proc, p_list)) { if (KREAD(kd, (u_long)p, &proc)) { - _kvm_err(kd, kd->program, "can't read proc at %x", p); + _kvm_err(kd, kd->program, "can't read proc at %p", p); goto fail; } if (proc.p_state == PRS_NEW) @@ -104,7 +102,7 @@ kvm_deadfiles(kd, op, arg, allproc_o, np if (proc.p_fd == NULL) continue; if (KREAD(kd, (u_long)p->p_fd, &filed)) { - _kvm_err(kd, kd->program, "can't read filedesc at %x", + _kvm_err(kd, kd->program, "can't read filedesc at %p", p->p_fd); goto fail; } @@ -118,7 +116,7 @@ kvm_deadfiles(kd, op, arg, allproc_o, np } if (KREADN(kd, (u_long)filed.fd_ofiles, ofiles, ocnt * sizeof(struct file *))) { - _kvm_err(kd, kd->program, "can't read ofiles at %x", + _kvm_err(kd, kd->program, "can't read ofiles at %p", filed.fd_ofiles); return (0); } @@ -135,7 +133,7 @@ kvm_deadfiles(kd, op, arg, allproc_o, np where += sizeof (fp); once = 1; } - if (buflen < sizeof (struct file)) + if (buflen < (int)sizeof(struct file)) goto fail; if (KREAD(kd, (long)fp, ((struct file *)where))) { _kvm_err(kd, kd->program, "can't read kfp"); @@ -156,10 +154,7 @@ fail: } char * -kvm_getfiles(kd, op, arg, cnt) - kvm_t *kd; - int op, arg; - int *cnt; +kvm_getfiles(kvm_t *kd, int op, int arg, int *cnt) { int mib[2], st, n, nfiles, nprocs; size_t size; @@ -177,7 +172,7 @@ kvm_getfiles(kd, op, arg, cnt) } if (kd->argspc == 0) kd->argspc = (char *)_kvm_malloc(kd, size); - else if (kd->arglen < size) + else if (kd->arglen < (int)size) kd->argspc = (char *)_kvm_realloc(kd, kd->argspc, size); if (kd->argspc == 0) return (0); @@ -214,7 +209,7 @@ kvm_getfiles(kd, op, arg, cnt) size = sizeof(void *) + (nfiles + 10) * sizeof(struct file); if (kd->argspc == 0) kd->argspc = (char *)_kvm_malloc(kd, size); - else if (kd->arglen < size) + else if (kd->arglen < (int)size) kd->argspc = (char *)_kvm_realloc(kd, kd->argspc, size); if (kd->argspc == 0) return (0); Modified: projects/binutils-2.17/lib/libkvm/kvm_getloadavg.c ============================================================================== --- projects/binutils-2.17/lib/libkvm/kvm_getloadavg.c Mon Jan 24 20:07:14 2011 (r217801) +++ projects/binutils-2.17/lib/libkvm/kvm_getloadavg.c Mon Jan 24 20:59:23 2011 (r217802) @@ -48,11 +48,11 @@ static char sccsid[] = "@(#)kvm_getloada #include "kvm_private.h" static struct nlist nl[] = { - { "_averunnable" }, + { .n_name = "_averunnable" }, #define X_AVERUNNABLE 0 - { "_fscale" }, + { .n_name = "_fscale" }, #define X_FSCALE 1 - { "" }, + { .n_name = "" }, }; /* @@ -62,10 +62,7 @@ static struct nlist nl[] = { * Return number of samples retrieved, or -1 on error. */ int -kvm_getloadavg(kd, loadavg, nelem) - kvm_t *kd; - double loadavg[]; - int nelem; +kvm_getloadavg(kvm_t *kd, double loadavg[], int nelem) { struct loadavg loadinfo; struct nlist *p; @@ -95,7 +92,7 @@ kvm_getloadavg(kd, loadavg, nelem) if (!KREAD(kd, nl[X_FSCALE].n_value, &fscale)) loadinfo.fscale = fscale; - nelem = MIN(nelem, sizeof(loadinfo.ldavg) / sizeof(fixpt_t)); + nelem = MIN(nelem, (int)(sizeof(loadinfo.ldavg) / sizeof(fixpt_t))); for (i = 0; i < nelem; i++) loadavg[i] = (double) loadinfo.ldavg[i] / loadinfo.fscale; return (nelem); Modified: projects/binutils-2.17/lib/libkvm/kvm_getswapinfo.c ============================================================================== --- projects/binutils-2.17/lib/libkvm/kvm_getswapinfo.c Mon Jan 24 20:07:14 2011 (r217801) +++ projects/binutils-2.17/lib/libkvm/kvm_getswapinfo.c Mon Jan 24 20:59:23 2011 (r217802) @@ -51,9 +51,9 @@ __FBSDID("$FreeBSD$"); #include "kvm_private.h" static struct nlist kvm_swap_nl[] = { - { "_swtailq" }, /* list of swap devices and sizes */ - { "_dmmax" }, /* maximum size of a swap block */ - { NULL } + { .n_name = "_swtailq" }, /* list of swap devices and sizes */ + { .n_name = "_dmmax" }, /* maximum size of a swap block */ + { .n_name = NULL } }; #define NL_SWTAILQ 0 @@ -66,7 +66,7 @@ static int dmmax; static int kvm_getswapinfo_kvm(kvm_t *, struct kvm_swap *, int, int); static int kvm_getswapinfo_sysctl(kvm_t *, struct kvm_swap *, int, int); static int nlist_init(kvm_t *); -static int getsysctl(kvm_t *, char *, void *, size_t); +static int getsysctl(kvm_t *, const char *, void *, size_t); #define KREAD(kd, addr, obj) \ (kvm_read(kd, addr, (char *)(obj), sizeof(*obj)) != sizeof(*obj)) @@ -90,12 +90,8 @@ static int getsysctl(kvm_t *, char *, v } int -kvm_getswapinfo( - kvm_t *kd, - struct kvm_swap *swap_ary, - int swap_max, - int flags -) { +kvm_getswapinfo(kvm_t *kd, struct kvm_swap *swap_ary, int swap_max, int flags) +{ /* * clear cache @@ -113,12 +109,9 @@ kvm_getswapinfo( } int -kvm_getswapinfo_kvm( - kvm_t *kd, - struct kvm_swap *swap_ary, - int swap_max, - int flags -) { +kvm_getswapinfo_kvm(kvm_t *kd, struct kvm_swap *swap_ary, int swap_max, + int flags) +{ int i, ttl; TAILQ_HEAD(, swdevt) swtailq; struct swdevt *sp, swinfo; @@ -161,12 +154,9 @@ kvm_getswapinfo_kvm( #define SWI_MAXMIB 3 int -kvm_getswapinfo_sysctl( - kvm_t *kd, - struct kvm_swap *swap_ary, - int swap_max, - int flags -) { +kvm_getswapinfo_sysctl(kvm_t *kd, struct kvm_swap *swap_ary, int swap_max, + int flags) +{ int ti, ttl; size_t mibi, len; int soid[SWI_MAXMIB]; @@ -229,8 +219,6 @@ kvm_getswapinfo_sysctl( static int nlist_init(kvm_t *kd) { - TAILQ_HEAD(, swdevt) swtailq; - struct swdevt *sp, swinfo; if (kvm_swap_nl_cached) return (1); @@ -257,12 +245,8 @@ nlist_init(kvm_t *kd) } static int -getsysctl ( - kvm_t *kd, - char *name, - void *ptr, - size_t len -) { +getsysctl(kvm_t *kd, const char *name, void *ptr, size_t len) +{ size_t nlen = len; if (sysctlbyname(name, ptr, &nlen, NULL, 0) == -1) { _kvm_err(kd, kd->program, "cannot read sysctl %s:%s", name, Modified: projects/binutils-2.17/lib/libkvm/kvm_i386.c ============================================================================== --- projects/binutils-2.17/lib/libkvm/kvm_i386.c Mon Jan 24 20:07:14 2011 (r217801) +++ projects/binutils-2.17/lib/libkvm/kvm_i386.c Mon Jan 24 20:59:23 2011 (r217802) @@ -153,7 +153,7 @@ _kvm_freevtop(kvm_t *kd) int _kvm_initvtop(kvm_t *kd) { - struct nlist nlist[2]; + struct nlist nl[2]; u_long pa; u_long kernbase; char *PTD; @@ -183,21 +183,21 @@ _kvm_initvtop(kvm_t *kd) return (-1); } - nlist[0].n_name = "kernbase"; - nlist[1].n_name = 0; + nl[0].n_name = "kernbase"; + nl[1].n_name = 0; - if (kvm_nlist(kd, nlist) != 0) + if (kvm_nlist(kd, nl) != 0) kernbase = KERNBASE; /* for old kernels */ else - kernbase = nlist[0].n_value; + kernbase = nl[0].n_value; - nlist[0].n_name = "IdlePDPT"; - nlist[1].n_name = 0; + nl[0].n_name = "IdlePDPT"; + nl[1].n_name = 0; - if (kvm_nlist(kd, nlist) == 0) { + if (kvm_nlist(kd, nl) == 0) { uint64_t pa64; - if (kvm_read(kd, (nlist[0].n_value - kernbase), &pa, + if (kvm_read(kd, (nl[0].n_value - kernbase), &pa, sizeof(pa)) != sizeof(pa)) { _kvm_err(kd, kd->program, "cannot read IdlePDPT"); return (-1); @@ -220,14 +220,14 @@ _kvm_initvtop(kvm_t *kd) kd->vmst->PTD = PTD; kd->vmst->pae = 1; } else { - nlist[0].n_name = "IdlePTD"; - nlist[1].n_name = 0; + nl[0].n_name = "IdlePTD"; + nl[1].n_name = 0; - if (kvm_nlist(kd, nlist) != 0) { + if (kvm_nlist(kd, nl) != 0) { _kvm_err(kd, kd->program, "bad namelist"); return (-1); } - if (kvm_read(kd, (nlist[0].n_value - kernbase), &pa, + if (kvm_read(kd, (nl[0].n_value - kernbase), &pa, sizeof(pa)) != sizeof(pa)) { _kvm_err(kd, kd->program, "cannot read IdlePTD"); return (-1); Modified: projects/binutils-2.17/lib/libkvm/kvm_ia64.c ============================================================================== --- projects/binutils-2.17/lib/libkvm/kvm_ia64.c Mon Jan 24 20:07:14 2011 (r217801) +++ projects/binutils-2.17/lib/libkvm/kvm_ia64.c Mon Jan 24 20:59:23 2011 (r217802) @@ -32,6 +32,7 @@ #include #include +#include #include #include @@ -123,7 +124,7 @@ _kvm_freevtop(kvm_t *kd) int _kvm_initvtop(kvm_t *kd) { - struct nlist nlist[2]; + struct nlist nl[2]; uint64_t va; Elf64_Ehdr *ehdr; size_t hdrsz; @@ -150,15 +151,15 @@ _kvm_initvtop(kvm_t *kd) * addresses/values. */ - nlist[0].n_name = "ia64_kptdir"; - nlist[1].n_name = 0; + nl[0].n_name = "ia64_kptdir"; + nl[1].n_name = 0; - if (kvm_nlist(kd, nlist) != 0) { + if (kvm_nlist(kd, nl) != 0) { _kvm_err(kd, kd->program, "bad namelist"); return (-1); } - if (kvm_read(kd, (nlist[0].n_value), &va, sizeof(va)) != sizeof(va)) { + if (kvm_read(kd, (nl[0].n_value), &va, sizeof(va)) != sizeof(va)) { _kvm_err(kd, kd->program, "cannot read kptdir"); return (-1); } Modified: projects/binutils-2.17/lib/libkvm/kvm_minidump_amd64.c ============================================================================== --- projects/binutils-2.17/lib/libkvm/kvm_minidump_amd64.c Mon Jan 24 20:07:14 2011 (r217801) +++ projects/binutils-2.17/lib/libkvm/kvm_minidump_amd64.c Mon Jan 24 20:59:23 2011 (r217802) @@ -136,7 +136,6 @@ _kvm_minidump_freevtop(kvm_t *kd) int _kvm_minidump_initvtop(kvm_t *kd) { - u_long pa; struct vmstate *vmst; off_t off; @@ -207,7 +206,6 @@ _kvm_minidump_vatop_v1(kvm_t *kd, u_long u_long offset; pt_entry_t pte; u_long pteindex; - int i; u_long a; off_t ofs; @@ -258,7 +256,6 @@ _kvm_minidump_vatop(kvm_t *kd, u_long va pd_entry_t pte; u_long pteindex; u_long pdeindex; - int i; u_long a; off_t ofs; Modified: projects/binutils-2.17/lib/libkvm/kvm_minidump_arm.c ============================================================================== --- projects/binutils-2.17/lib/libkvm/kvm_minidump_arm.c Mon Jan 24 20:07:14 2011 (r217801) +++ projects/binutils-2.17/lib/libkvm/kvm_minidump_arm.c Mon Jan 24 20:59:23 2011 (r217802) @@ -138,7 +138,6 @@ _kvm_minidump_freevtop(kvm_t *kd) int _kvm_minidump_initvtop(kvm_t *kd) { - u_long pa; struct vmstate *vmst; off_t off; @@ -179,7 +178,7 @@ _kvm_minidump_initvtop(kvm_t *kd) } if (pread(kd->pmfd, vmst->bitmap, vmst->hdr.bitmapsize, off) != - vmst->hdr.bitmapsize) { + (ssize_t)vmst->hdr.bitmapsize) { _kvm_err(kd, kd->program, "cannot read %d bytes for page bitmap", vmst->hdr.bitmapsize); return (-1); @@ -194,7 +193,7 @@ _kvm_minidump_initvtop(kvm_t *kd) } *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-projects@FreeBSD.ORG Tue Jan 25 14:45:57 2011 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 636D2106566C; Tue, 25 Jan 2011 14:45:57 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 522468FC1A; Tue, 25 Jan 2011 14:45:57 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0PEjvbU037682; Tue, 25 Jan 2011 14:45:57 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0PEjvHQ037679; Tue, 25 Jan 2011 14:45:57 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201101251445.p0PEjvHQ037679@svn.freebsd.org> From: Nathan Whitehorn Date: Tue, 25 Jan 2011 14:45:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217825 - in projects/binutils-2.17/sys/boot/powerpc: boot1.chrp ofw X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Jan 2011 14:45:57 -0000 Author: nwhitehorn Date: Tue Jan 25 14:45:56 2011 New Revision: 217825 URL: http://svn.freebsd.org/changeset/base/217825 Log: binutils 2.17 does not align the stack object to a 16-byte boundary anymore. Make this happen explicitly. Modified: projects/binutils-2.17/sys/boot/powerpc/boot1.chrp/boot1.c projects/binutils-2.17/sys/boot/powerpc/ofw/start.c Modified: projects/binutils-2.17/sys/boot/powerpc/boot1.chrp/boot1.c ============================================================================== --- projects/binutils-2.17/sys/boot/powerpc/boot1.chrp/boot1.c Tue Jan 25 14:04:02 2011 (r217824) +++ projects/binutils-2.17/sys/boot/powerpc/boot1.chrp/boot1.c Tue Jan 25 14:45:56 2011 (r217825) @@ -103,6 +103,7 @@ ofwh_t stdinh, stdouth; __asm(" \n\ .data \n\ + .align 4 \n\ stack: \n\ .space 16384 \n\ \n\ Modified: projects/binutils-2.17/sys/boot/powerpc/ofw/start.c ============================================================================== --- projects/binutils-2.17/sys/boot/powerpc/ofw/start.c Tue Jan 25 14:04:02 2011 (r217824) +++ projects/binutils-2.17/sys/boot/powerpc/ofw/start.c Tue Jan 25 14:45:56 2011 (r217825) @@ -40,6 +40,7 @@ void startup(void *, int, int (*)(void * __asm(" \n\ .data \n\ + .align 4 \n\ stack: \n\ .space 16388 \n\ \n\ From owner-svn-src-projects@FreeBSD.ORG Tue Jan 25 15:18:11 2011 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 286E7106564A; Tue, 25 Jan 2011 15:18:11 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0BE9F8FC16; Tue, 25 Jan 2011 15:18:11 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0PFIALt038685; Tue, 25 Jan 2011 15:18:10 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0PFIATq038681; Tue, 25 Jan 2011 15:18:10 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201101251518.p0PFIATq038681@svn.freebsd.org> From: Alexander Motin Date: Tue, 25 Jan 2011 15:18:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217827 - projects/graid/head/sys/geom X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Jan 2011 15:18:11 -0000 Author: mav Date: Tue Jan 25 15:18:10 2011 New Revision: 217827 URL: http://svn.freebsd.org/changeset/base/217827 Log: Change BIO_GETATTR("GEOM::kerneldump") API to make set_dumper() called by consumer (geom_dev) instead of provider (geom_disk). This allows any geom insert it's code into the dump call chain, implementing more sophisticated functionality then just disk partitioning. Modified: projects/graid/head/sys/geom/geom.h projects/graid/head/sys/geom/geom_dev.c projects/graid/head/sys/geom/geom_disk.c Modified: projects/graid/head/sys/geom/geom.h ============================================================================== --- projects/graid/head/sys/geom/geom.h Tue Jan 25 15:06:50 2011 (r217826) +++ projects/graid/head/sys/geom/geom.h Tue Jan 25 15:18:10 2011 (r217827) @@ -43,6 +43,7 @@ #include #include #include +#include #include #include @@ -303,6 +304,7 @@ extern struct sx topology_lock; struct g_kerneldump { off_t offset; off_t length; + struct dumperinfo di; }; MALLOC_DECLARE(M_GEOM); Modified: projects/graid/head/sys/geom/geom_dev.c ============================================================================== --- projects/graid/head/sys/geom/geom_dev.c Tue Jan 25 15:06:50 2011 (r217826) +++ projects/graid/head/sys/geom/geom_dev.c Tue Jan 25 15:18:10 2011 (r217827) @@ -289,8 +289,11 @@ g_dev_ioctl(struct cdev *dev, u_long cmd kd.length = OFF_MAX; i = sizeof kd; error = g_io_getattr("GEOM::kerneldump", cp, &i, &kd); - if (!error) - dev->si_flags |= SI_DUMPDEV; + if (!error) { + error = set_dumper(&kd.di); + if (!error) + dev->si_flags |= SI_DUMPDEV; + } break; case DIOCGFLUSH: error = g_io_flush(cp); Modified: projects/graid/head/sys/geom/geom_disk.c ============================================================================== --- projects/graid/head/sys/geom/geom_disk.c Tue Jan 25 15:06:50 2011 (r217826) +++ projects/graid/head/sys/geom/geom_disk.c Tue Jan 25 15:18:10 2011 (r217827) @@ -43,7 +43,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include #include @@ -164,9 +163,7 @@ g_disk_access(struct g_provider *pp, int static void g_disk_kerneldump(struct bio *bp, struct disk *dp) { - int error; struct g_kerneldump *gkd; - struct dumperinfo di; struct g_geom *gp; gkd = (struct g_kerneldump*)bp->bio_data; @@ -177,16 +174,15 @@ g_disk_kerneldump(struct bio *bp, struct g_io_deliver(bp, ENODEV); return; } - di.dumper = dp->d_dump; - di.priv = dp; - di.blocksize = dp->d_sectorsize; - di.maxiosize = dp->d_maxsize; - di.mediaoffset = gkd->offset; + gkd->di.dumper = dp->d_dump; + gkd->di.priv = dp; + gkd->di.blocksize = dp->d_sectorsize; + gkd->di.maxiosize = dp->d_maxsize; + gkd->di.mediaoffset = gkd->offset; if ((gkd->offset + gkd->length) > dp->d_mediasize) gkd->length = dp->d_mediasize - gkd->offset; - di.mediasize = gkd->length; - error = set_dumper(&di); - g_io_deliver(bp, error); + gkd->di.mediasize = gkd->length; + g_io_deliver(bp, 0); } static void From owner-svn-src-projects@FreeBSD.ORG Tue Jan 25 15:34:07 2011 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B976C1065670; Tue, 25 Jan 2011 15:34:07 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A7BEC8FC1A; Tue, 25 Jan 2011 15:34:07 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0PFY7Yn039186; Tue, 25 Jan 2011 15:34:07 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0PFY7cF039182; Tue, 25 Jan 2011 15:34:07 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201101251534.p0PFY7cF039182@svn.freebsd.org> From: Alexander Motin Date: Tue, 25 Jan 2011 15:34:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217828 - projects/graid/head/sys/geom/raid X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Jan 2011 15:34:07 -0000 Author: mav Date: Tue Jan 25 15:34:07 2011 New Revision: 217828 URL: http://svn.freebsd.org/changeset/base/217828 Log: Implement kernel dumping to geom_raid volumes. Dumping mechanism supports any RAID levels without any additional magic. Dumping to RAID0 and RAID1 verified to work right now. Modified: projects/graid/head/sys/geom/raid/g_raid.c projects/graid/head/sys/geom/raid/g_raid.h projects/graid/head/sys/geom/raid/md_intel.c Modified: projects/graid/head/sys/geom/raid/g_raid.c ============================================================================== --- projects/graid/head/sys/geom/raid/g_raid.c Tue Jan 25 15:18:10 2011 (r217827) +++ projects/graid/head/sys/geom/raid/g_raid.c Tue Jan 25 15:34:07 2011 (r217828) @@ -116,8 +116,10 @@ static int g_raid_update_subdisk(struct static int g_raid_update_volume(struct g_raid_volume *vol, u_int state); static void g_raid_dumpconf(struct sbuf *sb, const char *indent, struct g_geom *gp, struct g_consumer *cp, struct g_provider *pp); +static void g_raid_start(struct bio *bp); static void g_raid_start_request(struct bio *bp); static void g_raid_disk_done(struct bio *bp); +static void g_raid_poll(struct g_raid_softc *sc); static const char * g_raid_disk_state2str(int state) @@ -714,6 +716,73 @@ g_raid_unidle(struct g_raid_volume *vol) } static void +g_raid_dumpdone(struct bio *bp) +{ + + bp->bio_flags |= BIO_DONE; +} + +static int +g_raid_dump(void *arg, + void *virtual, vm_offset_t physical, off_t offset, size_t length) +{ + struct g_raid_softc *sc; + struct g_raid_volume *vol; + struct bio *bp; + + vol = (struct g_raid_volume *)arg; + sc = vol->v_softc; + G_RAID_DEBUG(3, "Dumping at off %llu len %llu.", + (long long unsigned)offset, (long long unsigned)length); + + bp = g_alloc_bio(); + bp->bio_cmd = BIO_WRITE; + bp->bio_done = g_raid_dumpdone; + bp->bio_attribute = NULL; + bp->bio_offset = offset; + bp->bio_length = length; + bp->bio_data = virtual; + bp->bio_to = vol->v_provider; + + g_raid_start(bp); + + while (!(bp->bio_flags & BIO_DONE)) { + G_RAID_DEBUG(4, "Poll..."); + g_raid_poll(sc); + DELAY(10); + } + + G_RAID_DEBUG(3, "Dumping at off %llu len %llu done.", + (long long unsigned)offset, (long long unsigned)length); + + g_destroy_bio(bp); + return (0); +} + +static void +g_raid_kerneldump(struct g_raid_softc *sc, struct bio *bp) +{ + struct g_kerneldump *gkd; + struct g_provider *pp; + struct g_raid_volume *vol; + + gkd = (struct g_kerneldump*)bp->bio_data; + pp = bp->bio_to; + vol = pp->private; + g_trace(G_T_TOPOLOGY, "g_raid_kerneldump(%s, %jd, %jd)", + pp->name, (intmax_t)gkd->offset, (intmax_t)gkd->length); + gkd->di.dumper = g_raid_dump; + gkd->di.priv = vol; + gkd->di.blocksize = vol->v_sectorsize; + gkd->di.maxiosize = DFLTPHYS; + gkd->di.mediaoffset = gkd->offset; + if ((gkd->offset + gkd->length) > vol->v_mediasize) + gkd->length = vol->v_mediasize - gkd->offset; + gkd->di.mediasize = gkd->length; + g_io_deliver(bp, 0); +} + +static void g_raid_start(struct bio *bp) { struct g_raid_softc *sc; @@ -736,6 +805,12 @@ g_raid_start(struct bio *bp) case BIO_FLUSH: g_io_deliver(bp, EOPNOTSUPP); return; + case BIO_GETATTR: + if (!strcmp(bp->bio_attribute, "GEOM::kerneldump")) + g_raid_kerneldump(sc, bp); + else + g_io_deliver(bp, EOPNOTSUPP); + return; default: g_io_deliver(bp, EOPNOTSUPP); return; @@ -743,8 +818,10 @@ g_raid_start(struct bio *bp) mtx_lock(&sc->sc_queue_mtx); bioq_disksort(&sc->sc_queue, bp); mtx_unlock(&sc->sc_queue_mtx); - G_RAID_DEBUG(4, "%s: Waking up %p.", __func__, sc); - wakeup(sc); + if (!dumping) { + G_RAID_DEBUG(4, "%s: Waking up %p.", __func__, sc); + wakeup(sc); + } } static int @@ -947,12 +1024,27 @@ g_raid_subdisk_iostart(struct g_raid_sub cp = sd->sd_disk->d_consumer; bp->bio_done = g_raid_disk_done; + bp->bio_from = sd->sd_disk->d_consumer; bp->bio_to = sd->sd_disk->d_consumer->provider; bp->bio_offset += sd->sd_offset; bp->bio_caller1 = sd; cp->index++; - G_RAID_LOGREQ(3, bp, "Sending request."); - g_io_request(bp, cp); + if (dumping) { + G_RAID_LOGREQ(3, bp, "Sending dumping request."); + if (sd->sd_disk->d_kd.di.dumper == NULL) { + bp->bio_error = EOPNOTSUPP; + g_raid_disk_done(bp); + return; + } + dump_write(&sd->sd_disk->d_kd.di, + bp->bio_data, 0, + sd->sd_disk->d_kd.di.mediaoffset + bp->bio_offset, + bp->bio_length); + g_raid_disk_done(bp); + } else { + G_RAID_LOGREQ(3, bp, "Sending request."); + g_io_request(bp, cp); + } } static void @@ -964,7 +1056,8 @@ g_raid_disk_done(struct bio *bp) mtx_lock(&sc->sc_queue_mtx); bioq_disksort(&sc->sc_queue, bp); mtx_unlock(&sc->sc_queue_mtx); - wakeup(sc); + if (!dumping) + wakeup(sc); } static void @@ -1068,7 +1161,8 @@ process: if (ep != NULL) g_raid_handle_event(sc, ep); if (bp != NULL) { - if (bp->bio_from->geom != sc->sc_geom) + if (bp->bio_from == NULL || + bp->bio_from->geom != sc->sc_geom) g_raid_start_request(bp); else g_raid_disk_done_request(bp); @@ -1080,6 +1174,38 @@ process: } } +static void +g_raid_poll(struct g_raid_softc *sc) +{ + struct g_raid_event *ep; + struct bio *bp; + + sx_xlock(&sc->sc_lock); + mtx_lock(&sc->sc_queue_mtx); + /* + * First take a look at events. + * This is important to handle events before any I/O requests. + */ + ep = TAILQ_FIRST(&sc->sc_events); + if (ep != NULL) { + TAILQ_REMOVE(&sc->sc_events, ep, e_next); + mtx_unlock(&sc->sc_queue_mtx); + g_raid_handle_event(sc, ep); + goto out; + } + bp = bioq_takefirst(&sc->sc_queue); + if (bp != NULL) { + mtx_unlock(&sc->sc_queue_mtx); + if (bp->bio_from == NULL || + bp->bio_from->geom != sc->sc_geom) + g_raid_start_request(bp); + else + g_raid_disk_done_request(bp); + } +out: + sx_xunlock(&sc->sc_lock); +} + #if 0 static void g_raid_update_idle(struct g_raid_softc *sc, struct g_raid_disk *disk) Modified: projects/graid/head/sys/geom/raid/g_raid.h ============================================================================== --- projects/graid/head/sys/geom/raid/g_raid.h Tue Jan 25 15:18:10 2011 (r217827) +++ projects/graid/head/sys/geom/raid/g_raid.h Tue Jan 25 15:34:07 2011 (r217828) @@ -114,6 +114,7 @@ struct g_raid_disk { struct g_raid_softc *d_softc; /* Back-pointer to softc. */ struct g_consumer *d_consumer; /* GEOM disk consumer. */ void *d_md_data; /* Disk's metadata storage. */ + struct g_kerneldump d_kd; /* Kernel dumping method/args. */ u_int d_state; /* Disk state. */ uint64_t d_flags; /* Additional flags. */ u_int d_load; /* Disk average load. */ Modified: projects/graid/head/sys/geom/raid/md_intel.c ============================================================================== --- projects/graid/head/sys/geom/raid/md_intel.c Tue Jan 25 15:18:10 2011 (r217827) +++ projects/graid/head/sys/geom/raid/md_intel.c Tue Jan 25 15:34:07 2011 (r217828) @@ -32,6 +32,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -1092,6 +1093,14 @@ search: disk->d_consumer = rcp; rcp->private = disk; + /* Read kernel dumping information. */ + disk->d_kd.offset = 0; + disk->d_kd.length = OFF_MAX; + len = sizeof(disk->d_kd); + error = g_io_getattr("GEOM::kerneldump", rcp, &len, &disk->d_kd); + if (disk->d_kd.di.dumper == NULL) + G_RAID_DEBUG(2, "Dumping not supported: %d.", error); + g_raid_md_intel_new_disk(disk); sx_xunlock(&sc->sc_lock); @@ -1267,6 +1276,15 @@ g_raid_md_ctl_intel(struct g_raid_md_obj error = -8; break; } + + /* Read kernel dumping information. */ + disk->d_kd.offset = 0; + disk->d_kd.length = OFF_MAX; + len = sizeof(disk->d_kd); + g_io_getattr("GEOM::kerneldump", cp, &len, &disk->d_kd); + if (disk->d_kd.di.dumper == NULL) + G_RAID_DEBUG(2, "Dumping not supported."); + pd->pd_disk_meta.sectors = pp->mediasize / pp->sectorsize; if (size > pp->mediasize) size = pp->mediasize; @@ -1494,6 +1512,14 @@ g_raid_md_ctl_intel(struct g_raid_md_obj disk->d_md_data = (void *)pd; cp->private = disk; + /* Read kernel dumping information. */ + disk->d_kd.offset = 0; + disk->d_kd.length = OFF_MAX; + len = sizeof(disk->d_kd); + g_io_getattr("GEOM::kerneldump", cp, &len, &disk->d_kd); + if (disk->d_kd.di.dumper == NULL) + G_RAID_DEBUG(2, "Dumping not supported."); + memcpy(&pd->pd_disk_meta.serial[0], &serial[0], INTEL_SERIAL_LEN); pd->pd_disk_meta.sectors = pp->mediasize / pp->sectorsize; From owner-svn-src-projects@FreeBSD.ORG Tue Jan 25 16:18:04 2011 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0E2861065674; Tue, 25 Jan 2011 16:18:04 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id C06BE8FC1D; Tue, 25 Jan 2011 16:18:03 +0000 (UTC) Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net [66.111.2.69]) by cyrus.watson.org (Postfix) with ESMTPSA id 4B0EA46B81; Tue, 25 Jan 2011 11:18:03 -0500 (EST) Received: from jhbbsd.localnet (smtp.hudson-trading.com [209.249.190.9]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 07FFD8A009; Tue, 25 Jan 2011 11:18:02 -0500 (EST) From: John Baldwin To: Alexander Motin Date: Tue, 25 Jan 2011 11:17:48 -0500 User-Agent: KMail/1.13.5 (FreeBSD/7.4-CBSD-20110107; KDE/4.4.5; amd64; ; ) References: <201101251534.p0PFY7cF039182@svn.freebsd.org> In-Reply-To: <201101251534.p0PFY7cF039182@svn.freebsd.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201101251117.49069.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.6 (bigwig.baldwin.cx); Tue, 25 Jan 2011 11:18:02 -0500 (EST) X-Virus-Scanned: clamav-milter 0.96.3 at bigwig.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-1.9 required=4.2 tests=BAYES_00 autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on bigwig.baldwin.cx Cc: svn-src-projects@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r217828 - projects/graid/head/sys/geom/raid X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Jan 2011 16:18:04 -0000 On Tuesday, January 25, 2011 10:34:07 am Alexander Motin wrote: > Author: mav > Date: Tue Jan 25 15:34:07 2011 > New Revision: 217828 > URL: http://svn.freebsd.org/changeset/base/217828 > > Log: > Implement kernel dumping to geom_raid volumes. Dumping mechanism supports > any RAID levels without any additional magic. Dumping to RAID0 and RAID1 > verified to work right now. > > Modified: > projects/graid/head/sys/geom/raid/g_raid.c > projects/graid/head/sys/geom/raid/g_raid.h > projects/graid/head/sys/geom/raid/md_intel.c > > Modified: projects/graid/head/sys/geom/raid/g_raid.c > ============================================================================== > --- projects/graid/head/sys/geom/raid/g_raid.c Tue Jan 25 15:18:10 2011 (r217827) > +++ projects/graid/head/sys/geom/raid/g_raid.c Tue Jan 25 15:34:07 2011 (r217828) > @@ -116,8 +116,10 @@ static int g_raid_update_subdisk(struct > static int g_raid_update_volume(struct g_raid_volume *vol, u_int state); > static void g_raid_dumpconf(struct sbuf *sb, const char *indent, > struct g_geom *gp, struct g_consumer *cp, struct g_provider *pp); > +static void g_raid_start(struct bio *bp); > static void g_raid_start_request(struct bio *bp); > static void g_raid_disk_done(struct bio *bp); > +static void g_raid_poll(struct g_raid_softc *sc); > > static const char * > g_raid_disk_state2str(int state) > @@ -714,6 +716,73 @@ g_raid_unidle(struct g_raid_volume *vol) > } > > static void > +g_raid_dumpdone(struct bio *bp) > +{ > + > + bp->bio_flags |= BIO_DONE; > +} > + > +static int > +g_raid_dump(void *arg, > + void *virtual, vm_offset_t physical, off_t offset, size_t length) > +{ > + struct g_raid_softc *sc; > + struct g_raid_volume *vol; > + struct bio *bp; > + > + vol = (struct g_raid_volume *)arg; > + sc = vol->v_softc; > + G_RAID_DEBUG(3, "Dumping at off %llu len %llu.", > + (long long unsigned)offset, (long long unsigned)length); > + > + bp = g_alloc_bio(); > + bp->bio_cmd = BIO_WRITE; > + bp->bio_done = g_raid_dumpdone; > + bp->bio_attribute = NULL; > + bp->bio_offset = offset; > + bp->bio_length = length; > + bp->bio_data = virtual; > + bp->bio_to = vol->v_provider; > + > + g_raid_start(bp); > + > + while (!(bp->bio_flags & BIO_DONE)) { > + G_RAID_DEBUG(4, "Poll..."); > + g_raid_poll(sc); > + DELAY(10); > + } > + > + G_RAID_DEBUG(3, "Dumping at off %llu len %llu done.", > + (long long unsigned)offset, (long long unsigned)length); > + > + g_destroy_bio(bp); > + return (0); > +} Hmm, so this allocates bio's to make the dump work. I believer other dump routines in other drivers do not do this, but instead use pre-allocated commands to schedule dump I/O requests. Would it be possible to pre-allocate the bio that is used here when dumping is enabled and reuse it for each g_raid_dump() call without free'ing it when the I/O is finished? -- John Baldwin From owner-svn-src-projects@FreeBSD.ORG Tue Jan 25 16:43:42 2011 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 230371065674; Tue, 25 Jan 2011 16:43:42 +0000 (UTC) (envelope-from mavbsd@gmail.com) Received: from mail-ey0-f182.google.com (mail-ey0-f182.google.com [209.85.215.182]) by mx1.freebsd.org (Postfix) with ESMTP id 528E48FC18; Tue, 25 Jan 2011 16:43:40 +0000 (UTC) Received: by eyf6 with SMTP id 6so2769033eyf.13 for ; Tue, 25 Jan 2011 08:43:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:sender:message-id:date:from:user-agent :mime-version:to:cc:subject:references:in-reply-to:content-type :content-transfer-encoding; bh=euKkFpISSOitsT8P86gmdtgOLuDoKzSX2EozIDqONw8=; b=OeEs4cdoA2R0zWaPxSUwVkP1nGMQNjr3onioOeF7CBiMgGFeG81sWSyg9kzzJAF2Yt BYtUiaZKprF6tzt+xp1j/jNfpeSvBwuKYEJp6dS9Me8Okw/CJ3KiUF7blRTztvepY9q8 CyLhDo1RIFO+pp2rURXldcaQdGkujIqzlqXYE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; b=fsYBdqBOee0G1mC3i8Cmg/Jl4kNxRTH+yTQ2hXZNSiDMUsQXlUuWYAX7wCcXMKSOYO +l3HucVC3XhgMEQJs3eNQHusougNoOpfKJbmHJ2j73Nc83vb+W2pafCybjuVqKrJr6DQ WeH7rGUv3Gr7gaj3JWyP/I3eyOAbtUoPmy8+Q= Received: by 10.204.118.3 with SMTP id t3mr5326048bkq.87.1295973194307; Tue, 25 Jan 2011 08:33:14 -0800 (PST) Received: from mavbook.mavhome.dp.ua (pc.mavhome.dp.ua [212.86.226.226]) by mx.google.com with ESMTPS id x38sm6947169bkj.13.2011.01.25.08.33.11 (version=SSLv3 cipher=RC4-MD5); Tue, 25 Jan 2011 08:33:12 -0800 (PST) Sender: Alexander Motin Message-ID: <4D3EFB3F.8020508@FreeBSD.org> Date: Tue, 25 Jan 2011 18:33:03 +0200 From: Alexander Motin User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.2.12) Gecko/20101104 Thunderbird/3.1.6 MIME-Version: 1.0 To: John Baldwin References: <201101251534.p0PFY7cF039182@svn.freebsd.org> <201101251117.49069.jhb@freebsd.org> In-Reply-To: <201101251117.49069.jhb@freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-projects@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r217828 - projects/graid/head/sys/geom/raid X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Jan 2011 16:43:42 -0000 On 25.01.2011 18:17, John Baldwin wrote: > On Tuesday, January 25, 2011 10:34:07 am Alexander Motin wrote: >> Author: mav >> Date: Tue Jan 25 15:34:07 2011 >> New Revision: 217828 >> URL: http://svn.freebsd.org/changeset/base/217828 >> >> Log: >> Implement kernel dumping to geom_raid volumes. Dumping mechanism supports >> any RAID levels without any additional magic. Dumping to RAID0 and RAID1 >> verified to work right now. >> >> Modified: >> projects/graid/head/sys/geom/raid/g_raid.c >> projects/graid/head/sys/geom/raid/g_raid.h >> projects/graid/head/sys/geom/raid/md_intel.c >> >> Modified: projects/graid/head/sys/geom/raid/g_raid.c >> > ============================================================================== >> --- projects/graid/head/sys/geom/raid/g_raid.c Tue Jan 25 15:18:10 2011 > (r217827) >> +++ projects/graid/head/sys/geom/raid/g_raid.c Tue Jan 25 15:34:07 2011 > (r217828) >> +static int >> +g_raid_dump(void *arg, >> + void *virtual, vm_offset_t physical, off_t offset, size_t length) >> +{ >> + struct g_raid_softc *sc; >> + struct g_raid_volume *vol; >> + struct bio *bp; >> + >> + vol = (struct g_raid_volume *)arg; >> + sc = vol->v_softc; >> + G_RAID_DEBUG(3, "Dumping at off %llu len %llu.", >> + (long long unsigned)offset, (long long unsigned)length); >> + >> + bp = g_alloc_bio(); >> + bp->bio_cmd = BIO_WRITE; >> + bp->bio_done = g_raid_dumpdone; >> + bp->bio_attribute = NULL; >> + bp->bio_offset = offset; >> + bp->bio_length = length; >> + bp->bio_data = virtual; >> + bp->bio_to = vol->v_provider; >> + >> + g_raid_start(bp); >> + >> + while (!(bp->bio_flags& BIO_DONE)) { >> + G_RAID_DEBUG(4, "Poll..."); >> + g_raid_poll(sc); >> + DELAY(10); >> + } >> + >> + G_RAID_DEBUG(3, "Dumping at off %llu len %llu done.", >> + (long long unsigned)offset, (long long unsigned)length); >> + >> + g_destroy_bio(bp); >> + return (0); >> +} > > Hmm, so this allocates bio's to make the dump work. I believer other dump > routines in other drivers do not do this, but instead use pre-allocated > commands to schedule dump I/O requests. Would it be possible to pre-allocate > the bio that is used here when dumping is enabled and reuse it for each > g_raid_dump() call without free'ing it when the I/O is finished? Actually I've also thought about it. It is trivial to use static variable in this particular place. But transformation modules (RAID0/RAID1/...) are also allocating some BIOs via g_clone_bio() and there it can be more difficult to fix, as several BIOs are allocated same time to fulfill original request. When testing with minidump enabled I've noticed errors about attempts to write after the dump device end. Is it unavoidable consequence of these allocations? -- Alexander Motin From owner-svn-src-projects@FreeBSD.ORG Tue Jan 25 16:56:35 2011 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3EB6E1065696 for ; Tue, 25 Jan 2011 16:56:35 +0000 (UTC) (envelope-from asmrookie@gmail.com) Received: from mail-yw0-f54.google.com (mail-yw0-f54.google.com [209.85.213.54]) by mx1.freebsd.org (Postfix) with ESMTP id EA0AC8FC2B for ; Tue, 25 Jan 2011 16:56:34 +0000 (UTC) Received: by ywp6 with SMTP id 6so1878396ywp.13 for ; Tue, 25 Jan 2011 08:56:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=gNCax8cGk6+aWtPipuBvzaAhkP0G7kginw0gRN0u9dw=; b=H9FtUjmQ8fMBdL10+2VV+Wyc4uamOlnbt8xnp0wUth4rkkTePO9Ns1c9oiE4nWmnBq ZZhwrA9e+gHBlMq6wXFuWL+5pAwEQ0bBDEgW8ulStbzGOsJaAa+9qqyvviPhRft+Ek5G 7QYz68hSJsqI4BaPYUwn219Aessc/n8ZKag1Q= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; b=h2NOUDH+k5By8mXLpAszM4P+4J48dzEyWZDaepbpXo1GSji7Q85AULavBqADp/wEBS nqfaGPqxsHUJnkv/cBtzDTn/lsgK8TIVjmNZc4HsiGohPg+YAm6bI8oEWacFZLoMh17T WetGgw/WDtxlZYYP5kR075qQq9ex/13SDYwbo= MIME-Version: 1.0 Received: by 10.90.92.13 with SMTP id p13mr49695agb.39.1295973131687; Tue, 25 Jan 2011 08:32:11 -0800 (PST) Sender: asmrookie@gmail.com Received: by 10.236.108.15 with HTTP; Tue, 25 Jan 2011 08:32:11 -0800 (PST) In-Reply-To: <201101251117.49069.jhb@freebsd.org> References: <201101251534.p0PFY7cF039182@svn.freebsd.org> <201101251117.49069.jhb@freebsd.org> Date: Tue, 25 Jan 2011 17:32:11 +0100 X-Google-Sender-Auth: QVp80f-w6XWiMcUSVgr91yw_grw Message-ID: From: Attilio Rao To: John Baldwin Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Cc: svn-src-projects@freebsd.org, Alexander Motin , src-committers@freebsd.org Subject: Re: svn commit: r217828 - projects/graid/head/sys/geom/raid X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Jan 2011 16:56:35 -0000 2011/1/25 John Baldwin : > On Tuesday, January 25, 2011 10:34:07 am Alexander Motin wrote: >> Author: mav >> Date: Tue Jan 25 15:34:07 2011 >> New Revision: 217828 >> URL: http://svn.freebsd.org/changeset/base/217828 >> >> Log: >> =C2=A0 Implement kernel dumping to geom_raid volumes. Dumping mechanism = supports >> =C2=A0 any RAID levels without any additional magic. Dumping to RAID0 an= d RAID1 >> =C2=A0 verified to work right now. >> >> Modified: >> =C2=A0 projects/graid/head/sys/geom/raid/g_raid.c >> =C2=A0 projects/graid/head/sys/geom/raid/g_raid.h >> =C2=A0 projects/graid/head/sys/geom/raid/md_intel.c >> >> Modified: projects/graid/head/sys/geom/raid/g_raid.c >> > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D >> --- projects/graid/head/sys/geom/raid/g_raid.c =C2=A0 =C2=A0 =C2=A0 =C2= =A0Tue Jan 25 15:18:10 2011 > (r217827) >> +++ projects/graid/head/sys/geom/raid/g_raid.c =C2=A0 =C2=A0 =C2=A0 =C2= =A0Tue Jan 25 15:34:07 2011 > (r217828) >> @@ -116,8 +116,10 @@ static int g_raid_update_subdisk(struct >> =C2=A0static int g_raid_update_volume(struct g_raid_volume *vol, u_int s= tate); >> =C2=A0static void g_raid_dumpconf(struct sbuf *sb, const char *indent, >> =C2=A0 =C2=A0 =C2=A0struct g_geom *gp, struct g_consumer *cp, struct g_p= rovider *pp); >> +static void g_raid_start(struct bio *bp); >> =C2=A0static void g_raid_start_request(struct bio *bp); >> =C2=A0static void g_raid_disk_done(struct bio *bp); >> +static void g_raid_poll(struct g_raid_softc *sc); >> >> =C2=A0static const char * >> =C2=A0g_raid_disk_state2str(int state) >> @@ -714,6 +716,73 @@ g_raid_unidle(struct g_raid_volume *vol) >> =C2=A0} >> >> =C2=A0static void >> +g_raid_dumpdone(struct bio *bp) >> +{ >> + >> + =C2=A0 =C2=A0 bp->bio_flags |=3D BIO_DONE; >> +} >> + >> +static int >> +g_raid_dump(void *arg, >> + =C2=A0 =C2=A0void *virtual, vm_offset_t physical, off_t offset, size_t= length) >> +{ >> + =C2=A0 =C2=A0 struct g_raid_softc *sc; >> + =C2=A0 =C2=A0 struct g_raid_volume *vol; >> + =C2=A0 =C2=A0 struct bio *bp; >> + >> + =C2=A0 =C2=A0 vol =3D (struct g_raid_volume *)arg; >> + =C2=A0 =C2=A0 sc =3D vol->v_softc; >> + =C2=A0 =C2=A0 G_RAID_DEBUG(3, "Dumping at off %llu len %llu.", >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 (long long unsigned)offset, (long long uns= igned)length); >> + >> + =C2=A0 =C2=A0 bp =3D g_alloc_bio(); >> + =C2=A0 =C2=A0 bp->bio_cmd =3D BIO_WRITE; >> + =C2=A0 =C2=A0 bp->bio_done =3D g_raid_dumpdone; >> + =C2=A0 =C2=A0 bp->bio_attribute =3D NULL; >> + =C2=A0 =C2=A0 bp->bio_offset =3D offset; >> + =C2=A0 =C2=A0 bp->bio_length =3D length; >> + =C2=A0 =C2=A0 bp->bio_data =3D virtual; >> + =C2=A0 =C2=A0 bp->bio_to =3D vol->v_provider; >> + >> + =C2=A0 =C2=A0 g_raid_start(bp); >> + >> + =C2=A0 =C2=A0 while (!(bp->bio_flags & BIO_DONE)) { >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 G_RAID_DEBUG(4, "Poll..."); >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 g_raid_poll(sc); >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 DELAY(10); >> + =C2=A0 =C2=A0 } >> + >> + =C2=A0 =C2=A0 G_RAID_DEBUG(3, "Dumping at off %llu len %llu done.", >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 (long long unsigned)offset, (long long uns= igned)length); >> + >> + =C2=A0 =C2=A0 g_destroy_bio(bp); >> + =C2=A0 =C2=A0 return (0); >> +} > > Hmm, so this allocates bio's to make the dump work. =C2=A0I believer othe= r dump > routines in other drivers do not do this, but instead use pre-allocated > commands to schedule dump I/O requests. =C2=A0Would it be possible to pre= -allocate > the bio that is used here when dumping is enabled and reuse it for each > g_raid_dump() call without free'ing it when the I/O is finished? Yes, I'd really support this as well. Having BIOs allocation in progress makes the dumping less robust than it should be (yeah, the discussion is much longer than that, but anyway...). Attilio --=20 Peace can only be achieved by understanding - A. Einstein From owner-svn-src-projects@FreeBSD.ORG Tue Jan 25 17:07:33 2011 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BE4571065674; Tue, 25 Jan 2011 17:07:33 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id 78B8D8FC08; Tue, 25 Jan 2011 17:07:33 +0000 (UTC) Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net [66.111.2.69]) by cyrus.watson.org (Postfix) with ESMTPSA id 113A946B81; Tue, 25 Jan 2011 12:07:33 -0500 (EST) Received: from jhbbsd.localnet (smtp.hudson-trading.com [209.249.190.9]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id CD94B8A009; Tue, 25 Jan 2011 12:07:31 -0500 (EST) From: John Baldwin To: Alexander Motin Date: Tue, 25 Jan 2011 12:07:13 -0500 User-Agent: KMail/1.13.5 (FreeBSD/7.4-CBSD-20110107; KDE/4.4.5; amd64; ; ) References: <201101251534.p0PFY7cF039182@svn.freebsd.org> <201101251117.49069.jhb@freebsd.org> <4D3EFB3F.8020508@FreeBSD.org> In-Reply-To: <4D3EFB3F.8020508@FreeBSD.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201101251207.13859.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.6 (bigwig.baldwin.cx); Tue, 25 Jan 2011 12:07:31 -0500 (EST) X-Virus-Scanned: clamav-milter 0.96.3 at bigwig.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-1.9 required=4.2 tests=BAYES_00 autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on bigwig.baldwin.cx Cc: svn-src-projects@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r217828 - projects/graid/head/sys/geom/raid X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Jan 2011 17:07:33 -0000 On Tuesday, January 25, 2011 11:33:03 am Alexander Motin wrote: > On 25.01.2011 18:17, John Baldwin wrote: > > On Tuesday, January 25, 2011 10:34:07 am Alexander Motin wrote: > >> Author: mav > >> Date: Tue Jan 25 15:34:07 2011 > >> New Revision: 217828 > >> URL: http://svn.freebsd.org/changeset/base/217828 > >> > >> Log: > >> Implement kernel dumping to geom_raid volumes. Dumping mechanism supports > >> any RAID levels without any additional magic. Dumping to RAID0 and RAID1 > >> verified to work right now. > >> > >> Modified: > >> projects/graid/head/sys/geom/raid/g_raid.c > >> projects/graid/head/sys/geom/raid/g_raid.h > >> projects/graid/head/sys/geom/raid/md_intel.c > >> > >> Modified: projects/graid/head/sys/geom/raid/g_raid.c > >> > > ============================================================================== > >> --- projects/graid/head/sys/geom/raid/g_raid.c Tue Jan 25 15:18:10 2011 > > (r217827) > >> +++ projects/graid/head/sys/geom/raid/g_raid.c Tue Jan 25 15:34:07 2011 > > (r217828) > >> +static int > >> +g_raid_dump(void *arg, > >> + void *virtual, vm_offset_t physical, off_t offset, size_t length) > >> +{ > >> + struct g_raid_softc *sc; > >> + struct g_raid_volume *vol; > >> + struct bio *bp; > >> + > >> + vol = (struct g_raid_volume *)arg; > >> + sc = vol->v_softc; > >> + G_RAID_DEBUG(3, "Dumping at off %llu len %llu.", > >> + (long long unsigned)offset, (long long unsigned)length); > >> + > >> + bp = g_alloc_bio(); > >> + bp->bio_cmd = BIO_WRITE; > >> + bp->bio_done = g_raid_dumpdone; > >> + bp->bio_attribute = NULL; > >> + bp->bio_offset = offset; > >> + bp->bio_length = length; > >> + bp->bio_data = virtual; > >> + bp->bio_to = vol->v_provider; > >> + > >> + g_raid_start(bp); > >> + > >> + while (!(bp->bio_flags& BIO_DONE)) { > >> + G_RAID_DEBUG(4, "Poll..."); > >> + g_raid_poll(sc); > >> + DELAY(10); > >> + } > >> + > >> + G_RAID_DEBUG(3, "Dumping at off %llu len %llu done.", > >> + (long long unsigned)offset, (long long unsigned)length); > >> + > >> + g_destroy_bio(bp); > >> + return (0); > >> +} > > > > Hmm, so this allocates bio's to make the dump work. I believer other dump > > routines in other drivers do not do this, but instead use pre-allocated > > commands to schedule dump I/O requests. Would it be possible to pre-allocate > > the bio that is used here when dumping is enabled and reuse it for each > > g_raid_dump() call without free'ing it when the I/O is finished? > > Actually I've also thought about it. It is trivial to use static > variable in this particular place. But transformation modules > (RAID0/RAID1/...) are also allocating some BIOs via g_clone_bio() and > there it can be more difficult to fix, as several BIOs are allocated > same time to fulfill original request. Hummm. That's a bit unfortunate. > When testing with minidump enabled I've noticed errors about attempts to > write after the dump device end. Is it unavoidable consequence of these > allocations? Possibly. That I can't say for certain. -- John Baldwin From owner-svn-src-projects@FreeBSD.ORG Tue Jan 25 17:45:25 2011 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B38E71065693; Tue, 25 Jan 2011 17:45:25 +0000 (UTC) (envelope-from mavbsd@gmail.com) Received: from mail-bw0-f54.google.com (mail-bw0-f54.google.com [209.85.214.54]) by mx1.freebsd.org (Postfix) with ESMTP id D41DB8FC13; Tue, 25 Jan 2011 17:45:24 +0000 (UTC) Received: by bwz12 with SMTP id 12so584503bwz.13 for ; Tue, 25 Jan 2011 09:45:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:sender:message-id:date:from:user-agent :mime-version:to:cc:subject:references:in-reply-to:content-type :content-transfer-encoding; bh=2ifOh5WsF2RqFDbNtK6+1/zlEC5I+P86llTXUM74lmc=; b=COhLH37SQYTI7uj0QhYSPT8LJ/iZXWa/kvj6HMTGrX1lQ78cCAokWgQiXn1sKRchkn ZxlYsdAre7SAA0nOdhSmAn/1HxK7CyKAMOciV1adhwHFBhflX/rdOWj/dNLF/mO/AWjb 1YtSZWlI+g7D+e4RWsF1jwWRM+uh2zUm+2Ysc= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; b=sPyp3VpoxgKyokWHcWw198vQs8ET8TYyT7bRD90zm/k+zcJKA+vCOxbMu5AJas2GEb 3/uYNu55l8QkHD7sDJiCnk+bLWHX9h5Fptj/l8YGNRBdFldTNHoa6vl5glnIhHROGwyC SxpcY58xcFCUcGGhvG0fkbiVbAETBHYr+R6CI= Received: by 10.204.76.65 with SMTP id b1mr5347596bkk.29.1295977502441; Tue, 25 Jan 2011 09:45:02 -0800 (PST) Received: from mavbook.mavhome.dp.ua (pc.mavhome.dp.ua [212.86.226.226]) by mx.google.com with ESMTPS id z18sm4768523bkf.8.2011.01.25.09.44.59 (version=SSLv3 cipher=RC4-MD5); Tue, 25 Jan 2011 09:45:00 -0800 (PST) Sender: Alexander Motin Message-ID: <4D3F0C13.6020902@FreeBSD.org> Date: Tue, 25 Jan 2011 19:44:51 +0200 From: Alexander Motin User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.2.12) Gecko/20101104 Thunderbird/3.1.6 MIME-Version: 1.0 To: John Baldwin References: <201101251534.p0PFY7cF039182@svn.freebsd.org> <201101251117.49069.jhb@freebsd.org> <4D3EFB3F.8020508@FreeBSD.org> <201101251207.13859.jhb@freebsd.org> In-Reply-To: <201101251207.13859.jhb@freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-projects@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r217828 - projects/graid/head/sys/geom/raid X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Jan 2011 17:45:25 -0000 On 25.01.2011 19:07, John Baldwin wrote: > On Tuesday, January 25, 2011 11:33:03 am Alexander Motin wrote: >> On 25.01.2011 18:17, John Baldwin wrote: >>> On Tuesday, January 25, 2011 10:34:07 am Alexander Motin wrote: >>>> Author: mav >>>> Date: Tue Jan 25 15:34:07 2011 >>>> New Revision: 217828 >>>> URL: http://svn.freebsd.org/changeset/base/217828 >>>> >>>> Log: >>>> Implement kernel dumping to geom_raid volumes. Dumping mechanism supports >>>> any RAID levels without any additional magic. Dumping to RAID0 and RAID1 >>>> verified to work right now. >>>> >>>> Modified: >>>> projects/graid/head/sys/geom/raid/g_raid.c >>>> projects/graid/head/sys/geom/raid/g_raid.h >>>> projects/graid/head/sys/geom/raid/md_intel.c >>>> >>>> Modified: projects/graid/head/sys/geom/raid/g_raid.c >>>> >>> ============================================================================== >>>> --- projects/graid/head/sys/geom/raid/g_raid.c Tue Jan 25 15:18:10 2011 >>> (r217827) >>>> +++ projects/graid/head/sys/geom/raid/g_raid.c Tue Jan 25 15:34:07 2011 >>> (r217828) >>>> +static int >>>> +g_raid_dump(void *arg, >>>> + void *virtual, vm_offset_t physical, off_t offset, size_t length) >>>> +{ >>>> + struct g_raid_softc *sc; >>>> + struct g_raid_volume *vol; >>>> + struct bio *bp; >>>> + >>>> + vol = (struct g_raid_volume *)arg; >>>> + sc = vol->v_softc; >>>> + G_RAID_DEBUG(3, "Dumping at off %llu len %llu.", >>>> + (long long unsigned)offset, (long long unsigned)length); >>>> + >>>> + bp = g_alloc_bio(); >>>> + bp->bio_cmd = BIO_WRITE; >>>> + bp->bio_done = g_raid_dumpdone; >>>> + bp->bio_attribute = NULL; >>>> + bp->bio_offset = offset; >>>> + bp->bio_length = length; >>>> + bp->bio_data = virtual; >>>> + bp->bio_to = vol->v_provider; >>>> + >>>> + g_raid_start(bp); >>>> + >>>> + while (!(bp->bio_flags& BIO_DONE)) { >>>> + G_RAID_DEBUG(4, "Poll..."); >>>> + g_raid_poll(sc); >>>> + DELAY(10); >>>> + } >>>> + >>>> + G_RAID_DEBUG(3, "Dumping at off %llu len %llu done.", >>>> + (long long unsigned)offset, (long long unsigned)length); >>>> + >>>> + g_destroy_bio(bp); >>>> + return (0); >>>> +} >>> >>> Hmm, so this allocates bio's to make the dump work. I believer other dump >>> routines in other drivers do not do this, but instead use pre-allocated >>> commands to schedule dump I/O requests. Would it be possible to pre-allocate >>> the bio that is used here when dumping is enabled and reuse it for each >>> g_raid_dump() call without free'ing it when the I/O is finished? >> >> Actually I've also thought about it. It is trivial to use static >> variable in this particular place. But transformation modules >> (RAID0/RAID1/...) are also allocating some BIOs via g_clone_bio() and >> there it can be more difficult to fix, as several BIOs are allocated >> same time to fulfill original request. > > Hummm. That's a bit unfortunate. It is hardly an excuse, but just for note, ataraid(4) does the same - on-stack allocation for the main request and uma_zalloc() for the children. I will think about possible alternatives. -- Alexander Motin From owner-svn-src-projects@FreeBSD.ORG Tue Jan 25 20:46:54 2011 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8260A106567A; Tue, 25 Jan 2011 20:46:54 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 726068FC2E; Tue, 25 Jan 2011 20:46:54 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0PKksvH049915; Tue, 25 Jan 2011 20:46:54 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0PKksqU049913; Tue, 25 Jan 2011 20:46:54 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201101252046.p0PKksqU049913@svn.freebsd.org> From: Alexander Motin Date: Tue, 25 Jan 2011 20:46:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217842 - projects/graid/head/sys/geom/raid X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Jan 2011 20:46:54 -0000 Author: mav Date: Tue Jan 25 20:46:54 2011 New Revision: 217842 URL: http://svn.freebsd.org/changeset/base/217842 Log: Allocate dumping BIO on stack, same as done in other places. Modified: projects/graid/head/sys/geom/raid/g_raid.c Modified: projects/graid/head/sys/geom/raid/g_raid.c ============================================================================== --- projects/graid/head/sys/geom/raid/g_raid.c Tue Jan 25 20:44:24 2011 (r217841) +++ projects/graid/head/sys/geom/raid/g_raid.c Tue Jan 25 20:46:54 2011 (r217842) @@ -728,25 +728,24 @@ g_raid_dump(void *arg, { struct g_raid_softc *sc; struct g_raid_volume *vol; - struct bio *bp; + struct bio bp; vol = (struct g_raid_volume *)arg; sc = vol->v_softc; G_RAID_DEBUG(3, "Dumping at off %llu len %llu.", (long long unsigned)offset, (long long unsigned)length); - bp = g_alloc_bio(); - bp->bio_cmd = BIO_WRITE; - bp->bio_done = g_raid_dumpdone; - bp->bio_attribute = NULL; - bp->bio_offset = offset; - bp->bio_length = length; - bp->bio_data = virtual; - bp->bio_to = vol->v_provider; - - g_raid_start(bp); + bzero(&bp, sizeof(bp)); + bp.bio_cmd = BIO_WRITE; + bp.bio_done = g_raid_dumpdone; + bp.bio_attribute = NULL; + bp.bio_offset = offset; + bp.bio_length = length; + bp.bio_data = virtual; + bp.bio_to = vol->v_provider; - while (!(bp->bio_flags & BIO_DONE)) { + g_raid_start(&bp); + while (!(bp.bio_flags & BIO_DONE)) { G_RAID_DEBUG(4, "Poll..."); g_raid_poll(sc); DELAY(10); @@ -754,8 +753,6 @@ g_raid_dump(void *arg, G_RAID_DEBUG(3, "Dumping at off %llu len %llu done.", (long long unsigned)offset, (long long unsigned)length); - - g_destroy_bio(bp); return (0); } From owner-svn-src-projects@FreeBSD.ORG Tue Jan 25 23:29:52 2011 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B77851065672; Tue, 25 Jan 2011 23:29:52 +0000 (UTC) (envelope-from pawel@dawidek.net) Received: from mail.garage.freebsd.pl (60.wheelsystems.com [83.12.187.60]) by mx1.freebsd.org (Postfix) with ESMTP id 258BF8FC13; Tue, 25 Jan 2011 23:29:51 +0000 (UTC) Received: by mail.garage.freebsd.pl (Postfix, from userid 65534) id 9BC1D45E5C; Wed, 26 Jan 2011 00:29:49 +0100 (CET) Received: from localhost (89-73-195-149.dynamic.chello.pl [89.73.195.149]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.garage.freebsd.pl (Postfix) with ESMTP id 317F34569A; Wed, 26 Jan 2011 00:29:44 +0100 (CET) Date: Wed, 26 Jan 2011 00:29:32 +0100 From: Pawel Jakub Dawidek To: Alexander Motin Message-ID: <20110125232932.GD2004@garage.freebsd.pl> References: <201101251534.p0PFY7cF039182@svn.freebsd.org> <201101251117.49069.jhb@freebsd.org> <4D3EFB3F.8020508@FreeBSD.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="veXX9dWIonWZEC6h" Content-Disposition: inline In-Reply-To: <4D3EFB3F.8020508@FreeBSD.org> User-Agent: Mutt/1.4.2.3i X-PGP-Key-URL: http://people.freebsd.org/~pjd/pjd.asc X-OS: FreeBSD 9.0-CURRENT amd64 X-Spam-Checker-Version: SpamAssassin 3.0.4 (2005-06-05) on mail.garage.freebsd.pl X-Spam-Level: X-Spam-Status: No, score=-0.6 required=4.5 tests=BAYES_00,RCVD_IN_SORBS_DUL autolearn=no version=3.0.4 Cc: svn-src-projects@freebsd.org, src-committers@freebsd.org, John Baldwin Subject: Re: svn commit: r217828 - projects/graid/head/sys/geom/raid X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Jan 2011 23:29:52 -0000 --veXX9dWIonWZEC6h Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Jan 25, 2011 at 06:33:03PM +0200, Alexander Motin wrote: > On 25.01.2011 18:17, John Baldwin wrote: > >Hmm, so this allocates bio's to make the dump work. I believer other du= mp > >routines in other drivers do not do this, but instead use pre-allocated > >commands to schedule dump I/O requests. Would it be possible to=20 > >pre-allocate > >the bio that is used here when dumping is enabled and reuse it for each > >g_raid_dump() call without free'ing it when the I/O is finished? >=20 > Actually I've also thought about it. It is trivial to use static=20 > variable in this particular place. But transformation modules=20 > (RAID0/RAID1/...) are also allocating some BIOs via g_clone_bio() and=20 > there it can be more difficult to fix, as several BIOs are allocated=20 > same time to fulfill original request. I don't think you will ever need more BIOs than you have consumers. If so, then you could allocate bio per consumer at consumer creation time and keep it somewhere in g_consumer->private. --=20 Pawel Jakub Dawidek http://www.wheelsystems.com pjd@FreeBSD.org http://www.FreeBSD.org FreeBSD committer Am I Evil? Yes, I Am! --veXX9dWIonWZEC6h Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.14 (FreeBSD) iEYEARECAAYFAk0/XNwACgkQForvXbEpPzRZ3gCg8VCndS192Ffzg0/6MaBKo4/t LT4AoKFdSkT5tlxtuYtqPbH/6xVU948V =MUW1 -----END PGP SIGNATURE----- --veXX9dWIonWZEC6h-- From owner-svn-src-projects@FreeBSD.ORG Wed Jan 26 09:26:27 2011 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AF550106566C; Wed, 26 Jan 2011 09:26:27 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id 8B3918FC08; Wed, 26 Jan 2011 09:26:27 +0000 (UTC) Received: from fledge.watson.org (fledge.watson.org [65.122.17.41]) by cyrus.watson.org (Postfix) with ESMTPS id 572FF46B8A; Wed, 26 Jan 2011 04:26:26 -0500 (EST) Date: Wed, 26 Jan 2011 09:26:26 +0000 (GMT) From: Robert Watson X-X-Sender: robert@fledge.watson.org To: John Baldwin In-Reply-To: <201101251117.49069.jhb@freebsd.org> Message-ID: References: <201101251534.p0PFY7cF039182@svn.freebsd.org> <201101251117.49069.jhb@freebsd.org> User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-projects@freebsd.org, Alexander Motin , src-committers@freebsd.org Subject: Re: svn commit: r217828 - projects/graid/head/sys/geom/raid X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Jan 2011 09:26:27 -0000 On Tue, 25 Jan 2011, John Baldwin wrote: > Hmm, so this allocates bio's to make the dump work. I believer other dump > routines in other drivers do not do this, but instead use pre-allocated > commands to schedule dump I/O requests. Would it be possible to > pre-allocate the bio that is used here when dumping is enabled and reuse it > for each g_raid_dump() call without free'ing it when the I/O is finished? Yeah, same concern here: memory allocation and freeing in the dump path leads to less robustness. Part of why the existing geom/dump interaction was so simplistic was to avoid exactly this problem by not needing lots of bio allocaiton/replication/etc on the way up/down the stack. Likewise, the goal was to minimise dependence on correct operation of the kernel scheduler. Some storage device drivers are poorly behaved in this regard, but introucing new dependencies in the stack just makes it harder to fix those drivers. (A similar discussion is taking place in the context of network dumping, where it's really important not to introduce further large kernel subsystem dependencies: you want debugging paths to depend on as little in the way of sensitive global data structures, locks, etc, as possible.) Robert From owner-svn-src-projects@FreeBSD.ORG Wed Jan 26 09:46:17 2011 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E762A1065670; Wed, 26 Jan 2011 09:46:16 +0000 (UTC) (envelope-from mavbsd@gmail.com) Received: from mail-bw0-f54.google.com (mail-bw0-f54.google.com [209.85.214.54]) by mx1.freebsd.org (Postfix) with ESMTP id B1AB48FC0C; Wed, 26 Jan 2011 09:46:15 +0000 (UTC) Received: by bwz12 with SMTP id 12so1227211bwz.13 for ; Wed, 26 Jan 2011 01:46:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:sender:message-id:date:from:user-agent :mime-version:to:cc:subject:references:in-reply-to :x-enigmail-version:content-type:content-transfer-encoding; bh=aEMvwXMxtuXbQ3uj+3nk569yZ21IpsaSmUGDqXLxD68=; b=neIdcGcwmQsDcK+CclOuoa19blPAlxQ2pBZ4vWVgAp8ymWcKjMuVysX/RAvMUbd25z s+B0+PzVBIrWu029z5oa/pkXkJb73FW1bbA1jp0XOxDXVVpAA4+toiXJoaOE2b1fKsne i6KjxxYd1UKnOHSCjKMLJhDxEHd2Bp3VAAcxw= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:x-enigmail-version:content-type :content-transfer-encoding; b=nh7eeKRGCfmBjEVWBSTvn7acmYUbQR+veA793nVPjgpYcxxX6SqJNKghWgRxDNxWIl q1OCtzVV9AqSBszoonBGdzaYhCrAKP9S+PhzJ/yb87uCeTt6T9+gH4dpMwH/W/ZW7/u6 iq1wIUp8mgPXd4OcoS1BkK5cn1SkHpeeZsAPs= Received: by 10.204.46.130 with SMTP id j2mr163600bkf.169.1296035174435; Wed, 26 Jan 2011 01:46:14 -0800 (PST) Received: from mavbook2.mavhome.dp.ua (pc.mavhome.dp.ua [212.86.226.226]) by mx.google.com with ESMTPS id v1sm7349349bkt.5.2011.01.26.01.46.11 (version=SSLv3 cipher=RC4-MD5); Wed, 26 Jan 2011 01:46:12 -0800 (PST) Sender: Alexander Motin Message-ID: <4D3FED31.8040304@FreeBSD.org> Date: Wed, 26 Jan 2011 11:45:21 +0200 From: Alexander Motin User-Agent: Thunderbird 2.0.0.23 (X11/20091212) MIME-Version: 1.0 To: Robert Watson References: <201101251534.p0PFY7cF039182@svn.freebsd.org> <201101251117.49069.jhb@freebsd.org> In-Reply-To: X-Enigmail-Version: 0.96.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: svn-src-projects@freebsd.org, src-committers@freebsd.org, Pawel Jakub Dawidek , John Baldwin Subject: Re: svn commit: r217828 - projects/graid/head/sys/geom/raid X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Jan 2011 09:46:17 -0000 Robert Watson wrote: > On Tue, 25 Jan 2011, John Baldwin wrote: >> Hmm, so this allocates bio's to make the dump work. I believer other >> dump routines in other drivers do not do this, but instead use >> pre-allocated commands to schedule dump I/O requests. Would it be >> possible to pre-allocate the bio that is used here when dumping is >> enabled and reuse it for each g_raid_dump() call without free'ing it >> when the I/O is finished? > > Yeah, same concern here: memory allocation and freeing in the dump path > leads to less robustness. Part of why the existing geom/dump > interaction was so simplistic was to avoid exactly this problem by not > needing lots of bio allocaiton/replication/etc on the way up/down the > stack. Likewise, the goal was to minimise dependence on correct > operation of the kernel scheduler. Some storage device drivers are > poorly behaved in this regard, but introucing new dependencies in the > stack just makes it harder to fix those drivers. > > (A similar discussion is taking place in the context of network dumping, > where it's really important not to introduce further large kernel > subsystem dependencies: you want debugging paths to depend on as little > in the way of sensitive global data structures, locks, etc, as possible.) That's all true. Those who want maximum robustness should use dedicated drive on the most trivial dedicated controller to make dumping reliable. If we are going above that - there are always some compromises. What's about dumping to GEOM, I think that with r217827 change (in projects/graid/head) it should be possible to implement robust dumping to gmirror and gstripe without doing any allocations and GEOM interaction. With some efforts it could also be done to graid by writing specialized minimalistic dumping routines for every transformation module (at least it seems trivial for RAID0/RAID1). -- Alexander Motin From owner-svn-src-projects@FreeBSD.ORG Wed Jan 26 10:20:21 2011 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 170AB106564A; Wed, 26 Jan 2011 10:20:21 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id E45008FC12; Wed, 26 Jan 2011 10:20:20 +0000 (UTC) Received: from fledge.watson.org (fledge.watson.org [65.122.17.41]) by cyrus.watson.org (Postfix) with ESMTPS id 7EA7946B09; Wed, 26 Jan 2011 05:20:20 -0500 (EST) Date: Wed, 26 Jan 2011 10:20:20 +0000 (GMT) From: Robert Watson X-X-Sender: robert@fledge.watson.org To: Alexander Motin In-Reply-To: <4D3FED31.8040304@FreeBSD.org> Message-ID: References: <201101251534.p0PFY7cF039182@svn.freebsd.org> <201101251117.49069.jhb@freebsd.org> <4D3FED31.8040304@FreeBSD.org> User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-projects@freebsd.org, src-committers@freebsd.org, Pawel Jakub Dawidek , John Baldwin Subject: Re: svn commit: r217828 - projects/graid/head/sys/geom/raid X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Jan 2011 10:20:21 -0000 On Wed, 26 Jan 2011, Alexander Motin wrote: > That's all true. Those who want maximum robustness should use dedicated > drive on the most trivial dedicated controller to make dumping reliable. If > we are going above that - there are always some compromises. This seems to be the best conclusion in the NIC space certainly -- for network debugging and crashdumps, a dedicated NIC involves far fewer compromises. However, the traditional route of resetting $controller when you realise you're past the point of no return, and then doing polled I/O to the freshly initialised device, should be pretty reliable under most circumstances. > What's about dumping to GEOM, I think that with r217827 change (in > projects/graid/head) it should be possible to implement robust dumping to > gmirror and gstripe without doing any allocations and GEOM interaction. With > some efforts it could also be done to graid by writing specialized > minimalistic dumping routines for every transformation module (at least it > seems trivial for RAID0/RAID1). Sounds good. Robert From owner-svn-src-projects@FreeBSD.ORG Wed Jan 26 13:18:26 2011 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D90F0106566B; Wed, 26 Jan 2011 13:18:26 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C76798FC12; Wed, 26 Jan 2011 13:18:26 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0QDIQsJ077848; Wed, 26 Jan 2011 13:18:26 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0QDIQAr077842; Wed, 26 Jan 2011 13:18:26 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201101261318.p0QDIQAr077842@svn.freebsd.org> From: Alexander Motin Date: Wed, 26 Jan 2011 13:18:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217884 - projects/graid/head/sys/geom/raid X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Jan 2011 13:18:27 -0000 Author: mav Date: Wed Jan 26 13:18:26 2011 New Revision: 217884 URL: http://svn.freebsd.org/changeset/base/217884 Log: Add kerneldump() method to the transformation modules API -- minimalistic shortcut for robust kernel dumps writing. When method is not implemented, previously made wrappers around regular code will try to handle the things. Implement kernel dumping for RAID0 and RAID1 transformation modules without using memory allocations, locks and other extra calls. Modified: projects/graid/head/sys/geom/raid/g_raid.c projects/graid/head/sys/geom/raid/g_raid.h projects/graid/head/sys/geom/raid/g_raid_tr_if.m projects/graid/head/sys/geom/raid/tr_raid0.c projects/graid/head/sys/geom/raid/tr_raid1.c Modified: projects/graid/head/sys/geom/raid/g_raid.c ============================================================================== --- projects/graid/head/sys/geom/raid/g_raid.c Wed Jan 26 13:10:07 2011 (r217883) +++ projects/graid/head/sys/geom/raid/g_raid.c Wed Jan 26 13:18:26 2011 (r217884) @@ -716,28 +716,26 @@ g_raid_unidle(struct g_raid_volume *vol) } static void -g_raid_dumpdone(struct bio *bp) +g_raid_tr_kerneldump_common_done(struct bio *bp) { bp->bio_flags |= BIO_DONE; } -static int -g_raid_dump(void *arg, +int +g_raid_tr_kerneldump_common(struct g_raid_tr_object *tr, void *virtual, vm_offset_t physical, off_t offset, size_t length) { struct g_raid_softc *sc; struct g_raid_volume *vol; struct bio bp; - vol = (struct g_raid_volume *)arg; + vol = tr->tro_volume; sc = vol->v_softc; - G_RAID_DEBUG(3, "Dumping at off %llu len %llu.", - (long long unsigned)offset, (long long unsigned)length); bzero(&bp, sizeof(bp)); bp.bio_cmd = BIO_WRITE; - bp.bio_done = g_raid_dumpdone; + bp.bio_done = g_raid_tr_kerneldump_common_done; bp.bio_attribute = NULL; bp.bio_offset = offset; bp.bio_length = length; @@ -751,9 +749,26 @@ g_raid_dump(void *arg, DELAY(10); } - G_RAID_DEBUG(3, "Dumping at off %llu len %llu done.", + return (bp.bio_error != 0 ? EIO : 0); +} + +static int +g_raid_dump(void *arg, + void *virtual, vm_offset_t physical, off_t offset, size_t length) +{ + struct g_raid_volume *vol; + int error; + + vol = (struct g_raid_volume *)arg; + G_RAID_DEBUG(3, "Dumping at off %llu len %llu.", (long long unsigned)offset, (long long unsigned)length); - return (0); + + error = G_RAID_TR_KERNELDUMP(vol->v_tr, + virtual, physical, offset, length); + + G_RAID_DEBUG(3, "Dumping at off %llu len %llu done: %d.", + (long long unsigned)offset, (long long unsigned)length, error); + return (error); } static void @@ -1020,30 +1035,41 @@ g_raid_subdisk_iostart(struct g_raid_sub vol->v_writes++; cp = sd->sd_disk->d_consumer; - bp->bio_done = g_raid_disk_done; bp->bio_from = sd->sd_disk->d_consumer; bp->bio_to = sd->sd_disk->d_consumer->provider; - bp->bio_offset += sd->sd_offset; bp->bio_caller1 = sd; cp->index++; if (dumping) { G_RAID_LOGREQ(3, bp, "Sending dumping request."); - if (sd->sd_disk->d_kd.di.dumper == NULL) { + if (bp->bio_cmd == BIO_WRITE) { + bp->bio_error = g_raid_subdisk_kerneldump(sd, + bp->bio_data, 0, bp->bio_offset, bp->bio_length); + } else bp->bio_error = EOPNOTSUPP; - g_raid_disk_done(bp); - return; - } - dump_write(&sd->sd_disk->d_kd.di, - bp->bio_data, 0, - sd->sd_disk->d_kd.di.mediaoffset + bp->bio_offset, - bp->bio_length); g_raid_disk_done(bp); } else { + bp->bio_done = g_raid_disk_done; + bp->bio_offset += sd->sd_offset; G_RAID_LOGREQ(3, bp, "Sending request."); g_io_request(bp, cp); } } +int +g_raid_subdisk_kerneldump(struct g_raid_subdisk *sd, + void *virtual, vm_offset_t physical, off_t offset, size_t length) +{ + + if (sd->sd_disk == NULL) + return (ENXIO); + if (sd->sd_disk->d_kd.di.dumper == NULL) + return (EOPNOTSUPP); + return (dump_write(&sd->sd_disk->d_kd.di, + virtual, physical, + sd->sd_disk->d_kd.di.mediaoffset + sd->sd_offset + offset, + length)); +} + static void g_raid_disk_done(struct bio *bp) { Modified: projects/graid/head/sys/geom/raid/g_raid.h ============================================================================== --- projects/graid/head/sys/geom/raid/g_raid.h Wed Jan 26 13:10:07 2011 (r217883) +++ projects/graid/head/sys/geom/raid/g_raid.h Wed Jan 26 13:18:26 2011 (r217884) @@ -307,6 +307,8 @@ int g_raid_destroy_disk(struct g_raid_di void g_raid_iodone(struct bio *bp, int error); void g_raid_subdisk_iostart(struct g_raid_subdisk *sd, struct bio *bp); +int g_raid_subdisk_kerneldump(struct g_raid_subdisk *sd, + void *virtual, vm_offset_t physical, off_t offset, size_t length); void g_raid_kill_consumer(struct g_raid_softc *sc, struct g_consumer *cp); @@ -319,6 +321,9 @@ void g_raid_write_metadata(struct g_raid void g_raid_fail_disk(struct g_raid_softc *sc, struct g_raid_subdisk *sd, struct g_raid_disk *disk); +int g_raid_tr_kerneldump_common(struct g_raid_tr_object *tr, + void *virtual, vm_offset_t physical, off_t offset, size_t length); + u_int g_raid_ndisks(struct g_raid_softc *sc, int state); u_int g_raid_nsubdisks(struct g_raid_volume *vol, int state); #define G_RAID_DESTROY_SOFT 0 Modified: projects/graid/head/sys/geom/raid/g_raid_tr_if.m ============================================================================== --- projects/graid/head/sys/geom/raid/g_raid_tr_if.m Wed Jan 26 13:10:07 2011 (r217883) +++ projects/graid/head/sys/geom/raid/g_raid_tr_if.m Wed Jan 26 13:18:26 2011 (r217884) @@ -91,6 +91,15 @@ METHOD void iodone { struct bio *bp; }; +# kerneldump() - optimized for rebustness (simplified) kernel dumping routine. +METHOD int kerneldump { + struct g_raid_tr_object *tr; + void *virtual; + vm_offset_t physical; + off_t offset; + size_t length; +} DEFAULT g_raid_tr_kerneldump_common; + # locked() - callback method for lock(). METHOD int locked { struct g_raid_tr_object *tr; Modified: projects/graid/head/sys/geom/raid/tr_raid0.c ============================================================================== --- projects/graid/head/sys/geom/raid/tr_raid0.c Wed Jan 26 13:10:07 2011 (r217883) +++ projects/graid/head/sys/geom/raid/tr_raid0.c Wed Jan 26 13:18:26 2011 (r217884) @@ -54,6 +54,7 @@ static g_raid_tr_start_t g_raid_tr_start static g_raid_tr_stop_t g_raid_tr_stop_raid0; static g_raid_tr_iostart_t g_raid_tr_iostart_raid0; static g_raid_tr_iodone_t g_raid_tr_iodone_raid0; +static g_raid_tr_kerneldump_t g_raid_tr_kerneldump_raid0; static g_raid_tr_free_t g_raid_tr_free_raid0; static kobj_method_t g_raid_tr_raid0_methods[] = { @@ -63,6 +64,7 @@ static kobj_method_t g_raid_tr_raid0_met KOBJMETHOD(g_raid_tr_stop, g_raid_tr_stop_raid0), KOBJMETHOD(g_raid_tr_iostart, g_raid_tr_iostart_raid0), KOBJMETHOD(g_raid_tr_iodone, g_raid_tr_iodone_raid0), + KOBJMETHOD(g_raid_tr_kerneldump, g_raid_tr_kerneldump_raid0), KOBJMETHOD(g_raid_tr_free, g_raid_tr_free_raid0), { 0, 0 } }; @@ -274,6 +276,57 @@ failure: g_raid_iodone(bp, bp->bio_error); } +int +g_raid_tr_kerneldump_raid0(struct g_raid_tr_object *tr, + void *virtual, vm_offset_t physical, off_t boffset, size_t blength) +{ + struct g_raid_softc *sc; + struct g_raid_volume *vol; + char *addr; + off_t offset, start, length, nstripe; + u_int no, strip_size; + int error; + + vol = tr->tro_volume; + if (vol->v_state != G_RAID_VOLUME_S_OPTIMAL) + return (ENXIO); + sc = vol->v_softc; + + addr = virtual; + strip_size = vol->v_strip_size; + /* Stripe number. */ + nstripe = boffset / strip_size; + /* Start position in stripe. */ + start = boffset % strip_size; + /* Disk number. */ + no = nstripe % vol->v_disks_count; + /* Start position in disk. */ + offset = (nstripe / vol->v_disks_count) * strip_size + start; + /* Length of data to operate. */ + length = MIN(blength, strip_size - start); + + error = g_raid_subdisk_kerneldump(&vol->v_subdisks[no], + addr, 0, offset, length); + if (error != 0) + return (error); + + offset -= offset % strip_size; + addr += length; + length = blength - length; + for (no++; length > 0; + no++, length -= strip_size, addr += strip_size) { + if (no > vol->v_disks_count - 1) { + no = 0; + offset += strip_size; + } + error = g_raid_subdisk_kerneldump(&vol->v_subdisks[no], + addr, 0, offset, MIN(strip_size, length)); + if (error != 0) + return (error); + } + return (0); +} + static void g_raid_tr_iodone_raid0(struct g_raid_tr_object *tr, struct g_raid_subdisk *sd,struct bio *bp) Modified: projects/graid/head/sys/geom/raid/tr_raid1.c ============================================================================== --- projects/graid/head/sys/geom/raid/tr_raid1.c Wed Jan 26 13:10:07 2011 (r217883) +++ projects/graid/head/sys/geom/raid/tr_raid1.c Wed Jan 26 13:18:26 2011 (r217884) @@ -54,6 +54,7 @@ static g_raid_tr_start_t g_raid_tr_start static g_raid_tr_stop_t g_raid_tr_stop_raid1; static g_raid_tr_iostart_t g_raid_tr_iostart_raid1; static g_raid_tr_iodone_t g_raid_tr_iodone_raid1; +static g_raid_tr_kerneldump_t g_raid_tr_kerneldump_raid1; static g_raid_tr_locked_t g_raid_tr_locked_raid1; static g_raid_tr_free_t g_raid_tr_free_raid1; @@ -64,6 +65,7 @@ static kobj_method_t g_raid_tr_raid1_met KOBJMETHOD(g_raid_tr_stop, g_raid_tr_stop_raid1), KOBJMETHOD(g_raid_tr_iostart, g_raid_tr_iostart_raid1), KOBJMETHOD(g_raid_tr_iodone, g_raid_tr_iodone_raid1), + KOBJMETHOD(g_raid_tr_kerneldump, g_raid_tr_kerneldump_raid1), KOBJMETHOD(g_raid_tr_locked, g_raid_tr_locked_raid1), KOBJMETHOD(g_raid_tr_free, g_raid_tr_free_raid1), { 0, 0 } @@ -361,6 +363,37 @@ g_raid_tr_iodone_raid1(struct g_raid_tr_ } } +int +g_raid_tr_kerneldump_raid1(struct g_raid_tr_object *tr, + void *virtual, vm_offset_t physical, off_t offset, size_t length) +{ + struct g_raid_volume *vol; + struct g_raid_subdisk *sd; + int error, i, ok; + + vol = tr->tro_volume; + error = 0; + ok = 0; + for (i = 0; i < vol->v_disks_count; i++) { + sd = &vol->v_subdisks[i]; + switch (sd->sd_state) { + case G_RAID_SUBDISK_S_ACTIVE: + break; +// case G_RAID_DISK_STATE_SYNCHRONIZING: +// if (bp->bio_offset >= sync->ds_offset) +// continue; +// break; + default: + continue; + } + error = g_raid_subdisk_kerneldump(sd, + virtual, physical, offset, length); + if (error == 0) + ok++; + } + return (ok > 0 ? 0 : error); +} + static int g_raid_tr_locked_raid1(struct g_raid_tr_object *tr, void *argp) { From owner-svn-src-projects@FreeBSD.ORG Wed Jan 26 15:15:02 2011 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 87601106564A; Wed, 26 Jan 2011 15:15:02 +0000 (UTC) (envelope-from kensmith@buffalo.edu) Received: from localmailB.acsu.buffalo.edu (localmail.buffalo.edu [128.205.5.200]) by mx1.freebsd.org (Postfix) with ESMTP id 4E9AB8FC15; Wed, 26 Jan 2011 15:15:01 +0000 (UTC) Received: from localmailB.acsu.buffalo.edu (localhost [127.0.0.1]) by localhost (Postfix) with SMTP id E4D171C33; Wed, 26 Jan 2011 10:06:59 -0500 (EST) Received: from localmailB.acsu.buffalo.edu (localhost [127.0.0.1]) by localmailB.acsu.buffalo.edu (Postfix) with ESMTP id 7343A1B21; Wed, 26 Jan 2011 10:06:58 -0500 (EST) Received: from mweb2.acsu.buffalo.edu (mweb2.acsu.buffalo.edu [128.205.5.239]) by localmailB.acsu.buffalo.edu (Prefixe) with ESMTP id 41AE919A7; Wed, 26 Jan 2011 10:06:58 -0500 (EST) Received: from [128.205.32.76] (bauer.cse.buffalo.edu [128.205.32.76]) by mweb2.acsu.buffalo.edu (Postfix) with ESMTP id 0A7D2207B4; Wed, 26 Jan 2011 10:06:58 -0500 (EST) From: Ken Smith To: Alexander Motin In-Reply-To: <4D3FED31.8040304@FreeBSD.org> References: <201101251534.p0PFY7cF039182@svn.freebsd.org> <201101251117.49069.jhb@freebsd.org> <4D3FED31.8040304@FreeBSD.org> Content-Type: multipart/signed; micalg="pgp-sha1"; protocol="application/pgp-signature"; boundary="=-Lwv/NfllsUYBYrOCgWix" Date: Wed, 26 Jan 2011 10:06:47 -0500 Message-ID: <1296054407.19051.5.camel@bauer.cse.buffalo.edu> Mime-Version: 1.0 X-Mailer: Evolution 2.28.2 FreeBSD GNOME Team Port X-PM-EL-Spam-Prob: : 8% Cc: svn-src-projects@freebsd.org, Pawel Jakub Dawidek , src-committers@freebsd.org, Robert Watson , John Baldwin Subject: Re: svn commit: r217828 - projects/graid/head/sys/geom/raid X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Jan 2011 15:15:02 -0000 --=-Lwv/NfllsUYBYrOCgWix Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable On Wed, 2011-01-26 at 11:45 +0200, Alexander Motin wrote: > Those who want maximum robustness should use dedicated > drive on the most trivial dedicated controller to make dumping reliable. > If we are going above that - there are always some compromises.=20 Please remember this statement when I change dumpdev from "AUTO" to "NO" in /etc/defaults/rc.conf shortly after branching stable/9. :-) --=20 Ken Smith - From there to here, from here to | kensmith@buffalo.edu there, funny things are everywhere. | - Theodor Geisel | --=-Lwv/NfllsUYBYrOCgWix Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (FreeBSD) iEYEABECAAYFAk1AOHoACgkQ/G14VSmup/ZunQCdFrC/jixhDrtSvvkRg0Wz34sH Et0An2cQKvAYRT78GsIYeCuglnJh+KT1 =CN5O -----END PGP SIGNATURE----- --=-Lwv/NfllsUYBYrOCgWix-- From owner-svn-src-projects@FreeBSD.ORG Wed Jan 26 15:40:35 2011 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 21170106566C; Wed, 26 Jan 2011 15:40:35 +0000 (UTC) (envelope-from mavbsd@gmail.com) Received: from mail-bw0-f54.google.com (mail-bw0-f54.google.com [209.85.214.54]) by mx1.freebsd.org (Postfix) with ESMTP id 716A28FC17; Wed, 26 Jan 2011 15:40:13 +0000 (UTC) Received: by bwz12 with SMTP id 12so1505611bwz.13 for ; Wed, 26 Jan 2011 07:40:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:sender:message-id:date:from:user-agent :mime-version:to:cc:subject:references:in-reply-to :x-enigmail-version:content-type:content-transfer-encoding; bh=KVQAmXZv5egXqGxVwIYAXiy0A/Itau2iocJxSb+28WU=; b=vpvOj2PyhbqCaW5lmfWkwVmRXpKNJk3zaHGwSLvF1wUEPcJH5tBJuRj7fNd1aWMgYU 4z5G6ODKJPHFKki8Aci8za15XRSp5V3ngaWBDXxg61+pn2IzRRC8fzQ7fCKyGI4sZkc+ TQIJFMn4bRlblHU9y92iNuTYXpuK3kwtrxP1I= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:x-enigmail-version:content-type :content-transfer-encoding; b=xm8JOrz2Dt0Sz1RFpgewS1z6qWbT+0tLDYM1QN51/pF5SzI4L/RsxoaawCgIm/W9yR uHmIlOzPZUy9rk48/xZsZGUhbX75t6BYixE2f+vIiRDh/W4wcpjAzSnp0LEcs2KpP846 uILKZ9KRRqgo3ZXZcqCh6qYFPCjJ0kK4+mk8c= Received: by 10.204.60.195 with SMTP id q3mr503203bkh.188.1296055741079; Wed, 26 Jan 2011 07:29:01 -0800 (PST) Received: from mavbook2.mavhome.dp.ua (pc.mavhome.dp.ua [212.86.226.226]) by mx.google.com with ESMTPS id u23sm4982756bkw.9.2011.01.26.07.28.57 (version=SSLv3 cipher=RC4-MD5); Wed, 26 Jan 2011 07:28:59 -0800 (PST) Sender: Alexander Motin Message-ID: <4D403D86.6040901@FreeBSD.org> Date: Wed, 26 Jan 2011 17:28:06 +0200 From: Alexander Motin User-Agent: Thunderbird 2.0.0.23 (X11/20091212) MIME-Version: 1.0 To: Ken Smith References: <201101251534.p0PFY7cF039182@svn.freebsd.org> <201101251117.49069.jhb@freebsd.org> <4D3FED31.8040304@FreeBSD.org> <1296054407.19051.5.camel@bauer.cse.buffalo.edu> In-Reply-To: <1296054407.19051.5.camel@bauer.cse.buffalo.edu> X-Enigmail-Version: 0.96.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: svn-src-projects@freebsd.org, Pawel Jakub Dawidek , src-committers@freebsd.org, Robert Watson , John Baldwin Subject: Re: svn commit: r217828 - projects/graid/head/sys/geom/raid X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Jan 2011 15:40:35 -0000 Ken Smith wrote: > On Wed, 2011-01-26 at 11:45 +0200, Alexander Motin wrote: >> Those who want maximum robustness should use dedicated >> drive on the most trivial dedicated controller to make dumping reliable. >> If we are going above that - there are always some compromises. > > Please remember this statement when I change dumpdev from "AUTO" > to "NO" in /etc/defaults/rc.conf shortly after branching stable/9. :-) World is imperfect. We have to choose between our wish to have kernel dumps and some non-zero (by definition, as something there already caused panic) probability that dumping may not finish as we expect. For this time I have already reimplemented dumping in more robust way, so you may relax a bit. :) -- Alexander Motin From owner-svn-src-projects@FreeBSD.ORG Wed Jan 26 15:42:44 2011 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CDCE3106564A; Wed, 26 Jan 2011 15:42:44 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id 9DEFD8FC08; Wed, 26 Jan 2011 15:42:44 +0000 (UTC) Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net [66.111.2.69]) by cyrus.watson.org (Postfix) with ESMTPSA id 4386046B2C; Wed, 26 Jan 2011 10:42:44 -0500 (EST) Received: from jhbbsd.localnet (smtp.hudson-trading.com [209.249.190.9]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 425C18A009; Wed, 26 Jan 2011 10:42:43 -0500 (EST) From: John Baldwin To: Ken Smith Date: Wed, 26 Jan 2011 10:42:37 -0500 User-Agent: KMail/1.13.5 (FreeBSD/7.4-CBSD-20110107; KDE/4.4.5; amd64; ; ) References: <201101251534.p0PFY7cF039182@svn.freebsd.org> <4D3FED31.8040304@FreeBSD.org> <1296054407.19051.5.camel@bauer.cse.buffalo.edu> In-Reply-To: <1296054407.19051.5.camel@bauer.cse.buffalo.edu> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit Message-Id: <201101261042.38218.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.6 (bigwig.baldwin.cx); Wed, 26 Jan 2011 10:42:43 -0500 (EST) X-Virus-Scanned: clamav-milter 0.96.3 at bigwig.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-1.9 required=4.2 tests=BAYES_00 autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on bigwig.baldwin.cx Cc: svn-src-projects@freebsd.org, Pawel Jakub Dawidek , Alexander Motin , src-committers@freebsd.org, Robert Watson Subject: Re: svn commit: r217828 - projects/graid/head/sys/geom/raid X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Jan 2011 15:42:44 -0000 On Wednesday, January 26, 2011 10:06:47 am Ken Smith wrote: > On Wed, 2011-01-26 at 11:45 +0200, Alexander Motin wrote: > > Those who want maximum robustness should use dedicated > > drive on the most trivial dedicated controller to make dumping reliable. > > If we are going above that - there are always some compromises. > > Please remember this statement when I change dumpdev from "AUTO" > to "NO" in /etc/defaults/rc.conf shortly after branching stable/9. :-) No, I still think this is the wrong answer. Kernel dumps are not inherently unreliable to the point that we should not enable them by default. However, turning dumps off is a good way to prevent developers from debugging non- trivial bugs that are only triggered under real-world workloads. I think we should strive to make our dumps as reliable as possible, but nothing in our system is perfect (hence bugs), and if we are going to require absolute perfection for kernel dumps before enabling them by default then we might as well not ship anything at all as I can _ensure_ you the rest of the system we ship is _not_ absolutely perfect. -- John Baldwin From owner-svn-src-projects@FreeBSD.ORG Wed Jan 26 15:45:36 2011 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 855FA106566B; Wed, 26 Jan 2011 15:45:36 +0000 (UTC) (envelope-from rwatson@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id 5DB108FC13; Wed, 26 Jan 2011 15:45:36 +0000 (UTC) Received: from lemongrass.sec.cl.cam.ac.uk (lemongrass.sec.cl.cam.ac.uk [128.232.18.47]) by cyrus.watson.org (Postfix) with ESMTPSA id 533F346B03; Wed, 26 Jan 2011 10:45:35 -0500 (EST) Mime-Version: 1.0 (Apple Message framework v1082) Content-Type: text/plain; charset=us-ascii From: "Robert N. M. Watson" In-Reply-To: <201101261042.38218.jhb@freebsd.org> Date: Wed, 26 Jan 2011 15:45:34 +0000 Content-Transfer-Encoding: quoted-printable Message-Id: <7FD27004-581F-4FED-858D-5819562CF111@freebsd.org> References: <201101251534.p0PFY7cF039182@svn.freebsd.org> <4D3FED31.8040304@FreeBSD.org> <1296054407.19051.5.camel@bauer.cse.buffalo.edu> <201101261042.38218.jhb@freebsd.org> To: John Baldwin X-Mailer: Apple Mail (2.1082) Cc: svn-src-projects@freebsd.org, Alexander Motin , src-committers@freebsd.org, Pawel Jakub Dawidek , Ken Smith Subject: Re: svn commit: r217828 - projects/graid/head/sys/geom/raid X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Jan 2011 15:45:36 -0000 On 26 Jan 2011, at 15:42, John Baldwin wrote: > On Wednesday, January 26, 2011 10:06:47 am Ken Smith wrote: >> On Wed, 2011-01-26 at 11:45 +0200, Alexander Motin wrote: >>> Those who want maximum robustness should use dedicated >>> drive on the most trivial dedicated controller to make dumping = reliable. >>> If we are going above that - there are always some compromises.=20 >>=20 >> Please remember this statement when I change dumpdev from "AUTO" >> to "NO" in /etc/defaults/rc.conf shortly after branching stable/9. = :-) >=20 > No, I still think this is the wrong answer. Kernel dumps are not = inherently=20 > unreliable to the point that we should not enable them by default. = However,=20 > turning dumps off is a good way to prevent developers from debugging = non- > trivial bugs that are only triggered under real-world workloads. >=20 > I think we should strive to make our dumps as reliable as possible, = but=20 > nothing in our system is perfect (hence bugs), and if we are going to = require=20 > absolute perfection for kernel dumps before enabling them by default = then we=20 > might as well not ship anything at all as I can _ensure_ you the rest = of the=20 > system we ship is _not_ absolutely perfect. I think the real constraint on shipping with dumps enabled remains a = disk space consideration. If you have a problem triggering a kernel bug, = you're going to generate quite a few crash dumps in short order, and for = many users, that result is not good. But the answer there may be better = savecore behaviour: perhaps we should keep the last (n) (where n is = small -- perhaps 2) dumps by default, with a way to mark dumps that = should be saved longer. minidumps have made the world better in some = ways, I can't help wonder whether that could be refined further... Robert= From owner-svn-src-projects@FreeBSD.ORG Wed Jan 26 15:59:22 2011 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 07CD71065672; Wed, 26 Jan 2011 15:59:22 +0000 (UTC) (envelope-from kensmith@buffalo.edu) Received: from localmailC.acsu.buffalo.edu (localmailC.acsu.buffalo.edu [128.205.5.204]) by mx1.freebsd.org (Postfix) with ESMTP id C381D8FC1B; Wed, 26 Jan 2011 15:59:21 +0000 (UTC) Received: from localmailC.acsu.buffalo.edu (localhost [127.0.0.1]) by localhost (Postfix) with SMTP id E533369408; Wed, 26 Jan 2011 10:59:20 -0500 (EST) Received: from localmailC.acsu.buffalo.edu (localhost [127.0.0.1]) by localmailC.acsu.buffalo.edu (Postfix) with ESMTP id 25E757A29A; Wed, 26 Jan 2011 10:58:58 -0500 (EST) Received: from mweb2.acsu.buffalo.edu (mweb2.acsu.buffalo.edu [128.205.5.239]) by localmailC.acsu.buffalo.edu (Prefixe) with ESMTP id 156297A2C9; Wed, 26 Jan 2011 10:58:58 -0500 (EST) Received: from [128.205.32.76] (bauer.cse.buffalo.edu [128.205.32.76]) by mweb2.acsu.buffalo.edu (Postfix) with ESMTP id 02BB8207B6; Wed, 26 Jan 2011 10:58:58 -0500 (EST) From: Ken Smith To: "Robert N. M. Watson" In-Reply-To: <7FD27004-581F-4FED-858D-5819562CF111@freebsd.org> References: <201101251534.p0PFY7cF039182@svn.freebsd.org> <4D3FED31.8040304@FreeBSD.org> <1296054407.19051.5.camel@bauer.cse.buffalo.edu> <201101261042.38218.jhb@freebsd.org> <7FD27004-581F-4FED-858D-5819562CF111@freebsd.org> Content-Type: multipart/signed; micalg="pgp-sha1"; protocol="application/pgp-signature"; boundary="=-hdeUVOr6/zUeD1cQW0wj" Date: Wed, 26 Jan 2011 10:58:57 -0500 Message-ID: <1296057537.19051.32.camel@bauer.cse.buffalo.edu> Mime-Version: 1.0 X-Mailer: Evolution 2.28.2 FreeBSD GNOME Team Port X-PM-EL-Spam-Prob: : 8% Cc: svn-src-projects@freebsd.org, Alexander Motin , src-committers@freebsd.org, Pawel Jakub Dawidek , John Baldwin Subject: Re: svn commit: r217828 - projects/graid/head/sys/geom/raid X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Jan 2011 15:59:22 -0000 --=-hdeUVOr6/zUeD1cQW0wj Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable On Wed, 2011-01-26 at 15:45 +0000, Robert N. M. Watson wrote: > On 26 Jan 2011, at 15:42, John Baldwin wrote: >=20 > > On Wednesday, January 26, 2011 10:06:47 am Ken Smith wrote: > >> On Wed, 2011-01-26 at 11:45 +0200, Alexander Motin wrote: > >>> Those who want maximum robustness should use dedicated > >>> drive on the most trivial dedicated controller to make dumping reliab= le. > >>> If we are going above that - there are always some compromises.=20 > >>=20 > >> Please remember this statement when I change dumpdev from "AUTO" > >> to "NO" in /etc/defaults/rc.conf shortly after branching stable/9. :-= ) > >=20 > > No, I still think this is the wrong answer. Kernel dumps are not inher= ently=20 > > unreliable to the point that we should not enable them by default. How= ever,=20 > > turning dumps off is a good way to prevent developers from debugging no= n- > > trivial bugs that are only triggered under real-world workloads. > >=20 > > I think we should strive to make our dumps as reliable as possible, but= =20 > > nothing in our system is perfect (hence bugs), and if we are going to r= equire=20 > > absolute perfection for kernel dumps before enabling them by default th= en we=20 > > might as well not ship anything at all as I can _ensure_ you the rest o= f the=20 > > system we ship is _not_ absolutely perfect. >=20 > I think the real constraint on shipping with dumps enabled remains a > disk space consideration. If you have a problem triggering a kernel > bug, you're going to generate quite a few crash dumps in short order, > and for many users, that result is not good. But the answer there may > be better savecore behaviour: perhaps we should keep the last (n) > (where n is small -- perhaps 2) dumps by default, with a way to mark > dumps that should be saved longer. minidumps have made the world > better in some ways, I can't help wonder whether that could be refined > further... >=20 > Robert >=20 This would be the non-smiley version of my thoughts at the moment. I'm not against dumps being enabled but IMHO we're not quite ready yet mostly due to the disk space issues. If that's addressed I'd be less worried about leaving them enabled. --=20 Ken Smith - From there to here, from here to | kensmith@buffalo.edu there, funny things are everywhere. | - Theodor Geisel | --=-hdeUVOr6/zUeD1cQW0wj Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (FreeBSD) iEYEABECAAYFAk1ARMEACgkQ/G14VSmup/ag5QCeOskf1jiAK1j87jH7N8zKMvvP kUMAnjq/jVoUZ52NRVGYp4PungYZt8UP =fVvl -----END PGP SIGNATURE----- --=-hdeUVOr6/zUeD1cQW0wj-- From owner-svn-src-projects@FreeBSD.ORG Wed Jan 26 18:03:03 2011 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CC2EF1065672; Wed, 26 Jan 2011 18:03:03 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A1FCA8FC18; Wed, 26 Jan 2011 18:03:03 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0QI33Rm084766; Wed, 26 Jan 2011 18:03:03 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0QI33wf084764; Wed, 26 Jan 2011 18:03:03 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201101261803.p0QI33wf084764@svn.freebsd.org> From: Warner Losh Date: Wed, 26 Jan 2011 18:03:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217889 - projects/graid/head/sys/geom/raid X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Jan 2011 18:03:03 -0000 Author: imp Date: Wed Jan 26 18:03:03 2011 New Revision: 217889 URL: http://svn.freebsd.org/changeset/base/217889 Log: Define cflags for our I/Os so we can properly mark them for SYNC and REMAP operations. Add some comments for some of the events. Modified: projects/graid/head/sys/geom/raid/g_raid.h Modified: projects/graid/head/sys/geom/raid/g_raid.h ============================================================================== --- projects/graid/head/sys/geom/raid/g_raid.h Wed Jan 26 17:31:03 2011 (r217888) +++ projects/graid/head/sys/geom/raid/g_raid.h Wed Jan 26 18:03:03 2011 (r217889) @@ -76,8 +76,28 @@ extern struct g_class g_raid_class; } \ } while (0) -#define G_RAID_BIO_FLAG_REGULAR 0x01 -#define G_RAID_BIO_FLAG_SYNC 0x02 +/* + * Flags we use to distinguish I/O initiated by the TR layer to maintain + * the volume's characteristics, fix subdisks, extra copies of data, etc. + * + * G_RAID_BIO_FLAG_SYNC I/O to update an extra copy of the data + * for RAID volumes that maintain extra data + * and need to rebuild that data. + * G_RAID_BIO_FLAG_REMAP I/O done to try to provoke a subdisk into + * doing some desirable action such as bad + * block remapping after we detect a bad part + * of the disk. + * + * and the following meta item: + * G_RAID_BIO_FLAG_SPECIAL And of the I/O flags that need to make it + * through the range locking which would + * otherwise defer the I/O until after that + * range is unlocked. + */ +#define G_RAID_BIO_FLAG_SYNC 0x01 +#define G_RAID_BIO_FLAG_REMAP 0x02 +#define G_RAID_BIO_FLAG_SPECIAL \ + (G_RAID_BIO_FLAG_SYNC|G_RAID_BIO_FLAG_REMAP) #define G_RAID_LOCK_PENDING 0x1 struct g_raid_lock { @@ -131,9 +151,10 @@ struct g_raid_disk { #define G_RAID_SUBDISK_S_RESYNC 0x05 /* Dirty + check/repair. */ #define G_RAID_SUBDISK_S_ACTIVE 0x06 /* Usable. */ -#define G_RAID_SUBDISK_E_NEW 0x01 -#define G_RAID_SUBDISK_E_FAILED 0x02 -#define G_RAID_SUBDISK_E_DISCONNECTED 0x03 +#define G_RAID_SUBDISK_E_NEW 0x01 /* A new subdisk has arrived */ +#define G_RAID_SUBDISK_E_FAILED 0x02 /* A subdisk failed, but remains in volume */ +#define G_RAID_SUBDISK_E_DISCONNECTED 0x03 /* A subdisk removed from volume. */ +#define G_RAID_SUBDISK_E_FIRST_TR_PRIVATE 0x80 /* translation private events */ struct g_raid_subdisk { struct g_raid_softc *sd_softc; /* Back-pointer to softc. */ From owner-svn-src-projects@FreeBSD.ORG Wed Jan 26 19:01:05 2011 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 70CCE106566B; Wed, 26 Jan 2011 19:01:05 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5F7B78FC13; Wed, 26 Jan 2011 19:01:05 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0QJ15kp086310; Wed, 26 Jan 2011 19:01:05 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0QJ15J4086306; Wed, 26 Jan 2011 19:01:05 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201101261901.p0QJ15J4086306@svn.freebsd.org> From: Warner Losh Date: Wed, 26 Jan 2011 19:01:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217891 - projects/graid/head/sys/geom/raid X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Jan 2011 19:01:05 -0000 Author: imp Date: Wed Jan 26 19:01:05 2011 New Revision: 217891 URL: http://svn.freebsd.org/changeset/base/217891 Log: Initial commit of recovery code: (1) We can REBUILD a RAID1 volume now. A REBUILD operation is one where you read from the good disk and write the bad disk. (2) Some support for RESYNC is present, but nothing really functional yet. A RESYNC operation reads the two disk, compares the results and writes only those sectors that differ. (3) Write remapping has finally been pushed in with this commit (4) We mark disks as bad after a threshold of disk read errors. This isn't complete yet: (1) RESYNC needs lots of work (2) Some refactoring for doing incremental REBUILD work would likely reduce bug or bug potential (3) SYSCLTize the #defines (4) Lots of edge cases need to be carefully reviewed and fixed. (5) Performance tuning of REBUILD: the initial parameters are WAGs. (6) The timeout function pointer needs to be a TR layer method. (7) Not all code paths have been executed: some stupid panics may linger. When not doing a RESYNC or REBUILD, I'm seeing 20MB/s both before and after these changes. But this was in virtualbox.... # reviews welcome... Modified: projects/graid/head/sys/geom/raid/g_raid.c projects/graid/head/sys/geom/raid/g_raid.h projects/graid/head/sys/geom/raid/tr_raid1.c Modified: projects/graid/head/sys/geom/raid/g_raid.c ============================================================================== --- projects/graid/head/sys/geom/raid/g_raid.c Wed Jan 26 18:43:15 2011 (r217890) +++ projects/graid/head/sys/geom/raid/g_raid.c Wed Jan 26 19:01:05 2011 (r217891) @@ -77,9 +77,9 @@ TUNABLE_INT("kern.geom.raid.name_format" SYSCTL_UINT(_kern_geom_raid, OID_AUTO, name_format, CTLFLAG_RW, &g_raid_name_format, 0, "Providers name format."); -#define MSLEEP(ident, mtx, priority, wmesg, timeout) do { \ +#define MSLEEP(rv, ident, mtx, priority, wmesg, timeout) do { \ G_RAID_DEBUG(4, "%s: Sleeping %p.", __func__, (ident)); \ - msleep((ident), (mtx), (priority), (wmesg), (timeout)); \ + rv = msleep((ident), (mtx), (priority), (wmesg), (timeout)); \ G_RAID_DEBUG(4, "%s: Woken up %p.", __func__, (ident)); \ } while (0) @@ -403,7 +403,7 @@ g_raid_event_send(void *arg, int event, sx_xunlock(&sc->sc_lock); while ((ep->e_flags & G_RAID_EVENT_DONE) == 0) { mtx_lock(&sc->sc_queue_mtx); - MSLEEP(ep, &sc->sc_queue_mtx, PRIBIO | PDROP, "m:event", + MSLEEP(error, ep, &sc->sc_queue_mtx, PRIBIO | PDROP, "m:event", hz * 5); } error = ep->e_error; @@ -682,6 +682,8 @@ g_raid_idle(struct g_raid_volume *vol, i TAILQ_FOREACH(disk, &sc->sc_disks, d_next) { if (disk->d_state != G_RAID_DISK_S_ACTIVE) continue; +// if (!(disk->d_flags & G_RAID_DISK_FLAG_DIRTY)) +// continue; G_RAID_DEBUG(1, "Disk %s (device %s) marked as clean.", g_raid_get_diskname(disk), sc->sc_name); // disk->d_flags &= ~G_RAID_DISK_FLAG_DIRTY; @@ -888,25 +890,34 @@ g_raid_start_request(struct bio *bp) sc = bp->bio_to->geom->softc; sx_assert(&sc->sc_lock, SX_LOCKED); vol = bp->bio_to->private; - if (bp->bio_cmd == BIO_WRITE || bp->bio_cmd == BIO_DELETE) { - if (vol->v_idle) - g_raid_unidle(vol); - else - vol->v_last_write = time_uptime; - } /* * Check to see if this item is in a locked range. If so, * queue it to our locked queue and return. We'll requeue - * it when the range is unlocked. + * it when the range is unlocked. Internal I/O for the + * rebuild/rescan/recovery process is excluded from this + * check so we can actually do the recovery. */ - if (g_raid_is_in_locked_range(vol, bp)) { + if (!(bp->bio_cflags & G_RAID_BIO_FLAG_SPECIAL) && + g_raid_is_in_locked_range(vol, bp)) { bioq_insert_tail(&vol->v_locked, bp); return; } /* + * If we're actually going to do the write/delete, then + * update the idle stats for the volume. + */ + if (bp->bio_cmd == BIO_WRITE || bp->bio_cmd == BIO_DELETE) { + if (vol->v_idle) + g_raid_unidle(vol); + else + vol->v_last_write = time_uptime; + } + + /* * Put request onto inflight queue, so we can check if new - * synchronization requests don't collide with it. + * synchronization requests don't collide with it. Then tell + * the tranlsation layer to start the I/O. */ bioq_insert_tail(&vol->v_inflight, bp); G_RAID_TR_IOSTART(vol->v_tr, bp); @@ -975,12 +986,12 @@ g_raid_lock_range(struct g_raid_volume * lp->l_length = len; lp->l_callback_arg = argp; - /* XXX lock in-flight queue? -- not done elsewhere, but should it be? */ pending = 0; TAILQ_FOREACH(bp, &vol->v_inflight.queue, bio_queue) { if (g_raid_bio_overlaps(bp, off, len)) pending++; } + /* * If there are any writes that are pending, we return EBUSY. All * callers will have to wait until all pending writes clear. @@ -990,6 +1001,7 @@ g_raid_lock_range(struct g_raid_volume * return (EBUSY); } lp->l_flags &= ~G_RAID_LOCK_PENDING; + G_RAID_TR_LOCKED(vol->v_tr, lp->l_callback_arg); return (0); } @@ -1149,7 +1161,7 @@ g_raid_worker(void *arg) struct g_raid_event *ep; struct g_raid_volume *vol; struct bio *bp; - int timeout; + int timeout, rv; sc = arg; thread_lock(curthread); @@ -1165,17 +1177,17 @@ g_raid_worker(void *arg) */ bp = NULL; vol = NULL; + rv = 0; ep = TAILQ_FIRST(&sc->sc_events); if (ep != NULL) TAILQ_REMOVE(&sc->sc_events, ep, e_next); else if ((bp = bioq_takefirst(&sc->sc_queue)) != NULL) ; -// else if ((vol = g_raid_check_idle(sc, &timeout)) != NULL) -// ; else { - timeout = 1000; + timeout = 1; sx_xunlock(&sc->sc_lock); - MSLEEP(sc, &sc->sc_queue_mtx, PRIBIO | PDROP, "-", timeout * hz); + MSLEEP(rv, sc, &sc->sc_queue_mtx, PRIBIO | PDROP, "-", + timeout * hz); sx_xlock(&sc->sc_lock); goto process; } @@ -1190,8 +1202,15 @@ process: else g_raid_disk_done_request(bp); } - if (vol != NULL) - g_raid_idle(vol, -1); + if (rv == EWOULDBLOCK) { + TAILQ_FOREACH(vol, &sc->sc_volumes, v_next) { + if (bioq_first(&vol->v_inflight) == NULL && + !vol->v_idle) + g_raid_idle(vol, -1); + if (vol->v_timeout) + vol->v_timeout(vol, vol->v_to_arg); + } + } if (sc->sc_stopping != 0) g_raid_destroy_node(sc, 1); /* May not return. */ } Modified: projects/graid/head/sys/geom/raid/g_raid.h ============================================================================== --- projects/graid/head/sys/geom/raid/g_raid.h Wed Jan 26 18:43:15 2011 (r217890) +++ projects/graid/head/sys/geom/raid/g_raid.h Wed Jan 26 19:01:05 2011 (r217891) @@ -206,6 +206,9 @@ struct g_raid_subdisk { #define G_RAID_VOLUME_RLQ_NONE 0x00 #define G_RAID_VOLUME_RLQ_UNKNOWN 0xff +struct g_raid_volume; +typedef void (*g_raid_volume_timeout_t)(struct g_raid_volume *, void *); + struct g_raid_volume { struct g_raid_softc *v_softc; /* Back-pointer to softc. */ struct g_provider *v_provider; /* GEOM provider. */ @@ -235,6 +238,8 @@ struct g_raid_volume { int v_stopping; /* Volume is stopping */ int v_provider_open; /* Number of opens. */ int v_global_id; /* Global volume ID (rX). */ + g_raid_volume_timeout_t v_timeout; /* Timeout function, if any */ + void *v_to_arg; /* Arg to timeout function */ TAILQ_ENTRY(g_raid_volume) v_next; /* List of volumes entry. */ LIST_ENTRY(g_raid_volume) v_global_next; /* Global list entry. */ }; Modified: projects/graid/head/sys/geom/raid/tr_raid1.c ============================================================================== --- projects/graid/head/sys/geom/raid/tr_raid1.c Wed Jan 26 18:43:15 2011 (r217890) +++ projects/graid/head/sys/geom/raid/tr_raid1.c Wed Jan 26 19:01:05 2011 (r217891) @@ -40,12 +40,38 @@ __FBSDID("$FreeBSD$"); #include "geom/raid/g_raid.h" #include "g_raid_tr_if.h" +#define SD_READ_THRESHOLD 10 /* errors to cause a rebuild */ +#define SD_REBUILD_SLAB (1 << 20) /* One transation in a rebuild */ +#define SD_REBUILD_FAIR_IO 10 /* use 1/x of the available I/O */ +#define SD_REBUILD_CLUSTER_BUSY 4 +#define SD_REBUILD_CLUSTER_IDLE 10 + +/* + * We don't want to hammer the disk with I/O requests when doing a rebuild or + * a resync. So, we send these events to ourselves when we go idle (or every + * Nth normal I/O to 'clock' the process along. The number and speed that we + * send these will determine the bandwidth we consume of the disk drive and + * how long these operations will take. + */ +#define G_RAID_SUBDISK_E_TR_REBUILD_SOME (G_RAID_SUBDISK_E_FIRST_TR_PRIVATE + 0) +#define G_RAID_SUBDISK_E_TR_RESYNC_SOME (G_RAID_SUBDISK_E_FIRST_TR_PRIVATE + 1) + static MALLOC_DEFINE(M_TR_raid1, "tr_raid1_data", "GEOM_RAID raid1 data"); +#define TR_RAID1_NONE 0 +#define TR_RAID1_REBUILD 1 +#define TR_RAID1_RESYNC 2 + struct g_raid_tr_raid1_object { struct g_raid_tr_object trso_base; int trso_starting; int trso_stopped; + int trso_type; /* From here down */ + int trso_recover_slabs; /* might need to be more */ + int trso_fair_io; + struct g_raid_subdisk *trso_good_sd; /* specific rather than per tr */ + struct g_raid_subdisk *trso_failed_sd; /* like per volume */ + void *trso_buffer; /* Buffer space */ }; static g_raid_tr_taste_t g_raid_tr_taste_raid1; @@ -78,6 +104,9 @@ struct g_raid_tr_class g_raid_tr_raid1_c .trc_priority = 100 }; +static void g_raid_tr_raid1_rebuild_abort(struct g_raid_tr_object *tr, + struct g_raid_volume *vol); + static int g_raid_tr_taste_raid1(struct g_raid_tr_object *tr, struct g_raid_volume *volume) { @@ -91,6 +120,115 @@ g_raid_tr_taste_raid1(struct g_raid_tr_o return (G_RAID_TR_TASTE_SUCCEED); } +static void +g_raid_tr_raid1_rebuild_some(struct g_raid_tr_object *tr, + struct g_raid_subdisk *sd) +{ + struct g_raid_tr_raid1_object *trs; + struct bio *bp; + + trs = (struct g_raid_tr_raid1_object *)tr; + trs->trso_recover_slabs = SD_REBUILD_CLUSTER_IDLE; + trs->trso_fair_io = SD_REBUILD_FAIR_IO; + bp = g_new_bio(); + bp->bio_offset = sd->sd_rebuild_pos; + bp->bio_data = trs->trso_buffer; + bp->bio_cmd = BIO_READ; + bp->bio_cflags = G_RAID_BIO_FLAG_SYNC; + bp->bio_caller1 = trs->trso_good_sd; + g_raid_lock_range(sd->sd_volume, /* Lock callback starts I/O */ + sd->sd_rebuild_pos, SD_REBUILD_SLAB, bp); +} + +static void +g_raid_tr_raid1_resync_some(struct g_raid_tr_object *tr, + struct g_raid_subdisk *sd) +{ + panic("We don't implement resync yet"); +} + +static void +g_raid_tr_raid1_idle_rebuild(struct g_raid_volume *vol, void *argp) +{ + struct g_raid_tr_raid1_object *trs; + + trs = (struct g_raid_tr_raid1_object *)argp; + g_raid_event_send(trs->trso_failed_sd, G_RAID_SUBDISK_E_TR_REBUILD_SOME, + G_RAID_EVENT_SUBDISK); +} + +static void +g_raid_tr_raid1_rebuild_finish(struct g_raid_tr_object *tr, struct g_raid_volume *vol) +{ + struct g_raid_tr_raid1_object *trs; + + trs = (struct g_raid_tr_raid1_object *)tr; + free(trs->trso_buffer, M_TR_raid1); + trs->trso_recover_slabs = 0; + trs->trso_failed_sd = NULL; + trs->trso_good_sd = NULL; + trs->trso_buffer = NULL; + /* xxx transition array? */ +} + +static void +g_raid_tr_raid1_rebuild_abort(struct g_raid_tr_object *tr, struct g_raid_volume *vol) +{ + struct g_raid_tr_raid1_object *trs; + + trs = (struct g_raid_tr_raid1_object *)tr; + g_raid_unlock_range(tr->tro_volume, + trs->trso_failed_sd->sd_rebuild_pos, SD_REBUILD_SLAB); + free(trs->trso_buffer, M_TR_raid1); + trs->trso_recover_slabs = 0; + trs->trso_failed_sd = NULL; + trs->trso_good_sd = NULL; + trs->trso_buffer = NULL; +} + +static struct g_raid_subdisk * +g_raid_tr_raid1_find_good_drive(struct g_raid_volume *vol) +{ + int i; + + for (i = 0; i < vol->v_disks_count; i++) + if (vol->v_subdisks[i].sd_state == G_RAID_SUBDISK_S_ACTIVE) + return (&vol->v_subdisks[i]); + return (NULL); +} + +static struct g_raid_subdisk * +g_raid_tr_raid1_find_failed_drive(struct g_raid_volume *vol) +{ + int i; + + for (i = 0; i < vol->v_disks_count; i++) + if (vol->v_subdisks[i].sd_state == G_RAID_SUBDISK_S_REBUILD || + vol->v_subdisks[i].sd_state == G_RAID_SUBDISK_S_RESYNC) + return (&vol->v_subdisks[i]); + return (NULL); +} + +static void +g_raid_tr_raid1_rebuild_start(struct g_raid_tr_object *tr, struct g_raid_volume *vol) +{ + /* XXX ---- XXX Should this be based on trs state or vol state? XXX --- XXX */ + struct g_raid_tr_raid1_object *trs; + + trs = (struct g_raid_tr_raid1_object *)tr; + if (trs->trso_failed_sd) { + G_RAID_DEBUG(1, "Already rebuild in start rebuild. pos %jd\n", + (intmax_t)trs->trso_failed_sd->sd_rebuild_pos); + return; + } + trs->trso_good_sd = g_raid_tr_raid1_find_good_drive(vol); + trs->trso_failed_sd = g_raid_tr_raid1_find_failed_drive(vol); + trs->trso_failed_sd->sd_rebuild_pos = 0; + trs->trso_buffer = malloc(SD_REBUILD_SLAB, M_TR_raid1, M_WAITOK); + /* XXX what else do I need to setup the first time? */ + g_raid_tr_raid1_rebuild_some(tr, trs->trso_failed_sd); +} + static int g_raid_tr_update_state_raid1(struct g_raid_volume *vol) { @@ -119,6 +257,14 @@ g_raid_tr_update_state_raid1(struct g_ra g_raid_event_send(vol, G_RAID_VOLUME_S_ALIVE(s) ? G_RAID_VOLUME_E_UP : G_RAID_VOLUME_E_DOWN, G_RAID_EVENT_VOLUME); + if (s == G_RAID_VOLUME_S_DEGRADED) { + g_raid_tr_raid1_rebuild_start(vol->v_tr, vol); + vol->v_timeout = g_raid_tr_raid1_idle_rebuild; + vol->v_to_arg = trs; + } else { + vol->v_timeout = 0; + vol->v_to_arg = 0; + } g_raid_change_volume_state(vol, s); } return (0); @@ -133,12 +279,25 @@ g_raid_tr_event_raid1(struct g_raid_tr_o trs = (struct g_raid_tr_raid1_object *)tr; vol = tr->tro_volume; - if (event == G_RAID_SUBDISK_E_NEW) { + switch (event) { + case G_RAID_SUBDISK_E_NEW: + // XXX do I need to start a rebuild here? // g_raid_change_subdisk_state(sd, G_RAID_SUBDISK_S_ACTIVE); - } else if (event == G_RAID_SUBDISK_E_FAILED) { + break; + case G_RAID_SUBDISK_E_FAILED: + // XXX do I need to stop a rebuild here? // g_raid_change_subdisk_state(sd, G_RAID_SUBDISK_S_FAILED); - } else + break; + case G_RAID_SUBDISK_E_DISCONNECTED: g_raid_change_subdisk_state(sd, G_RAID_SUBDISK_S_NONE); + break; + case G_RAID_SUBDISK_E_TR_REBUILD_SOME: + g_raid_tr_raid1_rebuild_some(tr, sd); + break; + case G_RAID_SUBDISK_E_TR_RESYNC_SOME: + g_raid_tr_raid1_resync_some(tr, sd); + break; + } g_raid_tr_update_state_raid1(vol); return (0); } @@ -171,13 +330,12 @@ g_raid_tr_stop_raid1(struct g_raid_tr_ob } /* - * Select the disk to do the reads to. For now, we just pick the - * first one in the list that's active always. This ensures we favor - * one disk on boot, and have more deterministic recovery from the - * weird edge cases of power failure. In the future, we can imagine - * policies that go for the least loaded disk to improve performance, - * or we need to limit reads to a disk during some kind of error - * recovery with that disk. + * Select the disk to do the reads to. For now, we just pick the first one in + * the list that's active always. This ensures we favor one disk on boot, and + * have more deterministic recovery from the weird edge cases of power + * failure. In the future, we can imagine policies that go for the least + * loaded disk to improve performance, or we need to limit reads to a disk + * during some kind of error recovery with that disk. */ static struct g_raid_subdisk * g_raid_tr_raid1_select_read_disk(struct g_raid_volume *vol) @@ -220,9 +378,10 @@ g_raid_tr_iostart_raid1_write(struct g_r vol = tr->tro_volume; sc = vol->v_softc; + /* - * Allocate all bios before sending any request, so we can - * return ENOMEM in nice and clean way. + * Allocate all bios before sending any request, so we can return + * ENOMEM in nice and clean way. */ bioq_init(&queue); for (i = 0; i < vol->v_disks_count; i++) { @@ -230,10 +389,22 @@ g_raid_tr_iostart_raid1_write(struct g_r switch (sd->sd_state) { case G_RAID_SUBDISK_S_ACTIVE: break; -// case G_RAID_DISK_STATE_SYNCHRONIZING: -// if (bp->bio_offset >= sync->ds_offset) -// continue; -// break; + case G_RAID_SUBDISK_S_REBUILD: + /* + * When rebuilding, only part of this subdisk is + * writable, the rest will be written as part of the + * that process. + */ + if (bp->bio_offset >= sd->sd_offset) + continue; + break; + case G_RAID_SUBDISK_S_RESYNC: + /* + * Resyncing still writes on the theory that the + * resync'd disk is very close and writing it will + * keep it that way better if we keep up while + * resyncing. + */ default: continue; } @@ -266,14 +437,30 @@ static void g_raid_tr_iostart_raid1(struct g_raid_tr_object *tr, struct bio *bp) { struct g_raid_volume *vol; + struct g_raid_tr_raid1_object *trs; vol = tr->tro_volume; + trs = (struct g_raid_tr_raid1_object *)tr; if (vol->v_state != G_RAID_VOLUME_S_OPTIMAL && vol->v_state != G_RAID_VOLUME_S_SUBOPTIMAL && vol->v_state != G_RAID_VOLUME_S_DEGRADED) { g_raid_iodone(bp, EIO); return; } + /* + * If we're rebuilding, squeeze in rebuild activity every so often, + * even when the disk is busy. Be sure to only count real I/O + * to the disk. All 'SPECIAL' I/O is traffic generated to the disk + * by this module. + */ + if (trs->trso_failed_sd != NULL && + !(bp->bio_cflags & G_RAID_BIO_FLAG_SPECIAL)) { + if (--trs->trso_fair_io <= 0) { + g_raid_event_send(trs->trso_failed_sd, + G_RAID_SUBDISK_E_TR_REBUILD_SOME, + G_RAID_EVENT_SUBDISK); + } + } switch (bp->bio_cmd) { case BIO_READ: g_raid_tr_iostart_raid1_read(tr, bp); @@ -299,15 +486,103 @@ g_raid_tr_iodone_raid1(struct g_raid_tr_ struct g_raid_subdisk *nsd; struct g_raid_volume *vol; struct bio *pbp; + struct g_raid_tr_raid1_object *trs; int i; + trs = (struct g_raid_tr_raid1_object *)tr; pbp = bp->bio_parent; + if (bp->bio_cflags & G_RAID_BIO_FLAG_SYNC) { + /* + * This operation is part of a rebuild or resync + * operation. See what work just got done, then + * schedule the next bit of work, if any. + * Rebuild/resync is done a little bit at a time. + * Either when a timeout happens, or after we get a + * bunch of I/Os to the disk (to make sure an active + * system will complete in a sane amount of time). + * + * We are setup to do differing amounts of work for + * each of these cases. so long as the slabs is + * smallish (less than 50 or so, I'd guess, but that's + * just a WAG), we shouldn't have any bio starvation + * issues. For active disks, we do 5MB of data, for + * inactive ones, we do 50MB. + */ + if (trs->trso_type == TR_RAID1_REBUILD) { + vol = tr->tro_volume; + if (bp->bio_cmd == BIO_READ) { + /* + * The read operation finished, queue the + * write and get out. + */ + pbp->bio_inbed++; + if (bp->bio_error != 0) { + g_raid_tr_raid1_rebuild_abort(tr, vol); + goto out; + } + cbp = g_clone_bio(pbp); + cbp->bio_cmd = BIO_WRITE; + cbp->bio_cflags = G_RAID_BIO_FLAG_SYNC; + cbp->bio_offset = bp->bio_offset; /* Necessary? */ + cbp->bio_length = bp->bio_length; + g_raid_subdisk_iostart(trs->trso_failed_sd, cbp); + return; + } else { + /* + * The write operation just finished. Do + * another. We keep cloning the master bio + * since it has the right buffers allocated to + * it. We'll free it when slabs get to 0. + * We'll also tie up SD_REBUILD_CLUSTER * 2 + + * 1 bios from the pool. Since + * SD_REBUILD_CLUSTER should be small, that + * shouldn't be a problem. + */ + pbp->bio_inbed++; + if (bp->bio_error != 0) { + g_raid_tr_raid1_rebuild_abort(tr, vol); + goto out; + } + /* A lot of the following is needed when we kick of the work -- refactor */ + nsd = trs->trso_failed_sd; + g_raid_unlock_range(sd->sd_volume, + nsd->sd_rebuild_pos, SD_REBUILD_SLAB); + nsd->sd_rebuild_pos += pbp->bio_length; + if (nsd->sd_rebuild_pos >= vol->v_mediasize) { + g_raid_tr_raid1_rebuild_finish(tr, vol); + goto out; + } + if (--trs->trso_recover_slabs == 0) { + goto out; + } + pbp->bio_offset = nsd->sd_rebuild_pos; + cbp = g_clone_bio(pbp); + cbp->bio_cmd = BIO_READ; + cbp->bio_cflags = G_RAID_BIO_FLAG_SYNC; + cbp->bio_offset = nsd->sd_rebuild_pos; + cbp->bio_length = MIN(SD_REBUILD_SLAB, vol->v_mediasize - nsd->sd_rebuild_pos); + cbp->bio_caller1 = trs->trso_good_sd; + g_raid_lock_range(sd->sd_volume, /* Lock callback starts I/O */ + nsd->sd_rebuild_pos, SD_REBUILD_SLAB, cbp); + goto out; + } + } else if (trs->trso_type == TR_RAID1_RESYNC) { + /* + * read good sd, read bad sd in parallel. + * when both done, compare the buffers. write + * good_sd to failed_sd if different. do the + * next bit of work. + */ + panic("Somehow, we think we're doing a resync"); + } + } if (bp->bio_error != 0 && bp->bio_cmd == BIO_READ && pbp->bio_children == 1) { /* - * Retry the read error on the other disk drive, if - * available, before erroring out the read. + * Read failed on first drive. Retry the read error on + * another disk drive, if available, before erroring out the + * read. */ vol = tr->tro_volume; sd->sd_read_errs++; @@ -316,8 +591,14 @@ g_raid_tr_iodone_raid1(struct g_raid_tr_ sd->sd_read_errs); /* - * XXX Check threshold of sd_read_errs here to declare - * this subdisk bad? + * If there are too many read errors, we move to degraded. + */ + if (sd->sd_read_errs > SD_READ_THRESHOLD) { + g_raid_fail_disk(sd->sd_softc, sd, sd->sd_disk); + } + + /* + * Find the other disk, and try to do the I/O to it. */ for (nsd = NULL, i = 0; i < vol->v_disks_count; i++) { nsd = &vol->v_subdisks[i]; @@ -334,10 +615,10 @@ g_raid_tr_iodone_raid1(struct g_raid_tr_ return; } /* - * something happened, so we can't retry. Return the - * original error by falling through. - * - * XXX degrade/break the mirror? + * We can't retry. Return the original error by falling + * through. This will happen when there's only one good disk. + * We don't need to fail the raid, since its actual state is + * based on the state of the subdisks. */ G_RAID_LOGREQ(3, bp, "Couldn't retry read, failing it"); } @@ -351,12 +632,38 @@ g_raid_tr_iodone_raid1(struct g_raid_tr_ * disk, remapping the bad sector. Do we need to do that by * queueing a request to the main worker thread? It doesn't * affect the return code of this current read, and can be - * done at our liesure. - * - * XXX TODO + * done at our liesure. However, to make the code simpler, it + * is done syncrhonously. */ G_RAID_LOGREQ(3, bp, "Recovered data from other drive"); + cbp = g_clone_bio(pbp); + if (cbp != NULL) { + nsd = bp->bio_caller1; + cbp->bio_cmd = BIO_WRITE; + cbp->bio_cflags = G_RAID_BIO_FLAG_REMAP; + cbp->bio_caller1 = nsd; + G_RAID_LOGREQ(3, bp, + "Attempting bad sector remap on failing drive."); + g_raid_lock_range(sd->sd_volume, /* Lock callback starts I/O */ + cbp->bio_offset, cbp->bio_length, cbp); + } } + if (bp->bio_cflags & G_RAID_BIO_FLAG_REMAP) { + /* + * We're doing a remap write, mark the range as unlocked now + * and fail the disk if the write failed. If the write + * failed, the parent's bio isn't failed since the recovered + * read for that actually succeeded. + */ + g_raid_unlock_range(sd->sd_volume, bp->bio_offset, + bp->bio_length); + if (bp->bio_error) { + G_RAID_LOGREQ(3, bp, "Error on remap: mark subdisk bad."); + g_raid_fail_disk(sd->sd_softc, sd, sd->sd_disk); + bp->bio_error = 0; + } + } +out:; if (pbp->bio_children == pbp->bio_inbed) { pbp->bio_completed = pbp->bio_length; g_raid_iodone(pbp, bp->bio_error); @@ -397,6 +704,13 @@ g_raid_tr_kerneldump_raid1(struct g_raid static int g_raid_tr_locked_raid1(struct g_raid_tr_object *tr, void *argp) { + struct bio *bp; + struct g_raid_subdisk *sd; + + bp = (struct bio *)argp; + sd = (struct g_raid_subdisk *)bp->bio_caller1; + g_raid_subdisk_iostart(sd, bp); + return (0); } From owner-svn-src-projects@FreeBSD.ORG Wed Jan 26 19:24:42 2011 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2D7AA106566B; Wed, 26 Jan 2011 19:24:42 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1B9B18FC1B; Wed, 26 Jan 2011 19:24:42 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0QJOg8b086853; Wed, 26 Jan 2011 19:24:42 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0QJOfgF086849; Wed, 26 Jan 2011 19:24:41 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201101261924.p0QJOfgF086849@svn.freebsd.org> From: Alexander Motin Date: Wed, 26 Jan 2011 19:24:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217892 - in projects/graid/head: sbin/geom/class/raid sys/geom/raid X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Jan 2011 19:24:42 -0000 Author: mav Date: Wed Jan 26 19:24:41 2011 New Revision: 217892 URL: http://svn.freebsd.org/changeset/base/217892 Log: Implement two more `graid` subcommands: add - add second volume into existing array; delete - delete specified volume or whole array. Modified: projects/graid/head/sbin/geom/class/raid/geom_raid.c projects/graid/head/sys/geom/raid/g_raid_ctl.c projects/graid/head/sys/geom/raid/md_intel.c Modified: projects/graid/head/sbin/geom/class/raid/geom_raid.c ============================================================================== --- projects/graid/head/sbin/geom/class/raid/geom_raid.c Wed Jan 26 19:01:05 2011 (r217891) +++ projects/graid/head/sbin/geom/class/raid/geom_raid.c Wed Jan 26 19:24:41 2011 (r217892) @@ -57,23 +57,34 @@ struct g_command class_commands[] = { { 's', "strip", G_VAL_OPTIONAL, G_TYPE_NUMBER }, G_OPT_SENTINEL }, - "[-S size] [-s stripsize] format name level prov ..." + "[-S size] [-s stripsize] format label level prov ..." + }, + { "add", G_FLAG_VERBOSE, NULL, + { + { 'S', "size", G_VAL_OPTIONAL, G_TYPE_NUMBER }, + { 's', "strip", G_VAL_OPTIONAL, G_TYPE_NUMBER }, + G_OPT_SENTINEL + }, + "[-S size] [-s stripsize] name label level" + }, + { "delete", G_FLAG_VERBOSE, NULL, G_NULL_OPTS, + "[-v] name [label|num]" }, { "insert", G_FLAG_VERBOSE, NULL, G_NULL_OPTS, - "[-v] name prov" + "[-v] name prov ..." }, { "remove", G_FLAG_VERBOSE, NULL, G_NULL_OPTS, - "[-v] name prov" + "[-v] name prov ..." }, { "fail", G_FLAG_VERBOSE, NULL, G_NULL_OPTS, - "[-v] name prov" + "[-v] name prov ..." }, { "stop", G_FLAG_VERBOSE, NULL, { { 'f', "force", NULL, G_TYPE_BOOL }, G_OPT_SENTINEL }, - "[-fv] name ..." + "[-fv] name" }, G_CMD_SENTINEL }; Modified: projects/graid/head/sys/geom/raid/g_raid_ctl.c ============================================================================== --- projects/graid/head/sys/geom/raid/g_raid_ctl.c Wed Jan 26 19:01:05 2011 (r217891) +++ projects/graid/head/sys/geom/raid/g_raid_ctl.c Wed Jan 26 19:24:41 2011 (r217892) @@ -119,7 +119,7 @@ g_raid_ctl_stop(struct gctl_req *req, st gctl_error(req, "No '%s' argument.", "nargs"); return; } - if (*nargs < 1) { + if (*nargs != 1) { gctl_error(req, "Invalid number of arguments."); return; } Modified: projects/graid/head/sys/geom/raid/md_intel.c ============================================================================== --- projects/graid/head/sys/geom/raid/md_intel.c Wed Jan 26 19:01:05 2011 (r217891) +++ projects/graid/head/sys/geom/raid/md_intel.c Wed Jan 26 19:24:41 2011 (r217892) @@ -542,7 +542,7 @@ g_raid_md_intel_start_disk(struct g_raid /* Make sure this disk is big enough. */ TAILQ_FOREACH(sd, &olddisk->d_subdisks, sd_next) { if (sd->sd_offset + sd->sd_size + 4096 > - (uint64_t)pd->pd_disk_meta.sectors * 512) { + (off_t)pd->pd_disk_meta.sectors * 512) { G_RAID_DEBUG(1, "Disk too small (%llu < %llu)", ((unsigned long long) @@ -1168,7 +1168,7 @@ g_raid_md_ctl_intel(struct g_raid_md_obj struct gctl_req *req) { struct g_raid_softc *sc; - struct g_raid_volume *vol; + struct g_raid_volume *vol, *vol1; struct g_raid_subdisk *sd; struct g_raid_disk *disk; struct g_raid_md_intel_object *mdi; @@ -1177,8 +1177,9 @@ g_raid_md_ctl_intel(struct g_raid_md_obj struct g_provider *pp; char arg[16], serial[INTEL_SERIAL_LEN]; const char *verb, *volname, *levelname, *diskname; + char *tmp; int *nargs; - uint64_t size, sectorsize, strip; + off_t off, size, sectorsize, strip; intmax_t *sizearg, *striparg; int numdisks, i, len, level, qual, update; int error; @@ -1218,7 +1219,7 @@ g_raid_md_ctl_intel(struct g_raid_md_obj /* Search for disks, connect them and probe. */ numdisks = *nargs - 3; - size = 0xffffffffffffffffllu; + size = 0x7fffffffffffffffllu; sectorsize = 0; for (i = 0; i < numdisks; i++) { snprintf(arg, sizeof(arg), "arg%d", i + 3); @@ -1304,7 +1305,8 @@ g_raid_md_ctl_intel(struct g_raid_md_obj sizearg = gctl_get_param(req, "size", &len); if (sizearg != NULL && len == sizeof(*sizearg)) { if (*sizearg > size) { - gctl_error(req, "Size too big."); + gctl_error(req, "Size too big %lld > %lld.", + (long long)*sizearg, (long long)size); return (-9); } size = *sizearg; @@ -1366,6 +1368,217 @@ g_raid_md_ctl_intel(struct g_raid_md_obj g_raid_md_write_intel(md, NULL, NULL, NULL); return (0); } + if (strcmp(verb, "add") == 0) { + + if (*nargs != 3) { + gctl_error(req, "Invalid number of arguments."); + return (-1); + } + volname = gctl_get_asciiparam(req, "arg1"); + if (volname == NULL) { + gctl_error(req, "No volume name."); + return (-2); + } + levelname = gctl_get_asciiparam(req, "arg2"); + if (levelname == NULL) { + gctl_error(req, "No RAID level."); + return (-3); + } + if (g_raid_volume_str2level(levelname, &level, &qual)) { + gctl_error(req, "Unknown RAID level '%s'.", levelname); + return (-4); + } + if (level != G_RAID_VOLUME_RL_RAID0 && + level != G_RAID_VOLUME_RL_RAID1 && + level != G_RAID_VOLUME_RL_RAID5 && + level != G_RAID_VOLUME_RL_RAID10) { + gctl_error(req, "Unsupported RAID level."); + return (-5); + } + + /* Look for existing volumes. */ + i = 0; + vol1 = NULL; + TAILQ_FOREACH(vol, &sc->sc_volumes, v_next) { + vol1 = vol; + i++; + } + if (i > 1) { + gctl_error(req, "Maximum two volumes supported."); + return (-6); + } + if (vol1 == NULL) { + gctl_error(req, "At least one volume must exist."); + return (-7); + } + + /* Collect info about present disks. */ + size = 0x7fffffffffffffffllu; + sectorsize = 512; + numdisks = vol1->v_disks_count; + for (i = 0; i < numdisks; i++) { + disk = vol1->v_subdisks[i].sd_disk; + pd = (struct g_raid_md_intel_perdisk *) + disk->d_md_data; + if ((off_t)pd->pd_disk_meta.sectors * 512 < size) + size = (off_t)pd->pd_disk_meta.sectors * 512; + if (disk->d_consumer != NULL && + disk->d_consumer->provider != NULL && + disk->d_consumer->provider->sectorsize > + sectorsize) { + sectorsize = + disk->d_consumer->provider->sectorsize; + } + } + + /* Reserve some space for metadata. */ + size -= ((4096 + sectorsize - 1) / sectorsize) * sectorsize; + + /* Decide insert before or after. */ + sd = &vol1->v_subdisks[0]; + if (sd->sd_offset > + size - (sd->sd_offset + sd->sd_size)) { + off = 0; + size = sd->sd_offset; + } else { + off = sd->sd_offset + sd->sd_size; + size = size - (sd->sd_offset + sd->sd_size); + } + + /* Handle size argument. */ + len = sizeof(*sizearg); + sizearg = gctl_get_param(req, "size", &len); + if (sizearg != NULL && len == sizeof(*sizearg)) { + if (*sizearg > size) { + gctl_error(req, "Size too big %lld > %lld.", + (long long)*sizearg, (long long)size); + return (-9); + } + size = *sizearg; + } + + /* Handle strip argument. */ + strip = 131072; + len = sizeof(*striparg); + striparg = gctl_get_param(req, "strip", &len); + if (striparg != NULL && len == sizeof(*striparg)) { + if (*striparg < sectorsize) { + gctl_error(req, "Strip size too small."); + return (-10); + } + if (*striparg % sectorsize != 0) { + gctl_error(req, "Incorrect strip size."); + return (-11); + } + if (strip > 65535 * sectorsize) { + gctl_error(req, "Strip size too big."); + return (-12); + } + strip = *striparg; + } + size -= ((strip - off) % strip); + off += ((strip - off) % strip); + size -= (size % strip); + + if (size <= 0) { + gctl_error(req, "No free space."); + return (-13); + } + + /* We have all we need, create things: volume, ... */ + vol = g_raid_create_volume(sc, volname); + vol->v_md_data = (void *)(intptr_t)i; + vol->v_raid_level = level; + vol->v_raid_level_qualifier = G_RAID_VOLUME_RLQ_NONE; + vol->v_strip_size = strip; + vol->v_disks_count = numdisks; + if (level == G_RAID_VOLUME_RL_RAID0) + vol->v_mediasize = size * numdisks; + else if (level == G_RAID_VOLUME_RL_RAID5) + vol->v_mediasize = size * (numdisks - 1); + else + vol->v_mediasize = size * (numdisks / 2); + vol->v_sectorsize = sectorsize; + g_raid_start_volume(vol); + + /* , and subdisks. */ + for (i = 0; i < numdisks; i++) { + disk = vol1->v_subdisks[i].sd_disk; + sd = &vol->v_subdisks[i]; + sd->sd_disk = disk; + sd->sd_offset = off; + sd->sd_size = size; + TAILQ_INSERT_TAIL(&disk->d_subdisks, sd, sd_next); + if (disk->d_state == G_RAID_DISK_S_ACTIVE) { + 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); + } + } + + /* Write metadata based on created entities. */ + g_raid_md_write_intel(md, NULL, NULL, NULL); + return (0); + } + if (strcmp(verb, "delete") == 0) { + + /* Full node destruction. */ + if (*nargs == 1) { + TAILQ_FOREACH(disk, &sc->sc_disks, d_next) { + if (disk->d_consumer) + intel_meta_erase(disk->d_consumer); + } + g_raid_destroy_node(sc, 0); + return (0); + } + + /* Destroy specified volume. If it was last - all node. */ + if (*nargs != 2) { + gctl_error(req, "Invalid number of arguments."); + return (-1); + } + volname = gctl_get_asciiparam(req, "arg1"); + if (volname == NULL) { + gctl_error(req, "No volume name."); + return (-2); + } + + /* Search for volume. */ + TAILQ_FOREACH(vol, &sc->sc_volumes, v_next) { + if (strcmp(vol->v_name, volname) == 0) + break; + } + if (vol == NULL) { + i = strtol(volname, &tmp, 10); + if (verb != volname && tmp[0] == 0) { + TAILQ_FOREACH(vol, &sc->sc_volumes, v_next) { + if ((intptr_t)vol->v_md_data == i) + break; + } + } + } + if (vol == NULL) { + gctl_error(req, "Volume '%s' not found.", volname); + return (-3); + } + + /* Destroy volume and potentially node. */ + i = 0; + TAILQ_FOREACH(vol1, &sc->sc_volumes, v_next) + i++; + if (i >= 2) { + g_raid_destroy_volume(vol); + g_raid_md_write_intel(md, NULL, NULL, NULL); + } else { + TAILQ_FOREACH(disk, &sc->sc_disks, d_next) { + if (disk->d_consumer) + intel_meta_erase(disk->d_consumer); + } + g_raid_destroy_node(sc, 0); + } + return (0); + } if (strcmp(verb, "remove") == 0 || strcmp(verb, "fail") == 0) { if (*nargs < 2) { @@ -1614,6 +1827,8 @@ g_raid_md_write_intel(struct g_raid_md_o vi = 0; version = INTEL_VERSION_1000; TAILQ_FOREACH(vol, &sc->sc_volumes, v_next) { + if (vol->v_stopping) + continue; mvol = intel_get_volume(meta, vi); /* New metadata may have different volumes order. */ From owner-svn-src-projects@FreeBSD.ORG Wed Jan 26 20:34:16 2011 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A6680106566B; Wed, 26 Jan 2011 20:34:16 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 965E68FC16; Wed, 26 Jan 2011 20:34:16 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0QKYGti089321; Wed, 26 Jan 2011 20:34:16 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0QKYGkB089319; Wed, 26 Jan 2011 20:34:16 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201101262034.p0QKYGkB089319@svn.freebsd.org> From: Warner Losh Date: Wed, 26 Jan 2011 20:34:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217907 - projects/graid/head/sys/geom/raid X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Jan 2011 20:34:16 -0000 Author: imp Date: Wed Jan 26 20:34:16 2011 New Revision: 217907 URL: http://svn.freebsd.org/changeset/base/217907 Log: Set arg before timeout function pointer to avoid a 1 instruction race. Modified: projects/graid/head/sys/geom/raid/tr_raid1.c Modified: projects/graid/head/sys/geom/raid/tr_raid1.c ============================================================================== --- projects/graid/head/sys/geom/raid/tr_raid1.c Wed Jan 26 20:29:28 2011 (r217906) +++ projects/graid/head/sys/geom/raid/tr_raid1.c Wed Jan 26 20:34:16 2011 (r217907) @@ -259,8 +259,8 @@ g_raid_tr_update_state_raid1(struct g_ra G_RAID_EVENT_VOLUME); if (s == G_RAID_VOLUME_S_DEGRADED) { g_raid_tr_raid1_rebuild_start(vol->v_tr, vol); - vol->v_timeout = g_raid_tr_raid1_idle_rebuild; vol->v_to_arg = trs; + vol->v_timeout = g_raid_tr_raid1_idle_rebuild; } else { vol->v_timeout = 0; vol->v_to_arg = 0; From owner-svn-src-projects@FreeBSD.ORG Wed Jan 26 21:22:07 2011 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1FBE0106564A; Wed, 26 Jan 2011 21:22:07 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E94F08FC14; Wed, 26 Jan 2011 21:22:06 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0QLM6wl090585; Wed, 26 Jan 2011 21:22:06 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0QLM6rq090583; Wed, 26 Jan 2011 21:22:06 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201101262122.p0QLM6rq090583@svn.freebsd.org> From: Warner Losh Date: Wed, 26 Jan 2011 21:22:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217912 - projects/graid/head/sys/geom/raid X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Jan 2011 21:22:07 -0000 Author: imp Date: Wed Jan 26 21:22:06 2011 New Revision: 217912 URL: http://svn.freebsd.org/changeset/base/217912 Log: Guard against the case where we don't have an extra disk to rebuild. Modified: projects/graid/head/sys/geom/raid/tr_raid1.c Modified: projects/graid/head/sys/geom/raid/tr_raid1.c ============================================================================== --- projects/graid/head/sys/geom/raid/tr_raid1.c Wed Jan 26 21:14:20 2011 (r217911) +++ projects/graid/head/sys/geom/raid/tr_raid1.c Wed Jan 26 21:22:06 2011 (r217912) @@ -66,12 +66,12 @@ struct g_raid_tr_raid1_object { struct g_raid_tr_object trso_base; int trso_starting; int trso_stopped; - int trso_type; /* From here down */ - int trso_recover_slabs; /* might need to be more */ + int trso_type; + int trso_recover_slabs; /* might need to be more */ int trso_fair_io; - struct g_raid_subdisk *trso_good_sd; /* specific rather than per tr */ - struct g_raid_subdisk *trso_failed_sd; /* like per volume */ - void *trso_buffer; /* Buffer space */ + struct g_raid_subdisk *trso_good_sd; /* specific rather than per tr */ + struct g_raid_subdisk *trso_failed_sd;/* like per volume */ + void *trso_buffer; /* Buffer space */ }; static g_raid_tr_taste_t g_raid_tr_taste_raid1; @@ -153,6 +153,8 @@ g_raid_tr_raid1_idle_rebuild(struct g_ra struct g_raid_tr_raid1_object *trs; trs = (struct g_raid_tr_raid1_object *)argp; + if (trs->trso_good_sd == NULL || trs->trso_failed_sd == NULL) + return; g_raid_event_send(trs->trso_failed_sd, G_RAID_SUBDISK_E_TR_REBUILD_SOME, G_RAID_EVENT_SUBDISK); } @@ -223,6 +225,12 @@ g_raid_tr_raid1_rebuild_start(struct g_r } trs->trso_good_sd = g_raid_tr_raid1_find_good_drive(vol); trs->trso_failed_sd = g_raid_tr_raid1_find_failed_drive(vol); + if (trs->trso_good_sd == NULL || trs->trso_failed_sd == NULL) { + G_RAID_DEBUG(1, "No failed disk to rebuild. night night."); + return; + } + G_RAID_DEBUG(2, "Kicking off a rebuild..."); + trs->trso_type = TR_RAID1_REBUILD; trs->trso_failed_sd->sd_rebuild_pos = 0; trs->trso_buffer = malloc(SD_REBUILD_SLAB, M_TR_raid1, M_WAITOK); /* XXX what else do I need to setup the first time? */ From owner-svn-src-projects@FreeBSD.ORG Wed Jan 26 22:05:40 2011 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 76BD8106566B; Wed, 26 Jan 2011 22:05:40 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id 471D78FC13; Wed, 26 Jan 2011 22:05:40 +0000 (UTC) Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net [66.111.2.69]) by cyrus.watson.org (Postfix) with ESMTPSA id E623D46B03; Wed, 26 Jan 2011 17:05:39 -0500 (EST) Received: from jhbbsd.localnet (smtp.hudson-trading.com [209.249.190.9]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 11C1F8A009; Wed, 26 Jan 2011 17:05:39 -0500 (EST) From: John Baldwin To: Warner Losh Date: Wed, 26 Jan 2011 16:54:51 -0500 User-Agent: KMail/1.13.5 (FreeBSD/7.4-CBSD-20110107; KDE/4.4.5; amd64; ; ) References: <201101262034.p0QKYGkB089319@svn.freebsd.org> In-Reply-To: <201101262034.p0QKYGkB089319@svn.freebsd.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201101261654.51397.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.6 (bigwig.baldwin.cx); Wed, 26 Jan 2011 17:05:39 -0500 (EST) X-Virus-Scanned: clamav-milter 0.96.3 at bigwig.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-1.9 required=4.2 tests=BAYES_00 autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on bigwig.baldwin.cx Cc: svn-src-projects@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r217907 - projects/graid/head/sys/geom/raid X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Jan 2011 22:05:40 -0000 On Wednesday, January 26, 2011 3:34:16 pm Warner Losh wrote: > Author: imp > Date: Wed Jan 26 20:34:16 2011 > New Revision: 217907 > URL: http://svn.freebsd.org/changeset/base/217907 > > Log: > Set arg before timeout function pointer to avoid a 1 instruction race. > > Modified: > projects/graid/head/sys/geom/raid/tr_raid1.c > > Modified: projects/graid/head/sys/geom/raid/tr_raid1.c > ============================================================================== > --- projects/graid/head/sys/geom/raid/tr_raid1.c Wed Jan 26 20:29:28 2011 (r217906) > +++ projects/graid/head/sys/geom/raid/tr_raid1.c Wed Jan 26 20:34:16 2011 (r217907) > @@ -259,8 +259,8 @@ g_raid_tr_update_state_raid1(struct g_ra > G_RAID_EVENT_VOLUME); > if (s == G_RAID_VOLUME_S_DEGRADED) { > g_raid_tr_raid1_rebuild_start(vol->v_tr, vol); > - vol->v_timeout = g_raid_tr_raid1_idle_rebuild; > vol->v_to_arg = trs; > + vol->v_timeout = g_raid_tr_raid1_idle_rebuild; > } else { > vol->v_timeout = 0; > vol->v_to_arg = 0; Err, this can't solve anything without a memory barrier given the ability of modern CPUs on at least some architectures to reorder writes. -- John Baldwin From owner-svn-src-projects@FreeBSD.ORG Wed Jan 26 23:35:44 2011 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7F218106566C; Wed, 26 Jan 2011 23:35:44 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85]) by mx1.freebsd.org (Postfix) with ESMTP id 3E2FE8FC0A; Wed, 26 Jan 2011 23:35:44 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by harmony.bsdimp.com (8.14.3/8.14.1) with ESMTP id p0QNVGwK064521; Wed, 26 Jan 2011 16:31:16 -0700 (MST) (envelope-from imp@bsdimp.com) Message-ID: <4D40AEC4.4070607@bsdimp.com> Date: Wed, 26 Jan 2011 16:31:16 -0700 From: Warner Losh User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.2.13) Gecko/20101211 Thunderbird/3.1.7 MIME-Version: 1.0 To: John Baldwin References: <201101262034.p0QKYGkB089319@svn.freebsd.org> <201101261654.51397.jhb@freebsd.org> In-Reply-To: <201101261654.51397.jhb@freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-projects@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r217907 - projects/graid/head/sys/geom/raid X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Jan 2011 23:35:44 -0000 On 01/26/2011 14:54, John Baldwin wrote: > On Wednesday, January 26, 2011 3:34:16 pm Warner Losh wrote: >> Author: imp >> Date: Wed Jan 26 20:34:16 2011 >> New Revision: 217907 >> URL: http://svn.freebsd.org/changeset/base/217907 >> >> Log: >> Set arg before timeout function pointer to avoid a 1 instruction race. >> >> Modified: >> projects/graid/head/sys/geom/raid/tr_raid1.c >> >> Modified: projects/graid/head/sys/geom/raid/tr_raid1.c >> > ============================================================================== >> --- projects/graid/head/sys/geom/raid/tr_raid1.c Wed Jan 26 20:29:28 2011 > (r217906)+++ projects/graid/head/sys/geom/raid/tr_raid1.c Wed Jan 26 20:34:16 2011 > (r217907) >> @@ -259,8 +259,8 @@ g_raid_tr_update_state_raid1(struct g_ra >> G_RAID_EVENT_VOLUME); >> if (s == G_RAID_VOLUME_S_DEGRADED) { >> g_raid_tr_raid1_rebuild_start(vol->v_tr, vol); >> - vol->v_timeout = g_raid_tr_raid1_idle_rebuild; >> vol->v_to_arg = trs; >> + vol->v_timeout = g_raid_tr_raid1_idle_rebuild; >> } else { >> vol->v_timeout = 0; >> vol->v_to_arg = 0; > Err, this can't solve anything without a memory barrier given the ability of > modern CPUs on at least some architectures to reorder writes True. I thought this was the cause of a crash, but it turns out it was elsewhere. I'm reworking this, but thanks for the info. Warner From owner-svn-src-projects@FreeBSD.ORG Thu Jan 27 02:00:02 2011 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 225E5106564A; Thu, 27 Jan 2011 02:00:02 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0A1148FC08; Thu, 27 Jan 2011 02:00:02 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0R201Gp097313; Thu, 27 Jan 2011 02:00:01 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0R2016b097311; Thu, 27 Jan 2011 02:00:01 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201101270200.p0R2016b097311@svn.freebsd.org> From: Warner Losh Date: Thu, 27 Jan 2011 02:00:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217918 - projects/graid/head/sys/geom/raid X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Jan 2011 02:00:02 -0000 Author: imp Date: Thu Jan 27 02:00:01 2011 New Revision: 217918 URL: http://svn.freebsd.org/changeset/base/217918 Log: Checkpoint commit: o Kick of rebuild of the volume correctly. o properly create and clone the master bp for the rebuild o tweak a few logging items o add a few logging items. o tweak timeout goo o add a semi-snarky comment about some semi-lame code I wrote Modified: projects/graid/head/sys/geom/raid/tr_raid1.c Modified: projects/graid/head/sys/geom/raid/tr_raid1.c ============================================================================== --- projects/graid/head/sys/geom/raid/tr_raid1.c Thu Jan 27 00:36:54 2011 (r217917) +++ projects/graid/head/sys/geom/raid/tr_raid1.c Thu Jan 27 02:00:01 2011 (r217918) @@ -125,19 +125,23 @@ g_raid_tr_raid1_rebuild_some(struct g_ra struct g_raid_subdisk *sd) { struct g_raid_tr_raid1_object *trs; - struct bio *bp; + struct bio *bp, *bp2; +/* XXX need interlock here? */ trs = (struct g_raid_tr_raid1_object *)tr; trs->trso_recover_slabs = SD_REBUILD_CLUSTER_IDLE; trs->trso_fair_io = SD_REBUILD_FAIR_IO; bp = g_new_bio(); bp->bio_offset = sd->sd_rebuild_pos; + bp->bio_length = MIN(SD_REBUILD_SLAB, + sd->sd_volume->v_mediasize - sd->sd_rebuild_pos); bp->bio_data = trs->trso_buffer; bp->bio_cmd = BIO_READ; - bp->bio_cflags = G_RAID_BIO_FLAG_SYNC; - bp->bio_caller1 = trs->trso_good_sd; + bp2 = g_clone_bio(bp); + bp2->bio_cflags = G_RAID_BIO_FLAG_SYNC; + bp2->bio_caller1 = trs->trso_good_sd; g_raid_lock_range(sd->sd_volume, /* Lock callback starts I/O */ - sd->sd_rebuild_pos, SD_REBUILD_SLAB, bp); + bp2->bio_offset, bp2->bio_length, bp2); } static void @@ -170,6 +174,7 @@ g_raid_tr_raid1_rebuild_finish(struct g_ trs->trso_failed_sd = NULL; trs->trso_good_sd = NULL; trs->trso_buffer = NULL; + vol->v_timeout = 0; /* xxx transition array? */ } @@ -186,6 +191,7 @@ g_raid_tr_raid1_rebuild_abort(struct g_r trs->trso_failed_sd = NULL; trs->trso_good_sd = NULL; trs->trso_buffer = NULL; + vol->v_timeout = 0; } static struct g_raid_subdisk * @@ -233,10 +239,37 @@ g_raid_tr_raid1_rebuild_start(struct g_r trs->trso_type = TR_RAID1_REBUILD; trs->trso_failed_sd->sd_rebuild_pos = 0; trs->trso_buffer = malloc(SD_REBUILD_SLAB, M_TR_raid1, M_WAITOK); + vol->v_to_arg = trs; + vol->v_timeout = g_raid_tr_raid1_idle_rebuild; /* XXX what else do I need to setup the first time? */ g_raid_tr_raid1_rebuild_some(tr, trs->trso_failed_sd); } + +static void +g_raid_tr_raid1_maybe_rebuild(struct g_raid_tr_object *tr, struct g_raid_volume *vol) +{ + struct g_raid_tr_raid1_object *trs; + int na, nr; + + /* + * If we're stopped, don't do anything. If we don't have at least + * one good disk and one bad disk, we don't do anything. And if there's + * a 'good disk' stored in the trs, then we're in progress and we punt. + * If we make it past all these checks, we need to rebuild. + */ + trs = (struct g_raid_tr_raid1_object *)tr; + if (trs->trso_stopped) + return; + na = g_raid_nsubdisks(vol, G_RAID_SUBDISK_S_ACTIVE); + nr = g_raid_nsubdisks(vol, G_RAID_SUBDISK_S_REBUILD); + if (na == 0 || nr == 0) + return; + if (trs->trso_good_sd) + return; + g_raid_tr_raid1_rebuild_start(tr, vol); +} + static int g_raid_tr_update_state_raid1(struct g_raid_volume *vol) { @@ -261,18 +294,11 @@ g_raid_tr_update_state_raid1(struct g_ra s = G_RAID_VOLUME_S_BROKEN; } } + g_raid_tr_raid1_maybe_rebuild(vol->v_tr, vol); if (s != vol->v_state) { g_raid_event_send(vol, G_RAID_VOLUME_S_ALIVE(s) ? G_RAID_VOLUME_E_UP : G_RAID_VOLUME_E_DOWN, G_RAID_EVENT_VOLUME); - if (s == G_RAID_VOLUME_S_DEGRADED) { - g_raid_tr_raid1_rebuild_start(vol->v_tr, vol); - vol->v_to_arg = trs; - vol->v_timeout = g_raid_tr_raid1_idle_rebuild; - } else { - vol->v_timeout = 0; - vol->v_to_arg = 0; - } g_raid_change_volume_state(vol, s); } return (0); @@ -289,8 +315,9 @@ g_raid_tr_event_raid1(struct g_raid_tr_o vol = tr->tro_volume; switch (event) { case G_RAID_SUBDISK_E_NEW: - // XXX do I need to start a rebuild here? -// g_raid_change_subdisk_state(sd, G_RAID_SUBDISK_S_ACTIVE); + printf("Current disk state is %d\n", sd->sd_state); + if (sd->sd_state == G_RAID_SUBDISK_S_NEW) + g_raid_change_subdisk_state(sd, G_RAID_SUBDISK_S_REBUILD); break; case G_RAID_SUBDISK_E_FAILED: // XXX do I need to stop a rebuild here? @@ -517,13 +544,16 @@ g_raid_tr_iodone_raid1(struct g_raid_tr_ * inactive ones, we do 50MB. */ if (trs->trso_type == TR_RAID1_REBUILD) { + printf("Rebuild BIO\n"); vol = tr->tro_volume; + pbp->bio_inbed++; if (bp->bio_cmd == BIO_READ) { /* * The read operation finished, queue the * write and get out. */ - pbp->bio_inbed++; + G_RAID_LOGREQ(1, bp, + "rebuild read done. Error %d", bp->bio_error); if (bp->bio_error != 0) { g_raid_tr_raid1_rebuild_abort(tr, vol); goto out; @@ -533,6 +563,7 @@ g_raid_tr_iodone_raid1(struct g_raid_tr_ cbp->bio_cflags = G_RAID_BIO_FLAG_SYNC; cbp->bio_offset = bp->bio_offset; /* Necessary? */ cbp->bio_length = bp->bio_length; + G_RAID_LOGREQ(1, bp, "Queueing reguild write."); g_raid_subdisk_iostart(trs->trso_failed_sd, cbp); return; } else { @@ -546,15 +577,20 @@ g_raid_tr_iodone_raid1(struct g_raid_tr_ * SD_REBUILD_CLUSTER should be small, that * shouldn't be a problem. */ - pbp->bio_inbed++; + G_RAID_LOGREQ(1, bp, + "rebuild write done. Error %d", bp->bio_error); if (bp->bio_error != 0) { g_raid_tr_raid1_rebuild_abort(tr, vol); goto out; } - /* A lot of the following is needed when we kick of the work -- refactor */ +/* XXX A lot of the following is needed when we kick of the work -- refactor */ nsd = trs->trso_failed_sd; + if (nsd == NULL) { + printf("WTF? nsd is null\n"); + goto out; + } g_raid_unlock_range(sd->sd_volume, - nsd->sd_rebuild_pos, SD_REBUILD_SLAB); + bp->bio_offset, bp->bio_length); nsd->sd_rebuild_pos += pbp->bio_length; if (nsd->sd_rebuild_pos >= vol->v_mediasize) { g_raid_tr_raid1_rebuild_finish(tr, vol); @@ -570,8 +606,10 @@ g_raid_tr_iodone_raid1(struct g_raid_tr_ cbp->bio_offset = nsd->sd_rebuild_pos; cbp->bio_length = MIN(SD_REBUILD_SLAB, vol->v_mediasize - nsd->sd_rebuild_pos); cbp->bio_caller1 = trs->trso_good_sd; + G_RAID_LOGREQ(1, bp, + "Rebuild read at %jd.", cbp->bio_offset); g_raid_lock_range(sd->sd_volume, /* Lock callback starts I/O */ - nsd->sd_rebuild_pos, SD_REBUILD_SLAB, cbp); + cbp->bio_offset, cbp->bio_length, cbp); goto out; } } else if (trs->trso_type == TR_RAID1_RESYNC) { @@ -584,9 +622,9 @@ g_raid_tr_iodone_raid1(struct g_raid_tr_ panic("Somehow, we think we're doing a resync"); } } + printf("Woof. bp is %p pbp is %p\n", bp, pbp); if (bp->bio_error != 0 && bp->bio_cmd == BIO_READ && - pbp->bio_children == 1) { - + pbp->bio_children == 1 && bp->bio_cflags == 0) { /* * Read failed on first drive. Retry the read error on * another disk drive, if available, before erroring out the @@ -594,7 +632,7 @@ g_raid_tr_iodone_raid1(struct g_raid_tr_ */ vol = tr->tro_volume; sd->sd_read_errs++; - G_RAID_LOGREQ(3, bp, + G_RAID_LOGREQ(1, bp, "Read failure, attempting recovery. %d total read errs", sd->sd_read_errs); @@ -628,10 +666,11 @@ g_raid_tr_iodone_raid1(struct g_raid_tr_ * We don't need to fail the raid, since its actual state is * based on the state of the subdisks. */ - G_RAID_LOGREQ(3, bp, "Couldn't retry read, failing it"); + G_RAID_LOGREQ(2, bp, "Couldn't retry read, failing it"); } pbp->bio_inbed++; - if (pbp->bio_cmd == BIO_READ && pbp->bio_children == 2) { + if (pbp->bio_cmd == BIO_READ && pbp->bio_children == 2 && + bp->bio_cflags == 0) { /* * If it was a read, and bio_children is 2, then we just * recovered the data from the second drive. We should try to @@ -663,6 +702,7 @@ g_raid_tr_iodone_raid1(struct g_raid_tr_ * failed, the parent's bio isn't failed since the recovered * read for that actually succeeded. */ + G_RAID_LOGREQ(2, bp, "REMAP done %d.", bp->bio_error); g_raid_unlock_range(sd->sd_volume, bp->bio_offset, bp->bio_length); if (bp->bio_error) { From owner-svn-src-projects@FreeBSD.ORG Thu Jan 27 02:17:01 2011 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E4178106566B; Thu, 27 Jan 2011 02:17:00 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D338B8FC0C; Thu, 27 Jan 2011 02:17:00 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0R2H0Do097753; Thu, 27 Jan 2011 02:17:00 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0R2H0eh097751; Thu, 27 Jan 2011 02:17:00 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201101270217.p0R2H0eh097751@svn.freebsd.org> From: Warner Losh Date: Thu, 27 Jan 2011 02:17:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217919 - projects/graid/head/sys/geom/raid X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Jan 2011 02:17:01 -0000 Author: imp Date: Thu Jan 27 02:17:00 2011 New Revision: 217919 URL: http://svn.freebsd.org/changeset/base/217919 Log: Don't call g_raid_iodone() on the parent bp we use to drive the rebuild process. Since g_raid didn't queue it to us, it freaks when we give it back. Tweak some debug levels, remove some debugs, etc. # now, we rebuild mostly correctly... just don't remove the disk being rebuilt # yet. Modified: projects/graid/head/sys/geom/raid/tr_raid1.c Modified: projects/graid/head/sys/geom/raid/tr_raid1.c ============================================================================== --- projects/graid/head/sys/geom/raid/tr_raid1.c Thu Jan 27 02:00:01 2011 (r217918) +++ projects/graid/head/sys/geom/raid/tr_raid1.c Thu Jan 27 02:17:00 2011 (r217919) @@ -544,7 +544,6 @@ g_raid_tr_iodone_raid1(struct g_raid_tr_ * inactive ones, we do 50MB. */ if (trs->trso_type == TR_RAID1_REBUILD) { - printf("Rebuild BIO\n"); vol = tr->tro_volume; pbp->bio_inbed++; if (bp->bio_cmd == BIO_READ) { @@ -552,7 +551,7 @@ g_raid_tr_iodone_raid1(struct g_raid_tr_ * The read operation finished, queue the * write and get out. */ - G_RAID_LOGREQ(1, bp, + G_RAID_LOGREQ(4, bp, "rebuild read done. Error %d", bp->bio_error); if (bp->bio_error != 0) { g_raid_tr_raid1_rebuild_abort(tr, vol); @@ -563,9 +562,8 @@ g_raid_tr_iodone_raid1(struct g_raid_tr_ cbp->bio_cflags = G_RAID_BIO_FLAG_SYNC; cbp->bio_offset = bp->bio_offset; /* Necessary? */ cbp->bio_length = bp->bio_length; - G_RAID_LOGREQ(1, bp, "Queueing reguild write."); + G_RAID_LOGREQ(4, bp, "Queueing reguild write."); g_raid_subdisk_iostart(trs->trso_failed_sd, cbp); - return; } else { /* * The write operation just finished. Do @@ -577,40 +575,39 @@ g_raid_tr_iodone_raid1(struct g_raid_tr_ * SD_REBUILD_CLUSTER should be small, that * shouldn't be a problem. */ - G_RAID_LOGREQ(1, bp, + G_RAID_LOGREQ(4, bp, "rebuild write done. Error %d", bp->bio_error); if (bp->bio_error != 0) { g_raid_tr_raid1_rebuild_abort(tr, vol); - goto out; + g_destroy_bio(pbp); + return; } /* XXX A lot of the following is needed when we kick of the work -- refactor */ nsd = trs->trso_failed_sd; - if (nsd == NULL) { - printf("WTF? nsd is null\n"); - goto out; - } g_raid_unlock_range(sd->sd_volume, bp->bio_offset, bp->bio_length); nsd->sd_rebuild_pos += pbp->bio_length; if (nsd->sd_rebuild_pos >= vol->v_mediasize) { g_raid_tr_raid1_rebuild_finish(tr, vol); - goto out; + g_destroy_bio(pbp); + return; } if (--trs->trso_recover_slabs == 0) { - goto out; + g_destroy_bio(pbp); + return; } pbp->bio_offset = nsd->sd_rebuild_pos; cbp = g_clone_bio(pbp); cbp->bio_cmd = BIO_READ; cbp->bio_cflags = G_RAID_BIO_FLAG_SYNC; cbp->bio_offset = nsd->sd_rebuild_pos; - cbp->bio_length = MIN(SD_REBUILD_SLAB, vol->v_mediasize - nsd->sd_rebuild_pos); + cbp->bio_length = MIN(SD_REBUILD_SLAB, + vol->v_mediasize - nsd->sd_rebuild_pos); cbp->bio_caller1 = trs->trso_good_sd; - G_RAID_LOGREQ(1, bp, + G_RAID_LOGREQ(4, bp, "Rebuild read at %jd.", cbp->bio_offset); g_raid_lock_range(sd->sd_volume, /* Lock callback starts I/O */ cbp->bio_offset, cbp->bio_length, cbp); - goto out; } } else if (trs->trso_type == TR_RAID1_RESYNC) { /* @@ -621,8 +618,8 @@ g_raid_tr_iodone_raid1(struct g_raid_tr_ */ panic("Somehow, we think we're doing a resync"); } + return; } - printf("Woof. bp is %p pbp is %p\n", bp, pbp); if (bp->bio_error != 0 && bp->bio_cmd == BIO_READ && pbp->bio_children == 1 && bp->bio_cflags == 0) { /* @@ -632,7 +629,7 @@ g_raid_tr_iodone_raid1(struct g_raid_tr_ */ vol = tr->tro_volume; sd->sd_read_errs++; - G_RAID_LOGREQ(1, bp, + G_RAID_LOGREQ(3, bp, "Read failure, attempting recovery. %d total read errs", sd->sd_read_errs); @@ -655,7 +652,7 @@ g_raid_tr_iodone_raid1(struct g_raid_tr_ cbp = g_clone_bio(pbp); if (cbp == NULL) break; - G_RAID_LOGREQ(3, cbp, "Retrying read"); + G_RAID_LOGREQ(2, cbp, "Retrying read"); g_raid_subdisk_iostart(nsd, cbp); pbp->bio_inbed++; return; From owner-svn-src-projects@FreeBSD.ORG Thu Jan 27 02:27:17 2011 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AE922106564A; Thu, 27 Jan 2011 02:27:17 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 83FC58FC0A; Thu, 27 Jan 2011 02:27:17 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0R2RHfZ098044; Thu, 27 Jan 2011 02:27:17 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0R2RH8u098042; Thu, 27 Jan 2011 02:27:17 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201101270227.p0R2RH8u098042@svn.freebsd.org> From: Warner Losh Date: Thu, 27 Jan 2011 02:27:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217920 - projects/graid/head/sys/geom/raid X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Jan 2011 02:27:17 -0000 Author: imp Date: Thu Jan 27 02:27:17 2011 New Revision: 217920 URL: http://svn.freebsd.org/changeset/base/217920 Log: You can now remove the disk that's being rebuilt manually and we don't crash... # However, if we're rebuilding and reboot we notice this on the way up and # try to rebuild, but that goes horribly wrong, so beware... Modified: projects/graid/head/sys/geom/raid/tr_raid1.c Modified: projects/graid/head/sys/geom/raid/tr_raid1.c ============================================================================== --- projects/graid/head/sys/geom/raid/tr_raid1.c Thu Jan 27 02:17:00 2011 (r217919) +++ projects/graid/head/sys/geom/raid/tr_raid1.c Thu Jan 27 02:27:17 2011 (r217920) @@ -320,10 +320,13 @@ g_raid_tr_event_raid1(struct g_raid_tr_o g_raid_change_subdisk_state(sd, G_RAID_SUBDISK_S_REBUILD); break; case G_RAID_SUBDISK_E_FAILED: - // XXX do I need to stop a rebuild here? + if (trs->trso_good_sd) + g_raid_tr_raid1_rebuild_abort(tr, vol); // g_raid_change_subdisk_state(sd, G_RAID_SUBDISK_S_FAILED); break; case G_RAID_SUBDISK_E_DISCONNECTED: + if (trs->trso_good_sd) + g_raid_tr_raid1_rebuild_abort(tr, vol); g_raid_change_subdisk_state(sd, G_RAID_SUBDISK_S_NONE); break; case G_RAID_SUBDISK_E_TR_REBUILD_SOME: @@ -551,8 +554,8 @@ g_raid_tr_iodone_raid1(struct g_raid_tr_ * The read operation finished, queue the * write and get out. */ - G_RAID_LOGREQ(4, bp, - "rebuild read done. Error %d", bp->bio_error); + G_RAID_LOGREQ(4, bp, "rebuild read done. %d", + bp->bio_error); if (bp->bio_error != 0) { g_raid_tr_raid1_rebuild_abort(tr, vol); goto out; @@ -560,7 +563,7 @@ g_raid_tr_iodone_raid1(struct g_raid_tr_ cbp = g_clone_bio(pbp); cbp->bio_cmd = BIO_WRITE; cbp->bio_cflags = G_RAID_BIO_FLAG_SYNC; - cbp->bio_offset = bp->bio_offset; /* Necessary? */ + cbp->bio_offset = bp->bio_offset; cbp->bio_length = bp->bio_length; G_RAID_LOGREQ(4, bp, "Queueing reguild write."); g_raid_subdisk_iostart(trs->trso_failed_sd, cbp); From owner-svn-src-projects@FreeBSD.ORG Thu Jan 27 08:47:06 2011 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BB7EF1065693; Thu, 27 Jan 2011 08:47:06 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AAB418FC15; Thu, 27 Jan 2011 08:47:06 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0R8l6op007183; Thu, 27 Jan 2011 08:47:06 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0R8l6ld007178; Thu, 27 Jan 2011 08:47:06 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201101270847.p0R8l6ld007178@svn.freebsd.org> From: Alexander Motin Date: Thu, 27 Jan 2011 08:47:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217926 - projects/graid/head/sys/geom/raid X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Jan 2011 08:47:06 -0000 Author: mav Date: Thu Jan 27 08:47:06 2011 New Revision: 217926 URL: http://svn.freebsd.org/changeset/base/217926 Log: Fix submodules loading order. This makes taste sequence start only after all parts are in place and removes some dirty hacks initially used for that. Modified: projects/graid/head/sys/geom/raid/g_raid.c projects/graid/head/sys/geom/raid/g_raid.h projects/graid/head/sys/geom/raid/tr_raid0.c projects/graid/head/sys/geom/raid/tr_raid1.c Modified: projects/graid/head/sys/geom/raid/g_raid.c ============================================================================== --- projects/graid/head/sys/geom/raid/g_raid.c Thu Jan 27 08:42:50 2011 (r217925) +++ projects/graid/head/sys/geom/raid/g_raid.c Thu Jan 27 08:47:06 2011 (r217926) @@ -93,6 +93,7 @@ LIST_HEAD(, g_raid_volume) g_raid_volume LIST_HEAD_INITIALIZER(g_raid_volumes); //static eventhandler_tag g_raid_pre_sync = NULL; +static int g_raid_started = 0; static int g_raid_destroy_geom(struct gctl_req *req, struct g_class *mp, struct g_geom *gp); @@ -1991,9 +1992,6 @@ g_raid_shutdown_pre_sync(void *arg, int } #endif -extern struct g_raid_tr_class g_raid_tr_raid0_class; -extern struct g_raid_tr_class g_raid_tr_raid1_class; - static void g_raid_init(struct g_class *mp) { @@ -2002,18 +2000,16 @@ g_raid_init(struct g_class *mp) // g_raid_shutdown_pre_sync, mp, SHUTDOWN_PRI_FIRST); // if (g_raid_pre_sync == NULL) // G_RAID_DEBUG(0, "Warning! Cannot register shutdown event."); - LIST_INSERT_HEAD(&g_raid_tr_classes, &g_raid_tr_raid1_class, trc_list); - LIST_INSERT_HEAD(&g_raid_tr_classes, &g_raid_tr_raid0_class, trc_list); + g_raid_started = 1; } static void g_raid_fini(struct g_class *mp) { - LIST_REMOVE(&g_raid_tr_raid0_class, trc_list); - LIST_REMOVE(&g_raid_tr_raid1_class, trc_list); // if (g_raid_pre_sync != NULL) // EVENTHANDLER_DEREGISTER(shutdown_pre_sync, g_raid_pre_sync); + g_raid_started = 0; } int @@ -2035,7 +2031,8 @@ g_raid_md_modevent(module_t mod, int typ c = nc; LIST_INSERT_AFTER(c, class, mdc_list); } - g_retaste(&g_raid_class); + if (g_raid_started) + g_retaste(&g_raid_class); break; case MOD_UNLOAD: LIST_REMOVE(class, mdc_list); @@ -2079,4 +2076,14 @@ g_raid_tr_modevent(module_t mod, int typ return (error); } -DECLARE_GEOM_CLASS(g_raid_class, g_raid); +/* + * Use local implementation of DECLARE_GEOM_CLASS(g_raid_class, g_raid) + * to reduce module priority, allowing submodules to register them first. + */ +static moduledata_t g_raid_mod = { + "g_raid", + g_modevent, + &g_raid_class +}; +DECLARE_MODULE(g_raid, g_raid_mod, SI_SUB_DRIVERS, SI_ORDER_THIRD); +MODULE_VERSION(geom_raid, 0); Modified: projects/graid/head/sys/geom/raid/g_raid.h ============================================================================== --- projects/graid/head/sys/geom/raid/g_raid.h Thu Jan 27 08:42:50 2011 (r217925) +++ projects/graid/head/sys/geom/raid/g_raid.h Thu Jan 27 08:47:06 2011 (r217926) @@ -285,7 +285,8 @@ int g_raid_md_modevent(module_t, int, vo g_raid_md_modevent, \ &name##_class \ }; \ - DECLARE_MODULE(name, name##_mod, SI_SUB_DRIVERS, SI_ORDER_ANY) + DECLARE_MODULE(name, name##_mod, SI_SUB_DRIVERS, SI_ORDER_SECOND); \ + MODULE_DEPEND(name, geom_raid, 0, 0, 0) /* * KOBJ parent class of data transformation modules. @@ -313,7 +314,8 @@ int g_raid_tr_modevent(module_t, int, vo g_raid_tr_modevent, \ &name##_class \ }; \ - DECLARE_MODULE(name, name##_mod, SI_SUB_DRIVERS, SI_ORDER_ANY) + DECLARE_MODULE(name, name##_mod, SI_SUB_DRIVERS, SI_ORDER_FIRST); \ + MODULE_DEPEND(name, geom_raid, 0, 0, 0) const char * g_raid_volume_level2str(int level, int qual); int g_raid_volume_str2level(const char *str, int *level, int *qual); Modified: projects/graid/head/sys/geom/raid/tr_raid0.c ============================================================================== --- projects/graid/head/sys/geom/raid/tr_raid0.c Thu Jan 27 08:42:50 2011 (r217925) +++ projects/graid/head/sys/geom/raid/tr_raid0.c Thu Jan 27 08:47:06 2011 (r217926) @@ -69,7 +69,7 @@ static kobj_method_t g_raid_tr_raid0_met { 0, 0 } }; -struct g_raid_tr_class g_raid_tr_raid0_class = { +static struct g_raid_tr_class g_raid_tr_raid0_class = { "RAID0", g_raid_tr_raid0_methods, sizeof(struct g_raid_tr_raid0_object), @@ -348,4 +348,4 @@ g_raid_tr_free_raid0(struct g_raid_tr_ob return (0); } -//G_RAID_TR_DECLARE(g_raid_tr_raid0); +G_RAID_TR_DECLARE(g_raid_tr_raid0); Modified: projects/graid/head/sys/geom/raid/tr_raid1.c ============================================================================== --- projects/graid/head/sys/geom/raid/tr_raid1.c Thu Jan 27 08:42:50 2011 (r217925) +++ projects/graid/head/sys/geom/raid/tr_raid1.c Thu Jan 27 08:47:06 2011 (r217926) @@ -97,7 +97,7 @@ static kobj_method_t g_raid_tr_raid1_met { 0, 0 } }; -struct g_raid_tr_class g_raid_tr_raid1_class = { +static struct g_raid_tr_class g_raid_tr_raid1_class = { "RAID1", g_raid_tr_raid1_methods, sizeof(struct g_raid_tr_raid1_object), @@ -772,4 +772,4 @@ g_raid_tr_free_raid1(struct g_raid_tr_ob return (0); } -//G_RAID_TR_DECLARE(g_raid_tr_raid1); +G_RAID_TR_DECLARE(g_raid_tr_raid1); From owner-svn-src-projects@FreeBSD.ORG Thu Jan 27 09:04:20 2011 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D2B23106564A; Thu, 27 Jan 2011 09:04:20 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C28098FC08; Thu, 27 Jan 2011 09:04:20 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0R94KLT007831; Thu, 27 Jan 2011 09:04:20 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0R94K9L007829; Thu, 27 Jan 2011 09:04:20 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201101270904.p0R94K9L007829@svn.freebsd.org> From: Alexander Motin Date: Thu, 27 Jan 2011 09:04:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217929 - projects/graid/head/sys/geom/raid X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Jan 2011 09:04:21 -0000 Author: mav Date: Thu Jan 27 09:04:20 2011 New Revision: 217929 URL: http://svn.freebsd.org/changeset/base/217929 Log: Report rebuild/resync progress within consumer status. Modified: projects/graid/head/sys/geom/raid/g_raid.c Modified: projects/graid/head/sys/geom/raid/g_raid.c ============================================================================== --- projects/graid/head/sys/geom/raid/g_raid.c Thu Jan 27 09:01:44 2011 (r217928) +++ projects/graid/head/sys/geom/raid/g_raid.c Thu Jan 27 09:04:20 2011 (r217929) @@ -1935,6 +1935,12 @@ g_raid_dumpconf(struct sbuf *sb, const c TAILQ_FOREACH(sd, &disk->d_subdisks, sd_next) { sbuf_printf(sb, "%s", g_raid_subdisk_state2str(sd->sd_state)); + if (sd->sd_state == G_RAID_SUBDISK_S_REBUILD || + sd->sd_state == G_RAID_SUBDISK_S_RESYNC) { + sbuf_printf(sb, " %d%%", + (int)(sd->sd_rebuild_pos * 100 / + sd->sd_size)); + } if (TAILQ_NEXT(sd, sd_next)) sbuf_printf(sb, ", "); } From owner-svn-src-projects@FreeBSD.ORG Thu Jan 27 12:01:24 2011 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 911DD1065672; Thu, 27 Jan 2011 12:01:24 +0000 (UTC) (envelope-from pho@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5D88B8FC29; Thu, 27 Jan 2011 12:01:24 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0RC1OY6015373; Thu, 27 Jan 2011 12:01:24 GMT (envelope-from pho@svn.freebsd.org) Received: (from pho@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0RC1OWs015371; Thu, 27 Jan 2011 12:01:24 GMT (envelope-from pho@svn.freebsd.org) Message-Id: <201101271201.p0RC1OWs015371@svn.freebsd.org> From: Peter Holm Date: Thu, 27 Jan 2011 12:01:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217934 - projects/stress2/misc X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Jan 2011 12:01:24 -0000 Author: pho Date: Thu Jan 27 12:01:24 2011 New Revision: 217934 URL: http://svn.freebsd.org/changeset/base/217934 Log: Deadlock scenario based on kern/154228 added. Added: projects/stress2/misc/gjournal.sh (contents, props changed) Added: projects/stress2/misc/gjournal.sh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ projects/stress2/misc/gjournal.sh Thu Jan 27 12:01:24 2011 (r217934) @@ -0,0 +1,70 @@ +#!/bin/sh + +# +# Copyright (c) 2011 Peter Holm +# All rights reserved. +# +# 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: projects/stress2/misc/sendfile.sh 199142 2009-11-10 16:47:48Z pho $ +# + +# Deadlock scenario based on kern/154228, fixed in r217880. + +. ../default.cfg + +size="2g" +m=$((mdstart + 1)) +mount | grep /media | grep -q /dev/md && umount -f /media +mount | grep $mntpoint | grep -q /dev/md && umount -f $mntpoint +mdconfig -l | grep -q md$mdstart && mdconfig -d -u $mdstart +mdconfig -l | grep -q md$m && mdconfig -d -u $m +mdconfig -a -t swap -s $size -u $mdstart || exit 1 + +gjournal load +gjournal label -s $((200 * 1024 * 1024)) md$mdstart +sleep .5 +newfs -J /dev/md$mdstart.journal > /dev/null +mount -o async /dev/md$mdstart.journal $mntpoint + +here=`pwd` +cd $mntpoint +truncate -s 1g image +mdconfig -a -t vnode -f image -u $m +bsdlabel -w md$m auto +newfs md${m}$part > /dev/null +mount /dev/md${m}$part /media +# dd will suspend in wdrain +dd if=/dev/zero of=/media/zero bs=1M 2>&1 | egrep -v "records|transferred" +while mount | grep /media | grep -q /dev/md; do + umount /media || sleep 1 +done +mdconfig -d -u $m +cd $here + +gjournal sync +while mount | grep $mntpoint | grep -q /dev/md; do + umount $mntpoint || sleep 1 +done +gjournal stop md$mdstart +gjournal unload +mdconfig -d -u $mdstart From owner-svn-src-projects@FreeBSD.ORG Thu Jan 27 13:16:10 2011 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 72C221065670; Thu, 27 Jan 2011 13:16:10 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5CD348FC14; Thu, 27 Jan 2011 13:16:10 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0RDGAcT017292; Thu, 27 Jan 2011 13:16:10 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0RDGAUl017268; Thu, 27 Jan 2011 13:16:10 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201101271316.p0RDGAUl017268@svn.freebsd.org> From: Alexander Motin Date: Thu, 27 Jan 2011 13:16:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217935 - in projects/graid/head: . bin/kill bin/ps bin/setfacl bin/sh bin/sh/bltin cddl/contrib/opensolaris/lib/libzpool/common/sys contrib/binutils/ld contrib/binutils/ld/emultempl co... X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Jan 2011 13:16:10 -0000 Author: mav Date: Thu Jan 27 13:16:08 2011 New Revision: 217935 URL: http://svn.freebsd.org/changeset/base/217935 Log: IFC Added: projects/graid/head/contrib/bsnmp/lib/tc.def - copied unchanged from r217933, head/contrib/bsnmp/lib/tc.def projects/graid/head/contrib/bsnmp/snmp_target/ - copied from r217933, head/contrib/bsnmp/snmp_target/ - copied from r217933, head/contrib/dialog/ projects/graid/head/gnu/lib/libdialog/dlg_config.h - copied unchanged from r217933, head/gnu/lib/libdialog/dlg_config.h projects/graid/head/gnu/lib/libodialog/ - copied from r217933, head/gnu/lib/libodialog/ projects/graid/head/lib/libthr/thread/thr_sleepq.c - copied unchanged from r217933, head/lib/libthr/thread/thr_sleepq.c projects/graid/head/share/doc/papers/kernmalloc/appendix.ms - copied unchanged from r217933, head/share/doc/papers/kernmalloc/appendix.ms projects/graid/head/share/doc/papers/sysperf/appendix.ms - copied unchanged from r217933, head/share/doc/papers/sysperf/appendix.ms projects/graid/head/share/man/man4/rgephy.4 - copied unchanged from r217933, head/share/man/man4/rgephy.4 projects/graid/head/share/man/man4/runfw.4 - copied unchanged from r217933, head/share/man/man4/runfw.4 projects/graid/head/share/man/man4/vte.4 - copied unchanged from r217933, head/share/man/man4/vte.4 projects/graid/head/share/man/man9/osd.9 - copied unchanged from r217933, head/share/man/man9/osd.9 projects/graid/head/sys/boot/powerpc/ps3/ - copied from r217933, head/sys/boot/powerpc/ps3/ projects/graid/head/sys/conf/ldscript.mips.octeon1 - copied unchanged from r217933, head/sys/conf/ldscript.mips.octeon1 projects/graid/head/sys/contrib/dev/acpica/compiler/asluuid.c - copied unchanged from r217933, head/sys/contrib/dev/acpica/compiler/asluuid.c projects/graid/head/sys/contrib/dev/acpica/events/evxfgpe.c - copied unchanged from r217933, head/sys/contrib/dev/acpica/events/evxfgpe.c projects/graid/head/sys/contrib/dev/wpi/iwlwifi-3945-15.32.2.9.fw.uu - copied unchanged from r217933, head/sys/contrib/dev/wpi/iwlwifi-3945-15.32.2.9.fw.uu projects/graid/head/sys/dev/ath/ath_hal/ah_diagcodes.h - copied unchanged from r217933, head/sys/dev/ath/ath_hal/ah_diagcodes.h projects/graid/head/sys/dev/ath/ath_hal/ar9001/ - copied from r217933, head/sys/dev/ath/ath_hal/ar9001/ projects/graid/head/sys/dev/ath/ath_hal/ar9002/ - copied from r217933, head/sys/dev/ath/ath_hal/ar9002/ projects/graid/head/sys/dev/ath/ath_hal/ar9003/ - copied from r217933, head/sys/dev/ath/ath_hal/ar9003/ projects/graid/head/sys/dev/mii/rdcphy.c - copied unchanged from r217933, head/sys/dev/mii/rdcphy.c projects/graid/head/sys/dev/mii/rdcphyreg.h - copied unchanged from r217933, head/sys/dev/mii/rdcphyreg.h projects/graid/head/sys/dev/vte/ - copied from r217933, head/sys/dev/vte/ projects/graid/head/sys/kern/kern_hhook.c - copied unchanged from r217933, head/sys/kern/kern_hhook.c projects/graid/head/sys/kern/kern_khelp.c - copied unchanged from r217933, head/sys/kern/kern_khelp.c projects/graid/head/sys/mips/cavium/if_octm.c - copied unchanged from r217933, head/sys/mips/cavium/if_octm.c projects/graid/head/sys/modules/khelp/ - copied from r217933, head/sys/modules/khelp/ projects/graid/head/sys/modules/vte/ - copied from r217933, head/sys/modules/vte/ projects/graid/head/sys/netinet/khelp/ - copied from r217933, head/sys/netinet/khelp/ projects/graid/head/sys/netinet/sctp_ss_functions.c - copied unchanged from r217933, head/sys/netinet/sctp_ss_functions.c projects/graid/head/sys/powerpc/ps3/ - copied from r217933, head/sys/powerpc/ps3/ projects/graid/head/sys/sys/hhook.h - copied unchanged from r217933, head/sys/sys/hhook.h projects/graid/head/sys/sys/khelp.h - copied unchanged from r217933, head/sys/sys/khelp.h projects/graid/head/sys/sys/module_khelp.h - copied unchanged from r217933, head/sys/sys/module_khelp.h projects/graid/head/sys/x86/include/_inttypes.h - copied unchanged from r217933, head/sys/x86/include/_inttypes.h projects/graid/head/sys/x86/include/bus.h - copied unchanged from r217933, head/sys/x86/include/bus.h projects/graid/head/tools/regression/bin/sh/builtins/exit1.0 - copied unchanged from r217933, head/tools/regression/bin/sh/builtins/exit1.0 projects/graid/head/tools/regression/bin/sh/builtins/exit2.8 - copied unchanged from r217933, head/tools/regression/bin/sh/builtins/exit2.8 projects/graid/head/tools/regression/bin/sh/builtins/exit3.0 - copied unchanged from r217933, head/tools/regression/bin/sh/builtins/exit3.0 projects/graid/head/tools/regression/bin/sh/builtins/printf3.0 - copied unchanged from r217933, head/tools/regression/bin/sh/builtins/printf3.0 projects/graid/head/tools/regression/bin/sh/builtins/printf4.0 - copied unchanged from r217933, head/tools/regression/bin/sh/builtins/printf4.0 projects/graid/head/tools/regression/bin/sh/builtins/trap4.0 - copied unchanged from r217933, head/tools/regression/bin/sh/builtins/trap4.0 projects/graid/head/tools/regression/bin/sh/builtins/trap5.0 - copied unchanged from r217933, head/tools/regression/bin/sh/builtins/trap5.0 projects/graid/head/tools/regression/bin/sh/builtins/trap6.0 - copied unchanged from r217933, head/tools/regression/bin/sh/builtins/trap6.0 projects/graid/head/tools/regression/bin/sh/errors/assignment-error2.0 - copied unchanged from r217933, head/tools/regression/bin/sh/errors/assignment-error2.0 projects/graid/head/tools/regression/bin/sh/errors/redirection-error7.0 - copied unchanged from r217933, head/tools/regression/bin/sh/errors/redirection-error7.0 projects/graid/head/tools/regression/bin/sh/execution/killed1.0 - copied unchanged from r217933, head/tools/regression/bin/sh/execution/killed1.0 projects/graid/head/tools/regression/bin/sh/execution/path1.0 - copied unchanged from r217933, head/tools/regression/bin/sh/execution/path1.0 projects/graid/head/tools/regression/bin/sh/expansion/arith8.0 - copied unchanged from r217933, head/tools/regression/bin/sh/expansion/arith8.0 projects/graid/head/tools/regression/bin/sh/expansion/cmdsubst10.0 - copied unchanged from r217933, head/tools/regression/bin/sh/expansion/cmdsubst10.0 projects/graid/head/tools/regression/bin/sh/expansion/cmdsubst3.0 - copied unchanged from r217933, head/tools/regression/bin/sh/expansion/cmdsubst3.0 projects/graid/head/tools/regression/bin/sh/expansion/cmdsubst4.0 - copied unchanged from r217933, head/tools/regression/bin/sh/expansion/cmdsubst4.0 projects/graid/head/tools/regression/bin/sh/expansion/cmdsubst5.0 - copied unchanged from r217933, head/tools/regression/bin/sh/expansion/cmdsubst5.0 projects/graid/head/tools/regression/bin/sh/expansion/cmdsubst6.0 - copied unchanged from r217933, head/tools/regression/bin/sh/expansion/cmdsubst6.0 projects/graid/head/tools/regression/bin/sh/expansion/cmdsubst7.0 - copied unchanged from r217933, head/tools/regression/bin/sh/expansion/cmdsubst7.0 projects/graid/head/tools/regression/bin/sh/expansion/cmdsubst8.0 - copied unchanged from r217933, head/tools/regression/bin/sh/expansion/cmdsubst8.0 projects/graid/head/tools/regression/bin/sh/expansion/cmdsubst9.0 - copied unchanged from r217933, head/tools/regression/bin/sh/expansion/cmdsubst9.0 projects/graid/head/tools/regression/bin/sh/expansion/plus-minus7.0 - copied unchanged from r217933, head/tools/regression/bin/sh/expansion/plus-minus7.0 projects/graid/head/tools/regression/usr.bin/sed/inplace_race.t - copied unchanged from r217933, head/tools/regression/usr.bin/sed/inplace_race.t projects/graid/head/tools/tools/ath/ath_ee_v14_print/ - copied from r217933, head/tools/tools/ath/ath_ee_v14_print/ projects/graid/head/tools/tools/ath/ath_ee_v4k_print/ - copied from r217933, head/tools/tools/ath/ath_ee_v4k_print/ projects/graid/head/tools/tools/ath/ath_prom_read/ - copied from r217933, head/tools/tools/ath/ath_prom_read/ projects/graid/head/usr.sbin/bsnmpd/modules/snmp_target/ - copied from r217933, head/usr.sbin/bsnmpd/modules/snmp_target/ Directory Properties: projects/graid/head/contrib/dialog/ (props changed) Deleted: projects/graid/head/gnu/lib/libdialog/CHANGES projects/graid/head/gnu/lib/libdialog/COPYING projects/graid/head/gnu/lib/libdialog/README projects/graid/head/gnu/lib/libdialog/TESTS/ projects/graid/head/gnu/lib/libdialog/TODO projects/graid/head/gnu/lib/libdialog/checklist.c projects/graid/head/gnu/lib/libdialog/colors.h projects/graid/head/gnu/lib/libdialog/dialog.3 projects/graid/head/gnu/lib/libdialog/dialog.h projects/graid/head/gnu/lib/libdialog/dialog.priv.h projects/graid/head/gnu/lib/libdialog/dir.c projects/graid/head/gnu/lib/libdialog/dir.h projects/graid/head/gnu/lib/libdialog/fselect.c projects/graid/head/gnu/lib/libdialog/gauge.c projects/graid/head/gnu/lib/libdialog/help.c projects/graid/head/gnu/lib/libdialog/inputbox.c projects/graid/head/gnu/lib/libdialog/kernel.c projects/graid/head/gnu/lib/libdialog/lineedit.c projects/graid/head/gnu/lib/libdialog/menubox.c projects/graid/head/gnu/lib/libdialog/msgbox.c projects/graid/head/gnu/lib/libdialog/notify.c projects/graid/head/gnu/lib/libdialog/prgbox.c projects/graid/head/gnu/lib/libdialog/radiolist.c projects/graid/head/gnu/lib/libdialog/raw_popen.c projects/graid/head/gnu/lib/libdialog/rc.c projects/graid/head/gnu/lib/libdialog/rc.h projects/graid/head/gnu/lib/libdialog/textbox.c projects/graid/head/gnu/lib/libdialog/tree.c projects/graid/head/gnu/lib/libdialog/ui_objects.c projects/graid/head/gnu/lib/libdialog/ui_objects.h projects/graid/head/gnu/lib/libdialog/yesno.c projects/graid/head/gnu/usr.bin/dialog/COPYING projects/graid/head/gnu/usr.bin/dialog/README projects/graid/head/gnu/usr.bin/dialog/README.lib projects/graid/head/gnu/usr.bin/dialog/TESTS/ projects/graid/head/gnu/usr.bin/dialog/dialog.1 projects/graid/head/gnu/usr.bin/dialog/dialog.c projects/graid/head/sys/arm/conf/SKYEYE projects/graid/head/sys/conf/ldscript.mips.64 projects/graid/head/sys/conf/ldscript.mips.64.cfe projects/graid/head/sys/conf/ldscript.mips.n32 projects/graid/head/sys/conf/ldscript.mips.octeon1.32 projects/graid/head/sys/conf/ldscript.mips.octeon1.64 projects/graid/head/sys/conf/ldscript.mips.octeon1.n32 projects/graid/head/sys/contrib/dev/wpi/iwlwifi-3945-2.14.4.fw.uu projects/graid/head/sys/dev/ath/ath_hal/ar5416/ar9160.ini projects/graid/head/sys/dev/ath/ath_hal/ar5416/ar9160_attach.c projects/graid/head/sys/dev/ath/ath_hal/ar5416/ar9280.c projects/graid/head/sys/dev/ath/ath_hal/ar5416/ar9280.h projects/graid/head/sys/dev/ath/ath_hal/ar5416/ar9280_attach.c projects/graid/head/sys/dev/ath/ath_hal/ar5416/ar9280v1.ini projects/graid/head/sys/dev/ath/ath_hal/ar5416/ar9280v2.ini projects/graid/head/sys/dev/ath/ath_hal/ar5416/ar9285.c projects/graid/head/sys/dev/ath/ath_hal/ar5416/ar9285.h projects/graid/head/sys/dev/ath/ath_hal/ar5416/ar9285.ini projects/graid/head/sys/dev/ath/ath_hal/ar5416/ar9285_attach.c projects/graid/head/sys/dev/ath/ath_hal/ar5416/ar9285_reset.c projects/graid/head/sys/dev/ath/ath_hal/ar5416/ar9285v2.ini projects/graid/head/sys/dev/cxgb/ulp/tom/cxgb_vm.c projects/graid/head/sys/dev/cxgb/ulp/tom/cxgb_vm.h projects/graid/head/sys/mips/conf/OCTEON1-32 projects/graid/head/sys/netinet/sctp_cc_functions.h Modified: projects/graid/head/COPYRIGHT projects/graid/head/Makefile projects/graid/head/Makefile.inc1 projects/graid/head/Makefile.mips projects/graid/head/ObsoleteFiles.inc projects/graid/head/UPDATING projects/graid/head/bin/kill/kill.1 projects/graid/head/bin/kill/kill.c projects/graid/head/bin/ps/print.c projects/graid/head/bin/ps/ps.1 projects/graid/head/bin/setfacl/setfacl.c projects/graid/head/bin/sh/Makefile projects/graid/head/bin/sh/alias.c projects/graid/head/bin/sh/arith_lex.l projects/graid/head/bin/sh/bltin/bltin.h projects/graid/head/bin/sh/builtins.def projects/graid/head/bin/sh/cd.c projects/graid/head/bin/sh/error.c projects/graid/head/bin/sh/error.h projects/graid/head/bin/sh/eval.c projects/graid/head/bin/sh/exec.c projects/graid/head/bin/sh/expand.c projects/graid/head/bin/sh/expand.h projects/graid/head/bin/sh/histedit.c projects/graid/head/bin/sh/jobs.c projects/graid/head/bin/sh/main.c projects/graid/head/bin/sh/memalloc.c projects/graid/head/bin/sh/memalloc.h projects/graid/head/bin/sh/parser.c projects/graid/head/bin/sh/redir.c projects/graid/head/bin/sh/sh.1 projects/graid/head/bin/sh/trap.c projects/graid/head/bin/sh/trap.h projects/graid/head/bin/sh/var.c projects/graid/head/bin/sh/var.h projects/graid/head/cddl/contrib/opensolaris/lib/libzpool/common/sys/zfs_context.h projects/graid/head/contrib/binutils/ld/emultempl/ppc64elf.em projects/graid/head/contrib/binutils/ld/ldemul.h projects/graid/head/contrib/bsnmp/lib/bsnmplib.3 projects/graid/head/contrib/bsnmp/lib/snmp.c projects/graid/head/contrib/bsnmp/lib/snmp.h projects/graid/head/contrib/bsnmp/lib/snmpagent.c projects/graid/head/contrib/bsnmp/lib/snmpclient.c projects/graid/head/contrib/bsnmp/lib/snmpcrypto.c projects/graid/head/contrib/bsnmp/lib/snmppriv.h projects/graid/head/contrib/bsnmp/snmp_usm/snmp_usm.3 projects/graid/head/contrib/bsnmp/snmp_usm/usm_tree.def projects/graid/head/contrib/bsnmp/snmp_vacm/vacm_tree.def projects/graid/head/contrib/bsnmp/snmpd/main.c projects/graid/head/contrib/bsnmp/snmpd/snmpmod.3 projects/graid/head/contrib/bsnmp/snmpd/snmpmod.h projects/graid/head/contrib/bsnmp/snmpd/trap.c projects/graid/head/contrib/bsnmp/snmpd/tree.def projects/graid/head/contrib/gcc/config/i386/freebsd.h projects/graid/head/contrib/gcc/config/rs6000/crtsavres.asm projects/graid/head/contrib/gcc/config/rs6000/freebsd.h projects/graid/head/contrib/gcc/config/rs6000/rs6000.c projects/graid/head/contrib/gcc/config/rs6000/tramp.asm projects/graid/head/contrib/groff/tmac/doc-common projects/graid/head/contrib/groff/tmac/doc-syms projects/graid/head/contrib/groff/tmac/groff_mdoc.man projects/graid/head/etc/defaults/rc.conf projects/graid/head/etc/devd.conf projects/graid/head/etc/mtree/BSD.usr.dist projects/graid/head/etc/mtree/README projects/graid/head/etc/periodic/daily/800.scrub-zfs projects/graid/head/etc/portsnap.conf projects/graid/head/etc/rc.d/devd projects/graid/head/etc/rc.d/ldconfig projects/graid/head/etc/rc.d/pf projects/graid/head/etc/rc.subr projects/graid/head/etc/snmpd.config projects/graid/head/games/factor/factor.c projects/graid/head/gnu/lib/Makefile projects/graid/head/gnu/lib/libdialog/Makefile projects/graid/head/gnu/lib/libgcc/Makefile projects/graid/head/gnu/lib/libgomp/Makefile projects/graid/head/gnu/usr.bin/binutils/Makefile.inc0 projects/graid/head/gnu/usr.bin/binutils/ld/Makefile.mips projects/graid/head/gnu/usr.bin/binutils/libbfd/Makefile.mips projects/graid/head/gnu/usr.bin/cc/Makefile.inc projects/graid/head/gnu/usr.bin/cc/Makefile.tgt projects/graid/head/gnu/usr.bin/dialog/Makefile projects/graid/head/gnu/usr.bin/gdb/Makefile.inc projects/graid/head/gnu/usr.bin/gdb/kgdb/main.c projects/graid/head/gnu/usr.bin/gdb/libgdb/Makefile projects/graid/head/gnu/usr.bin/groff/tmac/mdoc.local projects/graid/head/include/assert.h projects/graid/head/include/pthread.h projects/graid/head/include/unistd.h projects/graid/head/lib/bind/config.mk projects/graid/head/lib/csu/amd64/Makefile projects/graid/head/lib/csu/amd64/crti.S projects/graid/head/lib/csu/amd64/crtn.S projects/graid/head/lib/csu/arm/Makefile projects/graid/head/lib/csu/common/crtbrand.c projects/graid/head/lib/csu/i386-elf/Makefile projects/graid/head/lib/csu/i386-elf/crt1_s.S projects/graid/head/lib/csu/i386-elf/crti.S projects/graid/head/lib/csu/i386-elf/crtn.S projects/graid/head/lib/csu/ia64/Makefile projects/graid/head/lib/csu/mips/Makefile projects/graid/head/lib/csu/powerpc/Makefile projects/graid/head/lib/csu/powerpc/crti.S projects/graid/head/lib/csu/powerpc/crtn.S projects/graid/head/lib/csu/powerpc64/Makefile projects/graid/head/lib/csu/powerpc64/crti.S projects/graid/head/lib/csu/powerpc64/crtn.S projects/graid/head/lib/libc/Makefile projects/graid/head/lib/libc/amd64/gen/_setjmp.S projects/graid/head/lib/libc/amd64/gen/fabs.S projects/graid/head/lib/libc/amd64/gen/modf.S projects/graid/head/lib/libc/amd64/gen/rfork_thread.S projects/graid/head/lib/libc/amd64/gen/setjmp.S projects/graid/head/lib/libc/amd64/gen/sigsetjmp.S projects/graid/head/lib/libc/amd64/stdlib/div.S projects/graid/head/lib/libc/amd64/stdlib/ldiv.S projects/graid/head/lib/libc/amd64/stdlib/lldiv.S projects/graid/head/lib/libc/amd64/string/bcmp.S projects/graid/head/lib/libc/amd64/string/bcopy.S projects/graid/head/lib/libc/amd64/string/bzero.S projects/graid/head/lib/libc/amd64/string/memcmp.S projects/graid/head/lib/libc/amd64/string/memmove.S projects/graid/head/lib/libc/amd64/string/memset.S projects/graid/head/lib/libc/amd64/string/strcat.S projects/graid/head/lib/libc/amd64/string/strcmp.S projects/graid/head/lib/libc/amd64/string/strcpy.S projects/graid/head/lib/libc/amd64/sys/brk.S projects/graid/head/lib/libc/amd64/sys/cerror.S projects/graid/head/lib/libc/amd64/sys/exect.S projects/graid/head/lib/libc/amd64/sys/getcontext.S projects/graid/head/lib/libc/amd64/sys/pipe.S projects/graid/head/lib/libc/amd64/sys/ptrace.S projects/graid/head/lib/libc/amd64/sys/reboot.S projects/graid/head/lib/libc/amd64/sys/sbrk.S projects/graid/head/lib/libc/amd64/sys/setlogin.S projects/graid/head/lib/libc/amd64/sys/sigreturn.S projects/graid/head/lib/libc/amd64/sys/vfork.S projects/graid/head/lib/libc/gen/Symbol.map projects/graid/head/lib/libc/gen/dlfcn.c projects/graid/head/lib/libc/gen/elf_utils.c projects/graid/head/lib/libc/i386/gen/_ctx_start.S projects/graid/head/lib/libc/i386/gen/_setjmp.S projects/graid/head/lib/libc/i386/gen/fabs.S projects/graid/head/lib/libc/i386/gen/modf.S projects/graid/head/lib/libc/i386/gen/rfork_thread.S projects/graid/head/lib/libc/i386/gen/setjmp.S projects/graid/head/lib/libc/i386/gen/sigsetjmp.S projects/graid/head/lib/libc/i386/stdlib/div.S projects/graid/head/lib/libc/i386/stdlib/ldiv.S projects/graid/head/lib/libc/i386/string/bcmp.S projects/graid/head/lib/libc/i386/string/bcopy.S projects/graid/head/lib/libc/i386/string/bzero.S projects/graid/head/lib/libc/i386/string/ffs.S projects/graid/head/lib/libc/i386/string/index.S projects/graid/head/lib/libc/i386/string/memchr.S projects/graid/head/lib/libc/i386/string/memcmp.S projects/graid/head/lib/libc/i386/string/memcpy.S projects/graid/head/lib/libc/i386/string/memmove.S projects/graid/head/lib/libc/i386/string/memset.S projects/graid/head/lib/libc/i386/string/rindex.S projects/graid/head/lib/libc/i386/string/strcat.S projects/graid/head/lib/libc/i386/string/strchr.S projects/graid/head/lib/libc/i386/string/strcmp.S projects/graid/head/lib/libc/i386/string/strcpy.S projects/graid/head/lib/libc/i386/string/strncmp.S projects/graid/head/lib/libc/i386/string/strrchr.S projects/graid/head/lib/libc/i386/string/swab.S projects/graid/head/lib/libc/i386/string/wcschr.S projects/graid/head/lib/libc/i386/string/wcscmp.S projects/graid/head/lib/libc/i386/string/wcslen.S projects/graid/head/lib/libc/i386/string/wmemchr.S projects/graid/head/lib/libc/i386/sys/Ovfork.S projects/graid/head/lib/libc/i386/sys/brk.S projects/graid/head/lib/libc/i386/sys/cerror.S projects/graid/head/lib/libc/i386/sys/exect.S projects/graid/head/lib/libc/i386/sys/getcontext.S projects/graid/head/lib/libc/i386/sys/pipe.S projects/graid/head/lib/libc/i386/sys/ptrace.S projects/graid/head/lib/libc/i386/sys/reboot.S projects/graid/head/lib/libc/i386/sys/sbrk.S projects/graid/head/lib/libc/i386/sys/setlogin.S projects/graid/head/lib/libc/i386/sys/sigreturn.S projects/graid/head/lib/libc/i386/sys/syscall.S projects/graid/head/lib/libc/locale/mbrtowc.3 projects/graid/head/lib/libc/net/hesiod.c projects/graid/head/lib/libc/powerpc/gen/_ctx_start.S projects/graid/head/lib/libc/powerpc/gen/_setjmp.S projects/graid/head/lib/libc/powerpc/gen/fabs.S projects/graid/head/lib/libc/powerpc/gen/setjmp.S projects/graid/head/lib/libc/powerpc/gen/sigsetjmp.S projects/graid/head/lib/libc/powerpc/sys/brk.S projects/graid/head/lib/libc/powerpc/sys/cerror.S projects/graid/head/lib/libc/powerpc/sys/exect.S projects/graid/head/lib/libc/powerpc/sys/pipe.S projects/graid/head/lib/libc/powerpc/sys/ptrace.S projects/graid/head/lib/libc/powerpc/sys/sbrk.S projects/graid/head/lib/libc/powerpc/sys/setlogin.S projects/graid/head/lib/libc/powerpc64/gen/_ctx_start.S projects/graid/head/lib/libc/powerpc64/gen/_setjmp.S projects/graid/head/lib/libc/powerpc64/gen/fabs.S projects/graid/head/lib/libc/powerpc64/gen/setjmp.S projects/graid/head/lib/libc/powerpc64/gen/sigsetjmp.S projects/graid/head/lib/libc/powerpc64/sys/brk.S projects/graid/head/lib/libc/powerpc64/sys/cerror.S projects/graid/head/lib/libc/powerpc64/sys/exect.S projects/graid/head/lib/libc/powerpc64/sys/pipe.S projects/graid/head/lib/libc/powerpc64/sys/ptrace.S projects/graid/head/lib/libc/powerpc64/sys/sbrk.S projects/graid/head/lib/libc/powerpc64/sys/setlogin.S projects/graid/head/lib/libc/rpc/publickey.3 projects/graid/head/lib/libc/stdlib/realpath.c projects/graid/head/lib/libc/sys/Makefile.inc projects/graid/head/lib/libc/sys/getgroups.2 projects/graid/head/lib/libc/sys/mknod.2 projects/graid/head/lib/libc/sys/ptrace.2 projects/graid/head/lib/libc/sys/shmat.2 projects/graid/head/lib/libc/sys/shmctl.2 projects/graid/head/lib/libc/sys/shmget.2 projects/graid/head/lib/libcompiler_rt/Makefile projects/graid/head/lib/libelf/elf_data.c projects/graid/head/lib/libfetch/ftp.c projects/graid/head/lib/libjail/jail.c projects/graid/head/lib/libkvm/Makefile projects/graid/head/lib/libkvm/kvm.c projects/graid/head/lib/libkvm/kvm.h projects/graid/head/lib/libkvm/kvm_amd64.c projects/graid/head/lib/libkvm/kvm_arm.c projects/graid/head/lib/libkvm/kvm_cptime.c projects/graid/head/lib/libkvm/kvm_file.c projects/graid/head/lib/libkvm/kvm_getloadavg.3 projects/graid/head/lib/libkvm/kvm_getloadavg.c projects/graid/head/lib/libkvm/kvm_getswapinfo.c projects/graid/head/lib/libkvm/kvm_i386.c projects/graid/head/lib/libkvm/kvm_ia64.c projects/graid/head/lib/libkvm/kvm_minidump_amd64.c projects/graid/head/lib/libkvm/kvm_minidump_arm.c projects/graid/head/lib/libkvm/kvm_minidump_i386.c projects/graid/head/lib/libkvm/kvm_minidump_mips.c projects/graid/head/lib/libkvm/kvm_mips.c projects/graid/head/lib/libkvm/kvm_pcpu.c projects/graid/head/lib/libkvm/kvm_powerpc.c projects/graid/head/lib/libkvm/kvm_powerpc64.c projects/graid/head/lib/libkvm/kvm_proc.c projects/graid/head/lib/libkvm/kvm_sparc64.c projects/graid/head/lib/libkvm/kvm_vnet.c projects/graid/head/lib/libstand/Makefile projects/graid/head/lib/libthr/arch/amd64/amd64/_umtx_op_err.S projects/graid/head/lib/libthr/arch/i386/i386/_umtx_op_err.S projects/graid/head/lib/libthr/pthread.map projects/graid/head/lib/libthr/thread/Makefile.inc projects/graid/head/lib/libthr/thread/thr_cond.c projects/graid/head/lib/libthr/thread/thr_create.c projects/graid/head/lib/libthr/thread/thr_init.c projects/graid/head/lib/libthr/thread/thr_kern.c projects/graid/head/lib/libthr/thread/thr_list.c projects/graid/head/lib/libthr/thread/thr_mutex.c projects/graid/head/lib/libthr/thread/thr_private.h projects/graid/head/lib/libthr/thread/thr_rtld.c projects/graid/head/lib/libthr/thread/thr_sig.c projects/graid/head/lib/libthr/thread/thr_stack.c projects/graid/head/lib/libthr/thread/thr_umtx.c projects/graid/head/lib/libthr/thread/thr_umtx.h projects/graid/head/lib/libugidfw/ugidfw.c projects/graid/head/lib/msun/amd64/e_remainder.S projects/graid/head/lib/msun/amd64/e_remainderf.S projects/graid/head/lib/msun/amd64/e_remainderl.S projects/graid/head/lib/msun/amd64/e_sqrt.S projects/graid/head/lib/msun/amd64/e_sqrtf.S projects/graid/head/lib/msun/amd64/e_sqrtl.S projects/graid/head/lib/msun/amd64/s_llrint.S projects/graid/head/lib/msun/amd64/s_llrintf.S projects/graid/head/lib/msun/amd64/s_llrintl.S projects/graid/head/lib/msun/amd64/s_logbl.S projects/graid/head/lib/msun/amd64/s_lrint.S projects/graid/head/lib/msun/amd64/s_lrintf.S projects/graid/head/lib/msun/amd64/s_lrintl.S projects/graid/head/lib/msun/amd64/s_remquo.S projects/graid/head/lib/msun/amd64/s_remquof.S projects/graid/head/lib/msun/amd64/s_remquol.S projects/graid/head/lib/msun/amd64/s_rintl.S projects/graid/head/lib/msun/amd64/s_scalbn.S projects/graid/head/lib/msun/amd64/s_scalbnf.S projects/graid/head/lib/msun/amd64/s_scalbnl.S projects/graid/head/lib/msun/i387/e_exp.S projects/graid/head/lib/msun/i387/e_fmod.S projects/graid/head/lib/msun/i387/e_log.S projects/graid/head/lib/msun/i387/e_log10.S projects/graid/head/lib/msun/i387/e_log10f.S projects/graid/head/lib/msun/i387/e_logf.S projects/graid/head/lib/msun/i387/e_remainder.S projects/graid/head/lib/msun/i387/e_remainderf.S projects/graid/head/lib/msun/i387/e_remainderl.S projects/graid/head/lib/msun/i387/e_sqrt.S projects/graid/head/lib/msun/i387/e_sqrtf.S projects/graid/head/lib/msun/i387/e_sqrtl.S projects/graid/head/lib/msun/i387/s_ceil.S projects/graid/head/lib/msun/i387/s_ceilf.S projects/graid/head/lib/msun/i387/s_ceill.S projects/graid/head/lib/msun/i387/s_copysign.S projects/graid/head/lib/msun/i387/s_copysignf.S projects/graid/head/lib/msun/i387/s_copysignl.S projects/graid/head/lib/msun/i387/s_cos.S projects/graid/head/lib/msun/i387/s_finite.S projects/graid/head/lib/msun/i387/s_floor.S projects/graid/head/lib/msun/i387/s_floorf.S projects/graid/head/lib/msun/i387/s_floorl.S projects/graid/head/lib/msun/i387/s_llrint.S projects/graid/head/lib/msun/i387/s_llrintf.S projects/graid/head/lib/msun/i387/s_llrintl.S projects/graid/head/lib/msun/i387/s_logb.S projects/graid/head/lib/msun/i387/s_logbf.S projects/graid/head/lib/msun/i387/s_logbl.S projects/graid/head/lib/msun/i387/s_lrint.S projects/graid/head/lib/msun/i387/s_lrintf.S projects/graid/head/lib/msun/i387/s_lrintl.S projects/graid/head/lib/msun/i387/s_remquo.S projects/graid/head/lib/msun/i387/s_remquof.S projects/graid/head/lib/msun/i387/s_remquol.S projects/graid/head/lib/msun/i387/s_rint.S projects/graid/head/lib/msun/i387/s_rintf.S projects/graid/head/lib/msun/i387/s_rintl.S projects/graid/head/lib/msun/i387/s_scalbn.S projects/graid/head/lib/msun/i387/s_scalbnf.S projects/graid/head/lib/msun/i387/s_scalbnl.S projects/graid/head/lib/msun/i387/s_significand.S projects/graid/head/lib/msun/i387/s_significandf.S projects/graid/head/lib/msun/i387/s_sin.S projects/graid/head/lib/msun/i387/s_tan.S projects/graid/head/lib/msun/i387/s_trunc.S projects/graid/head/lib/msun/i387/s_truncf.S projects/graid/head/lib/msun/i387/s_truncl.S projects/graid/head/libexec/ftpd/ftpd.c projects/graid/head/libexec/getty/chat.c projects/graid/head/libexec/getty/main.c projects/graid/head/libexec/rbootd/rbootd.c projects/graid/head/libexec/rlogind/rlogind.c projects/graid/head/libexec/rpc.rwalld/rwalld.c projects/graid/head/libexec/rtld-elf/Makefile projects/graid/head/libexec/rtld-elf/Symbol.map projects/graid/head/libexec/rtld-elf/amd64/Makefile.inc projects/graid/head/libexec/rtld-elf/amd64/reloc.c projects/graid/head/libexec/rtld-elf/amd64/rtld_machdep.h projects/graid/head/libexec/rtld-elf/amd64/rtld_start.S projects/graid/head/libexec/rtld-elf/arm/reloc.c projects/graid/head/libexec/rtld-elf/arm/rtld_machdep.h projects/graid/head/libexec/rtld-elf/i386/Makefile.inc projects/graid/head/libexec/rtld-elf/i386/reloc.c projects/graid/head/libexec/rtld-elf/i386/rtld_machdep.h projects/graid/head/libexec/rtld-elf/i386/rtld_start.S projects/graid/head/libexec/rtld-elf/ia64/reloc.c projects/graid/head/libexec/rtld-elf/ia64/rtld_machdep.h projects/graid/head/libexec/rtld-elf/map_object.c projects/graid/head/libexec/rtld-elf/mips/reloc.c projects/graid/head/libexec/rtld-elf/mips/rtld_machdep.h projects/graid/head/libexec/rtld-elf/powerpc/reloc.c projects/graid/head/libexec/rtld-elf/powerpc/rtld_machdep.h projects/graid/head/libexec/rtld-elf/powerpc/rtld_start.S projects/graid/head/libexec/rtld-elf/powerpc64/reloc.c projects/graid/head/libexec/rtld-elf/powerpc64/rtld_machdep.h projects/graid/head/libexec/rtld-elf/powerpc64/rtld_start.S projects/graid/head/libexec/rtld-elf/rtld.1 projects/graid/head/libexec/rtld-elf/rtld.c projects/graid/head/libexec/rtld-elf/rtld.h projects/graid/head/libexec/rtld-elf/rtld_lock.c projects/graid/head/libexec/rtld-elf/rtld_lock.h projects/graid/head/libexec/rtld-elf/sparc64/reloc.c projects/graid/head/libexec/rtld-elf/sparc64/rtld_machdep.h projects/graid/head/release/amd64/boot_crunch.conf projects/graid/head/release/i386/boot_crunch.conf projects/graid/head/release/ia64/boot_crunch.conf projects/graid/head/release/pc98/boot_crunch.conf projects/graid/head/release/powerpc/boot_crunch.conf projects/graid/head/release/powerpc/mkisoimages.sh projects/graid/head/release/sparc64/boot_crunch.conf projects/graid/head/release/sun4v/boot_crunch.conf projects/graid/head/sbin/camcontrol/camcontrol.8 projects/graid/head/sbin/dump/itime.c projects/graid/head/sbin/dump/main.c projects/graid/head/sbin/dump/optr.c projects/graid/head/sbin/dump/tape.c projects/graid/head/sbin/dumpfs/dumpfs.c projects/graid/head/sbin/fdisk/fdisk.c projects/graid/head/sbin/fsck_ffs/inode.c projects/graid/head/sbin/fsck_ffs/main.c projects/graid/head/sbin/fsck_ffs/suj.c projects/graid/head/sbin/fsdb/fsdb.c projects/graid/head/sbin/fsirand/fsirand.c projects/graid/head/sbin/geom/Makefile.inc projects/graid/head/sbin/geom/class/Makefile.inc projects/graid/head/sbin/geom/class/cache/Makefile projects/graid/head/sbin/geom/class/concat/Makefile projects/graid/head/sbin/geom/class/eli/Makefile projects/graid/head/sbin/geom/class/journal/Makefile projects/graid/head/sbin/geom/class/label/Makefile projects/graid/head/sbin/geom/class/mirror/Makefile projects/graid/head/sbin/geom/class/mountver/Makefile projects/graid/head/sbin/geom/class/multipath/Makefile projects/graid/head/sbin/geom/class/nop/Makefile projects/graid/head/sbin/geom/class/part/Makefile projects/graid/head/sbin/geom/class/part/geom_part.c projects/graid/head/sbin/geom/class/part/gpart.8 projects/graid/head/sbin/geom/class/raid/Makefile projects/graid/head/sbin/geom/class/raid3/Makefile projects/graid/head/sbin/geom/class/raid3/geom_raid3.c projects/graid/head/sbin/geom/class/raid3/graid3.8 projects/graid/head/sbin/geom/class/sched/Makefile projects/graid/head/sbin/geom/class/shsec/Makefile projects/graid/head/sbin/geom/class/stripe/Makefile projects/graid/head/sbin/geom/class/virstor/Makefile projects/graid/head/sbin/geom/class/virstor/gvirstor.8 projects/graid/head/sbin/geom/core/Makefile projects/graid/head/sbin/geom/core/geom.c projects/graid/head/sbin/growfs/growfs.c projects/graid/head/sbin/hastd/control.c projects/graid/head/sbin/hastd/control.h projects/graid/head/sbin/hastd/hastd.c projects/graid/head/sbin/hastd/hastd.h projects/graid/head/sbin/hastd/hooks.c projects/graid/head/sbin/hastd/nv.c projects/graid/head/sbin/hastd/nv.h projects/graid/head/sbin/hastd/parse.y projects/graid/head/sbin/hastd/pjdlog.c projects/graid/head/sbin/hastd/pjdlog.h projects/graid/head/sbin/hastd/primary.c projects/graid/head/sbin/ifconfig/ifmedia.c projects/graid/head/sbin/init/init.8 projects/graid/head/sbin/init/init.c projects/graid/head/sbin/iscontrol/config.c projects/graid/head/sbin/iscontrol/fsm.c projects/graid/head/sbin/mount/mount.8 projects/graid/head/sbin/mount_nfs/mount_nfs.c projects/graid/head/sbin/newfs/mkfs.c projects/graid/head/sbin/newfs/newfs.8 projects/graid/head/sbin/newfs/newfs.c projects/graid/head/sbin/newfs/newfs.h projects/graid/head/sbin/ping6/ping6.c projects/graid/head/sbin/shutdown/Makefile projects/graid/head/sbin/shutdown/shutdown.8 projects/graid/head/sbin/shutdown/shutdown.c projects/graid/head/sbin/sysctl/sysctl.8 projects/graid/head/sbin/sysctl/sysctl.c projects/graid/head/sbin/tunefs/tunefs.8 projects/graid/head/sbin/tunefs/tunefs.c projects/graid/head/share/doc/papers/kernmalloc/Makefile projects/graid/head/share/doc/papers/sysperf/Makefile projects/graid/head/share/examples/etc/make.conf projects/graid/head/share/examples/kld/dyn_sysctl/dyn_sysctl.c projects/graid/head/share/man/man1/builtin.1 projects/graid/head/share/man/man3/queue.3 projects/graid/head/share/man/man4/Makefile projects/graid/head/share/man/man4/altq.4 projects/graid/head/share/man/man4/axe.4 projects/graid/head/share/man/man4/ixgb.4 projects/graid/head/share/man/man4/ixgbe.4 projects/graid/head/share/man/man4/jme.4 projects/graid/head/share/man/man4/miibus.4 projects/graid/head/share/man/man4/nfe.4 projects/graid/head/share/man/man4/nve.4 projects/graid/head/share/man/man4/re.4 projects/graid/head/share/man/man4/run.4 projects/graid/head/share/man/man4/sge.4 projects/graid/head/share/man/man4/tcp.4 projects/graid/head/share/man/man4/uplcom.4 projects/graid/head/share/man/man4/vlan.4 projects/graid/head/share/man/man4/wi.4 projects/graid/head/share/man/man4/xen.4 projects/graid/head/share/man/man5/core.5 projects/graid/head/share/man/man5/devfs.5 projects/graid/head/share/man/man5/rc.conf.5 projects/graid/head/share/man/man5/xfs.5 projects/graid/head/share/man/man7/build.7 projects/graid/head/share/man/man9/BUS_SETUP_INTR.9 projects/graid/head/share/man/man9/Makefile projects/graid/head/share/man/man9/VOP_READDIR.9 projects/graid/head/share/man/man9/ithread.9 projects/graid/head/share/man/man9/make_dev.9 projects/graid/head/share/man/man9/mutex.9 projects/graid/head/share/man/man9/sbuf.9 projects/graid/head/share/man/man9/sleep.9 projects/graid/head/share/man/man9/style.9 projects/graid/head/share/man/man9/swi.9 projects/graid/head/share/man/man9/sysctl.9 projects/graid/head/share/misc/bsd-family-tree projects/graid/head/share/misc/committers-doc.dot projects/graid/head/share/misc/committers-src.dot projects/graid/head/share/mk/bsd.cpu.mk projects/graid/head/share/mk/bsd.endian.mk projects/graid/head/share/mk/bsd.lib.mk projects/graid/head/share/mk/bsd.libnames.mk projects/graid/head/share/mk/bsd.own.mk projects/graid/head/share/mk/sys.mk projects/graid/head/sys/amd64/acpica/acpi_machdep.c projects/graid/head/sys/amd64/amd64/amd64_mem.c projects/graid/head/sys/amd64/amd64/apic_vector.S projects/graid/head/sys/amd64/amd64/cpu_switch.S projects/graid/head/sys/amd64/amd64/elf_machdep.c projects/graid/head/sys/amd64/amd64/exception.S projects/graid/head/sys/amd64/amd64/fpu.c projects/graid/head/sys/amd64/amd64/genassym.c projects/graid/head/sys/amd64/amd64/legacy.c projects/graid/head/sys/amd64/amd64/machdep.c projects/graid/head/sys/amd64/amd64/mem.c projects/graid/head/sys/amd64/amd64/mp_machdep.c projects/graid/head/sys/amd64/amd64/sys_machdep.c projects/graid/head/sys/amd64/amd64/vm_machdep.c projects/graid/head/sys/amd64/ia32/ia32_reg.c projects/graid/head/sys/amd64/ia32/ia32_signal.c projects/graid/head/sys/amd64/include/_inttypes.h projects/graid/head/sys/amd64/include/_limits.h projects/graid/head/sys/amd64/include/_stdint.h projects/graid/head/sys/amd64/include/atomic.h projects/graid/head/sys/amd64/include/bus.h projects/graid/head/sys/amd64/include/elf.h projects/graid/head/sys/amd64/include/memdev.h projects/graid/head/sys/amd64/include/pcb.h projects/graid/head/sys/amd64/include/vmparam.h projects/graid/head/sys/amd64/linux32/linux32_machdep.c projects/graid/head/sys/amd64/linux32/linux32_sysvec.c projects/graid/head/sys/arm/arm/mem.c projects/graid/head/sys/arm/arm/vm_machdep.c projects/graid/head/sys/arm/at91/at91_machdep.c projects/graid/head/sys/arm/at91/at91_st.c projects/graid/head/sys/arm/at91/at91rm9200.c projects/graid/head/sys/arm/at91/if_macb.c projects/graid/head/sys/arm/at91/uart_bus_at91usart.c projects/graid/head/sys/arm/at91/uart_cpu_at91rm9200usart.c projects/graid/head/sys/arm/at91/uart_dev_at91usart.c projects/graid/head/sys/arm/econa/econa_machdep.c projects/graid/head/sys/arm/econa/ehci_ebus.c projects/graid/head/sys/arm/econa/ohci_ec.c projects/graid/head/sys/arm/include/_limits.h projects/graid/head/sys/arm/include/_stdint.h projects/graid/head/sys/arm/include/_types.h projects/graid/head/sys/arm/include/elf.h projects/graid/head/sys/arm/include/memdev.h projects/graid/head/sys/arm/include/metadata.h projects/graid/head/sys/arm/include/pmap.h projects/graid/head/sys/arm/include/vmparam.h projects/graid/head/sys/arm/mv/gpio.c projects/graid/head/sys/arm/mv/mv_machdep.c projects/graid/head/sys/arm/s3c2xx0/s3c24x0_clk.c projects/graid/head/sys/arm/s3c2xx0/s3c24x0_machdep.c projects/graid/head/sys/arm/xscale/i80321/ep80219_machdep.c projects/graid/head/sys/arm/xscale/i80321/iq31244_machdep.c projects/graid/head/sys/arm/xscale/i8134x/crb_machdep.c projects/graid/head/sys/arm/xscale/ixp425/avila_gpio.c projects/graid/head/sys/arm/xscale/ixp425/avila_machdep.c projects/graid/head/sys/arm/xscale/pxa/pxa_machdep.c projects/graid/head/sys/boot/arm/at91/boot0/linker.cfg projects/graid/head/sys/boot/arm/at91/linker.cfg projects/graid/head/sys/boot/common/loader.8 projects/graid/head/sys/boot/efi/libefi/efinet.c projects/graid/head/sys/boot/efi/libefi/efipart.c projects/graid/head/sys/boot/ficl/Makefile projects/graid/head/sys/boot/forth/beastie.4th projects/graid/head/sys/boot/forth/loader.conf projects/graid/head/sys/boot/i386/Makefile.inc projects/graid/head/sys/boot/i386/boot2/Makefile projects/graid/head/sys/boot/i386/gptboot/Makefile projects/graid/head/sys/boot/i386/gptzfsboot/Makefile projects/graid/head/sys/boot/i386/zfsboot/Makefile projects/graid/head/sys/boot/pc98/Makefile.inc projects/graid/head/sys/boot/pc98/boot2/Makefile projects/graid/head/sys/boot/powerpc/Makefile projects/graid/head/sys/boot/powerpc/ofw/ldscript.powerpc projects/graid/head/sys/boot/zfs/Makefile projects/graid/head/sys/cam/ata/ata_xpt.c projects/graid/head/sys/cam/cam_periph.c projects/graid/head/sys/cam/cam_xpt.c projects/graid/head/sys/cam/scsi/scsi_da.c projects/graid/head/sys/cddl/compat/opensolaris/kern/opensolaris_kstat.c projects/graid/head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c projects/graid/head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_zfetch.c projects/graid/head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio.h projects/graid/head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/txg.c projects/graid/head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c projects/graid/head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c projects/graid/head/sys/cddl/dev/cyclic/i386/cyclic_machdep.c projects/graid/head/sys/compat/freebsd32/freebsd32.h projects/graid/head/sys/compat/freebsd32/freebsd32_misc.c projects/graid/head/sys/compat/ia32/ia32_sysvec.c projects/graid/head/sys/compat/ia32/ia32_util.h projects/graid/head/sys/compat/linprocfs/linprocfs.c projects/graid/head/sys/compat/linux/linux_file.c projects/graid/head/sys/compat/linux/linux_ioctl.c projects/graid/head/sys/compat/linux/linux_ioctl.h projects/graid/head/sys/compat/linux/linux_signal.c projects/graid/head/sys/compat/ndis/hal_var.h projects/graid/head/sys/compat/ndis/subr_ntoskrnl.c projects/graid/head/sys/conf/Makefile.mips projects/graid/head/sys/conf/NOTES projects/graid/head/sys/conf/files projects/graid/head/sys/conf/files.amd64 projects/graid/head/sys/conf/files.i386 projects/graid/head/sys/conf/files.pc98 projects/graid/head/sys/conf/files.powerpc projects/graid/head/sys/conf/kern.mk projects/graid/head/sys/conf/kern.pre.mk projects/graid/head/sys/conf/ldscript.mips.cfe projects/graid/head/sys/conf/ldscript.mips.mips64 (contents, props changed) projects/graid/head/sys/conf/ldscript.powerpc projects/graid/head/sys/conf/ldscript.powerpc64 projects/graid/head/sys/conf/ldscript.sparc64 projects/graid/head/sys/conf/makeLINT.mk projects/graid/head/sys/conf/options.i386 projects/graid/head/sys/conf/options.powerpc projects/graid/head/sys/contrib/dev/acpica/acpica_prep.sh projects/graid/head/sys/contrib/dev/acpica/changes.txt (contents, props changed) projects/graid/head/sys/contrib/dev/acpica/common/adfile.c (contents, props changed) projects/graid/head/sys/contrib/dev/acpica/common/adisasm.c (contents, props changed) projects/graid/head/sys/contrib/dev/acpica/common/adwalk.c (contents, props changed) projects/graid/head/sys/contrib/dev/acpica/common/dmextern.c projects/graid/head/sys/contrib/dev/acpica/common/dmrestag.c (contents, props changed) projects/graid/head/sys/contrib/dev/acpica/common/dmtable.c (contents, props changed) projects/graid/head/sys/contrib/dev/acpica/common/dmtbdump.c (contents, props changed) projects/graid/head/sys/contrib/dev/acpica/common/dmtbinfo.c (contents, props changed) projects/graid/head/sys/contrib/dev/acpica/common/getopt.c (contents, props changed) projects/graid/head/sys/contrib/dev/acpica/compiler/aslanalyze.c (contents, props changed) projects/graid/head/sys/contrib/dev/acpica/compiler/aslcodegen.c (contents, props changed) projects/graid/head/sys/contrib/dev/acpica/compiler/aslcompile.c (contents, props changed) projects/graid/head/sys/contrib/dev/acpica/compiler/aslcompiler.h (contents, props changed) projects/graid/head/sys/contrib/dev/acpica/compiler/aslcompiler.l (contents, props changed) projects/graid/head/sys/contrib/dev/acpica/compiler/aslcompiler.y (contents, props changed) projects/graid/head/sys/contrib/dev/acpica/compiler/asldefine.h (contents, props changed) projects/graid/head/sys/contrib/dev/acpica/compiler/aslerror.c (contents, props changed) projects/graid/head/sys/contrib/dev/acpica/compiler/aslfiles.c (contents, props changed) projects/graid/head/sys/contrib/dev/acpica/compiler/aslfold.c (contents, props changed) projects/graid/head/sys/contrib/dev/acpica/compiler/aslglobal.h (contents, props changed) projects/graid/head/sys/contrib/dev/acpica/compiler/asllength.c (contents, props changed) projects/graid/head/sys/contrib/dev/acpica/compiler/asllisting.c (contents, props changed) projects/graid/head/sys/contrib/dev/acpica/compiler/aslload.c (contents, props changed) projects/graid/head/sys/contrib/dev/acpica/compiler/asllookup.c (contents, props changed) projects/graid/head/sys/contrib/dev/acpica/compiler/aslmain.c (contents, props changed) projects/graid/head/sys/contrib/dev/acpica/compiler/aslmap.c (contents, props changed) projects/graid/head/sys/contrib/dev/acpica/compiler/aslmessages.h projects/graid/head/sys/contrib/dev/acpica/compiler/aslopcodes.c (contents, props changed) projects/graid/head/sys/contrib/dev/acpica/compiler/asloperands.c (contents, props changed) projects/graid/head/sys/contrib/dev/acpica/compiler/aslopt.c (contents, props changed) projects/graid/head/sys/contrib/dev/acpica/compiler/aslpredef.c projects/graid/head/sys/contrib/dev/acpica/compiler/aslresource.c (contents, props changed) projects/graid/head/sys/contrib/dev/acpica/compiler/aslrestype1.c (contents, props changed) projects/graid/head/sys/contrib/dev/acpica/compiler/aslrestype1i.c projects/graid/head/sys/contrib/dev/acpica/compiler/aslrestype2.c (contents, props changed) projects/graid/head/sys/contrib/dev/acpica/compiler/aslrestype2d.c projects/graid/head/sys/contrib/dev/acpica/compiler/aslrestype2e.c projects/graid/head/sys/contrib/dev/acpica/compiler/aslrestype2q.c projects/graid/head/sys/contrib/dev/acpica/compiler/aslrestype2w.c projects/graid/head/sys/contrib/dev/acpica/compiler/aslstartup.c projects/graid/head/sys/contrib/dev/acpica/compiler/aslstubs.c (contents, props changed) projects/graid/head/sys/contrib/dev/acpica/compiler/asltransform.c (contents, props changed) projects/graid/head/sys/contrib/dev/acpica/compiler/asltree.c (contents, props changed) projects/graid/head/sys/contrib/dev/acpica/compiler/asltypes.h (contents, props changed) projects/graid/head/sys/contrib/dev/acpica/compiler/aslutils.c (contents, props changed) projects/graid/head/sys/contrib/dev/acpica/compiler/dtcompile.c projects/graid/head/sys/contrib/dev/acpica/compiler/dtcompiler.h projects/graid/head/sys/contrib/dev/acpica/compiler/dtfield.c projects/graid/head/sys/contrib/dev/acpica/compiler/dtio.c projects/graid/head/sys/contrib/dev/acpica/compiler/dtsubtable.c projects/graid/head/sys/contrib/dev/acpica/compiler/dttable.c projects/graid/head/sys/contrib/dev/acpica/compiler/dttemplate.c projects/graid/head/sys/contrib/dev/acpica/compiler/dttemplate.h projects/graid/head/sys/contrib/dev/acpica/compiler/dtutils.c projects/graid/head/sys/contrib/dev/acpica/debugger/dbcmds.c (contents, props changed) projects/graid/head/sys/contrib/dev/acpica/debugger/dbdisply.c (contents, props changed) projects/graid/head/sys/contrib/dev/acpica/debugger/dbexec.c (contents, props changed) projects/graid/head/sys/contrib/dev/acpica/debugger/dbfileio.c (contents, props changed) projects/graid/head/sys/contrib/dev/acpica/debugger/dbhistry.c (contents, props changed) projects/graid/head/sys/contrib/dev/acpica/debugger/dbinput.c (contents, props changed) projects/graid/head/sys/contrib/dev/acpica/debugger/dbstats.c (contents, props changed) projects/graid/head/sys/contrib/dev/acpica/debugger/dbutils.c (contents, props changed) projects/graid/head/sys/contrib/dev/acpica/debugger/dbxface.c (contents, props changed) projects/graid/head/sys/contrib/dev/acpica/disassembler/dmbuffer.c (contents, props changed) projects/graid/head/sys/contrib/dev/acpica/disassembler/dmnames.c (contents, props changed) projects/graid/head/sys/contrib/dev/acpica/disassembler/dmobject.c (contents, props changed) projects/graid/head/sys/contrib/dev/acpica/disassembler/dmopcode.c (contents, props changed) projects/graid/head/sys/contrib/dev/acpica/disassembler/dmresrc.c (contents, props changed) projects/graid/head/sys/contrib/dev/acpica/disassembler/dmresrcl.c (contents, props changed) projects/graid/head/sys/contrib/dev/acpica/disassembler/dmresrcs.c (contents, props changed) projects/graid/head/sys/contrib/dev/acpica/disassembler/dmutils.c (contents, props changed) projects/graid/head/sys/contrib/dev/acpica/disassembler/dmwalk.c (contents, props changed) projects/graid/head/sys/contrib/dev/acpica/dispatcher/dsfield.c (contents, props changed) projects/graid/head/sys/contrib/dev/acpica/dispatcher/dsinit.c (contents, props changed) projects/graid/head/sys/contrib/dev/acpica/dispatcher/dsmethod.c (contents, props changed) projects/graid/head/sys/contrib/dev/acpica/dispatcher/dsmthdat.c (contents, props changed) projects/graid/head/sys/contrib/dev/acpica/dispatcher/dsobject.c (contents, props changed) projects/graid/head/sys/contrib/dev/acpica/dispatcher/dsopcode.c (contents, props changed) projects/graid/head/sys/contrib/dev/acpica/dispatcher/dsutils.c (contents, props changed) projects/graid/head/sys/contrib/dev/acpica/dispatcher/dswexec.c (contents, props changed) projects/graid/head/sys/contrib/dev/acpica/dispatcher/dswload.c (contents, props changed) projects/graid/head/sys/contrib/dev/acpica/dispatcher/dswscope.c (contents, props changed) projects/graid/head/sys/contrib/dev/acpica/dispatcher/dswstate.c (contents, props changed) projects/graid/head/sys/contrib/dev/acpica/events/evevent.c (contents, props changed) projects/graid/head/sys/contrib/dev/acpica/events/evgpe.c (contents, props changed) projects/graid/head/sys/contrib/dev/acpica/events/evgpeblk.c (contents, props changed) projects/graid/head/sys/contrib/dev/acpica/events/evgpeinit.c projects/graid/head/sys/contrib/dev/acpica/events/evgpeutil.c projects/graid/head/sys/contrib/dev/acpica/events/evmisc.c (contents, props changed) projects/graid/head/sys/contrib/dev/acpica/events/evregion.c (contents, props changed) projects/graid/head/sys/contrib/dev/acpica/events/evrgnini.c (contents, props changed) projects/graid/head/sys/contrib/dev/acpica/events/evsci.c (contents, props changed) projects/graid/head/sys/contrib/dev/acpica/events/evxface.c (contents, props changed) projects/graid/head/sys/contrib/dev/acpica/events/evxfevnt.c (contents, props changed) projects/graid/head/sys/contrib/dev/acpica/events/evxfregn.c (contents, props changed) projects/graid/head/sys/contrib/dev/acpica/executer/exconfig.c (contents, props changed) projects/graid/head/sys/contrib/dev/acpica/executer/exconvrt.c (contents, props changed) projects/graid/head/sys/contrib/dev/acpica/executer/excreate.c (contents, props changed) projects/graid/head/sys/contrib/dev/acpica/executer/exdebug.c projects/graid/head/sys/contrib/dev/acpica/executer/exdump.c (contents, props changed) projects/graid/head/sys/contrib/dev/acpica/executer/exfield.c (contents, props changed) projects/graid/head/sys/contrib/dev/acpica/executer/exfldio.c (contents, props changed) projects/graid/head/sys/contrib/dev/acpica/executer/exmisc.c (contents, props changed) projects/graid/head/sys/contrib/dev/acpica/executer/exmutex.c (contents, props changed) projects/graid/head/sys/contrib/dev/acpica/executer/exnames.c (contents, props changed) projects/graid/head/sys/contrib/dev/acpica/executer/exoparg1.c (contents, props changed) projects/graid/head/sys/contrib/dev/acpica/executer/exoparg2.c (contents, props changed) projects/graid/head/sys/contrib/dev/acpica/executer/exoparg3.c (contents, props changed) projects/graid/head/sys/contrib/dev/acpica/executer/exoparg6.c (contents, props changed) projects/graid/head/sys/contrib/dev/acpica/executer/exprep.c (contents, props changed) projects/graid/head/sys/contrib/dev/acpica/executer/exregion.c (contents, props changed) projects/graid/head/sys/contrib/dev/acpica/executer/exresnte.c (contents, props changed) projects/graid/head/sys/contrib/dev/acpica/executer/exresolv.c (contents, props changed) projects/graid/head/sys/contrib/dev/acpica/executer/exresop.c (contents, props changed) projects/graid/head/sys/contrib/dev/acpica/executer/exstore.c (contents, props changed) projects/graid/head/sys/contrib/dev/acpica/executer/exstoren.c (contents, props changed) projects/graid/head/sys/contrib/dev/acpica/executer/exstorob.c (contents, props changed) projects/graid/head/sys/contrib/dev/acpica/executer/exsystem.c (contents, props changed) projects/graid/head/sys/contrib/dev/acpica/executer/exutils.c (contents, props changed) projects/graid/head/sys/contrib/dev/acpica/hardware/hwacpi.c (contents, props changed) projects/graid/head/sys/contrib/dev/acpica/hardware/hwgpe.c (contents, props changed) projects/graid/head/sys/contrib/dev/acpica/hardware/hwpci.c projects/graid/head/sys/contrib/dev/acpica/hardware/hwregs.c (contents, props changed) projects/graid/head/sys/contrib/dev/acpica/hardware/hwsleep.c (contents, props changed) projects/graid/head/sys/contrib/dev/acpica/hardware/hwtimer.c (contents, props changed) projects/graid/head/sys/contrib/dev/acpica/hardware/hwvalid.c projects/graid/head/sys/contrib/dev/acpica/hardware/hwxface.c projects/graid/head/sys/contrib/dev/acpica/include/acapps.h (contents, props changed) projects/graid/head/sys/contrib/dev/acpica/include/accommon.h projects/graid/head/sys/contrib/dev/acpica/include/acconfig.h (contents, props changed) projects/graid/head/sys/contrib/dev/acpica/include/acdebug.h (contents, props changed) projects/graid/head/sys/contrib/dev/acpica/include/acdisasm.h (contents, props changed) projects/graid/head/sys/contrib/dev/acpica/include/acdispat.h (contents, props changed) projects/graid/head/sys/contrib/dev/acpica/include/acevents.h (contents, props changed) projects/graid/head/sys/contrib/dev/acpica/include/acexcep.h (contents, props changed) projects/graid/head/sys/contrib/dev/acpica/include/acglobal.h (contents, props changed) projects/graid/head/sys/contrib/dev/acpica/include/achware.h (contents, props changed) projects/graid/head/sys/contrib/dev/acpica/include/acinterp.h (contents, props changed) projects/graid/head/sys/contrib/dev/acpica/include/aclocal.h (contents, props changed) projects/graid/head/sys/contrib/dev/acpica/include/acmacros.h (contents, props changed) projects/graid/head/sys/contrib/dev/acpica/include/acnames.h (contents, props changed) projects/graid/head/sys/contrib/dev/acpica/include/acnamesp.h (contents, props changed) projects/graid/head/sys/contrib/dev/acpica/include/acobject.h (contents, props changed) projects/graid/head/sys/contrib/dev/acpica/include/acopcode.h (contents, props changed) projects/graid/head/sys/contrib/dev/acpica/include/acoutput.h (contents, props changed) projects/graid/head/sys/contrib/dev/acpica/include/acparser.h (contents, props changed) projects/graid/head/sys/contrib/dev/acpica/include/acpi.h (contents, props changed) projects/graid/head/sys/contrib/dev/acpica/include/acpiosxf.h (contents, props changed) projects/graid/head/sys/contrib/dev/acpica/include/acpixf.h (contents, props changed) projects/graid/head/sys/contrib/dev/acpica/include/acpredef.h projects/graid/head/sys/contrib/dev/acpica/include/acresrc.h (contents, props changed) projects/graid/head/sys/contrib/dev/acpica/include/acrestyp.h projects/graid/head/sys/contrib/dev/acpica/include/acstruct.h (contents, props changed) projects/graid/head/sys/contrib/dev/acpica/include/actables.h (contents, props changed) projects/graid/head/sys/contrib/dev/acpica/include/actbl.h (contents, props changed) projects/graid/head/sys/contrib/dev/acpica/include/actbl1.h (contents, props changed) projects/graid/head/sys/contrib/dev/acpica/include/actbl2.h projects/graid/head/sys/contrib/dev/acpica/include/actypes.h (contents, props changed) projects/graid/head/sys/contrib/dev/acpica/include/acutils.h (contents, props changed) projects/graid/head/sys/contrib/dev/acpica/include/amlcode.h (contents, props changed) projects/graid/head/sys/contrib/dev/acpica/include/amlresrc.h (contents, props changed) projects/graid/head/sys/contrib/dev/acpica/include/platform/acenv.h (contents, props changed) projects/graid/head/sys/contrib/dev/acpica/include/platform/acfreebsd.h (contents, props changed) projects/graid/head/sys/contrib/dev/acpica/include/platform/acgcc.h (contents, props changed) projects/graid/head/sys/contrib/dev/acpica/namespace/nsaccess.c (contents, props changed) projects/graid/head/sys/contrib/dev/acpica/namespace/nsalloc.c (contents, props changed) projects/graid/head/sys/contrib/dev/acpica/namespace/nsdump.c (contents, props changed) projects/graid/head/sys/contrib/dev/acpica/namespace/nsdumpdv.c (contents, props changed) projects/graid/head/sys/contrib/dev/acpica/namespace/nseval.c (contents, props changed) projects/graid/head/sys/contrib/dev/acpica/namespace/nsinit.c (contents, props changed) projects/graid/head/sys/contrib/dev/acpica/namespace/nsload.c (contents, props changed) projects/graid/head/sys/contrib/dev/acpica/namespace/nsnames.c (contents, props changed) projects/graid/head/sys/contrib/dev/acpica/namespace/nsobject.c (contents, props changed) projects/graid/head/sys/contrib/dev/acpica/namespace/nsparse.c (contents, props changed) projects/graid/head/sys/contrib/dev/acpica/namespace/nspredef.c projects/graid/head/sys/contrib/dev/acpica/namespace/nsrepair.c projects/graid/head/sys/contrib/dev/acpica/namespace/nsrepair2.c projects/graid/head/sys/contrib/dev/acpica/namespace/nssearch.c (contents, props changed) projects/graid/head/sys/contrib/dev/acpica/namespace/nsutils.c (contents, props changed) projects/graid/head/sys/contrib/dev/acpica/namespace/nswalk.c (contents, props changed) projects/graid/head/sys/contrib/dev/acpica/namespace/nsxfeval.c (contents, props changed) projects/graid/head/sys/contrib/dev/acpica/namespace/nsxfname.c (contents, props changed) projects/graid/head/sys/contrib/dev/acpica/namespace/nsxfobj.c (contents, props changed) projects/graid/head/sys/contrib/dev/acpica/osunixxf.c (contents, props changed) projects/graid/head/sys/contrib/dev/acpica/parser/psargs.c (contents, props changed) projects/graid/head/sys/contrib/dev/acpica/parser/psloop.c (contents, props changed) projects/graid/head/sys/contrib/dev/acpica/parser/psopcode.c (contents, props changed) projects/graid/head/sys/contrib/dev/acpica/parser/psparse.c (contents, props changed) projects/graid/head/sys/contrib/dev/acpica/parser/psscope.c (contents, props changed) projects/graid/head/sys/contrib/dev/acpica/parser/pstree.c (contents, props changed) projects/graid/head/sys/contrib/dev/acpica/parser/psutils.c (contents, props changed) projects/graid/head/sys/contrib/dev/acpica/parser/pswalk.c (contents, props changed) projects/graid/head/sys/contrib/dev/acpica/parser/psxface.c (contents, props changed) projects/graid/head/sys/contrib/dev/acpica/resources/rsaddr.c (contents, props changed) projects/graid/head/sys/contrib/dev/acpica/resources/rscalc.c (contents, props changed) projects/graid/head/sys/contrib/dev/acpica/resources/rscreate.c (contents, props changed) projects/graid/head/sys/contrib/dev/acpica/resources/rsdump.c (contents, props changed) projects/graid/head/sys/contrib/dev/acpica/resources/rsinfo.c (contents, props changed) projects/graid/head/sys/contrib/dev/acpica/resources/rsio.c (contents, props changed) projects/graid/head/sys/contrib/dev/acpica/resources/rsirq.c (contents, props changed) projects/graid/head/sys/contrib/dev/acpica/resources/rslist.c (contents, props changed) projects/graid/head/sys/contrib/dev/acpica/resources/rsmemory.c (contents, props changed) projects/graid/head/sys/contrib/dev/acpica/resources/rsmisc.c (contents, props changed) projects/graid/head/sys/contrib/dev/acpica/resources/rsutils.c (contents, props changed) projects/graid/head/sys/contrib/dev/acpica/resources/rsxface.c (contents, props changed) projects/graid/head/sys/contrib/dev/acpica/tables/tbfadt.c (contents, props changed) projects/graid/head/sys/contrib/dev/acpica/tables/tbfind.c (contents, props changed) projects/graid/head/sys/contrib/dev/acpica/tables/tbinstal.c (contents, props changed) projects/graid/head/sys/contrib/dev/acpica/tables/tbutils.c (contents, props changed) projects/graid/head/sys/contrib/dev/acpica/tables/tbxface.c (contents, props changed) projects/graid/head/sys/contrib/dev/acpica/tables/tbxfroot.c (contents, props changed) projects/graid/head/sys/contrib/dev/acpica/tools/acpiexec/aecommon.h (contents, props changed) projects/graid/head/sys/contrib/dev/acpica/utilities/utalloc.c (contents, props changed) projects/graid/head/sys/contrib/dev/acpica/utilities/utcache.c (contents, props changed) projects/graid/head/sys/contrib/dev/acpica/utilities/utcopy.c (contents, props changed) projects/graid/head/sys/contrib/dev/acpica/utilities/utdebug.c (contents, props changed) projects/graid/head/sys/contrib/dev/acpica/utilities/utdelete.c (contents, props changed) projects/graid/head/sys/contrib/dev/acpica/utilities/uteval.c (contents, props changed) projects/graid/head/sys/contrib/dev/acpica/utilities/utglobal.c (contents, props changed) projects/graid/head/sys/contrib/dev/acpica/utilities/utids.c projects/graid/head/sys/contrib/dev/acpica/utilities/utinit.c (contents, props changed) projects/graid/head/sys/contrib/dev/acpica/utilities/utlock.c projects/graid/head/sys/contrib/dev/acpica/utilities/utmath.c (contents, props changed) projects/graid/head/sys/contrib/dev/acpica/utilities/utmisc.c (contents, props changed) projects/graid/head/sys/contrib/dev/acpica/utilities/utmutex.c (contents, props changed) projects/graid/head/sys/contrib/dev/acpica/utilities/utobject.c (contents, props changed) projects/graid/head/sys/contrib/dev/acpica/utilities/utosi.c projects/graid/head/sys/contrib/dev/acpica/utilities/utresrc.c (contents, props changed) projects/graid/head/sys/contrib/dev/acpica/utilities/utstate.c (contents, props changed) projects/graid/head/sys/contrib/dev/acpica/utilities/uttrack.c (contents, props changed) projects/graid/head/sys/contrib/dev/acpica/utilities/utxface.c (contents, props changed) projects/graid/head/sys/contrib/dev/acpica/utilities/utxferror.c projects/graid/head/sys/contrib/dev/wpi/LICENSE projects/graid/head/sys/contrib/octeon-sdk/cvmx-app-init.h projects/graid/head/sys/contrib/octeon-sdk/cvmx-helper-board.c projects/graid/head/sys/contrib/octeon-sdk/cvmx-helper-rgmii.c projects/graid/head/sys/contrib/octeon-sdk/cvmx-mgmt-port.c projects/graid/head/sys/contrib/octeon-sdk/cvmx-mgmt-port.h projects/graid/head/sys/contrib/octeon-sdk/cvmx-pcie.c projects/graid/head/sys/contrib/pf/net/pf_osfp.c projects/graid/head/sys/ddb/db_capture.c projects/graid/head/sys/dev/acpi_support/acpi_ibm.c projects/graid/head/sys/dev/acpi_support/atk0110.c projects/graid/head/sys/dev/acpica/Osd/OsdInterrupt.c projects/graid/head/sys/dev/acpica/Osd/OsdSchedule.c projects/graid/head/sys/dev/acpica/acpi.c projects/graid/head/sys/dev/acpica/acpi_battery.c projects/graid/head/sys/dev/acpica/acpi_button.c projects/graid/head/sys/dev/acpica/acpi_cmbat.c projects/graid/head/sys/dev/acpica/acpi_cpu.c projects/graid/head/sys/dev/acpica/acpi_ec.c projects/graid/head/sys/dev/acpica/acpi_hpet.c projects/graid/head/sys/dev/acpica/acpi_pci.c projects/graid/head/sys/dev/acpica/acpi_smbat.c projects/graid/head/sys/dev/acpica/acpi_video.c projects/graid/head/sys/dev/acpica/acpiio.h projects/graid/head/sys/dev/acpica/acpivar.h projects/graid/head/sys/dev/adlink/adlink.c projects/graid/head/sys/dev/ae/if_ae.c projects/graid/head/sys/dev/ae/if_aevar.h projects/graid/head/sys/dev/age/if_age.c projects/graid/head/sys/dev/age/if_agevar.h projects/graid/head/sys/dev/ahci/ahci.c projects/graid/head/sys/dev/alc/if_alc.c projects/graid/head/sys/dev/alc/if_alcreg.h projects/graid/head/sys/dev/alc/if_alcvar.h projects/graid/head/sys/dev/ale/if_ale.c projects/graid/head/sys/dev/ale/if_alevar.h projects/graid/head/sys/dev/ata/chipsets/ata-intel.c projects/graid/head/sys/dev/ath/ath_hal/ah.c projects/graid/head/sys/dev/ath/ath_hal/ah.h projects/graid/head/sys/dev/ath/ath_hal/ah_debug.h projects/graid/head/sys/dev/ath/ath_hal/ah_devid.h projects/graid/head/sys/dev/ath/ath_hal/ah_eeprom.h projects/graid/head/sys/dev/ath/ath_hal/ah_eeprom_v14.c projects/graid/head/sys/dev/ath/ath_hal/ah_eeprom_v14.h projects/graid/head/sys/dev/ath/ath_hal/ah_eeprom_v4k.c projects/graid/head/sys/dev/ath/ath_hal/ah_eeprom_v4k.h projects/graid/head/sys/dev/ath/ath_hal/ah_internal.h projects/graid/head/sys/dev/ath/ath_hal/ar5210/ar5210.h projects/graid/head/sys/dev/ath/ath_hal/ar5210/ar5210_attach.c projects/graid/head/sys/dev/ath/ath_hal/ar5210/ar5210_misc.c projects/graid/head/sys/dev/ath/ath_hal/ar5210/ar5210_xmit.c projects/graid/head/sys/dev/ath/ath_hal/ar5211/ar5211.h projects/graid/head/sys/dev/ath/ath_hal/ar5211/ar5211_attach.c projects/graid/head/sys/dev/ath/ath_hal/ar5211/ar5211_misc.c projects/graid/head/sys/dev/ath/ath_hal/ar5211/ar5211_xmit.c projects/graid/head/sys/dev/ath/ath_hal/ar5212/ar5212.h projects/graid/head/sys/dev/ath/ath_hal/ar5212/ar5212_ani.c projects/graid/head/sys/dev/ath/ath_hal/ar5212/ar5212_attach.c projects/graid/head/sys/dev/ath/ath_hal/ar5212/ar5212_xmit.c projects/graid/head/sys/dev/ath/ath_hal/ar5312/ar5312_attach.c projects/graid/head/sys/dev/ath/ath_hal/ar5416/ar2133.c projects/graid/head/sys/dev/ath/ath_hal/ar5416/ar5416.h projects/graid/head/sys/dev/ath/ath_hal/ar5416/ar5416_ani.c projects/graid/head/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c projects/graid/head/sys/dev/ath/ath_hal/ar5416/ar5416_cal.c projects/graid/head/sys/dev/ath/ath_hal/ar5416/ar5416_misc.c projects/graid/head/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c projects/graid/head/sys/dev/ath/ath_hal/ar5416/ar5416_xmit.c projects/graid/head/sys/dev/ath/ath_hal/ar5416/ar5416reg.h projects/graid/head/sys/dev/ath/ath_rate/sample/sample.c projects/graid/head/sys/dev/ath/ath_rate/sample/sample.h projects/graid/head/sys/dev/ath/if_ath.c projects/graid/head/sys/dev/ath/if_athioctl.h projects/graid/head/sys/dev/ath/if_athvar.h projects/graid/head/sys/dev/atkbdc/atkbd_atkbdc.c projects/graid/head/sys/dev/atkbdc/atkbdc.c projects/graid/head/sys/dev/atkbdc/atkbdc_isa.c projects/graid/head/sys/dev/atkbdc/atkbdcreg.h projects/graid/head/sys/dev/atkbdc/psm.c projects/graid/head/sys/dev/bce/if_bce.c projects/graid/head/sys/dev/bge/if_bge.c projects/graid/head/sys/dev/buslogic/bt.c projects/graid/head/sys/dev/bwi/if_bwi.c projects/graid/head/sys/dev/bwn/if_bwn.c projects/graid/head/sys/dev/cs/if_cs.c projects/graid/head/sys/dev/cxgb/cxgb_main.c projects/graid/head/sys/dev/cxgb/cxgb_sge.c projects/graid/head/sys/dev/cxgb/ulp/iw_cxgb/iw_cxgb_cm.c projects/graid/head/sys/dev/cxgb/ulp/tom/cxgb_cpl_socket.c projects/graid/head/sys/dev/cxgb/ulp/tom/cxgb_ddp.c projects/graid/head/sys/dev/dc/dcphy.c projects/graid/head/sys/dev/dc/pnphy.c projects/graid/head/sys/dev/drm/via_dmablit.c projects/graid/head/sys/dev/e1000/if_em.c projects/graid/head/sys/dev/e1000/if_igb.c projects/graid/head/sys/dev/e1000/if_lem.c projects/graid/head/sys/dev/ed/if_ed.c projects/graid/head/sys/dev/en/midway.c projects/graid/head/sys/dev/fatm/if_fatm.c projects/graid/head/sys/dev/hifn/hifn7751.c projects/graid/head/sys/dev/if_ndis/if_ndis.c projects/graid/head/sys/dev/if_ndis/if_ndis_pccard.c projects/graid/head/sys/dev/if_ndis/if_ndis_pci.c projects/graid/head/sys/dev/if_ndis/if_ndis_usb.c projects/graid/head/sys/dev/iicbus/ds1775.c projects/graid/head/sys/dev/iicbus/max6690.c projects/graid/head/sys/dev/iscsi/initiator/isc_sm.c projects/graid/head/sys/dev/iscsi/initiator/iscsi.c projects/graid/head/sys/dev/ispfw/asm_2322.h projects/graid/head/sys/dev/ispfw/asm_2400.h projects/graid/head/sys/dev/ispfw/asm_2500.h projects/graid/head/sys/dev/iwi/if_iwi.c projects/graid/head/sys/dev/iwn/if_iwn.c projects/graid/head/sys/dev/ixgbe/ixgbe.c projects/graid/head/sys/dev/ixgbe/ixgbe.h projects/graid/head/sys/dev/ixgbe/ixgbe_82599.c projects/graid/head/sys/dev/ixgbe/ixgbe_api.h projects/graid/head/sys/dev/ixgbe/ixgbe_common.c projects/graid/head/sys/dev/ixgbe/ixgbe_common.h projects/graid/head/sys/dev/ixgbe/ixgbe_mbx.c projects/graid/head/sys/dev/ixgbe/ixgbe_type.h projects/graid/head/sys/dev/ixgbe/ixv.h projects/graid/head/sys/dev/jme/if_jme.c projects/graid/head/sys/dev/jme/if_jmereg.h projects/graid/head/sys/dev/jme/if_jmevar.h projects/graid/head/sys/dev/le/if_le_pci.c projects/graid/head/sys/dev/lmc/if_lmc.c projects/graid/head/sys/dev/malo/if_malo_pci.c projects/graid/head/sys/dev/md/md.c projects/graid/head/sys/dev/mem/memdev.c projects/graid/head/sys/dev/mem/memutil.c projects/graid/head/sys/dev/mii/atphy.c projects/graid/head/sys/dev/mii/brgphy.c projects/graid/head/sys/dev/mii/ciphy.c projects/graid/head/sys/dev/mii/e1000phy.c projects/graid/head/sys/dev/mii/ip1000phy.c projects/graid/head/sys/dev/mii/jmphy.c projects/graid/head/sys/dev/mii/jmphyreg.h projects/graid/head/sys/dev/mii/mii_physubr.c projects/graid/head/sys/dev/mii/miidevs projects/graid/head/sys/dev/mii/nsgphy.c projects/graid/head/sys/dev/mii/rgephy.c projects/graid/head/sys/dev/mii/rlphy.c projects/graid/head/sys/dev/mii/xmphy.c projects/graid/head/sys/dev/mmc/mmc.c projects/graid/head/sys/dev/mps/mps.c projects/graid/head/sys/dev/mpt/mpt.c projects/graid/head/sys/dev/mpt/mpt_cam.c projects/graid/head/sys/dev/mpt/mpt_pci.c projects/graid/head/sys/dev/mpt/mpt_raid.c projects/graid/head/sys/dev/msk/if_msk.c projects/graid/head/sys/dev/mwl/mwlhal.c projects/graid/head/sys/dev/mxge/if_mxge.c projects/graid/head/sys/dev/nfe/if_nfe.c projects/graid/head/sys/dev/nfe/if_nfevar.h projects/graid/head/sys/dev/patm/if_patm_attach.c projects/graid/head/sys/dev/pccbb/pccbb.c projects/graid/head/sys/dev/pci/vga_pci.c projects/graid/head/sys/dev/pty/pty.c projects/graid/head/sys/dev/puc/pucdata.c projects/graid/head/sys/dev/ral/rt2560.c projects/graid/head/sys/dev/ral/rt2661.c projects/graid/head/sys/dev/random/randomdev.c projects/graid/head/sys/dev/re/if_re.c projects/graid/head/sys/dev/siis/siis.c projects/graid/head/sys/dev/siis/siis.h projects/graid/head/sys/dev/sis/if_sis.c projects/graid/head/sys/dev/sound/pci/atiixp.c projects/graid/head/sys/dev/sound/pci/csa.c projects/graid/head/sys/dev/sound/pci/hda/hdac.c projects/graid/head/sys/dev/sound/pci/ich.c projects/graid/head/sys/dev/sound/pcm/buffer.c projects/graid/head/sys/dev/sound/pcm/sound.c projects/graid/head/sys/dev/sound/usb/uaudio.c projects/graid/head/sys/dev/ste/if_ste.c projects/graid/head/sys/dev/txp/if_txp.c projects/graid/head/sys/dev/uart/uart_bus_fdt.c projects/graid/head/sys/dev/uart/uart_cpu_amd64.c projects/graid/head/sys/dev/uart/uart_cpu_i386.c projects/graid/head/sys/dev/uart/uart_cpu_pc98.c projects/graid/head/sys/dev/uart/uart_tty.c projects/graid/head/sys/dev/usb/controller/at91dci.c projects/graid/head/sys/dev/usb/controller/at91dci_atmelarm.c projects/graid/head/sys/dev/usb/controller/atmegadci.c projects/graid/head/sys/dev/usb/controller/atmegadci_atmelarm.c projects/graid/head/sys/dev/usb/controller/avr32dci.c projects/graid/head/sys/dev/usb/controller/ehci.c projects/graid/head/sys/dev/usb/controller/ehci_ixp4xx.c projects/graid/head/sys/dev/usb/controller/ehci_mv.c projects/graid/head/sys/dev/usb/controller/ehci_pci.c projects/graid/head/sys/dev/usb/controller/musb_otg.c projects/graid/head/sys/dev/usb/controller/musb_otg_atmelarm.c projects/graid/head/sys/dev/usb/controller/ohci.c projects/graid/head/sys/dev/usb/controller/ohci_atmelarm.c projects/graid/head/sys/dev/usb/controller/ohci_pci.c projects/graid/head/sys/dev/usb/controller/ohci_s3c24x0.c projects/graid/head/sys/dev/usb/controller/uhci.c projects/graid/head/sys/dev/usb/controller/uhci_pci.c projects/graid/head/sys/dev/usb/controller/usb_controller.c projects/graid/head/sys/dev/usb/controller/uss820dci.c projects/graid/head/sys/dev/usb/controller/uss820dci_atmelarm.c projects/graid/head/sys/dev/usb/controller/xhci.c projects/graid/head/sys/dev/usb/controller/xhci.h projects/graid/head/sys/dev/usb/controller/xhci_pci.c projects/graid/head/sys/dev/usb/input/atp.c projects/graid/head/sys/dev/usb/input/uhid.c projects/graid/head/sys/dev/usb/input/ukbd.c projects/graid/head/sys/dev/usb/input/ums.c projects/graid/head/sys/dev/usb/misc/udbp.c projects/graid/head/sys/dev/usb/misc/ufm.c projects/graid/head/sys/dev/usb/net/if_aue.c projects/graid/head/sys/dev/usb/net/if_axe.c projects/graid/head/sys/dev/usb/net/if_cdce.c projects/graid/head/sys/dev/usb/net/if_cue.c projects/graid/head/sys/dev/usb/net/if_ipheth.c projects/graid/head/sys/dev/usb/net/if_kue.c projects/graid/head/sys/dev/usb/net/if_rue.c projects/graid/head/sys/dev/usb/net/if_udav.c projects/graid/head/sys/dev/usb/net/usb_ethernet.c projects/graid/head/sys/dev/usb/quirk/usb_quirk.c projects/graid/head/sys/dev/usb/serial/u3g.c projects/graid/head/sys/dev/usb/serial/uark.c projects/graid/head/sys/dev/usb/serial/ubsa.c projects/graid/head/sys/dev/usb/serial/ubser.c projects/graid/head/sys/dev/usb/serial/uchcom.c projects/graid/head/sys/dev/usb/serial/ucycom.c projects/graid/head/sys/dev/usb/serial/ufoma.c projects/graid/head/sys/dev/usb/serial/uftdi.c projects/graid/head/sys/dev/usb/serial/ugensa.c projects/graid/head/sys/dev/usb/serial/uipaq.c projects/graid/head/sys/dev/usb/serial/ulpt.c projects/graid/head/sys/dev/usb/serial/umct.c projects/graid/head/sys/dev/usb/serial/umodem.c projects/graid/head/sys/dev/usb/serial/umoscom.c projects/graid/head/sys/dev/usb/serial/uplcom.c projects/graid/head/sys/dev/usb/serial/usb_serial.c projects/graid/head/sys/dev/usb/serial/uslcom.c projects/graid/head/sys/dev/usb/serial/uvisor.c projects/graid/head/sys/dev/usb/serial/uvscom.c projects/graid/head/sys/dev/usb/storage/umass.c projects/graid/head/sys/dev/usb/storage/urio.c projects/graid/head/sys/dev/usb/storage/ustorage_fs.c projects/graid/head/sys/dev/usb/template/usb_template.c projects/graid/head/sys/dev/usb/template/usb_template_cdce.c projects/graid/head/sys/dev/usb/template/usb_template_msc.c projects/graid/head/sys/dev/usb/template/usb_template_mtp.c projects/graid/head/sys/dev/usb/usb_busdma.c projects/graid/head/sys/dev/usb/usb_compat_linux.c projects/graid/head/sys/dev/usb/usb_core.c projects/graid/head/sys/dev/usb/usb_debug.c projects/graid/head/sys/dev/usb/usb_dev.c projects/graid/head/sys/dev/usb/usb_device.c projects/graid/head/sys/dev/usb/usb_dynamic.c projects/graid/head/sys/dev/usb/usb_error.c projects/graid/head/sys/dev/usb/usb_freebsd.h projects/graid/head/sys/dev/usb/usb_generic.c projects/graid/head/sys/dev/usb/usb_handle_request.c projects/graid/head/sys/dev/usb/usb_hid.c projects/graid/head/sys/dev/usb/usb_hub.c projects/graid/head/sys/dev/usb/usb_lookup.c projects/graid/head/sys/dev/usb/usb_mbuf.c projects/graid/head/sys/dev/usb/usb_msctest.c projects/graid/head/sys/dev/usb/usb_parse.c projects/graid/head/sys/dev/usb/usb_process.c projects/graid/head/sys/dev/usb/usb_process.h projects/graid/head/sys/dev/usb/usb_request.c projects/graid/head/sys/dev/usb/usb_transfer.c projects/graid/head/sys/dev/usb/usb_util.c projects/graid/head/sys/dev/usb/usbdevs projects/graid/head/sys/dev/usb/wlan/if_rum.c projects/graid/head/sys/dev/usb/wlan/if_run.c projects/graid/head/sys/dev/usb/wlan/if_ural.c projects/graid/head/sys/dev/wi/if_wi.c projects/graid/head/sys/dev/wpi/if_wpi.c projects/graid/head/sys/dev/xen/balloon/balloon.c projects/graid/head/sys/dev/xen/blkfront/blkfront.c projects/graid/head/sys/dev/xen/console/console.c projects/graid/head/sys/dev/xen/netback/netback.c projects/graid/head/sys/dev/xen/netfront/netfront.c projects/graid/head/sys/dev/xen/xenpci/evtchn.c projects/graid/head/sys/fs/devfs/devfs_devs.c projects/graid/head/sys/fs/devfs/devfs_rule.c projects/graid/head/sys/fs/devfs/devfs_vnops.c projects/graid/head/sys/fs/ext2fs/ext2_alloc.c projects/graid/head/sys/fs/ext2fs/ext2_dinode.h projects/graid/head/sys/fs/ext2fs/ext2_lookup.c projects/graid/head/sys/fs/ext2fs/ext2_subr.c projects/graid/head/sys/fs/ext2fs/ext2_vfsops.c projects/graid/head/sys/fs/ext2fs/ext2fs.h projects/graid/head/sys/fs/ext2fs/inode.h projects/graid/head/sys/fs/nfs/nfs.h projects/graid/head/sys/fs/nfs/nfs_commonsubs.c projects/graid/head/sys/fs/nfs/nfs_var.h projects/graid/head/sys/fs/nfs/nfsdport.h projects/graid/head/sys/fs/nfs/nfsport.h projects/graid/head/sys/fs/nfsclient/nfs_clvfsops.c projects/graid/head/sys/fs/nfsclient/nfsmount.h projects/graid/head/sys/fs/nfsserver/nfs_nfsdcache.c projects/graid/head/sys/fs/nfsserver/nfs_nfsdkrpc.c projects/graid/head/sys/fs/nfsserver/nfs_nfsdport.c projects/graid/head/sys/fs/nfsserver/nfs_nfsdserv.c projects/graid/head/sys/fs/nfsserver/nfs_nfsdsocket.c projects/graid/head/sys/fs/nfsserver/nfs_nfsdstate.c projects/graid/head/sys/fs/procfs/procfs_dbregs.c projects/graid/head/sys/fs/procfs/procfs_fpregs.c projects/graid/head/sys/fs/procfs/procfs_map.c projects/graid/head/sys/fs/procfs/procfs_regs.c projects/graid/head/sys/fs/tmpfs/tmpfs_subr.c projects/graid/head/sys/fs/tmpfs/tmpfs_vnops.c projects/graid/head/sys/geom/geom_ctl.c projects/graid/head/sys/geom/geom_disk.c projects/graid/head/sys/geom/journal/g_journal.c projects/graid/head/sys/geom/nop/g_nop.c projects/graid/head/sys/geom/part/g_part.c projects/graid/head/sys/geom/part/g_part_bsd.c projects/graid/head/sys/geom/part/g_part_ebr.c projects/graid/head/sys/geom/part/g_part_gpt.c projects/graid/head/sys/geom/raid3/g_raid3.c projects/graid/head/sys/geom/sched/g_sched.c projects/graid/head/sys/geom/sched/gs_rr.c projects/graid/head/sys/i386/conf/GENERIC projects/graid/head/sys/i386/conf/XBOX projects/graid/head/sys/i386/conf/XEN projects/graid/head/sys/i386/i386/apic_vector.s projects/graid/head/sys/i386/i386/i686_mem.c projects/graid/head/sys/i386/i386/legacy.c projects/graid/head/sys/i386/i386/machdep.c projects/graid/head/sys/i386/i386/mem.c projects/graid/head/sys/i386/i386/pmap.c projects/graid/head/sys/i386/i386/sys_machdep.c projects/graid/head/sys/i386/i386/vm86bios.s projects/graid/head/sys/i386/i386/vm_machdep.c projects/graid/head/sys/i386/include/_inttypes.h projects/graid/head/sys/i386/include/_limits.h projects/graid/head/sys/i386/include/_stdint.h projects/graid/head/sys/i386/include/_types.h projects/graid/head/sys/i386/include/atomic.h projects/graid/head/sys/i386/include/bus.h projects/graid/head/sys/i386/include/elf.h projects/graid/head/sys/i386/include/memdev.h projects/graid/head/sys/i386/include/pcpu.h projects/graid/head/sys/i386/include/pmap.h projects/graid/head/sys/i386/include/segments.h projects/graid/head/sys/i386/include/vmparam.h projects/graid/head/sys/i386/include/xen/hypercall.h projects/graid/head/sys/i386/include/xen/xen-os.h projects/graid/head/sys/i386/include/xen/xenpmap.h projects/graid/head/sys/i386/include/xen/xenvar.h projects/graid/head/sys/i386/linux/linux_machdep.c projects/graid/head/sys/i386/xen/clock.c projects/graid/head/sys/i386/xen/mp_machdep.c projects/graid/head/sys/i386/xen/pmap.c projects/graid/head/sys/i386/xen/xen_machdep.c projects/graid/head/sys/ia64/acpica/OsdEnvironment.c projects/graid/head/sys/ia64/ia64/machdep.c projects/graid/head/sys/ia64/ia64/mem.c projects/graid/head/sys/ia64/include/_limits.h projects/graid/head/sys/ia64/include/_stdint.h projects/graid/head/sys/ia64/include/elf.h projects/graid/head/sys/ia64/include/float.h projects/graid/head/sys/ia64/include/memdev.h projects/graid/head/sys/ia64/include/vmparam.h projects/graid/head/sys/kern/imgact_elf.c projects/graid/head/sys/kern/init_main.c projects/graid/head/sys/kern/kern_clocksource.c projects/graid/head/sys/kern/kern_descrip.c projects/graid/head/sys/kern/kern_et.c projects/graid/head/sys/kern/kern_exec.c projects/graid/head/sys/kern/kern_fail.c projects/graid/head/sys/kern/kern_fork.c projects/graid/head/sys/kern/kern_intr.c projects/graid/head/sys/kern/kern_jail.c projects/graid/head/sys/kern/kern_kthread.c projects/graid/head/sys/kern/kern_linker.c projects/graid/head/sys/kern/kern_lock.c projects/graid/head/sys/kern/kern_malloc.c projects/graid/head/sys/kern/kern_mib.c projects/graid/head/sys/kern/kern_ntptime.c projects/graid/head/sys/kern/kern_proc.c projects/graid/head/sys/kern/kern_resource.c projects/graid/head/sys/kern/kern_sig.c projects/graid/head/sys/kern/kern_sx.c projects/graid/head/sys/kern/kern_synch.c projects/graid/head/sys/kern/kern_sysctl.c projects/graid/head/sys/kern/kern_tc.c projects/graid/head/sys/kern/kern_umtx.c projects/graid/head/sys/kern/sched_4bsd.c projects/graid/head/sys/kern/sched_ule.c projects/graid/head/sys/kern/subr_autoconf.c projects/graid/head/sys/kern/subr_bus.c projects/graid/head/sys/kern/subr_clock.c projects/graid/head/sys/kern/subr_devstat.c projects/graid/head/sys/kern/subr_kobj.c projects/graid/head/sys/kern/subr_lock.c projects/graid/head/sys/kern/subr_log.c projects/graid/head/sys/kern/subr_param.c projects/graid/head/sys/kern/subr_pcpu.c projects/graid/head/sys/kern/subr_sleepqueue.c projects/graid/head/sys/kern/subr_smp.c projects/graid/head/sys/kern/subr_trap.c projects/graid/head/sys/kern/subr_witness.c projects/graid/head/sys/kern/sys_pipe.c projects/graid/head/sys/kern/sys_process.c projects/graid/head/sys/kern/sysv_msg.c projects/graid/head/sys/kern/sysv_sem.c projects/graid/head/sys/kern/sysv_shm.c projects/graid/head/sys/kern/tty.c projects/graid/head/sys/kern/tty_tty.c projects/graid/head/sys/kern/uipc_cow.c projects/graid/head/sys/kern/uipc_usrreq.c projects/graid/head/sys/kern/vfs_bio.c projects/graid/head/sys/kern/vfs_mount.c projects/graid/head/sys/kern/vfs_mountroot.c projects/graid/head/sys/kern/vfs_subr.c projects/graid/head/sys/mips/atheros/ar91xxreg.h projects/graid/head/sys/mips/cavium/ciu.c projects/graid/head/sys/mips/cavium/cryptocteon/cavium_crypto.c projects/graid/head/sys/mips/cavium/cvmx_config.h projects/graid/head/sys/mips/cavium/files.octeon1 projects/graid/head/sys/mips/cavium/octe/ethernet-common.c projects/graid/head/sys/mips/cavium/octe/ethernet-defines.h projects/graid/head/sys/mips/cavium/octe/ethernet-rx.c projects/graid/head/sys/mips/cavium/octe/ethernet-tx.c projects/graid/head/sys/mips/cavium/octe/ethernet.c projects/graid/head/sys/mips/cavium/octeon_machdep.c projects/graid/head/sys/mips/cavium/octeon_mp.c projects/graid/head/sys/mips/cavium/octeon_wdog.c projects/graid/head/sys/mips/cavium/octopci.c projects/graid/head/sys/mips/cavium/uart_bus_octeonusart.c projects/graid/head/sys/mips/cavium/usb/octusb.c projects/graid/head/sys/mips/cavium/usb/octusb_octeon.c projects/graid/head/sys/mips/conf/MALTA64 projects/graid/head/sys/mips/conf/OCTEON1 projects/graid/head/sys/mips/conf/SENTRY5 projects/graid/head/sys/mips/conf/SWARM projects/graid/head/sys/mips/conf/SWARM64 projects/graid/head/sys/mips/conf/SWARM64_SMP projects/graid/head/sys/mips/conf/SWARM_SMP projects/graid/head/sys/mips/conf/XLR projects/graid/head/sys/mips/conf/XLR64 projects/graid/head/sys/mips/conf/XLRN32 projects/graid/head/sys/mips/include/_inttypes.h projects/graid/head/sys/mips/include/_limits.h projects/graid/head/sys/mips/include/_stdint.h projects/graid/head/sys/mips/include/_types.h projects/graid/head/sys/mips/include/cpufunc.h projects/graid/head/sys/mips/include/elf.h projects/graid/head/sys/mips/include/md_var.h projects/graid/head/sys/mips/include/memdev.h projects/graid/head/sys/mips/include/param.h projects/graid/head/sys/mips/include/pmap.h projects/graid/head/sys/mips/include/proc.h projects/graid/head/sys/mips/include/pte.h projects/graid/head/sys/mips/include/vmparam.h projects/graid/head/sys/mips/mips/dump_machdep.c projects/graid/head/sys/mips/mips/elf_trampoline.c projects/graid/head/sys/mips/mips/exception.S projects/graid/head/sys/mips/mips/inckern.S projects/graid/head/sys/mips/mips/machdep.c projects/graid/head/sys/mips/mips/mem.c projects/graid/head/sys/mips/mips/mp_machdep.c projects/graid/head/sys/mips/mips/pmap.c projects/graid/head/sys/mips/mips/swtch.S projects/graid/head/sys/mips/mips/tick.c projects/graid/head/sys/mips/mips/trap.c projects/graid/head/sys/mips/mips/vm_machdep.c projects/graid/head/sys/mips/rmi/dev/nlge/if_nlge.c projects/graid/head/sys/mips/rmi/dev/xlr/rge.c projects/graid/head/sys/mips/rmi/fmn.c projects/graid/head/sys/mips/rmi/pic.h projects/graid/head/sys/mips/rmi/std.xlr projects/graid/head/sys/mips/rmi/tick.c projects/graid/head/sys/mips/rmi/xlr_machdep.c projects/graid/head/sys/mips/rmi/xlr_pci.c projects/graid/head/sys/mips/rmi/xls_ehci.c projects/graid/head/sys/modules/Makefile projects/graid/head/sys/modules/acpi/acpi/Makefile projects/graid/head/sys/modules/aha/Makefile projects/graid/head/sys/modules/ahb/Makefile projects/graid/head/sys/modules/ath/Makefile projects/graid/head/sys/modules/mem/Makefile projects/graid/head/sys/modules/mii/Makefile projects/graid/head/sys/modules/wpifw/Makefile projects/graid/head/sys/net/bpf_zerocopy.c projects/graid/head/sys/net/flowtable.c projects/graid/head/sys/net/if.c projects/graid/head/sys/net/if_enc.c projects/graid/head/sys/net/if_llatbl.h projects/graid/head/sys/net/if_media.h projects/graid/head/sys/net/netisr.c projects/graid/head/sys/net/route.c projects/graid/head/sys/net/vnet.c projects/graid/head/sys/net/vnet.h projects/graid/head/sys/net80211/ieee80211_amrr.c projects/graid/head/sys/net80211/ieee80211_freebsd.c projects/graid/head/sys/net80211/ieee80211_mesh.c projects/graid/head/sys/net80211/ieee80211_node.c projects/graid/head/sys/netgraph/bluetooth/common/ng_bluetooth.c projects/graid/head/sys/netgraph/bluetooth/drivers/ubt/ng_ubt.c projects/graid/head/sys/netgraph/bluetooth/drivers/ubtbcmfw/ubtbcmfw.c projects/graid/head/sys/netgraph/bluetooth/socket/ng_btsocket_hci_raw.c projects/graid/head/sys/netgraph/bluetooth/socket/ng_btsocket_l2cap.c projects/graid/head/sys/netgraph/bluetooth/socket/ng_btsocket_l2cap_raw.c projects/graid/head/sys/netgraph/bluetooth/socket/ng_btsocket_rfcomm.c projects/graid/head/sys/netgraph/bluetooth/socket/ng_btsocket_sco.c projects/graid/head/sys/netgraph/ng_socket.c projects/graid/head/sys/netinet/cc/cc.c projects/graid/head/sys/netinet/cc/cc_cubic.c projects/graid/head/sys/netinet/cc/cc_htcp.c projects/graid/head/sys/netinet/if_atm.c projects/graid/head/sys/netinet/if_ether.c projects/graid/head/sys/netinet/in_pcb.c projects/graid/head/sys/netinet/ip_divert.c projects/graid/head/sys/netinet/ip_output.c projects/graid/head/sys/netinet/ipfw/ip_dn_io.c projects/graid/head/sys/netinet/ipfw/ip_dummynet.c projects/graid/head/sys/netinet/ipfw/ip_fw_dynamic.c projects/graid/head/sys/netinet/raw_ip.c projects/graid/head/sys/netinet/sctp.h projects/graid/head/sys/netinet/sctp_asconf.c projects/graid/head/sys/netinet/sctp_bsd_addr.c projects/graid/head/sys/netinet/sctp_cc_functions.c projects/graid/head/sys/netinet/sctp_constants.h projects/graid/head/sys/netinet/sctp_indata.c projects/graid/head/sys/netinet/sctp_input.c projects/graid/head/sys/netinet/sctp_output.c projects/graid/head/sys/netinet/sctp_output.h projects/graid/head/sys/netinet/sctp_pcb.c projects/graid/head/sys/netinet/sctp_pcb.h projects/graid/head/sys/netinet/sctp_structs.h projects/graid/head/sys/netinet/sctp_sysctl.c projects/graid/head/sys/netinet/sctp_sysctl.h projects/graid/head/sys/netinet/sctp_timer.c projects/graid/head/sys/netinet/sctp_uio.h projects/graid/head/sys/netinet/sctp_usrreq.c projects/graid/head/sys/netinet/sctputil.c projects/graid/head/sys/netinet/tcp_hostcache.c projects/graid/head/sys/netinet/tcp_input.c projects/graid/head/sys/netinet/tcp_lro.c projects/graid/head/sys/netinet/tcp_lro.h projects/graid/head/sys/netinet/tcp_output.c projects/graid/head/sys/netinet/tcp_reass.c projects/graid/head/sys/netinet/tcp_sack.c projects/graid/head/sys/netinet/tcp_subr.c projects/graid/head/sys/netinet/tcp_syncache.c projects/graid/head/sys/netinet/tcp_syncache.h projects/graid/head/sys/netinet/tcp_timer.c projects/graid/head/sys/netinet/tcp_usrreq.c projects/graid/head/sys/netinet/tcp_var.h projects/graid/head/sys/netinet/udp.h projects/graid/head/sys/netinet/udp_usrreq.c projects/graid/head/sys/netinet/udp_var.h projects/graid/head/sys/netinet6/in6_ifattach.c projects/graid/head/sys/netinet6/sctp6_usrreq.c projects/graid/head/sys/netsmb/smb_dev.h projects/graid/head/sys/netsmb/smb_subr.c projects/graid/head/sys/netsmb/smb_subr.h projects/graid/head/sys/nfs/nfs_lock.c projects/graid/head/sys/nfs/nfs_mountcommon.h projects/graid/head/sys/nfs/nfs_nfssvc.c projects/graid/head/sys/nfs/nfssvc.h projects/graid/head/sys/nfsclient/nfs_vfsops.c projects/graid/head/sys/nfsclient/nfsmount.h projects/graid/head/sys/nfsserver/nfs.h projects/graid/head/sys/nfsserver/nfs_serv.c projects/graid/head/sys/nfsserver/nfs_srvsubs.c projects/graid/head/sys/nlm/nlm_advlock.c projects/graid/head/sys/nlm/nlm_prot_impl.c projects/graid/head/sys/pc98/include/_inttypes.h projects/graid/head/sys/pc98/include/bus.h projects/graid/head/sys/pc98/pc98/machdep.c projects/graid/head/sys/pci/if_rlreg.h projects/graid/head/sys/powerpc/aim/machdep.c projects/graid/head/sys/powerpc/aim/mmu_oea.c projects/graid/head/sys/powerpc/aim/mmu_oea64.c projects/graid/head/sys/powerpc/aim/moea64_native.c projects/graid/head/sys/powerpc/aim/nexus.c projects/graid/head/sys/powerpc/aim/slb.c projects/graid/head/sys/powerpc/aim/trap.c projects/graid/head/sys/powerpc/aim/vm_machdep.c projects/graid/head/sys/powerpc/booke/machdep.c projects/graid/head/sys/powerpc/booke/platform_bare.c projects/graid/head/sys/powerpc/booke/pmap.c projects/graid/head/sys/powerpc/booke/vm_machdep.c projects/graid/head/sys/powerpc/conf/GENERIC64 projects/graid/head/sys/powerpc/conf/NOTES projects/graid/head/sys/powerpc/cpufreq/dfs.c projects/graid/head/sys/powerpc/cpufreq/pcr.c projects/graid/head/sys/powerpc/include/_inttypes.h projects/graid/head/sys/powerpc/include/_limits.h projects/graid/head/sys/powerpc/include/_stdint.h projects/graid/head/sys/powerpc/include/_types.h projects/graid/head/sys/powerpc/include/elf.h projects/graid/head/sys/powerpc/include/float.h projects/graid/head/sys/powerpc/include/memdev.h projects/graid/head/sys/powerpc/include/metadata.h projects/graid/head/sys/powerpc/include/pte.h projects/graid/head/sys/powerpc/include/spr.h projects/graid/head/sys/powerpc/include/vmparam.h projects/graid/head/sys/powerpc/ofw/ofw_real.c projects/graid/head/sys/powerpc/powermac/ata_kauai.c projects/graid/head/sys/powerpc/powermac/cpcht.c projects/graid/head/sys/powerpc/powermac/fcu.c projects/graid/head/sys/powerpc/powermac/grackle.c projects/graid/head/sys/powerpc/powermac/gracklevar.h projects/graid/head/sys/powerpc/powermac/macgpio.c projects/graid/head/sys/powerpc/powermac/uninorth.c projects/graid/head/sys/powerpc/powermac/uninorthpci.c projects/graid/head/sys/powerpc/powermac/uninorthvar.h projects/graid/head/sys/powerpc/powerpc/elf32_machdep.c projects/graid/head/sys/powerpc/powerpc/elf64_machdep.c projects/graid/head/sys/powerpc/powerpc/exec_machdep.c projects/graid/head/sys/powerpc/powerpc/intr_machdep.c projects/graid/head/sys/powerpc/powerpc/mem.c projects/graid/head/sys/rpc/clnt_dg.c projects/graid/head/sys/rpc/clnt_vc.c projects/graid/head/sys/rpc/svc.c projects/graid/head/sys/rpc/svc_vc.c projects/graid/head/sys/security/mac/mac_framework.c projects/graid/head/sys/security/mac_seeotheruids/mac_seeotheruids.c projects/graid/head/sys/sparc64/include/_limits.h projects/graid/head/sys/sparc64/include/_stdint.h projects/graid/head/sys/sparc64/include/asmacros.h projects/graid/head/sys/sparc64/include/cpufunc.h projects/graid/head/sys/sparc64/include/elf.h projects/graid/head/sys/sparc64/include/float.h projects/graid/head/sys/sparc64/include/intr_machdep.h projects/graid/head/sys/sparc64/include/memdev.h projects/graid/head/sys/sparc64/include/pmap.h projects/graid/head/sys/sparc64/include/tsb.h projects/graid/head/sys/sparc64/include/vmparam.h projects/graid/head/sys/sparc64/pci/apb.c projects/graid/head/sys/sparc64/pci/fire.c projects/graid/head/sys/sparc64/pci/ofw_pcib.c projects/graid/head/sys/sparc64/pci/psycho.c projects/graid/head/sys/sparc64/pci/schizo.c projects/graid/head/sys/sparc64/sbus/sbus.c projects/graid/head/sys/sparc64/sparc64/db_trace.c projects/graid/head/sys/sparc64/sparc64/exception.S projects/graid/head/sys/sparc64/sparc64/genassym.c projects/graid/head/sys/sparc64/sparc64/intr_machdep.c projects/graid/head/sys/sparc64/sparc64/machdep.c projects/graid/head/sys/sparc64/sparc64/mem.c projects/graid/head/sys/sparc64/sparc64/mp_machdep.c projects/graid/head/sys/sparc64/sparc64/pmap.c projects/graid/head/sys/sparc64/sparc64/support.S projects/graid/head/sys/sparc64/sparc64/tick.c projects/graid/head/sys/sparc64/sparc64/tlb.c projects/graid/head/sys/sparc64/sparc64/tsb.c projects/graid/head/sys/sparc64/sparc64/vm_machdep.c projects/graid/head/sys/sun4v/include/_limits.h projects/graid/head/sys/sun4v/include/_stdint.h projects/graid/head/sys/sun4v/include/elf.h projects/graid/head/sys/sun4v/include/float.h projects/graid/head/sys/sun4v/include/memdev.h projects/graid/head/sys/sun4v/include/vmparam.h projects/graid/head/sys/sun4v/sun4v/db_interface.c projects/graid/head/sys/sun4v/sun4v/db_trace.c projects/graid/head/sys/sun4v/sun4v/machdep.c projects/graid/head/sys/sun4v/sun4v/pmap.c projects/graid/head/sys/sun4v/sun4v/vm_machdep.c projects/graid/head/sys/sys/_umtx.h projects/graid/head/sys/sys/bus.h projects/graid/head/sys/sys/cdefs.h projects/graid/head/sys/sys/copyright.h projects/graid/head/sys/sys/fail.h projects/graid/head/sys/sys/imgact.h projects/graid/head/sys/sys/link_elf.h projects/graid/head/sys/sys/memrange.h projects/graid/head/sys/sys/mount.h projects/graid/head/sys/sys/msgbuf.h projects/graid/head/sys/sys/osd.h projects/graid/head/sys/sys/param.h projects/graid/head/sys/sys/pioctl.h projects/graid/head/sys/sys/priority.h projects/graid/head/sys/sys/proc.h projects/graid/head/sys/sys/ptrace.h projects/graid/head/sys/sys/sched.h projects/graid/head/sys/sys/sysctl.h projects/graid/head/sys/sys/sysent.h projects/graid/head/sys/sys/umtx.h projects/graid/head/sys/sys/vmmeter.h projects/graid/head/sys/ufs/ffs/ffs_alloc.c projects/graid/head/sys/ufs/ffs/ffs_softdep.c projects/graid/head/sys/ufs/ffs/ffs_vfsops.c projects/graid/head/sys/ufs/ffs/fs.h projects/graid/head/sys/ufs/ffs/softdep.h projects/graid/head/sys/ufs/ufs/ufs_inode.c projects/graid/head/sys/ufs/ufs/ufs_quota.c projects/graid/head/sys/ufs/ufs/ufs_vnops.c projects/graid/head/sys/ufs/ufs/ufsmount.h projects/graid/head/sys/vm/device_pager.c projects/graid/head/sys/vm/phys_pager.c projects/graid/head/sys/vm/pmap.h projects/graid/head/sys/vm/sg_pager.c projects/graid/head/sys/vm/swap_pager.c projects/graid/head/sys/vm/uma_core.c projects/graid/head/sys/vm/vm_contig.c projects/graid/head/sys/vm/vm_extern.h projects/graid/head/sys/vm/vm_fault.c projects/graid/head/sys/vm/vm_glue.c projects/graid/head/sys/vm/vm_map.h projects/graid/head/sys/vm/vm_meter.c projects/graid/head/sys/vm/vm_object.c projects/graid/head/sys/vm/vm_object.h projects/graid/head/sys/vm/vm_page.c projects/graid/head/sys/vm/vm_page.h projects/graid/head/sys/vm/vm_pageout.c projects/graid/head/sys/vm/vm_pager.c projects/graid/head/sys/vm/vm_pager.h projects/graid/head/sys/vm/vm_phys.c projects/graid/head/sys/vm/vm_reserv.c projects/graid/head/sys/x86/acpica/OsdEnvironment.c projects/graid/head/sys/x86/isa/atrtc.c projects/graid/head/sys/x86/x86/busdma_machdep.c projects/graid/head/sys/x86/x86/io_apic.c projects/graid/head/sys/x86/x86/local_apic.c projects/graid/head/sys/x86/x86/nexus.c projects/graid/head/sys/x86/x86/tsc.c projects/graid/head/sys/xen/evtchn/evtchn.c projects/graid/head/sys/xen/xenbus/xenbusb.c projects/graid/head/sys/xen/xenstore/xenstore.c projects/graid/head/tools/regression/acct/Makefile projects/graid/head/tools/regression/acct/pack.c projects/graid/head/tools/regression/acct/regress.t projects/graid/head/tools/regression/bin/date/regress.sh projects/graid/head/tools/regression/bin/sh/expansion/plus-minus1.0 projects/graid/head/tools/regression/usr.bin/sed/Makefile projects/graid/head/tools/tools/ath/Makefile projects/graid/head/tools/tools/ath/Makefile.inc projects/graid/head/tools/tools/ath/athdebug/athdebug.c projects/graid/head/tools/tools/ath/athdecode/main.c projects/graid/head/tools/tools/ath/athprom/athprom.c projects/graid/head/tools/tools/ath/athrd/athrd.c projects/graid/head/tools/tools/ath/athregs/dumpregs.c projects/graid/head/tools/tools/ath/athstats/Makefile projects/graid/head/tools/tools/ath/athstats/athstats.c projects/graid/head/tools/tools/ath/athstats/main.c projects/graid/head/tools/tools/nanobsd/gateworks/common projects/graid/head/tools/tools/nanobsd/nanobsd.sh projects/graid/head/tools/tools/sysbuild/sysbuild.sh projects/graid/head/usr.bin/ar/ar.1 projects/graid/head/usr.bin/c89/c89.1 projects/graid/head/usr.bin/c99/c99.1 projects/graid/head/usr.bin/calendar/calendar.1 projects/graid/head/usr.bin/calendar/calendar.h projects/graid/head/usr.bin/calendar/calendars/calendar.freebsd projects/graid/head/usr.bin/calendar/parsedata.c projects/graid/head/usr.bin/cpuset/cpuset.1 projects/graid/head/usr.bin/cpuset/cpuset.c projects/graid/head/usr.bin/csup/rcsfile.c projects/graid/head/usr.bin/csup/rcsfile.h projects/graid/head/usr.bin/csup/updater.c projects/graid/head/usr.bin/gcore/gcore.1 projects/graid/head/usr.bin/getopt/getopt.1 projects/graid/head/usr.bin/ktrdump/ktrdump.8 projects/graid/head/usr.bin/ktrdump/ktrdump.c projects/graid/head/usr.bin/lock/lock.c projects/graid/head/usr.bin/mail/cmd1.c projects/graid/head/usr.bin/mail/cmd2.c projects/graid/head/usr.bin/mail/cmd3.c projects/graid/head/usr.bin/mail/collect.c projects/graid/head/usr.bin/mail/edit.c projects/graid/head/usr.bin/mail/fio.c projects/graid/head/usr.bin/mail/getname.c projects/graid/head/usr.bin/mail/head.c projects/graid/head/usr.bin/mail/lex.c projects/graid/head/usr.bin/mail/list.c projects/graid/head/usr.bin/mail/mail.1 projects/graid/head/usr.bin/mail/main.c projects/graid/head/usr.bin/mail/names.c projects/graid/head/usr.bin/mail/popen.c projects/graid/head/usr.bin/mail/quit.c projects/graid/head/usr.bin/mail/send.c projects/graid/head/usr.bin/mail/strings.c projects/graid/head/usr.bin/mail/temp.c projects/graid/head/usr.bin/mail/tty.c projects/graid/head/usr.bin/mail/util.c projects/graid/head/usr.bin/mail/v7.local.c projects/graid/head/usr.bin/mail/vars.c projects/graid/head/usr.bin/man/man.sh projects/graid/head/usr.bin/netstat/if.c projects/graid/head/usr.bin/netstat/netisr.c projects/graid/head/usr.bin/netstat/netstat.h projects/graid/head/usr.bin/netstat/route.c projects/graid/head/usr.bin/printf/printf.c projects/graid/head/usr.bin/rsh/rsh.c projects/graid/head/usr.bin/sed/main.c projects/graid/head/usr.bin/stat/stat.c projects/graid/head/usr.bin/tar/bsdtar.1 projects/graid/head/usr.bin/top/top.local.1 projects/graid/head/usr.bin/unifdef/unifdef.c projects/graid/head/usr.bin/xlint/Makefile.inc projects/graid/head/usr.sbin/Makefile.mips projects/graid/head/usr.sbin/acpi/acpidb/Makefile projects/graid/head/usr.sbin/acpi/iasl/Makefile projects/graid/head/usr.sbin/ancontrol/ancontrol.8 projects/graid/head/usr.sbin/bsnmpd/bsnmpd/Makefile projects/graid/head/usr.sbin/bsnmpd/modules/Makefile projects/graid/head/usr.sbin/bsnmpd/modules/snmp_bridge/bridge_tree.def projects/graid/head/usr.sbin/bsnmpd/modules/snmp_wlan/wlan_tree.def projects/graid/head/usr.sbin/cpucontrol/cpucontrol.c projects/graid/head/usr.sbin/freebsd-update/freebsd-update.sh projects/graid/head/usr.sbin/fwcontrol/fwdv.c projects/graid/head/usr.sbin/fwcontrol/fwmpegts.c projects/graid/head/usr.sbin/kbdmap/kbdmap.c projects/graid/head/usr.sbin/lmcconfig/Makefile projects/graid/head/usr.sbin/lmcconfig/lmcconfig.c projects/graid/head/usr.sbin/makefs/ffs.c projects/graid/head/usr.sbin/makefs/makefs.c projects/graid/head/usr.sbin/mld6query/mld6.c projects/graid/head/usr.sbin/mountd/mountd.c projects/graid/head/usr.sbin/ndp/ndp.c projects/graid/head/usr.sbin/newsyslog/newsyslog.c projects/graid/head/usr.sbin/ngctl/main.c projects/graid/head/usr.sbin/ngctl/msg.c projects/graid/head/usr.sbin/pc-sysinstall/backend-query/disk-part.sh projects/graid/head/usr.sbin/pc-sysinstall/backend-query/send-logs.sh projects/graid/head/usr.sbin/pc-sysinstall/backend/functions-bsdlabel.sh projects/graid/head/usr.sbin/pc-sysinstall/backend/functions-cleanup.sh projects/graid/head/usr.sbin/pc-sysinstall/backend/functions-disk.sh projects/graid/head/usr.sbin/pc-sysinstall/backend/functions-networking.sh projects/graid/head/usr.sbin/pc-sysinstall/backend/functions-users.sh projects/graid/head/usr.sbin/pc-sysinstall/examples/README projects/graid/head/usr.sbin/pkg_install/add/main.c projects/graid/head/usr.sbin/portsnap/portsnap/portsnap.sh projects/graid/head/usr.sbin/quot/quot.c projects/graid/head/usr.sbin/rpc.lockd/Makefile projects/graid/head/usr.sbin/rpc.lockd/lockd.c projects/graid/head/usr.sbin/rpc.lockd/lockd_lock.c projects/graid/head/usr.sbin/rtadvd/Makefile projects/graid/head/usr.sbin/rtadvd/rtadvd.8 projects/graid/head/usr.sbin/rtadvd/rtadvd.c projects/graid/head/usr.sbin/rtprio/rtprio.c projects/graid/head/usr.sbin/sade/Makefile projects/graid/head/usr.sbin/spkrtest/spkrtest.sh projects/graid/head/usr.sbin/sysinstall/Makefile projects/graid/head/usr.sbin/sysinstall/devices.c projects/graid/head/usr.sbin/sysinstall/install.c projects/graid/head/usr.sbin/sysinstall/menus.c projects/graid/head/usr.sbin/syslogd/syslogd.c projects/graid/head/usr.sbin/tzsetup/Makefile projects/graid/head/usr.sbin/usbdump/usbdump.8 projects/graid/head/usr.sbin/wpa/hostapd/driver_freebsd.c Directory Properties: projects/graid/head/ (props changed) projects/graid/head/cddl/contrib/opensolaris/ (props changed) projects/graid/head/contrib/bind9/ (props changed) projects/graid/head/contrib/binutils/ (props changed) projects/graid/head/contrib/bzip2/ (props changed) projects/graid/head/contrib/ee/ (props changed) projects/graid/head/contrib/expat/ (props changed) projects/graid/head/contrib/file/ (props changed) projects/graid/head/contrib/gdb/ (props changed) projects/graid/head/contrib/gdtoa/ (props changed) projects/graid/head/contrib/gnu-sort/ (props changed) projects/graid/head/contrib/groff/ (props changed) projects/graid/head/contrib/less/ (props changed) projects/graid/head/contrib/libpcap/ (props changed) projects/graid/head/contrib/llvm/ (props changed) projects/graid/head/contrib/llvm/tools/clang/ (props changed) projects/graid/head/contrib/ncurses/ (props changed) projects/graid/head/contrib/netcat/ (props changed) projects/graid/head/contrib/ntp/ (props changed) projects/graid/head/contrib/one-true-awk/ (props changed) projects/graid/head/contrib/openbsm/ (props changed) projects/graid/head/contrib/openpam/ (props changed) projects/graid/head/contrib/pf/ (props changed) projects/graid/head/contrib/sendmail/ (props changed) projects/graid/head/contrib/tcpdump/ (props changed) projects/graid/head/contrib/tcsh/ (props changed) projects/graid/head/contrib/top/ (props changed) projects/graid/head/contrib/top/install-sh (props changed) projects/graid/head/contrib/tzcode/stdtime/ (props changed) projects/graid/head/contrib/tzcode/zic/ (props changed) projects/graid/head/contrib/tzdata/ (props changed) projects/graid/head/contrib/wpa/ (props changed) projects/graid/head/contrib/xz/ (props changed) projects/graid/head/crypto/openssh/ (props changed) projects/graid/head/crypto/openssl/ (props changed) projects/graid/head/lib/libc/ (props changed) projects/graid/head/lib/libc/stdtime/ (props changed) projects/graid/head/lib/libutil/ (props changed) projects/graid/head/lib/libz/ (props changed) projects/graid/head/sbin/ (props changed) projects/graid/head/sbin/ipfw/ (props changed) projects/graid/head/share/mk/bsd.arch.inc.mk (props changed) projects/graid/head/share/zoneinfo/ (props changed) projects/graid/head/sys/ (props changed) projects/graid/head/sys/amd64/include/xen/ (props changed) projects/graid/head/sys/cddl/contrib/opensolaris/ (props changed) projects/graid/head/sys/contrib/dev/acpica/ (props changed) projects/graid/head/sys/contrib/octeon-sdk/ (props changed) projects/graid/head/sys/contrib/pf/ (props changed) projects/graid/head/sys/contrib/x86emu/ (props changed) projects/graid/head/usr.bin/calendar/ (props changed) projects/graid/head/usr.bin/csup/ (props changed) projects/graid/head/usr.bin/procstat/ (props changed) projects/graid/head/usr.sbin/zic/ (props changed) Modified: projects/graid/head/COPYRIGHT ============================================================================== --- projects/graid/head/COPYRIGHT Thu Jan 27 12:01:24 2011 (r217934) +++ projects/graid/head/COPYRIGHT Thu Jan 27 13:16:08 2011 (r217935) @@ -4,7 +4,7 @@ The compilation of software known as FreeBSD is distributed under the following terms: -Copyright (c) 1992-2010 The FreeBSD Project. All rights reserved. +Copyright (c) 1992-2011 The FreeBSD Project. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions Modified: projects/graid/head/Makefile ============================================================================== --- projects/graid/head/Makefile Thu Jan 27 12:01:24 2011 (r217934) +++ projects/graid/head/Makefile Thu Jan 27 13:16:08 2011 (r217935) @@ -5,6 +5,8 @@ # # universe - *Really* build *everything* (buildworld and # all kernels on all architectures). +# tinderbox - Same as universe, but presents a list of failed build +# targets and exits with an error if there were any. # buildworld - Rebuild *everything*, including glue to help do # upgrades. # installworld - Install everything built by "buildworld". @@ -26,6 +28,8 @@ # delete-old-dirs - Delete obsolete directories. # delete-old-files - Delete obsolete files. # delete-old-libs - Delete obsolete libraries. +# targets - Print a list of supported TARGET/TARGET_ARCH pairs +# for world and kernel targets. # # This makefile is simple by design. The FreeBSD make automatically reads # the /usr/share/mk/sys.mk unless the -m argument is specified on the @@ -34,10 +38,12 @@ # tree. This makefile executes a child make process, forcing it to use # the mk files from the source tree which are supposed to DTRT. # -# The user-driven targets (as listed above) are implemented in Makefile.inc1. +# Most of the user-driven targets (as listed above) are implemented in +# Makefile.inc1. The exceptions are universe, tinderbox and targets. # # If you want to build your system from source be sure that /usr/obj has -# at least 800MB of diskspace available. +# at least 1GB of diskspace available. A complete 'universe' build requires +# about 15GB of space. # # For individuals wanting to build from the sources currently on their # system, the simple instructions are: @@ -270,8 +276,8 @@ make: .PHONY ${MMAKE} install DESTDIR=${MAKEPATH} BINDIR= tinderbox: - cd ${.CURDIR} && \ - DOING_TINDERBOX=YES ${MAKE} ${JFLAG} universe + @cd ${.CURDIR} && \ + DOING_TINDERBOX=YES ${MAKE} JFLAG=${JFLAG} universe # # universe @@ -280,11 +286,27 @@ tinderbox: # with a reasonable chance of success, regardless of how old your # existing system is. # -.if make(universe) || make(universe_kernels) || make(tinderbox) -TARGETS?=amd64 i386 ia64 pc98 powerpc sparc64 sun4v mips +.if make(universe) || make(universe_kernels) || make(tinderbox) || make(targets) +TARGETS?=amd64 arm i386 ia64 mips pc98 powerpc sparc64 sun4v +TARGET_ARCHES_arm?= arm armeb +TARGET_ARCHES_mips?= mipsel mipseb mips64el mips64eb +TARGET_ARCHES_powerpc?= powerpc powerpc64 +TARGET_ARCHES_pc98?= i386 +TARGET_ARCHES_sun4v?= sparc64 +.for target in ${TARGETS} +TARGET_ARCHES_${target}?= ${target} +.endfor + +targets: + @echo "Supported TARGET/TARGET_ARCH pairs for world and kernel targets" +.for target in ${TARGETS} +.for target_arch in ${TARGET_ARCHES_${target}} + @echo " ${target}/${target_arch}" +.endfor +.endfor .if defined(DOING_TINDERBOX) -FAILFILE=tinderbox.failed +FAILFILE=${.CURDIR}/_.tinderbox.failed MAKEFAIL=tee -a ${FAILFILE} .else MAKEFAIL=cat @@ -296,21 +318,29 @@ universe_prologue: @echo ">>> make universe started on ${STARTTIME}" @echo "--------------------------------------------------------------" .if defined(DOING_TINDERBOX) - rm -f ${FAILFILE} + @rm -f ${FAILFILE} .endif .for target in ${TARGETS} universe: universe_${target} .ORDER: universe_prologue universe_${target} universe_epilogue -universe_${target}: -.if !defined(MAKE_JUST_KERNELS) +universe_${target}: universe_${target}_prologue +universe_${target}_prologue: @echo ">> ${target} started on `LC_ALL=C date`" +.if !defined(MAKE_JUST_KERNELS) +.for target_arch in ${TARGET_ARCHES_${target}} +universe_${target}: universe_${target}_${target_arch} +universe_${target}_${target_arch}: universe_${target}_prologue + @echo ">> ${target}.${target_arch} buildworld started on `LC_ALL=C date`" @(cd ${.CURDIR} && env __MAKE_CONF=/dev/null \ ${MAKE} ${JFLAG} buildworld \ TARGET=${target} \ - > _.${target}.buildworld 2>&1 || \ - (echo "${target} world failed," \ - "check _.${target}.buildworld for details" | ${MAKEFAIL})) - @echo ">> ${target} buildworld completed on `LC_ALL=C date`" + TARGET_ARCH=${target_arch} \ + > _.${target}.${target_arch}.buildworld 2>&1 || \ + (echo "${target}.${target_arch} world failed," \ + "check _.${target}.${target_arch}.buildworld for details" | \ + ${MAKEFAIL})) + @echo ">> ${target}.${target_arch} buildworld completed on `LC_ALL=C date`" +.endfor .endif .if !defined(MAKE_JUST_WORLDS) .if exists(${.CURDIR}/sys/${target}/conf/NOTES) @@ -333,9 +363,18 @@ KERNCONFS!= cd ${.CURDIR}/sys/${TARGET}/ ! -name DEFAULTS ! -name NOTES universe_kernconfs: .for kernel in ${KERNCONFS} +TARGET_ARCH_${kernel}!= cd ${.CURDIR}/sys/${TARGET}/conf && \ + config -m ${.CURDIR}/sys/${TARGET}/conf/${kernel} 2> /dev/null | \ + grep -v WARNING: | cut -f 2 +.if empty(TARGET_ARCH_${kernel}) +.error "Target architecture for ${TARGET}/conf/${kernel} unknown. config(8) likely too old." +.endif +universe_kernconfs: universe_kernconf_${TARGET}_${kernel} +universe_kernconf_${TARGET}_${kernel}: @(cd ${.CURDIR} && env __MAKE_CONF=/dev/null \ ${MAKE} ${JFLAG} buildkernel \ TARGET=${TARGET} \ + TARGET_ARCH=${TARGET_ARCH_${kernel}} \ KERNCONF=${kernel} \ > _.${TARGET}.${kernel} 2>&1 || \ (echo "${TARGET} ${kernel} kernel failed," \ Modified: projects/graid/head/Makefile.inc1 ============================================================================== --- projects/graid/head/Makefile.inc1 Thu Jan 27 12:01:24 2011 (r217934) +++ projects/graid/head/Makefile.inc1 Thu Jan 27 13:16:08 2011 (r217935) @@ -121,7 +121,7 @@ VERSION+= ${OSRELDATE} TARGET_ARCH= ${TARGET:S/pc98/i386/:S/sun4v/sparc64/:S/mips/mipsel/} .elif !defined(TARGET) && defined(TARGET_ARCH) && \ ${TARGET_ARCH} != ${MACHINE_ARCH} -TARGET= ${TARGET_ARCH:C/mipse[lb]/mips/:C/armeb/arm/} +TARGET= ${TARGET_ARCH:C/mips.*e[lb]/mips/:C/armeb/arm/} .endif # Legacy names, for a transition period mips:mips -> mipsel:mips .if defined(TARGET) && defined(TARGET_ARCH) && \ @@ -142,7 +142,7 @@ TARGET_ARCH=armeb TARGET?= ${MACHINE} TARGET_ARCH?= ${MACHINE_ARCH} -KNOWN_ARCHES?= amd64 arm armeb/arm i386 i386/pc98 ia64 mipsel/mips mipseb/mips powerpc powerpc64/powerpc sparc64 sparc64/sun4v +KNOWN_ARCHES?= amd64 arm armeb/arm i386 i386/pc98 ia64 mipsel/mips mipseb/mips mips64el/mips mips64eb/mips mipsn32el/mips mipsn32eb/mips powerpc powerpc64/powerpc sparc64 sparc64/sun4v .if ${TARGET} == ${TARGET_ARCH} _t= ${TARGET} .else Modified: projects/graid/head/Makefile.mips ============================================================================== --- projects/graid/head/Makefile.mips Thu Jan 27 12:01:24 2011 (r217934) +++ projects/graid/head/Makefile.mips Thu Jan 27 13:16:08 2011 (r217935) @@ -1,5 +1,5 @@ # $FreeBSD$ -.if defined(TARGET_ABI) && ${TARGET_ABI} == "n64" +.if ${MACHINE_ARCH} != "mipsel" && ${MACHINE_ARCH} != "mipseb" MK_RESCUE=no .endif Modified: projects/graid/head/ObsoleteFiles.inc ============================================================================== --- projects/graid/head/ObsoleteFiles.inc Thu Jan 27 12:01:24 2011 (r217934) +++ projects/graid/head/ObsoleteFiles.inc Thu Jan 27 13:16:08 2011 (r217935) @@ -38,6 +38,51 @@ # xargs -n1 | sort | uniq -d; # done +# 20110112: Update dialog to new version, rename old libdialog to libodialog, +# removing associated man pages and header files. +OLD_FILES+=usr/share/man/man3/draw_shadow.3.gz \ + usr/share/man/man3/draw_box.3.gz usr/share/man/man3/line_edit.3.gz \ + usr/share/man/man3/strheight.3.gz usr/share/man/man3/strwidth.3.gz \ + usr/share/man/man3/dialog_create_rc.3.gz \ + usr/share/man/man3/dialog_yesno.3.gz usr/share/man/man3/dialog_noyes.3.gz \ + usr/share/man/man3/dialog_prgbox.3.gz \ + usr/share/man/man3/dialog_textbox.3.gz usr/share/man/man3/dialog_menu.3.gz \ + usr/share/man/man3/dialog_checklist.3.gz \ + usr/share/man/man3/dialog_radiolist.3.gz \ + usr/share/man/man3/dialog_inputbox.3.gz \ + usr/share/man/man3/dialog_clear_norefresh.3.gz \ + usr/share/man/man3/dialog_clear.3.gz usr/share/man/man3/dialog_update.3.gz \ + usr/share/man/man3/dialog_fselect.3.gz \ + usr/share/man/man3/dialog_notify.3.gz \ + usr/share/man/man3/dialog_mesgbox.3.gz \ + usr/share/man/man3/dialog_gauge.3.gz usr/share/man/man3/init_dialog.3.gz \ + usr/share/man/man3/end_dialog.3.gz usr/share/man/man3/use_helpfile.3.gz \ + usr/share/man/man3/use_helpline.3.gz usr/share/man/man3/get_helpline.3.gz \ + usr/share/man/man3/restore_helpline.3.gz \ + usr/share/man/man3/dialog_msgbox.3.gz \ + usr/share/man/man3/dialog_ftree.3.gz usr/share/man/man3/dialog_tree.3.gz \ + usr/share/examples/dialog/README usr/share/examples/dialog/checklist \ + usr/share/examples/dialog/ftreebox usr/share/examples/dialog/infobox \ + usr/share/examples/dialog/inputbox usr/share/examples/dialog/menubox \ + usr/share/examples/dialog/msgbox usr/share/examples/dialog/prgbox \ + usr/share/examples/dialog/radiolist usr/share/examples/dialog/textbox \ + usr/share/examples/dialog/treebox usr/share/examples/dialog/yesno \ + usr/share/examples/libdialog/Makefile usr/share/examples/libdialog/check1.c\ + usr/share/examples/libdialog/check2.c usr/share/examples/libdialog/check3.c\ + usr/share/examples/libdialog/dselect.c \ + usr/share/examples/libdialog/fselect.c \ + usr/share/examples/libdialog/ftree1.c \ + usr/share/examples/libdialog/ftree1.test \ + usr/share/examples/libdialog/ftree2.c \ + usr/share/examples/libdialog/ftree2.test \ + usr/share/examples/libdialog/gauge.c usr/share/examples/libdialog/input1.c \ + usr/share/examples/libdialog/input2.c usr/share/examples/libdialog/menu1.c \ + usr/share/examples/libdialog/menu2.c usr/share/examples/libdialog/menu3.c \ + usr/share/examples/libdialog/msg.c usr/share/examples/libdialog/prgbox.c \ + usr/share/examples/libdialog/radio1.c usr/share/examples/libdialog/radio2.c\ + usr/share/examples/libdialog/radio3.c usr/share/examples/libdialog/text.c \ + usr/share/examples/libdialog/tree.c usr/share/examples/libdialog/yesno.c +OLD_DIRS+=usr/share/examples/libdialog usr/share/examples/dialog # 20101114: Remove long-obsolete MAKEDEV.8 OLD_FILES+=usr/share/man/man8/MAKEDEV.8.gz # 20101112: vgonel(9) has gone to private API a while ago @@ -284,6 +329,8 @@ OLD_FILES+=usr/share/man/man9/ieee80211_ OLD_FILES+=usr/share/man/man9/ieee80211_wep_crypt.9.gz # 20090801: vimage.h removed in favour of vnet.h OLD_FILES+=usr/include/sys/vimage.h +# 20101208: libbsnmp was moved to usr/lib +OLD_LIBS+=lib/libbsnmp.so.5 # 20090719: library version bump for 8.0 OLD_LIBS+=lib/libalias.so.6 OLD_LIBS+=lib/libavl.so.1 Modified: projects/graid/head/UPDATING ============================================================================== --- projects/graid/head/UPDATING Thu Jan 27 12:01:24 2011 (r217934) +++ projects/graid/head/UPDATING Thu Jan 27 13:16:08 2011 (r217935) @@ -22,6 +22,43 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 9. machines to maximize performance. (To disable malloc debugging, run ln -s aj /etc/malloc.conf.) +20110112: + A SYSCTL_[ADD_]UQUAD was added for unsigned uint64_t pointers, + symmetric with the existing SYSCTL_[ADD_]QUAD. Type checking + for scalar sysctls is defined but disabled. Code that needs + UQUAD to pass the type checking that must compile on older + systems where the define is not present can check against + __FreeBSD_version >= 900030. + + The system dialog(1) has been replaced with a new version previously + in ports as devel/cdialog. dialog(1) is mostly command-line compatible + with the previous version, but the libdialog associated with it has + a largely incompatible API. As such, the original version of libdialog + will be kept temporarily as libodialog, until its base system consumers + are replaced or updated. Bump __FreeBSD_version to 900030. + +20110103: + If you are trying to run make universe on a -stable system, and you get + the following warning: + "Makefile", line 356: "Target architecture for i386/conf/GENERIC + unknown. config(8) likely too old." + or something similar to it, then you must upgrade your -stable system + to 8.2-Release or newer (really, any time after r210146 7/15/2010 in + stable/8) or build the config from the latest stable/8 branch and + install it on your system. + + Prior to this date, building a current universe on 8-stable system from + between 7/15/2010 and 1/2/2011 would result in a weird shell parsing + error in the first kernel build phase. A new config on those old + systems will fix that problem for older versions of -current. + +20101228: + The TCP stack has been modified to allow Khelp modules to interact with + it via helper hook points and store per-connection data in the TCP + control block. Bump __FreeBSD_version to 900029. User space tools that + rely on the size of struct tcpcb in tcp_var.h (e.g. sockstat) need to + be recompiled. + 20101114: Generic IEEE 802.3 annex 31B full duplex flow control support has been added to mii(4) and bge(4), bce(4), msk(4), nfe(4) and stge(4) along @@ -1136,8 +1173,8 @@ COMMON ITEMS: [3] mergemaster -p [5] make installworld - make delete-old mergemaster -i [4] + make delete-old [6] @@ -1174,8 +1211,8 @@ COMMON ITEMS: [3] mergemaster -p [5] make installworld - make delete-old mergemaster -i [4] + make delete-old [6] Make sure that you've read the UPDATING file to understand the @@ -1218,6 +1255,10 @@ COMMON ITEMS: install) after the buildworld before this step if you last updated from current before 20020224 or from -stable before 20020408. + [6] This only deletes old files and directories. Old libraries + can be deleted by "make delete-old-libs", but you have to make + sure that no program is using those libraries anymore. + [8] In order to have a kernel that can run the 4.x binaries needed to do an installworld, you must include the COMPAT_FREEBSD4 option in your kernel. Failure to do so may leave you with a system that is Modified: projects/graid/head/bin/kill/kill.1 ============================================================================== --- projects/graid/head/bin/kill/kill.1 Thu Jan 27 12:01:24 2011 (r217934) +++ projects/graid/head/bin/kill/kill.1 Thu Jan 27 13:16:08 2011 (r217935) @@ -134,6 +134,7 @@ Terminate the process group with PGID 11 .Xr csh 1 , .Xr killall 1 , .Xr ps 1 , +.Xr sh 1 , .Xr kill 2 , .Xr sigaction 2 .Sh STANDARDS Modified: projects/graid/head/bin/kill/kill.c ============================================================================== --- projects/graid/head/bin/kill/kill.c Thu Jan 27 12:01:24 2011 (r217934) +++ projects/graid/head/bin/kill/kill.c Thu Jan 27 13:16:08 2011 (r217935) @@ -49,6 +49,12 @@ __FBSDID("$FreeBSD$"); #include #include +#ifdef SHELL +#define main killcmd +#include "bltin/bltin.h" +#include "error.h" +#endif + static void nosig(const char *); static void printsignals(FILE *); static int signame_to_signum(const char *); @@ -75,16 +81,16 @@ main(int argc, char *argv[]) usage(); numsig = strtol(*argv, &ep, 10); if (!**argv || *ep) - errx(1, "illegal signal number: %s", *argv); + errx(2, "illegal signal number: %s", *argv); if (numsig >= 128) numsig -= 128; if (numsig <= 0 || numsig >= sys_nsig) nosig(*argv); printf("%s\n", sys_signame[numsig]); - exit(0); + return (0); } printsignals(stdout); - exit(0); + return (0); } if (!strcmp(*argv, "-s")) { @@ -107,7 +113,7 @@ main(int argc, char *argv[]) } else if (isdigit(**argv)) { numsig = strtol(*argv, &ep, 10); if (!**argv || *ep) - errx(1, "illegal signal number: %s", *argv); + errx(2, "illegal signal number: %s", *argv); if (numsig < 0) nosig(*argv); } else @@ -122,16 +128,23 @@ main(int argc, char *argv[]) usage(); for (errors = 0; argc; argc--, argv++) { - pid = strtol(*argv, &ep, 10); - if (!**argv || *ep) - errx(1, "illegal process id: %s", *argv); - else if (kill(pid, numsig) == -1) { +#ifdef SHELL + if (**argv == '%') + pid = getjobpgrp(*argv); + else +#endif + { + pid = strtol(*argv, &ep, 10); + if (!**argv || *ep) + errx(2, "illegal process id: %s", *argv); + } + if (kill(pid, numsig) == -1) { warn("%s", *argv); errors = 1; } } - exit(errors); + return (errors); } static int @@ -154,7 +167,11 @@ nosig(const char *name) warnx("unknown signal %s; valid signals:", name); printsignals(stderr); - exit(1); +#ifdef SHELL + error(NULL); +#else + exit(2); +#endif } static void @@ -180,5 +197,9 @@ usage(void) " kill -l [exit_status]", " kill -signal_name pid ...", " kill -signal_number pid ..."); - exit(1); +#ifdef SHELL + error(NULL); +#else + exit(2); +#endif } Modified: projects/graid/head/bin/ps/print.c ============================================================================== --- projects/graid/head/bin/ps/print.c Thu Jan 27 12:01:24 2011 (r217934) +++ projects/graid/head/bin/ps/print.c Thu Jan 27 13:16:08 2011 (r217935) @@ -45,6 +45,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include Modified: projects/graid/head/bin/ps/ps.1 ============================================================================== --- projects/graid/head/bin/ps/ps.1 Thu Jan 27 12:01:24 2011 (r217934) +++ projects/graid/head/bin/ps/ps.1 Thu Jan 27 13:16:08 2011 (r217935) @@ -288,6 +288,7 @@ the include file .It Dv "P_ADVLOCK" Ta No "0x00001 Process may hold a POSIX advisory lock" .It Dv "P_CONTROLT" Ta No "0x00002 Has a controlling terminal" .It Dv "P_KTHREAD" Ta No "0x00004 Kernel thread" +.It Dv "P_FOLLOWFORK" Ta No "0x00008 Attach debugger to new children" .It Dv "P_PPWAIT" Ta No "0x00010 Parent is waiting for child to exec/exit" .It Dv "P_PROFIL" Ta No "0x00020 Has started profiling" .It Dv "P_STOPPROF" Ta No "0x00040 Has thread in requesting to stop prof" Modified: projects/graid/head/bin/setfacl/setfacl.c ============================================================================== --- projects/graid/head/bin/setfacl/setfacl.c Thu Jan 27 12:01:24 2011 (r217934) +++ projects/graid/head/bin/setfacl/setfacl.c Thu Jan 27 13:16:08 2011 (r217935) @@ -201,12 +201,14 @@ main(int argc, char *argv[]) if (stat(file->filename, &sb) == -1) { warn("%s: stat() failed", file->filename); + carried_error++; continue; } if (acl_type == ACL_TYPE_DEFAULT && S_ISDIR(sb.st_mode) == 0) { warnx("%s: default ACL may only be set on a directory", file->filename); + carried_error++; continue; } @@ -218,6 +220,7 @@ main(int argc, char *argv[]) if (acl_type == ACL_TYPE_DEFAULT) { warnx("%s: there are no default entries " "in NFSv4 ACLs", file->filename); + carried_error++; continue; } acl_type = ACL_TYPE_NFS4; @@ -240,6 +243,7 @@ main(int argc, char *argv[]) else warn("%s: acl_get_file() failed", file->filename); + carried_error++; continue; } Modified: projects/graid/head/bin/sh/Makefile ============================================================================== --- projects/graid/head/bin/sh/Makefile Thu Jan 27 12:01:24 2011 (r217934) +++ projects/graid/head/bin/sh/Makefile Thu Jan 27 13:16:08 2011 (r217935) @@ -4,7 +4,7 @@ PROG= sh INSTALLFLAGS= -S SHSRCS= alias.c arith.y arith_lex.l cd.c echo.c error.c eval.c exec.c expand.c \ - histedit.c input.c jobs.c mail.c main.c memalloc.c miscbltin.c \ + histedit.c input.c jobs.c kill.c mail.c main.c memalloc.c miscbltin.c \ mystring.c options.c output.c parser.c printf.c redir.c show.c \ test.c trap.c var.c GENSRCS= builtins.c init.c nodes.c syntax.c @@ -26,6 +26,7 @@ WARNS?= 2 WFORMAT=0 .PATH: ${.CURDIR}/bltin \ + ${.CURDIR}/../kill \ ${.CURDIR}/../test \ ${.CURDIR}/../../usr.bin/printf Modified: projects/graid/head/bin/sh/alias.c ============================================================================== --- projects/graid/head/bin/sh/alias.c Thu Jan 27 12:01:24 2011 (r217934) +++ projects/graid/head/bin/sh/alias.c Thu Jan 27 13:16:08 2011 (r217935) @@ -246,7 +246,7 @@ aliascmd(int argc, char **argv) while ((n = *++argv) != NULL) { if ((v = strchr(n+1, '=')) == NULL) /* n+1: funny ksh stuff */ if ((ap = lookupalias(n, 0)) == NULL) { - outfmt(out2, "alias: %s not found\n", n); + warning("%s not found", n); ret = 1; } else printalias(ap); Modified: projects/graid/head/bin/sh/arith_lex.l ============================================================================== --- projects/graid/head/bin/sh/arith_lex.l Thu Jan 27 12:01:24 2011 (r217934) +++ projects/graid/head/bin/sh/arith_lex.l Thu Jan 27 13:16:08 2011 (r217935) @@ -74,12 +74,12 @@ int yylex(void); return ARITH_NUM; } -0[0-7]+ { +0[0-7]* { yylval.l_value = strtoarith_t(yytext, NULL, 8); return ARITH_NUM; } -[0-9]+ { +[1-9][0-9]* { yylval.l_value = strtoarith_t(yytext, NULL, 10); return ARITH_NUM; } Modified: projects/graid/head/bin/sh/bltin/bltin.h ============================================================================== --- projects/graid/head/bin/sh/bltin/bltin.h Thu Jan 27 12:01:24 2011 (r217934) +++ projects/graid/head/bin/sh/bltin/bltin.h Thu Jan 27 13:16:08 2011 (r217935) @@ -43,6 +43,7 @@ #include "../mystring.h" #ifdef SHELL #include "../output.h" +#define FILE struct output #undef stdout #define stdout out1 #undef stderr @@ -57,21 +58,9 @@ #define fwrite(ptr, size, nmemb, file) outbin(ptr, (size) * (nmemb), file) #define fflush flushout #define INITARGS(argv) -#define warnx1(a, b, c) { \ - char buf[64]; \ - (void)snprintf(buf, sizeof(buf), a); \ - error("%s", buf); \ -} -#define warnx2(a, b, c) { \ - char buf[64]; \ - (void)snprintf(buf, sizeof(buf), a, b); \ - error("%s", buf); \ -} -#define warnx3(a, b, c) { \ - char buf[64]; \ - (void)snprintf(buf, sizeof(buf), a, b, c); \ - error("%s", buf); \ -} +#define warnx warning +#define warn(fmt, ...) warning(fmt ": %s", __VA_ARGS__, strerror(errno)) +#define errx(exitstatus, ...) error(__VA_ARGS__) #else #undef NULL @@ -80,8 +69,11 @@ #define INITARGS(argv) if ((commandname = argv[0]) == NULL) {fputs("Argc is zero\n", stderr); exit(2);} else #endif +#include + pointer stalloc(int); void error(const char *, ...) __printf0like(1, 2); +pid_t getjobpgrp(char *); int echocmd(int, char **); int testcmd(int, char **); Modified: projects/graid/head/bin/sh/builtins.def ============================================================================== --- projects/graid/head/bin/sh/builtins.def Thu Jan 27 12:01:24 2011 (r217934) +++ projects/graid/head/bin/sh/builtins.def Thu Jan 27 13:16:08 2011 (r217935) @@ -70,6 +70,7 @@ hashcmd hash histcmd -h fc jobidcmd jobid jobscmd jobs +killcmd kill localcmd local printfcmd printf pwdcmd pwd Modified: projects/graid/head/bin/sh/cd.c ============================================================================== --- projects/graid/head/bin/sh/cd.c Thu Jan 27 12:01:24 2011 (r217934) +++ projects/graid/head/bin/sh/cd.c Thu Jan 27 13:16:08 2011 (r217935) @@ -224,7 +224,7 @@ cdphysical(char *dest) } p = findcwd(NULL); if (p == NULL) - out2fmt_flush("cd: warning: failed to get name of current directory\n"); + warning("warning: failed to get name of current directory"); updatepwd(p); INTON; return (0); Modified: projects/graid/head/bin/sh/error.c ============================================================================== --- projects/graid/head/bin/sh/error.c Thu Jan 27 12:01:24 2011 (r217934) +++ projects/graid/head/bin/sh/error.c Thu Jan 27 13:16:08 2011 (r217935) @@ -134,6 +134,26 @@ onint(void) } +static void +vwarning(const char *msg, va_list ap) +{ + if (commandname) + outfmt(out2, "%s: ", commandname); + doformat(out2, msg, ap); + out2fmt_flush("\n"); +} + + +void +warning(const char *msg, ...) +{ + va_list ap; + va_start(ap, msg); + vwarning(msg, ap); + va_end(ap); +} + + /* * Exverror is called to raise the error exception. If the first argument * is not NULL then error prints an error message using printf style @@ -158,12 +178,8 @@ exverror(int cond, const char *msg, va_l else TRACE(("exverror(%d, NULL) pid=%d\n", cond, getpid())); #endif - if (msg) { - if (commandname) - outfmt(out2, "%s: ", commandname); - doformat(out2, msg, ap); - out2c('\n'); - } + if (msg) + vwarning(msg, ap); flushall(); exraise(cond); } Modified: projects/graid/head/bin/sh/error.h ============================================================================== --- projects/graid/head/bin/sh/error.h Thu Jan 27 12:01:24 2011 (r217934) +++ projects/graid/head/bin/sh/error.h Thu Jan 27 13:16:08 2011 (r217935) @@ -80,6 +80,7 @@ extern volatile sig_atomic_t intpending; void exraise(int) __dead2; void onint(void); +void warning(const char *, ...) __printflike(1, 2); void error(const char *, ...) __printf0like(1, 2) __dead2; void exerror(int, const char *, ...) __printf0like(2, 3) __dead2; Modified: projects/graid/head/bin/sh/eval.c ============================================================================== --- projects/graid/head/bin/sh/eval.c Thu Jan 27 12:01:24 2011 (r217934) +++ projects/graid/head/bin/sh/eval.c Thu Jan 27 13:16:08 2011 (r217935) @@ -94,6 +94,7 @@ static void evalsubshell(union node *, i static void evalredir(union node *, int); static void expredir(union node *); static void evalpipe(union node *); +static int is_valid_fast_cmdsubst(union node *n); static void evalcommand(union node *, int, struct backcmd *); static void prehash(union node *); @@ -565,6 +566,19 @@ evalpipe(union node *n) +static int +is_valid_fast_cmdsubst(union node *n) +{ + union node *argp; + + if (n->type != NCMD) + return 0; + for (argp = n->ncmd.args ; argp ; argp = argp->narg.next) + if (expandhassideeffects(argp->narg.text)) + return 0; + return 1; +} + /* * Execute a command inside back quotes. If it's a builtin command, we * want to save its output in a block obtained from malloc. Otherwise @@ -578,6 +592,8 @@ evalbackcmd(union node *n, struct backcm int pip[2]; struct job *jp; struct stackmark smark; /* unnecessary */ + struct jmploc jmploc; + struct jmploc *savehandler; setstackmark(&smark); result->fd = -1; @@ -588,9 +604,21 @@ evalbackcmd(union node *n, struct backcm exitstatus = 0; goto out; } - if (n->type == NCMD) { + if (is_valid_fast_cmdsubst(n)) { exitstatus = oexitstatus; - evalcommand(n, EV_BACKCMD, result); + savehandler = handler; + if (setjmp(jmploc.loc)) { + if (exception == EXERROR || exception == EXEXEC) + exitstatus = 2; + else if (exception != 0) { + handler = savehandler; + longjmp(handler->loc, 1); + } + } else { + handler = &jmploc; + evalcommand(n, EV_BACKCMD, result); + } + handler = savehandler; } else { exitstatus = 0; if (pipe(pip) < 0) @@ -615,10 +643,35 @@ out: result->fd, result->buf, result->nleft, result->jp)); } - +/* + * Check if a builtin can safely be executed in the same process, + * even though it should be in a subshell (command substitution). + * Note that jobid, jobs, times and trap can show information not + * available in a child process; this is deliberate. + * The arguments should already have been expanded. + */ +static int +safe_builtin(int idx, int argc, char **argv) +{ + if (idx == BLTINCMD || idx == COMMANDCMD || idx == ECHOCMD || + idx == FALSECMD || idx == JOBIDCMD || idx == JOBSCMD || + idx == KILLCMD || idx == PRINTFCMD || idx == PWDCMD || + idx == TESTCMD || idx == TIMESCMD || idx == TRUECMD || + idx == TYPECMD) + return (1); + if (idx == EXPORTCMD || idx == TRAPCMD || idx == ULIMITCMD || + idx == UMASKCMD) + return (argc <= 1 || (argc == 2 && argv[1][0] == '-')); + if (idx == SETCMD) + return (argc <= 1 || (argc == 2 && (argv[1][0] == '-' || + argv[1][0] == '+') && argv[1][1] == 'o' && + argv[1][2] == '\0')); + return (0); +} /* * Execute a simple command. + * Note: This may or may not return if (flags & EV_EXIT). */ static void @@ -655,6 +708,7 @@ evalcommand(union node *cmd, int flags, arglist.lastp = &arglist.list; varlist.lastp = &varlist.list; varflag = 1; + jp = NULL; do_clearcmdentry = 0; oexitstatus = exitstatus; exitstatus = 0; @@ -833,10 +887,8 @@ evalcommand(union node *cmd, int flags, || ((cmdentry.cmdtype == CMDNORMAL || cmdentry.cmdtype == CMDUNKNOWN) && ((flags & EV_EXIT) == 0 || have_traps())) || ((flags & EV_BACKCMD) != 0 - && (cmdentry.cmdtype != CMDBUILTIN - || cmdentry.u.index == CDCMD - || cmdentry.u.index == DOTCMD - || cmdentry.u.index == EVALCMD))) { + && (cmdentry.cmdtype != CMDBUILTIN || + !safe_builtin(cmdentry.u.index, argc, argv)))) { jp = makejob(cmd, 1); mode = cmd->ncmd.backgnd; if (flags & EV_BACKCMD) { @@ -915,7 +967,7 @@ evalcommand(union node *cmd, int flags, evalskip = 0; skipcount = 0; } - if (flags & EV_EXIT) + if (jp) exitshell(exitstatus); } else if (cmdentry.cmdtype == CMDBUILTIN) { #ifdef DEBUG @@ -947,8 +999,7 @@ evalcommand(union node *cmd, int flags, */ if (argc == 0 && !(flags & EV_BACKCMD)) cmdentry.special = 1; - if (cmdentry.special) - listsetvar(cmdenviron); + listsetvar(cmdenviron, cmdentry.special ? 0 : VNOSET); if (argc > 0) bltinsetlocale(); commandname = argv[0]; @@ -964,13 +1015,12 @@ cmddone: out1 = &output; out2 = &errout; freestdout(); + handler = savehandler; if (e != EXSHELLPROC) { commandname = savecmdname; - if (flags & EV_EXIT) { + if (jp) exitshell(exitstatus); - } } - handler = savehandler; if (flags == EV_BACKCMD) { backcmd->buf = memout.buf; backcmd->nleft = memout.nextc - memout.buf; Modified: projects/graid/head/bin/sh/exec.c ============================================================================== --- projects/graid/head/bin/sh/exec.c Thu Jan 27 12:01:24 2011 (r217934) +++ projects/graid/head/bin/sh/exec.c Thu Jan 27 13:16:08 2011 (r217935) @@ -92,7 +92,6 @@ struct tblentry { static struct tblentry *cmdtable[CMDTABLESIZE]; -static int builtinloc = -1; /* index in path of %builtin, or -1 */ int exerrno = 0; /* Last exec error */ @@ -190,9 +189,8 @@ padvance(const char **path, const char * for (p = start; *p && *p != ':' && *p != '%'; p++) ; /* nothing */ len = p - start + strlen(name) + 2; /* "2" is for '/' and '\0' */ - while (stackblocksize() < len) - growstackblock(); - q = stackblock(); + STARTSTACKSTR(q); + CHECKSTRSPACE(len, q); if (p != start) { memcpy(q, start, p - start); q += p - start; @@ -245,8 +243,7 @@ hashcmd(int argc __unused, char **argv _ } while ((name = *argptr) != NULL) { if ((cmdp = cmdlookup(name, 0)) != NULL - && (cmdp->cmdtype == CMDNORMAL - || (cmdp->cmdtype == CMDBUILTIN && builtinloc >= 0))) + && cmdp->cmdtype == CMDNORMAL) delete_cmd_entry(); find_command(name, &entry, DO_ERR, pathval()); if (verbose) { @@ -337,8 +334,8 @@ find_command(const char *name, struct cm goto success; } - /* If %builtin not in path, check for builtin next */ - if (builtinloc < 0 && (i = find_builtin(name, &spec)) >= 0) { + /* Check for builtin next */ + if ((i = find_builtin(name, &spec)) >= 0) { INTOFF; cmdp = cmdlookup(name, 1); if (cmdp->cmdtype == CMDFUNCTION) @@ -354,7 +351,7 @@ find_command(const char *name, struct cm prev = -1; /* where to start */ if (cmdp) { /* doing a rehash */ if (cmdp->cmdtype == CMDBUILTIN) - prev = builtinloc; + prev = -1; else prev = cmdp->param.index; } @@ -366,19 +363,7 @@ loop: stunalloc(fullname); idx++; if (pathopt) { - if (prefix("builtin", pathopt)) { - if ((i = find_builtin(name, &spec)) < 0) - goto loop; - INTOFF; - cmdp = cmdlookup(name, 1); - if (cmdp->cmdtype == CMDFUNCTION) - cmdp = &loc_cmd; - cmdp->cmdtype = CMDBUILTIN; - cmdp->param.index = i; - cmdp->special = spec; - INTON; - goto success; - } else if (prefix("func", pathopt)) { + if (prefix("func", pathopt)) { /* handled below */ } else { goto loop; /* ignore unimplemented options */ @@ -485,8 +470,7 @@ hashcd(void) for (pp = cmdtable ; pp < &cmdtable[CMDTABLESIZE] ; pp++) { for (cmdp = *pp ; cmdp ; cmdp = cmdp->next) { - if (cmdp->cmdtype == CMDNORMAL - || (cmdp->cmdtype == CMDBUILTIN && builtinloc >= 0)) + if (cmdp->cmdtype == CMDNORMAL) cmdp->rehash = 1; } } @@ -506,13 +490,11 @@ changepath(const char *newval) const char *old, *new; int idx; int firstchange; - int bltin; old = pathval(); new = newval; firstchange = 9999; /* assume no change */ idx = 0; - bltin = -1; for (;;) { if (*old != *new) { firstchange = idx; @@ -523,19 +505,12 @@ changepath(const char *newval) } if (*new == '\0') break; - if (*new == '%' && bltin < 0 && prefix("builtin", new + 1)) - bltin = idx; if (*new == ':') { idx++; } new++, old++; } - if (builtinloc < 0 && bltin >= 0) - builtinloc = bltin; /* zap builtins */ - if (builtinloc >= 0 && bltin < 0) - firstchange = 0; clearcmdentry(firstchange); - builtinloc = bltin; } @@ -556,9 +531,7 @@ clearcmdentry(int firstchange) pp = tblp; while ((cmdp = *pp) != NULL) { if ((cmdp->cmdtype == CMDNORMAL && - cmdp->param.index >= firstchange) - || (cmdp->cmdtype == CMDBUILTIN && - builtinloc >= firstchange)) { + cmdp->param.index >= firstchange)) { *pp = cmdp->next; ckfree(cmdp); } else { Modified: projects/graid/head/bin/sh/expand.c ============================================================================== --- projects/graid/head/bin/sh/expand.c Thu Jan 27 12:01:24 2011 (r217934) +++ projects/graid/head/bin/sh/expand.c Thu Jan 27 13:16:08 2011 (r217935) @@ -499,16 +499,17 @@ expbackq(union node *cmd, int quoted, in } lastc = *p++; if (lastc != '\0') { - if (quotes && syntax[(int)lastc] == CCTL) - STPUTC(CTLESC, dest); if (lastc == '\n') { nnl++; } else { + CHECKSTRSPACE(nnl + 2, dest); while (nnl > 0) { nnl--; - STPUTC('\n', dest); + USTPUTC('\n', dest); } - STPUTC(lastc, dest); + if (quotes && syntax[(int)lastc] == CCTL) + USTPUTC(CTLESC, dest); + USTPUTC(lastc, dest); } } } @@ -557,8 +558,6 @@ subevalvar(char *p, char *str, int strlo amount = startp - expdest; STADJUST(amount, expdest); varflags &= ~VSNUL; - if (c != 0) - *loc = c; return 1; case VSQUESTION: @@ -1571,6 +1570,78 @@ cvtnum(int num, char *buf) } /* + * Check statically if expanding a string may have side effects. + */ +int +expandhassideeffects(const char *p) +{ + int c; + int arinest; + + arinest = 0; + while ((c = *p++) != '\0') { + switch (c) { + case CTLESC: + p++; + break; + case CTLVAR: + c = *p++; + /* Expanding $! sets the job to remembered. */ + if (*p == '!') + return 1; + if ((c & VSTYPE) == VSASSIGN) + return 1; + /* + * If we are in arithmetic, the parameter may contain + * '=' which may cause side effects. Exceptions are + * the length of a parameter and $$, $# and $? which + * are always numeric. + */ + if ((c & VSTYPE) == VSLENGTH) { + while (*p != '=') + p++; + p++; + break; + } + if ((*p == '$' || *p == '#' || *p == '?') && + p[1] == '=') { + p += 2; + break; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-projects@FreeBSD.ORG Thu Jan 27 14:46:02 2011 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CB97E106566B; Thu, 27 Jan 2011 14:46:02 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B67068FC0C; Thu, 27 Jan 2011 14:46:02 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0REk2um020396; Thu, 27 Jan 2011 14:46:02 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0REk2Iq020357; Thu, 27 Jan 2011 14:46:02 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201101271446.p0REk2Iq020357@svn.freebsd.org> From: Alexander Motin Date: Thu, 27 Jan 2011 14:46:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217943 - in projects/graid/8: . bin/pkill bin/sh contrib/binutils/bfd contrib/binutils/binutils contrib/binutils/include/elf contrib/bsnmp/snmpd contrib/file contrib/gdb/gdb contrib/to... X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Jan 2011 14:46:02 -0000 Author: mav Date: Thu Jan 27 14:46:01 2011 New Revision: 217943 URL: http://svn.freebsd.org/changeset/base/217943 Log: IFS Added: projects/graid/8/share/man/man4/rgephy.4 - copied unchanged from r217941, stable/8/share/man/man4/rgephy.4 projects/graid/8/share/man/man4/run.4 - copied unchanged from r217941, stable/8/share/man/man4/run.4 projects/graid/8/share/man/man4/runfw.4 - copied unchanged from r217941, stable/8/share/man/man4/runfw.4 projects/graid/8/share/man/man4/xen.4 - copied unchanged from r217941, stable/8/share/man/man4/xen.4 projects/graid/8/share/man/man9/osd.9 - copied unchanged from r217941, stable/8/share/man/man9/osd.9 projects/graid/8/sys/net/netisr_internal.h - copied unchanged from r217941, stable/8/sys/net/netisr_internal.h projects/graid/8/tools/regression/bin/sh/builtins/exit1.0 - copied unchanged from r217941, stable/8/tools/regression/bin/sh/builtins/exit1.0 projects/graid/8/tools/regression/bin/sh/builtins/exit2.8 - copied unchanged from r217941, stable/8/tools/regression/bin/sh/builtins/exit2.8 projects/graid/8/tools/regression/bin/sh/builtins/wait3.0 - copied unchanged from r217941, stable/8/tools/regression/bin/sh/builtins/wait3.0 projects/graid/8/tools/regression/bin/sh/expansion/cmdsubst6.0 - copied unchanged from r217941, stable/8/tools/regression/bin/sh/expansion/cmdsubst6.0 projects/graid/8/tools/regression/bin/sh/expansion/cmdsubst8.0 - copied unchanged from r217941, stable/8/tools/regression/bin/sh/expansion/cmdsubst8.0 projects/graid/8/tools/regression/bin/sh/expansion/cmdsubst9.0 - copied unchanged from r217941, stable/8/tools/regression/bin/sh/expansion/cmdsubst9.0 projects/graid/8/tools/regression/netinet/arphold/ - copied from r217941, stable/8/tools/regression/netinet/arphold/ projects/graid/8/tools/regression/usr.bin/pkill/pgrep-q.t - copied unchanged from r217941, stable/8/tools/regression/usr.bin/pkill/pgrep-q.t projects/graid/8/tools/regression/usr.bin/sed/inplace_race.t - copied unchanged from r217941, stable/8/tools/regression/usr.bin/sed/inplace_race.t projects/graid/8/usr.bin/netstat/netisr.c - copied unchanged from r217941, stable/8/usr.bin/netstat/netisr.c Modified: projects/graid/8/COPYRIGHT (contents, props changed) projects/graid/8/Makefile.inc1 (contents, props changed) projects/graid/8/ObsoleteFiles.inc (contents, props changed) projects/graid/8/bin/pkill/pkill.1 projects/graid/8/bin/pkill/pkill.c projects/graid/8/bin/sh/histedit.c projects/graid/8/contrib/binutils/bfd/elf-bfd.h projects/graid/8/contrib/binutils/bfd/elf.c projects/graid/8/contrib/binutils/binutils/readelf.c projects/graid/8/contrib/binutils/include/elf/common.h projects/graid/8/contrib/file/readelf.h projects/graid/8/contrib/gdb/gdb/fbsd-proc.c projects/graid/8/etc/devd.conf projects/graid/8/etc/network.subr projects/graid/8/etc/rc.d/mountcritlocal projects/graid/8/gnu/usr.bin/gdb/libgdb/fbsd-threads.c projects/graid/8/gnu/usr.bin/groff/tmac/mdoc.local projects/graid/8/lib/csu/i386-elf/crt1_s.S projects/graid/8/lib/libc/net/hesiod.c projects/graid/8/lib/libc/stdio/freopen.c projects/graid/8/lib/libc/stdlib/realpath.c projects/graid/8/lib/libc/sys/mknod.2 projects/graid/8/lib/libc/sys/setpgid.2 projects/graid/8/lib/libkvm/Makefile projects/graid/8/lib/libkvm/kvm.c projects/graid/8/lib/libkvm/kvm.h projects/graid/8/lib/libkvm/kvm_getpcpu.3 projects/graid/8/lib/libkvm/kvm_pcpu.c projects/graid/8/lib/libkvm/kvm_private.h projects/graid/8/lib/libproc/proc_create.c projects/graid/8/lib/libusb/libusb20_compat01.c projects/graid/8/libexec/ftpd/ftpd.c projects/graid/8/release/Makefile projects/graid/8/release/powerpc/mkisoimages.sh projects/graid/8/sbin/geom/class/raid3/geom_raid3.c projects/graid/8/sbin/hastd/Makefile projects/graid/8/sbin/hastd/hastd.c projects/graid/8/sbin/hastd/hooks.c projects/graid/8/sbin/hastd/parse.y projects/graid/8/sbin/hastd/primary.c projects/graid/8/sbin/ifconfig/ifmedia.c projects/graid/8/sbin/mount_nfs/mount_nfs.c projects/graid/8/sbin/newfs/newfs.c projects/graid/8/sbin/route/route.8 projects/graid/8/share/examples/etc/make.conf projects/graid/8/share/man/man4/Makefile projects/graid/8/share/man/man4/axe.4 projects/graid/8/share/man/man4/miibus.4 projects/graid/8/share/man/man4/nfe.4 projects/graid/8/share/man/man4/nve.4 projects/graid/8/share/man/man4/re.4 projects/graid/8/share/man/man4/sge.4 projects/graid/8/share/man/man4/tcp.4 projects/graid/8/share/man/man5/core.5 projects/graid/8/share/man/man5/mqueuefs.5 projects/graid/8/share/man/man5/periodic.conf.5 projects/graid/8/share/man/man5/rc.conf.5 projects/graid/8/share/man/man5/xfs.5 projects/graid/8/share/man/man7/build.7 projects/graid/8/share/man/man9/Makefile projects/graid/8/share/man/man9/netisr.9 projects/graid/8/share/mk/bsd.cpu.mk projects/graid/8/sys/amd64/acpica/madt.c projects/graid/8/sys/amd64/amd64/cpu_switch.S projects/graid/8/sys/amd64/amd64/exception.S projects/graid/8/sys/amd64/amd64/fpu.c projects/graid/8/sys/amd64/amd64/genassym.c projects/graid/8/sys/amd64/amd64/io_apic.c projects/graid/8/sys/amd64/amd64/legacy.c projects/graid/8/sys/amd64/amd64/machdep.c projects/graid/8/sys/amd64/amd64/sys_machdep.c projects/graid/8/sys/amd64/amd64/vm_machdep.c projects/graid/8/sys/amd64/ia32/ia32_signal.c projects/graid/8/sys/amd64/include/atomic.h projects/graid/8/sys/amd64/include/pcb.h projects/graid/8/sys/amd64/linux32/linux32_sysvec.c projects/graid/8/sys/arm/arm/machdep.c projects/graid/8/sys/arm/arm/vm_machdep.c projects/graid/8/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c projects/graid/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio.h projects/graid/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c projects/graid/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c projects/graid/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c projects/graid/8/sys/cddl/dev/cyclic/cyclic.c projects/graid/8/sys/cddl/dev/dtrace/amd64/dtrace_subr.c projects/graid/8/sys/cddl/dev/dtrace/dtrace_debug.c projects/graid/8/sys/cddl/dev/dtrace/dtrace_load.c projects/graid/8/sys/cddl/dev/dtrace/i386/dtrace_subr.c projects/graid/8/sys/compat/freebsd32/freebsd32.h projects/graid/8/sys/compat/linprocfs/linprocfs.c projects/graid/8/sys/compat/linux/linux_ioctl.c projects/graid/8/sys/compat/linux/linux_ioctl.h projects/graid/8/sys/compat/ndis/kern_ndis.c projects/graid/8/sys/compat/ndis/ndis_var.h projects/graid/8/sys/compat/ndis/ntoskrnl_var.h projects/graid/8/sys/compat/ndis/subr_ndis.c projects/graid/8/sys/compat/ndis/subr_ntoskrnl.c projects/graid/8/sys/conf/files projects/graid/8/sys/dev/aac/aac_cam.c projects/graid/8/sys/dev/acpica/acpi_cpu.c projects/graid/8/sys/dev/acpica/acpi_ec.c projects/graid/8/sys/dev/ahci/ahci.c projects/graid/8/sys/dev/alc/if_alc.c projects/graid/8/sys/dev/alc/if_alcreg.h projects/graid/8/sys/dev/ata/chipsets/ata-serverworks.c projects/graid/8/sys/dev/ata/chipsets/ata-via.c projects/graid/8/sys/dev/bge/if_bge.c projects/graid/8/sys/dev/bwi/if_bwi.c projects/graid/8/sys/dev/bwn/if_bwn.c projects/graid/8/sys/dev/dc/dcphy.c projects/graid/8/sys/dev/dc/pnphy.c projects/graid/8/sys/dev/e1000/if_em.c projects/graid/8/sys/dev/e1000/if_igb.c projects/graid/8/sys/dev/ichwd/ichwd.c projects/graid/8/sys/dev/ichwd/ichwd.h projects/graid/8/sys/dev/ieee488/ibfoo.c projects/graid/8/sys/dev/if_ndis/if_ndis.c projects/graid/8/sys/dev/if_ndis/if_ndis_pccard.c projects/graid/8/sys/dev/if_ndis/if_ndis_pci.c projects/graid/8/sys/dev/if_ndis/if_ndis_usb.c projects/graid/8/sys/dev/iwn/if_iwn.c projects/graid/8/sys/dev/ixgbe/ixgbe.c projects/graid/8/sys/dev/ixgbe/ixgbe.h projects/graid/8/sys/dev/ixgbe/ixgbe_82599.c projects/graid/8/sys/dev/ixgbe/ixgbe_api.h projects/graid/8/sys/dev/ixgbe/ixgbe_common.c projects/graid/8/sys/dev/ixgbe/ixgbe_common.h projects/graid/8/sys/dev/ixgbe/ixgbe_mbx.c projects/graid/8/sys/dev/ixgbe/ixgbe_type.h projects/graid/8/sys/dev/md/md.c projects/graid/8/sys/dev/mfi/mfi_cam.c projects/graid/8/sys/dev/mii/atphy.c projects/graid/8/sys/dev/mii/brgphy.c projects/graid/8/sys/dev/mii/ciphy.c projects/graid/8/sys/dev/mii/e1000phy.c projects/graid/8/sys/dev/mii/ip1000phy.c projects/graid/8/sys/dev/mii/jmphy.c projects/graid/8/sys/dev/mii/mii_physubr.c projects/graid/8/sys/dev/mii/nsgphy.c projects/graid/8/sys/dev/mii/rgephy.c projects/graid/8/sys/dev/mii/xmphy.c projects/graid/8/sys/dev/mmc/mmc.c projects/graid/8/sys/dev/mpt/mpt_cam.c projects/graid/8/sys/dev/mpt/mpt_pci.c projects/graid/8/sys/dev/mwl/mwlhal.c projects/graid/8/sys/dev/pci/vga_pci.c projects/graid/8/sys/dev/puc/pucdata.c projects/graid/8/sys/dev/ral/rt2560.c projects/graid/8/sys/dev/ral/rt2661.c projects/graid/8/sys/dev/random/randomdev.c projects/graid/8/sys/dev/re/if_re.c projects/graid/8/sys/dev/sis/if_sis.c projects/graid/8/sys/dev/usb/net/if_axe.c projects/graid/8/sys/dev/usb/net/if_axereg.h projects/graid/8/sys/dev/usb/serial/uftdi.c projects/graid/8/sys/dev/usb/usb_request.c projects/graid/8/sys/dev/usb/usbdevs projects/graid/8/sys/dev/usb/wlan/if_rum.c projects/graid/8/sys/dev/usb/wlan/if_run.c projects/graid/8/sys/dev/usb/wlan/if_ural.c projects/graid/8/sys/dev/wpi/if_wpi.c projects/graid/8/sys/dev/xen/blkfront/blkfront.c projects/graid/8/sys/dev/xen/console/console.c projects/graid/8/sys/fs/nfs/nfs.h projects/graid/8/sys/fs/nfs/nfs_commonsubs.c projects/graid/8/sys/fs/nfs/nfs_var.h projects/graid/8/sys/fs/nfs/nfsdport.h projects/graid/8/sys/fs/nfs/nfsport.h projects/graid/8/sys/fs/nfsclient/nfs_clvfsops.c projects/graid/8/sys/fs/nfsclient/nfsmount.h projects/graid/8/sys/fs/nfsserver/nfs_nfsdkrpc.c projects/graid/8/sys/fs/nfsserver/nfs_nfsdport.c projects/graid/8/sys/fs/nfsserver/nfs_nfsdserv.c projects/graid/8/sys/fs/nfsserver/nfs_nfsdsocket.c projects/graid/8/sys/fs/nfsserver/nfs_nfsdstate.c projects/graid/8/sys/fs/tmpfs/tmpfs_subr.c projects/graid/8/sys/fs/tmpfs/tmpfs_vnops.c projects/graid/8/sys/geom/geom_ctl.c projects/graid/8/sys/geom/geom_disk.c projects/graid/8/sys/geom/geom_event.c projects/graid/8/sys/geom/nop/g_nop.c projects/graid/8/sys/geom/part/g_part.c projects/graid/8/sys/geom/part/g_part_gpt.c projects/graid/8/sys/geom/raid3/g_raid3.c projects/graid/8/sys/i386/acpica/madt.c projects/graid/8/sys/i386/i386/io_apic.c projects/graid/8/sys/i386/i386/legacy.c projects/graid/8/sys/i386/i386/machdep.c projects/graid/8/sys/i386/i386/minidump_machdep.c projects/graid/8/sys/i386/i386/mp_machdep.c projects/graid/8/sys/i386/i386/sys_machdep.c projects/graid/8/sys/i386/i386/vm86bios.s projects/graid/8/sys/i386/i386/vm_machdep.c projects/graid/8/sys/i386/include/atomic.h projects/graid/8/sys/i386/include/pmap.h projects/graid/8/sys/i386/include/segments.h projects/graid/8/sys/i386/isa/npx.c projects/graid/8/sys/i386/xen/clock.c projects/graid/8/sys/i386/xen/pmap.c projects/graid/8/sys/i386/xen/xen_machdep.c projects/graid/8/sys/ia64/ia64/machdep.c projects/graid/8/sys/kern/imgact_elf.c projects/graid/8/sys/kern/kern_clock.c projects/graid/8/sys/kern/kern_conf.c projects/graid/8/sys/kern/kern_descrip.c projects/graid/8/sys/kern/kern_exec.c projects/graid/8/sys/kern/kern_exit.c projects/graid/8/sys/kern/kern_fail.c projects/graid/8/sys/kern/kern_fork.c projects/graid/8/sys/kern/kern_jail.c projects/graid/8/sys/kern/kern_ktrace.c projects/graid/8/sys/kern/kern_proc.c projects/graid/8/sys/kern/kern_resource.c projects/graid/8/sys/kern/kern_switch.c projects/graid/8/sys/kern/kern_sysctl.c projects/graid/8/sys/kern/kern_timeout.c projects/graid/8/sys/kern/kern_umtx.c projects/graid/8/sys/kern/p1003_1b.c projects/graid/8/sys/kern/posix4_mib.c projects/graid/8/sys/kern/sched_4bsd.c projects/graid/8/sys/kern/sched_ule.c projects/graid/8/sys/kern/subr_bus.c projects/graid/8/sys/kern/subr_clock.c projects/graid/8/sys/kern/subr_devstat.c projects/graid/8/sys/kern/subr_lock.c projects/graid/8/sys/kern/subr_log.c projects/graid/8/sys/kern/subr_pcpu.c projects/graid/8/sys/kern/subr_smp.c projects/graid/8/sys/kern/sys_process.c projects/graid/8/sys/kern/tty.c projects/graid/8/sys/kern/tty_tty.c projects/graid/8/sys/kern/uipc_sem.c projects/graid/8/sys/kern/vfs_lookup.c projects/graid/8/sys/mips/mips/machdep.c projects/graid/8/sys/mips/mips/vm_machdep.c projects/graid/8/sys/modules/Makefile projects/graid/8/sys/net/flowtable.c projects/graid/8/sys/net/if_epair.c projects/graid/8/sys/net/if_lagg.c projects/graid/8/sys/net/if_lagg.h projects/graid/8/sys/net/if_llatbl.c projects/graid/8/sys/net/if_llatbl.h projects/graid/8/sys/net/if_media.h projects/graid/8/sys/net/netisr.c projects/graid/8/sys/net/netisr.h projects/graid/8/sys/net/vnet.c projects/graid/8/sys/net/vnet.h projects/graid/8/sys/net80211/ieee80211_mesh.c projects/graid/8/sys/net80211/ieee80211_node.c projects/graid/8/sys/netinet/if_ether.c projects/graid/8/sys/netinet/in.c projects/graid/8/sys/netinet/in_pcb.c projects/graid/8/sys/netinet/ipfw/ip_dn_io.c projects/graid/8/sys/netinet/sctp_indata.c projects/graid/8/sys/netinet/sctp_input.c projects/graid/8/sys/netinet/sctputil.c projects/graid/8/sys/netinet/tcp.h projects/graid/8/sys/netinet/tcp_output.c projects/graid/8/sys/netinet/tcp_reass.c projects/graid/8/sys/netinet/tcp_timer.c projects/graid/8/sys/netinet/tcp_usrreq.c projects/graid/8/sys/netinet/tcp_var.h projects/graid/8/sys/nfs/nfs_lock.c projects/graid/8/sys/nfs/nfs_mountcommon.h projects/graid/8/sys/nfs/nfs_nfssvc.c projects/graid/8/sys/nfs/nfssvc.h projects/graid/8/sys/nfsclient/nfs_vfsops.c projects/graid/8/sys/nfsclient/nfsmount.h projects/graid/8/sys/nfsserver/nfs.h projects/graid/8/sys/nfsserver/nfs_serv.c projects/graid/8/sys/nfsserver/nfs_srvsubs.c projects/graid/8/sys/nlm/nlm_advlock.c projects/graid/8/sys/nlm/nlm_prot_impl.c projects/graid/8/sys/pc98/pc98/machdep.c projects/graid/8/sys/powerpc/aim/machdep.c projects/graid/8/sys/powerpc/aim/vm_machdep.c projects/graid/8/sys/powerpc/booke/machdep.c projects/graid/8/sys/powerpc/booke/vm_machdep.c projects/graid/8/sys/rpc/clnt_dg.c projects/graid/8/sys/rpc/clnt_vc.c projects/graid/8/sys/rpc/svc_vc.c projects/graid/8/sys/sparc64/include/asmacros.h projects/graid/8/sys/sparc64/include/cpufunc.h projects/graid/8/sys/sparc64/sparc64/machdep.c projects/graid/8/sys/sparc64/sparc64/support.S projects/graid/8/sys/sparc64/sparc64/tick.c projects/graid/8/sys/sparc64/sparc64/tlb.c projects/graid/8/sys/sparc64/sparc64/vm_machdep.c projects/graid/8/sys/sun4v/sun4v/machdep.c projects/graid/8/sys/sys/copyright.h projects/graid/8/sys/sys/elf_common.h projects/graid/8/sys/sys/fail.h projects/graid/8/sys/sys/ktrace.h projects/graid/8/sys/sys/param.h projects/graid/8/sys/sys/pioctl.h projects/graid/8/sys/sys/procfs.h projects/graid/8/sys/sys/ptrace.h projects/graid/8/sys/vm/uma_core.c projects/graid/8/sys/vm/vm_map.c projects/graid/8/sys/vm/vm_map.h projects/graid/8/sys/vm/vm_object.c projects/graid/8/sys/vm/vm_page.c projects/graid/8/sys/x86/x86/mca.c projects/graid/8/sys/xen/evtchn/evtchn.c projects/graid/8/tools/regression/acct/Makefile projects/graid/8/tools/regression/acct/pack.c projects/graid/8/tools/regression/acct/regress.t projects/graid/8/tools/regression/bin/date/regress.sh projects/graid/8/tools/regression/usr.bin/sed/Makefile projects/graid/8/tools/tools/mctest/mctest.cc projects/graid/8/tools/tools/mctest/mctest_run.sh projects/graid/8/usr.bin/chpass/Makefile (contents, props changed) projects/graid/8/usr.bin/find/function.c projects/graid/8/usr.bin/gcore/elfcore.c projects/graid/8/usr.bin/gcore/gcore.1 projects/graid/8/usr.bin/gcore/gcore.c projects/graid/8/usr.bin/kdump/mksubr projects/graid/8/usr.bin/locate/locate/locate.rc projects/graid/8/usr.bin/locate/locate/updatedb.sh projects/graid/8/usr.bin/netstat/Makefile projects/graid/8/usr.bin/netstat/inet.c projects/graid/8/usr.bin/netstat/main.c projects/graid/8/usr.bin/netstat/netstat.1 projects/graid/8/usr.bin/netstat/netstat.h projects/graid/8/usr.bin/sed/main.c projects/graid/8/usr.bin/stat/Makefile projects/graid/8/usr.bin/stat/stat.1 projects/graid/8/usr.bin/stat/stat.c projects/graid/8/usr.bin/unifdef/Makefile projects/graid/8/usr.bin/unifdef/unifdef.1 projects/graid/8/usr.bin/unifdef/unifdef.c projects/graid/8/usr.bin/unifdef/unifdefall.sh projects/graid/8/usr.sbin/config/config.y projects/graid/8/usr.sbin/config/mkmakefile.c projects/graid/8/usr.sbin/config/mkoptions.c projects/graid/8/usr.sbin/mfiutil/Makefile projects/graid/8/usr.sbin/mfiutil/mfi_cmd.c projects/graid/8/usr.sbin/mfiutil/mfi_config.c projects/graid/8/usr.sbin/mfiutil/mfi_evt.c projects/graid/8/usr.sbin/mfiutil/mfi_flash.c projects/graid/8/usr.sbin/mfiutil/mfiutil.8 projects/graid/8/usr.sbin/newsyslog/newsyslog.c projects/graid/8/usr.sbin/pkg_install/add/main.c projects/graid/8/usr.sbin/sysinstall/media.c Directory Properties: projects/graid/8/ (props changed) projects/graid/8/Makefile (props changed) projects/graid/8/UPDATING (props changed) projects/graid/8/bin/ (props changed) projects/graid/8/bin/chio/ (props changed) projects/graid/8/bin/chmod/ (props changed) projects/graid/8/bin/cp/ (props changed) projects/graid/8/bin/csh/ (props changed) projects/graid/8/bin/date/ (props changed) projects/graid/8/bin/echo/ (props changed) projects/graid/8/bin/expr/ (props changed) projects/graid/8/bin/getfacl/ (props changed) projects/graid/8/bin/kill/ (props changed) projects/graid/8/bin/ln/ (props changed) projects/graid/8/bin/ls/ (props changed) projects/graid/8/bin/mv/ (props changed) projects/graid/8/bin/pax/ (props changed) projects/graid/8/bin/pkill/ (props changed) projects/graid/8/bin/ps/ (props changed) projects/graid/8/bin/pwait/ (props changed) projects/graid/8/bin/setfacl/ (props changed) projects/graid/8/bin/sh/ (props changed) projects/graid/8/bin/sleep/ (props changed) projects/graid/8/bin/test/ (props changed) projects/graid/8/cddl/compat/opensolaris/ (props changed) projects/graid/8/cddl/contrib/opensolaris/ (props changed) projects/graid/8/cddl/lib/ (props changed) projects/graid/8/cddl/lib/libnvpair/ (props changed) projects/graid/8/cddl/lib/libzpool/ (props changed) projects/graid/8/cddl/usr.bin/ (props changed) projects/graid/8/cddl/usr.sbin/ (props changed) projects/graid/8/contrib/ (props changed) projects/graid/8/contrib/bind9/ (props changed) projects/graid/8/contrib/binutils/ (props changed) projects/graid/8/contrib/bsnmp/ (props changed) projects/graid/8/contrib/bsnmp/snmpd/bsnmpd.1 (props changed) projects/graid/8/contrib/bzip2/ (props changed) projects/graid/8/contrib/com_err/ (props changed) projects/graid/8/contrib/csup/ (props changed) projects/graid/8/contrib/ee/ (props changed) projects/graid/8/contrib/expat/ (props changed) projects/graid/8/contrib/file/ (props changed) projects/graid/8/contrib/gcc/ (props changed) projects/graid/8/contrib/gdb/ (props changed) projects/graid/8/contrib/gdtoa/ (props changed) projects/graid/8/contrib/groff/ (props changed) projects/graid/8/contrib/ipfilter/ (props changed) projects/graid/8/contrib/less/ (props changed) projects/graid/8/contrib/libpcap/ (props changed) projects/graid/8/contrib/ncurses/ (props changed) projects/graid/8/contrib/netcat/ (props changed) projects/graid/8/contrib/ntp/ (props changed) projects/graid/8/contrib/nvi/ (props changed) projects/graid/8/contrib/one-true-awk/ (props changed) projects/graid/8/contrib/openbsm/ (props changed) projects/graid/8/contrib/openpam/ (props changed) projects/graid/8/contrib/pf/ (props changed) projects/graid/8/contrib/sendmail/ (props changed) projects/graid/8/contrib/tcp_wrappers/ (props changed) projects/graid/8/contrib/tcpdump/ (props changed) projects/graid/8/contrib/tcsh/ (props changed) projects/graid/8/contrib/telnet/ (props changed) projects/graid/8/contrib/top/ (props changed) projects/graid/8/contrib/top/install-sh (props changed) projects/graid/8/contrib/traceroute/ (props changed) projects/graid/8/contrib/wpa/ (props changed) projects/graid/8/contrib/xz/ (props changed) projects/graid/8/contrib/xz/AUTHORS (props changed) projects/graid/8/contrib/xz/COPYING (props changed) projects/graid/8/contrib/xz/ChangeLog (props changed) projects/graid/8/contrib/xz/FREEBSD-Xlist (props changed) projects/graid/8/contrib/xz/FREEBSD-upgrade (props changed) projects/graid/8/contrib/xz/README (props changed) projects/graid/8/contrib/xz/THANKS (props changed) projects/graid/8/contrib/xz/TODO (props changed) projects/graid/8/contrib/xz/po/ (props changed) projects/graid/8/contrib/xz/src/ (props changed) projects/graid/8/crypto/heimdal/ (props changed) projects/graid/8/crypto/openssh/ (props changed) projects/graid/8/crypto/openssl/ (props changed) projects/graid/8/etc/ (props changed) projects/graid/8/etc/periodic/daily/ (props changed) projects/graid/8/etc/periodic/daily/800.scrub-zfs (props changed) projects/graid/8/etc/periodic/security/ (props changed) projects/graid/8/games/factor/ (props changed) projects/graid/8/games/fortune/ (props changed) projects/graid/8/games/grdc/ (props changed) projects/graid/8/games/pom/ (props changed) projects/graid/8/gnu/lib/csu/ (props changed) projects/graid/8/gnu/lib/libgcc/ (props changed) projects/graid/8/gnu/lib/libstdc++/ (props changed) projects/graid/8/gnu/usr.bin/ (props changed) projects/graid/8/gnu/usr.bin/Makefile (props changed) projects/graid/8/gnu/usr.bin/dialog/ (props changed) projects/graid/8/gnu/usr.bin/gdb/ (props changed) projects/graid/8/gnu/usr.bin/gdb/kgdb/ (props changed) projects/graid/8/gnu/usr.bin/groff/ (props changed) projects/graid/8/gnu/usr.bin/patch/ (props changed) projects/graid/8/include/ (props changed) projects/graid/8/kerberos5/lib/libgssapi_krb5/ (props changed) projects/graid/8/kerberos5/lib/libgssapi_spnego/ (props changed) projects/graid/8/kerberos5/usr.bin/kdestroy/ (props changed) projects/graid/8/kerberos5/usr.bin/kpasswd/ (props changed) projects/graid/8/lib/ (props changed) projects/graid/8/lib/bind/ (props changed) projects/graid/8/lib/csu/ (props changed) projects/graid/8/lib/libarchive/ (props changed) projects/graid/8/lib/libbluetooth/ (props changed) projects/graid/8/lib/libc/ (props changed) projects/graid/8/lib/libc/locale/ (props changed) projects/graid/8/lib/libc/stdtime/ (props changed) projects/graid/8/lib/libc/sys/ (props changed) projects/graid/8/lib/libc_r/ (props changed) projects/graid/8/lib/libcam/ (props changed) projects/graid/8/lib/libcompat/ (props changed) projects/graid/8/lib/libdevinfo/ (props changed) projects/graid/8/lib/libdisk/ (props changed) projects/graid/8/lib/libedit/ (props changed) projects/graid/8/lib/libelf/ (props changed) projects/graid/8/lib/libexpat/ (props changed) projects/graid/8/lib/libfetch/ (props changed) projects/graid/8/lib/libgeom/ (props changed) projects/graid/8/lib/libgpib/ (props changed) projects/graid/8/lib/libgssapi/ (props changed) projects/graid/8/lib/libjail/ (props changed) projects/graid/8/lib/libkse/ (props changed) projects/graid/8/lib/libkvm/ (props changed) projects/graid/8/lib/liblzma/ (props changed) projects/graid/8/lib/libmagic/ (props changed) projects/graid/8/lib/libmemstat/ (props changed) projects/graid/8/lib/libpam/ (props changed) projects/graid/8/lib/libpmc/ (props changed) projects/graid/8/lib/libproc/ (props changed) projects/graid/8/lib/libradius/ (props changed) projects/graid/8/lib/librpcsec_gss/ (props changed) projects/graid/8/lib/librtld_db/ (props changed) projects/graid/8/lib/libsm/ (props changed) projects/graid/8/lib/libstand/ (props changed) projects/graid/8/lib/libtacplus/ (props changed) projects/graid/8/lib/libthr/ (props changed) projects/graid/8/lib/libthread_db/ (props changed) projects/graid/8/lib/libufs/ (props changed) projects/graid/8/lib/libugidfw/ (props changed) projects/graid/8/lib/libusb/ (props changed) projects/graid/8/lib/libusb/usb.h (props changed) projects/graid/8/lib/libusbhid/ (props changed) projects/graid/8/lib/libutil/ (props changed) projects/graid/8/lib/libz/ (props changed) projects/graid/8/lib/libz/contrib/ (props changed) projects/graid/8/lib/msun/ (props changed) projects/graid/8/libexec/ (props changed) projects/graid/8/libexec/ftpd/ (props changed) projects/graid/8/libexec/rtld-elf/ (props changed) projects/graid/8/libexec/tftpd/ (props changed) projects/graid/8/release/ (props changed) projects/graid/8/release/doc/en_US.ISO8859-1/hardware/ (props changed) projects/graid/8/release/picobsd/ (props changed) projects/graid/8/release/picobsd/floppy.tree/sbin/ (props changed) projects/graid/8/release/picobsd/floppy.tree/sbin/dhclient-script (props changed) projects/graid/8/release/picobsd/qemu/ (props changed) projects/graid/8/release/picobsd/tinyware/login/ (props changed) projects/graid/8/release/powerpc/ (props changed) projects/graid/8/sbin/ (props changed) projects/graid/8/sbin/atacontrol/ (props changed) projects/graid/8/sbin/bsdlabel/ (props changed) projects/graid/8/sbin/camcontrol/ (props changed) projects/graid/8/sbin/ddb/ (props changed) projects/graid/8/sbin/devd/ (props changed) projects/graid/8/sbin/devfs/ (props changed) projects/graid/8/sbin/dhclient/ (props changed) projects/graid/8/sbin/dump/ (props changed) projects/graid/8/sbin/dumpfs/ (props changed) projects/graid/8/sbin/fdisk/ (props changed) projects/graid/8/sbin/fsck/ (props changed) projects/graid/8/sbin/fsck_ffs/ (props changed) projects/graid/8/sbin/fsck_msdosfs/ (props changed) projects/graid/8/sbin/fsirand/ (props changed) projects/graid/8/sbin/geom/ (props changed) projects/graid/8/sbin/geom/class/multipath/ (props changed) projects/graid/8/sbin/geom/class/part/ (props changed) projects/graid/8/sbin/geom/class/sched/gsched.8 (props changed) projects/graid/8/sbin/geom/class/stripe/ (props changed) projects/graid/8/sbin/ggate/ (props changed) projects/graid/8/sbin/growfs/ (props changed) projects/graid/8/sbin/hastctl/ (props changed) projects/graid/8/sbin/hastd/ (props changed) projects/graid/8/sbin/ifconfig/ (props changed) projects/graid/8/sbin/ipfw/ (props changed) projects/graid/8/sbin/iscontrol/ (props changed) projects/graid/8/sbin/kldload/ (props changed) projects/graid/8/sbin/kldstat/ (props changed) projects/graid/8/sbin/mdconfig/ (props changed) projects/graid/8/sbin/mksnap_ffs/ (props changed) projects/graid/8/sbin/mount/ (props changed) projects/graid/8/sbin/mount_cd9660/ (props changed) projects/graid/8/sbin/mount_msdosfs/ (props changed) projects/graid/8/sbin/mount_nfs/ (props changed) projects/graid/8/sbin/natd/ (props changed) projects/graid/8/sbin/newfs/ (props changed) projects/graid/8/sbin/newfs_msdos/ (props changed) projects/graid/8/sbin/ping6/ (props changed) projects/graid/8/sbin/reboot/ (props changed) projects/graid/8/sbin/restore/ (props changed) projects/graid/8/sbin/route/ (props changed) projects/graid/8/sbin/routed/ (props changed) projects/graid/8/sbin/setkey/ (props changed) projects/graid/8/sbin/spppcontrol/ (props changed) projects/graid/8/sbin/sysctl/ (props changed) projects/graid/8/sbin/tunefs/ (props changed) projects/graid/8/sbin/umount/ (props changed) projects/graid/8/secure/ (props changed) projects/graid/8/secure/lib/libcrypto/ (props changed) projects/graid/8/secure/lib/libssl/ (props changed) projects/graid/8/secure/usr.bin/bdes/ (props changed) projects/graid/8/secure/usr.bin/openssl/ (props changed) projects/graid/8/share/dict/ (props changed) projects/graid/8/share/doc/papers/jail/ (props changed) projects/graid/8/share/doc/smm/01.setup/ (props changed) projects/graid/8/share/examples/ (props changed) projects/graid/8/share/examples/etc/ (props changed) projects/graid/8/share/examples/kld/syscall/ (props changed) projects/graid/8/share/man/ (props changed) projects/graid/8/share/man/man1/ (props changed) projects/graid/8/share/man/man3/ (props changed) projects/graid/8/share/man/man4/ (props changed) projects/graid/8/share/man/man5/ (props changed) projects/graid/8/share/man/man7/ (props changed) projects/graid/8/share/man/man8/ (props changed) projects/graid/8/share/man/man9/ (props changed) projects/graid/8/share/misc/ (props changed) projects/graid/8/share/mk/ (props changed) projects/graid/8/share/syscons/ (props changed) projects/graid/8/share/termcap/ (props changed) projects/graid/8/share/timedef/ (props changed) projects/graid/8/share/zoneinfo/ (props changed) projects/graid/8/sys/ (props changed) projects/graid/8/sys/amd64/include/xen/ (props changed) projects/graid/8/sys/cddl/contrib/opensolaris/ (props changed) projects/graid/8/sys/contrib/dev/acpica/ (props changed) projects/graid/8/sys/contrib/pf/ (props changed) projects/graid/8/tools/ (props changed) projects/graid/8/tools/build/mk/ (props changed) projects/graid/8/tools/build/options/ (props changed) projects/graid/8/tools/debugscripts/ (props changed) projects/graid/8/tools/kerneldoc/subsys/ (props changed) projects/graid/8/tools/regression/acct/ (props changed) projects/graid/8/tools/regression/acltools/ (props changed) projects/graid/8/tools/regression/aio/aiotest/ (props changed) projects/graid/8/tools/regression/bin/ (props changed) projects/graid/8/tools/regression/bin/date/ (props changed) projects/graid/8/tools/regression/bin/sh/ (props changed) projects/graid/8/tools/regression/fifo/ (props changed) projects/graid/8/tools/regression/geom/ (props changed) projects/graid/8/tools/regression/lib/libc/ (props changed) projects/graid/8/tools/regression/lib/msun/test-conj.t (props changed) projects/graid/8/tools/regression/mqueue/mqtest1/ (props changed) projects/graid/8/tools/regression/mqueue/mqtest2/ (props changed) projects/graid/8/tools/regression/mqueue/mqtest3/ (props changed) projects/graid/8/tools/regression/mqueue/mqtest4/ (props changed) projects/graid/8/tools/regression/mqueue/mqtest5/ (props changed) projects/graid/8/tools/regression/netinet/ (props changed) projects/graid/8/tools/regression/poll/ (props changed) projects/graid/8/tools/regression/posixsem/ (props changed) projects/graid/8/tools/regression/priv/ (props changed) projects/graid/8/tools/regression/sockets/unix_gc/ (props changed) projects/graid/8/tools/regression/usr.bin/ (props changed) projects/graid/8/tools/regression/usr.bin/pkill/ (props changed) projects/graid/8/tools/regression/usr.bin/pkill/pgrep-_g.t (props changed) projects/graid/8/tools/regression/usr.bin/pkill/pgrep-_s.t (props changed) projects/graid/8/tools/regression/usr.bin/pkill/pkill-_g.t (props changed) projects/graid/8/tools/regression/usr.bin/sed/ (props changed) projects/graid/8/tools/regression/usr.bin/tr/ (props changed) projects/graid/8/tools/test/ (props changed) projects/graid/8/tools/tools/ (props changed) projects/graid/8/tools/tools/ath/ (props changed) projects/graid/8/tools/tools/ath/common/dumpregs.h (props changed) projects/graid/8/tools/tools/ath/common/dumpregs_5210.c (props changed) projects/graid/8/tools/tools/ath/common/dumpregs_5211.c (props changed) projects/graid/8/tools/tools/ath/common/dumpregs_5212.c (props changed) projects/graid/8/tools/tools/ath/common/dumpregs_5416.c (props changed) projects/graid/8/tools/tools/mctest/ (props changed) projects/graid/8/tools/tools/nanobsd/ (props changed) projects/graid/8/tools/tools/netrate/ (props changed) projects/graid/8/tools/tools/netrate/tcpp/ (props changed) projects/graid/8/tools/tools/termcap/termcap.pl (props changed) projects/graid/8/tools/tools/umastat/ (props changed) projects/graid/8/tools/tools/vimage/ (props changed) projects/graid/8/usr.bin/ (props changed) projects/graid/8/usr.bin/apply/ (props changed) projects/graid/8/usr.bin/ar/ (props changed) projects/graid/8/usr.bin/awk/ (props changed) projects/graid/8/usr.bin/biff/ (props changed) projects/graid/8/usr.bin/c89/ (props changed) projects/graid/8/usr.bin/c99/ (props changed) projects/graid/8/usr.bin/calendar/ (props changed) projects/graid/8/usr.bin/catman/ (props changed) projects/graid/8/usr.bin/column/ (props changed) projects/graid/8/usr.bin/comm/ (props changed) projects/graid/8/usr.bin/cpio/ (props changed) projects/graid/8/usr.bin/csup/ (props changed) projects/graid/8/usr.bin/du/ (props changed) projects/graid/8/usr.bin/ee/ (props changed) projects/graid/8/usr.bin/enigma/ (props changed) projects/graid/8/usr.bin/fetch/ (props changed) projects/graid/8/usr.bin/find/ (props changed) projects/graid/8/usr.bin/finger/ (props changed) projects/graid/8/usr.bin/fold/ (props changed) projects/graid/8/usr.bin/fstat/ (props changed) projects/graid/8/usr.bin/gcore/ (props changed) projects/graid/8/usr.bin/getopt/ (props changed) projects/graid/8/usr.bin/gzip/ (props changed) projects/graid/8/usr.bin/hexdump/ (props changed) projects/graid/8/usr.bin/indent/ (props changed) projects/graid/8/usr.bin/jot/ (props changed) projects/graid/8/usr.bin/kdump/ (props changed) projects/graid/8/usr.bin/killall/ (props changed) projects/graid/8/usr.bin/ktrace/ (props changed) projects/graid/8/usr.bin/ldd/ (props changed) projects/graid/8/usr.bin/lex/ (props changed) projects/graid/8/usr.bin/locale/ (props changed) projects/graid/8/usr.bin/locate/ (props changed) projects/graid/8/usr.bin/lockf/ (props changed) projects/graid/8/usr.bin/look/ (props changed) projects/graid/8/usr.bin/mail/ (props changed) projects/graid/8/usr.bin/make/ (props changed) projects/graid/8/usr.bin/makewhatis/ (props changed) projects/graid/8/usr.bin/minigzip/ (props changed) projects/graid/8/usr.bin/ncal/ (props changed) projects/graid/8/usr.bin/netstat/ (props changed) projects/graid/8/usr.bin/pathchk/ (props changed) projects/graid/8/usr.bin/perror/ (props changed) projects/graid/8/usr.bin/procstat/ (props changed) projects/graid/8/usr.bin/rpcgen/ (props changed) projects/graid/8/usr.bin/ruptime/ (props changed) projects/graid/8/usr.bin/script/ (props changed) projects/graid/8/usr.bin/sed/ (props changed) projects/graid/8/usr.bin/sockstat/ (props changed) projects/graid/8/usr.bin/split/ (props changed) projects/graid/8/usr.bin/stat/ (props changed) projects/graid/8/usr.bin/systat/ (props changed) projects/graid/8/usr.bin/tar/ (props changed) projects/graid/8/usr.bin/tftp/ (props changed) projects/graid/8/usr.bin/top/ (props changed) projects/graid/8/usr.bin/touch/ (props changed) projects/graid/8/usr.bin/tr/ (props changed) projects/graid/8/usr.bin/truss/ (props changed) projects/graid/8/usr.bin/uname/ (props changed) projects/graid/8/usr.bin/unifdef/ (props changed) projects/graid/8/usr.bin/uniq/ (props changed) projects/graid/8/usr.bin/unzip/ (props changed) projects/graid/8/usr.bin/uudecode/ (props changed) projects/graid/8/usr.bin/vmstat/ (props changed) projects/graid/8/usr.bin/w/ (props changed) projects/graid/8/usr.bin/whois/ (props changed) projects/graid/8/usr.bin/xinstall/ (props changed) projects/graid/8/usr.bin/xlint/ (props changed) projects/graid/8/usr.bin/xz/ (props changed) projects/graid/8/usr.bin/yacc/ (props changed) projects/graid/8/usr.sbin/ (props changed) projects/graid/8/usr.sbin/Makefile (props changed) projects/graid/8/usr.sbin/acpi/ (props changed) projects/graid/8/usr.sbin/arp/ (props changed) projects/graid/8/usr.sbin/asf/ (props changed) projects/graid/8/usr.sbin/bluetooth/ (props changed) projects/graid/8/usr.sbin/bluetooth/bthidcontrol/ (props changed) projects/graid/8/usr.sbin/bluetooth/bthidd/ (props changed) projects/graid/8/usr.sbin/boot0cfg/ (props changed) projects/graid/8/usr.sbin/bsnmpd/ (props changed) projects/graid/8/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_processor_tbl.c (props changed) projects/graid/8/usr.sbin/burncd/ (props changed) projects/graid/8/usr.sbin/cdcontrol/ (props changed) projects/graid/8/usr.sbin/chown/ (props changed) projects/graid/8/usr.sbin/config/ (props changed) projects/graid/8/usr.sbin/config/SMM.doc/ (props changed) projects/graid/8/usr.sbin/cpucontrol/ (props changed) projects/graid/8/usr.sbin/crashinfo/ (props changed) projects/graid/8/usr.sbin/cron/ (props changed) projects/graid/8/usr.sbin/crunch/examples/ (props changed) projects/graid/8/usr.sbin/ctm/ (props changed) projects/graid/8/usr.sbin/cxgbtool/ (props changed) projects/graid/8/usr.sbin/devinfo/ (props changed) projects/graid/8/usr.sbin/diskinfo/ (props changed) projects/graid/8/usr.sbin/dumpcis/cardinfo.h (props changed) projects/graid/8/usr.sbin/dumpcis/cis.h (props changed) projects/graid/8/usr.sbin/faithd/ (props changed) projects/graid/8/usr.sbin/fdcontrol/ (props changed) projects/graid/8/usr.sbin/fdformat/ (props changed) projects/graid/8/usr.sbin/fdread/ (props changed) projects/graid/8/usr.sbin/fdwrite/ (props changed) projects/graid/8/usr.sbin/fifolog/ (props changed) projects/graid/8/usr.sbin/flowctl/ (props changed) projects/graid/8/usr.sbin/freebsd-update/ (props changed) projects/graid/8/usr.sbin/i2c/ (props changed) projects/graid/8/usr.sbin/inetd/ (props changed) projects/graid/8/usr.sbin/iostat/ (props changed) projects/graid/8/usr.sbin/jail/ (props changed) projects/graid/8/usr.sbin/jls/ (props changed) projects/graid/8/usr.sbin/lpr/ (props changed) projects/graid/8/usr.sbin/mailwrapper/ (props changed) projects/graid/8/usr.sbin/makefs/ffs/ffs_bswap.c (props changed) projects/graid/8/usr.sbin/makefs/ffs/ffs_subr.c (props changed) projects/graid/8/usr.sbin/makefs/ffs/ufs_bswap.h (props changed) projects/graid/8/usr.sbin/makefs/getid.c (props changed) projects/graid/8/usr.sbin/mergemaster/ (props changed) projects/graid/8/usr.sbin/mfiutil/ (props changed) projects/graid/8/usr.sbin/mountd/ (props changed) projects/graid/8/usr.sbin/moused/ (props changed) projects/graid/8/usr.sbin/mptutil/ (props changed) projects/graid/8/usr.sbin/mtest/ (props changed) projects/graid/8/usr.sbin/mtree/ (props changed) projects/graid/8/usr.sbin/named/ (props changed) projects/graid/8/usr.sbin/ndp/ (props changed) projects/graid/8/usr.sbin/newsyslog/ (props changed) projects/graid/8/usr.sbin/nfsdumpstate/ (props changed) projects/graid/8/usr.sbin/ntp/ (props changed) projects/graid/8/usr.sbin/pciconf/ (props changed) projects/graid/8/usr.sbin/periodic/ (props changed) projects/graid/8/usr.sbin/pkg_install/ (props changed) projects/graid/8/usr.sbin/pmcannotate/ (props changed) projects/graid/8/usr.sbin/pmccontrol/ (props changed) projects/graid/8/usr.sbin/pmcstat/ (props changed) projects/graid/8/usr.sbin/powerd/ (props changed) projects/graid/8/usr.sbin/ppp/ (props changed) projects/graid/8/usr.sbin/pppctl/ (props changed) projects/graid/8/usr.sbin/pstat/ (props changed) projects/graid/8/usr.sbin/rpc.lockd/ (props changed) projects/graid/8/usr.sbin/rpc.umntall/ (props changed) projects/graid/8/usr.sbin/rtadvd/ (props changed) projects/graid/8/usr.sbin/rtsold/ (props changed) projects/graid/8/usr.sbin/sade/ (props changed) projects/graid/8/usr.sbin/service/ (props changed) projects/graid/8/usr.sbin/services_mkdb/ (props changed) projects/graid/8/usr.sbin/setfmac/ (props changed) projects/graid/8/usr.sbin/setpmac/ (props changed) projects/graid/8/usr.sbin/smbmsg/ (props changed) projects/graid/8/usr.sbin/sysinstall/ (props changed) projects/graid/8/usr.sbin/syslogd/ (props changed) projects/graid/8/usr.sbin/traceroute/ (props changed) projects/graid/8/usr.sbin/traceroute6/ (props changed) projects/graid/8/usr.sbin/uathload/ (props changed) projects/graid/8/usr.sbin/ugidfw/ (props changed) projects/graid/8/usr.sbin/uhsoctl/ (props changed) projects/graid/8/usr.sbin/usbconfig/ (props changed) projects/graid/8/usr.sbin/vidcontrol/ (props changed) projects/graid/8/usr.sbin/watchdogd/ (props changed) projects/graid/8/usr.sbin/wpa/ (props changed) projects/graid/8/usr.sbin/ypserv/ (props changed) projects/graid/8/usr.sbin/zic/ (props changed) Modified: projects/graid/8/COPYRIGHT ============================================================================== --- projects/graid/8/COPYRIGHT Thu Jan 27 14:16:12 2011 (r217942) +++ projects/graid/8/COPYRIGHT Thu Jan 27 14:46:01 2011 (r217943) @@ -4,7 +4,7 @@ The compilation of software known as FreeBSD is distributed under the following terms: -Copyright (c) 1992-2010 The FreeBSD Project. All rights reserved. +Copyright (c) 1992-2011 The FreeBSD Project. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions Modified: projects/graid/8/Makefile.inc1 ============================================================================== --- projects/graid/8/Makefile.inc1 Thu Jan 27 14:16:12 2011 (r217942) +++ projects/graid/8/Makefile.inc1 Thu Jan 27 14:46:01 2011 (r217943) @@ -926,6 +926,10 @@ _groff= gnu/usr.bin/groff/tmac _ar= usr.bin/ar .endif +.if ${BOOTSTRAPPING} < 802000 +_lex= usr.bin/lex +.endif + .if ${BOOTSTRAPPING} < 800013 _mklocale= usr.bin/mklocale .endif @@ -951,6 +955,7 @@ bootstrap-tools: ${_gperf} \ ${_groff} \ ${_ar} \ + ${_lex} \ usr.bin/lorder \ usr.bin/makewhatis \ ${_mklocale} \ Modified: projects/graid/8/ObsoleteFiles.inc ============================================================================== --- projects/graid/8/ObsoleteFiles.inc Thu Jan 27 14:16:12 2011 (r217942) +++ projects/graid/8/ObsoleteFiles.inc Thu Jan 27 14:46:01 2011 (r217943) @@ -16,6 +16,8 @@ # 20101123: removed subblock.h from liblzma OLD_FILES+=usr/include/lzma/subblock.h +# 20101114: Remove long-obsolete MAKEDEV.8 +OLD_FILES+=usr/share/man/man8/MAKEDEV.8.gz # 20101112: vgonel(9) has gone to private API a while ago OLD_FILES+=usr/share/man/man9/vgonel.9.gz # 20101025: catch up with vm_page_sleep_if_busy rename Modified: projects/graid/8/bin/pkill/pkill.1 ============================================================================== --- projects/graid/8/bin/pkill/pkill.1 Thu Jan 27 14:16:12 2011 (r217942) +++ projects/graid/8/bin/pkill/pkill.1 Thu Jan 27 14:46:01 2011 (r217943) @@ -36,7 +36,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. .\" -.Dd May 16, 2009 +.Dd February 11, 2010 .Dt PKILL 1 .Os .Sh NAME @@ -44,7 +44,7 @@ .Nd find or signal processes by name .Sh SYNOPSIS .Nm pgrep -.Op Fl LSafilnovx +.Op Fl LSafilnoqvx .Op Fl F Ar pidfile .Op Fl G Ar gid .Op Fl M Ar core @@ -177,6 +177,8 @@ display the kill command used for each p Select only the newest (most recently started) of the matching processes. .It Fl o Select only the oldest (least recently started) of the matching processes. +.It Fl q +Do not write anything to standard output. .It Fl s Ar sid Restrict matches to processes with a session ID in the comma-separated list Modified: projects/graid/8/bin/pkill/pkill.c ============================================================================== --- projects/graid/8/bin/pkill/pkill.c Thu Jan 27 14:16:12 2011 (r217942) +++ projects/graid/8/bin/pkill/pkill.c Thu Jan 27 14:46:01 2011 (r217943) @@ -49,6 +49,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -110,6 +111,7 @@ static int matchargs; static int fullmatch; static int kthreads; static int cflags = REG_EXTENDED; +static int quiet; static kvm_t *kd; static pid_t mypid; @@ -180,10 +182,11 @@ main(int argc, char **argv) debug_opt = 0; pidfile = NULL; pidfilelock = 0; + quiet = 0; execf = NULL; coref = _PATH_DEVNULL; - while ((ch = getopt(argc, argv, "DF:G:ILM:N:P:SU:ad:fg:ij:lnos:t:u:vx")) != -1) + while ((ch = getopt(argc, argv, "DF:G:ILM:N:P:SU:ad:fg:ij:lnoqs:t:u:vx")) != -1) switch (ch) { case 'D': debug_opt++; @@ -256,6 +259,11 @@ main(int argc, char **argv) oldest = 1; criteria = 1; break; + case 'q': + if (!pgrep) + usage(); + quiet = 1; + break; case 's': makelist(&sidlist, LT_SID, optarg); criteria = 1; @@ -555,7 +563,7 @@ usage(void) const char *ustr; if (pgrep) - ustr = "[-LSfilnovx] [-d delim]"; + ustr = "[-LSfilnoqvx] [-d delim]"; else ustr = "[-signal] [-ILfilnovx]"; @@ -573,6 +581,10 @@ show_process(const struct kinfo_proc *kp { char **argv; + if (quiet) { + assert(pgrep); + return; + } if ((longfmt || !pgrep) && matchargs && (argv = kvm_getargv(kd, kp, 0)) != NULL) { printf("%d ", (int)kp->ki_pid); @@ -629,7 +641,8 @@ grepact(const struct kinfo_proc *kp) { show_process(kp); - printf("%s", delim); + if (!quiet) + printf("%s", delim); return (1); } Modified: projects/graid/8/bin/sh/histedit.c ============================================================================== --- projects/graid/8/bin/sh/histedit.c Thu Jan 27 14:16:12 2011 (r217942) +++ projects/graid/8/bin/sh/histedit.c Thu Jan 27 14:46:01 2011 (r217943) @@ -214,6 +214,7 @@ histcmd(int argc, char **argv) } argc -= optind, argv += optind; + savehandler = handler; /* * If executing... */ @@ -224,7 +225,6 @@ histcmd(int argc, char **argv) * Catch interrupts to reset active counter and * cleanup temp files. */ - savehandler = handler; if (setjmp(jmploc.loc)) { active = 0; if (editfile) @@ -380,6 +380,7 @@ histcmd(int argc, char **argv) --active; if (displayhist) displayhist = 0; + handler = savehandler; return 0; } Modified: projects/graid/8/contrib/binutils/bfd/elf-bfd.h ============================================================================== --- projects/graid/8/contrib/binutils/bfd/elf-bfd.h Thu Jan 27 14:16:12 2011 (r217942) +++ projects/graid/8/contrib/binutils/bfd/elf-bfd.h Thu Jan 27 14:46:01 2011 (r217943) @@ -1673,6 +1673,8 @@ extern char * elfcore_write_pstatus (bfd *, char *, int *, long, int, const void *); extern char *elfcore_write_prfpreg (bfd *, char *, int *, const void *, int); +extern char *elfcore_write_thrmisc + (bfd *, char *, int *, const char *, int); extern char *elfcore_write_prxfpreg (bfd *, char *, int *, const void *, int); extern char *elfcore_write_lwpstatus Modified: projects/graid/8/contrib/binutils/bfd/elf.c ============================================================================== --- projects/graid/8/contrib/binutils/bfd/elf.c Thu Jan 27 14:16:12 2011 (r217942) +++ projects/graid/8/contrib/binutils/bfd/elf.c Thu Jan 27 14:46:01 2011 (r217943) @@ -6316,6 +6316,12 @@ _bfd_elf_rel_vtable_reloc_fn #ifdef HAVE_SYS_PROCFS_H # include + +/* Define HAVE_THRMISC_T for consistency with other similar GNU-type stubs. */ +#undef HAVE_THRMISC_T +#if defined (THRMISC_VERSION) +#define HAVE_THRMISC_T 1 +#endif #endif /* FIXME: this is kinda wrong, but it's what gdb wants. */ @@ -6497,6 +6503,16 @@ elfcore_grok_prxfpreg (bfd *abfd, Elf_In return elfcore_make_note_pseudosection (abfd, ".reg-xfp", note); } +#if defined (HAVE_THRMISC_T) + +static bfd_boolean +elfcore_grok_thrmisc (bfd *abfd, Elf_Internal_Note *note) +{ + return elfcore_make_note_pseudosection (abfd, ".tname", note); +} + +#endif /* defined (HAVE_THRMISC_T) */ + #if defined (HAVE_PRPSINFO_T) typedef prpsinfo_t elfcore_psinfo_t; #if defined (HAVE_PRPSINFO32_T) /* Sparc64 cross Sparc32 */ @@ -6863,6 +6879,12 @@ elfcore_grok_note (bfd *abfd, Elf_Intern return TRUE; } + +#if defined (HAVE_THRMISC_T) + case NT_THRMISC: + return elfcore_grok_thrmisc (abfd, note); +#endif + } } @@ -7245,6 +7267,22 @@ elfcore_write_prfpreg (bfd *abfd, } char * +elfcore_write_thrmisc (bfd *abfd, + char *buf, + int *bufsiz, + const char *tname, + int size) +{ +#if defined (HAVE_THRMISC_T) + char *note_name = "CORE"; + return elfcore_write_note (abfd, buf, bufsiz, + note_name, NT_THRMISC, tname, size); +#else + return buf; +#endif +} + +char * elfcore_write_prxfpreg (bfd *abfd, char *buf, int *bufsiz, Modified: projects/graid/8/contrib/binutils/binutils/readelf.c ============================================================================== --- projects/graid/8/contrib/binutils/binutils/readelf.c Thu Jan 27 14:16:12 2011 (r217942) +++ projects/graid/8/contrib/binutils/binutils/readelf.c Thu Jan 27 14:46:01 2011 (r217943) @@ -9908,6 +9908,7 @@ get_note_type (unsigned e_type) case NT_PSTATUS: return _("NT_PSTATUS (pstatus structure)"); case NT_FPREGS: return _("NT_FPREGS (floating point registers)"); case NT_PSINFO: return _("NT_PSINFO (psinfo structure)"); + case NT_THRMISC: return _("NT_THRMISC (thrmisc structure)"); case NT_LWPSTATUS: return _("NT_LWPSTATUS (lwpstatus_t structure)"); case NT_LWPSINFO: return _("NT_LWPSINFO (lwpsinfo_t structure)"); case NT_WIN32PSTATUS: return _("NT_WIN32PSTATUS (win32_pstatus structure)"); Modified: projects/graid/8/contrib/binutils/include/elf/common.h ============================================================================== --- projects/graid/8/contrib/binutils/include/elf/common.h Thu Jan 27 14:16:12 2011 (r217942) +++ projects/graid/8/contrib/binutils/include/elf/common.h Thu Jan 27 14:46:01 2011 (r217943) @@ -366,6 +366,7 @@ #define NT_PRPSINFO 3 /* Contains copy of prpsinfo struct */ #define NT_TASKSTRUCT 4 /* Contains copy of task struct */ #define NT_AUXV 6 /* Contains copy of Elfxx_auxv_t */ +#define NT_THRMISC 7 /* Contains copy of thrmisc struct */ #define NT_PRXFPREG 0x46e62b7f /* Contains a user_xfpregs_struct; */ /* note name must be "LINUX". */ Modified: projects/graid/8/contrib/file/readelf.h ============================================================================== --- projects/graid/8/contrib/file/readelf.h Thu Jan 27 14:16:12 2011 (r217942) +++ projects/graid/8/contrib/file/readelf.h Thu Jan 27 14:46:01 2011 (r217943) @@ -224,6 +224,7 @@ typedef struct { #define NT_TASKSTRUCT 4 #define NT_PLATFORM 5 #define NT_AUXV 6 +#define NT_THRMISC 7 /* Note types used in executables */ /* NetBSD executables (name = "NetBSD") */ Modified: projects/graid/8/contrib/gdb/gdb/fbsd-proc.c ============================================================================== --- projects/graid/8/contrib/gdb/gdb/fbsd-proc.c Thu Jan 27 14:16:12 2011 (r217942) +++ projects/graid/8/contrib/gdb/gdb/fbsd-proc.c Thu Jan 27 14:46:01 2011 (r217943) @@ -124,6 +124,7 @@ fbsd_make_corefile_notes (bfd *obfd, int fpregset_t fpregs; char *note_data = NULL; Elf_Internal_Ehdr *i_ehdrp; + char fakename; /* Put a "FreeBSD" label in the ELF header. */ i_ehdrp = elf_elfheader (obfd); @@ -138,6 +139,10 @@ fbsd_make_corefile_notes (bfd *obfd, int note_data = elfcore_write_prfpreg (obfd, note_data, note_size, &fpregs, sizeof (fpregs)); + fakename = '\0'; + note_data = elfcore_write_thrmisc (obfd, note_data, note_size, + &fakename, sizeof (fakename)); + if (get_exec_file (0)) { char *fname = strrchr (get_exec_file (0), '/') + 1; Modified: projects/graid/8/etc/devd.conf ============================================================================== --- projects/graid/8/etc/devd.conf Thu Jan 27 14:16:12 2011 (r217942) +++ projects/graid/8/etc/devd.conf Thu Jan 27 14:46:01 2011 (r217943) @@ -45,7 +45,7 @@ notify 0 { # # Try to start dhclient on Ethernet like interfaces when the link comes # up. Only devices that are configured to support DHCP will actually -# run it. No link down rule exists because dhclient automaticly exits +# run it. No link down rule exists because dhclient automatically exits # when the link goes down. # notify 0 { Modified: projects/graid/8/etc/network.subr ============================================================================== --- projects/graid/8/etc/network.subr Thu Jan 27 14:16:12 2011 (r217942) +++ projects/graid/8/etc/network.subr Thu Jan 27 14:46:01 2011 (r217943) @@ -1134,8 +1134,7 @@ network6_default_interface_setup() ;; *) laddr=`network6_getladdr ${ipv6_default_interface}` - route add -inet6 ff02:: ${laddr} -prefixlen 16 -interface \ - -cloning + route add -inet6 ff02:: ${laddr} -prefixlen 16 -interface # Disable installing the default interface with the # case net.inet6.ip6.forwarding=0 and Modified: projects/graid/8/etc/rc.d/mountcritlocal ============================================================================== --- projects/graid/8/etc/rc.d/mountcritlocal Thu Jan 27 14:16:12 2011 (r217942) +++ projects/graid/8/etc/rc.d/mountcritlocal Thu Jan 27 14:46:01 2011 (r217943) @@ -5,13 +5,13 @@ # PROVIDE: mountcritlocal # REQUIRE: root -# KEYWORD: nojail +# KEYWORD: nojail shutdown . /etc/rc.subr name="mountcritlocal" start_cmd="mountcritlocal_start" -stop_cmd=":" +stop_cmd=sync mountcritlocal_start() { Modified: projects/graid/8/gnu/usr.bin/gdb/libgdb/fbsd-threads.c ============================================================================== --- projects/graid/8/gnu/usr.bin/gdb/libgdb/fbsd-threads.c Thu Jan 27 14:16:12 2011 (r217942) +++ projects/graid/8/gnu/usr.bin/gdb/libgdb/fbsd-threads.c Thu Jan 27 14:46:01 2011 (r217943) @@ -426,6 +426,46 @@ fbsd_thread_deactivate (void) init_thread_list (); } +static char * +fbsd_thread_get_name (lwpid_t lwpid) +{ + static char last_thr_name[MAXCOMLEN + 1]; + char section_name[32]; + struct ptrace_lwpinfo lwpinfo; + bfd_size_type size; + struct bfd_section *section; + + if (target_has_execution) + { + if (ptrace (PT_LWPINFO, lwpid, (caddr_t)&lwpinfo, sizeof (lwpinfo)) == -1) + goto fail; + strncpy (last_thr_name, lwpinfo.pl_tdname, sizeof (last_thr_name) - 1); + } + else + { + snprintf (section_name, sizeof (section_name), ".tname/%u", lwpid); + section = bfd_get_section_by_name (core_bfd, section_name); + if (! section) + goto fail; + + /* Section size fix-up. */ + size = bfd_section_size (core_bfd, section); + if (size > sizeof (last_thr_name)) + size = sizeof (last_thr_name); + + if (! bfd_get_section_contents (core_bfd, section, last_thr_name, + (file_ptr)0, size)) + goto fail; + if (last_thr_name[0] == '\0') + goto fail; + } + last_thr_name[sizeof (last_thr_name) - 1] = '\0'; + return last_thr_name; +fail: + strcpy (last_thr_name, ""); + return last_thr_name; +} + static void fbsd_thread_new_objfile (struct objfile *objfile) { @@ -1158,7 +1198,7 @@ fbsd_thread_find_new_threads (void) static char * fbsd_thread_pid_to_str (ptid_t ptid) { - static char buf[64]; + static char buf[64 + MAXCOMLEN]; if (IS_THREAD (ptid)) { @@ -1178,8 +1218,9 @@ fbsd_thread_pid_to_str (ptid_t ptid) if (ti.ti_lid != 0) { - snprintf (buf, sizeof (buf), "Thread %llx (LWP %d)", - (unsigned long long)th.th_thread, ti.ti_lid); + snprintf (buf, sizeof (buf), "Thread %llx (LWP %d/%s)", + (unsigned long long)th.th_thread, ti.ti_lid, + fbsd_thread_get_name (ti.ti_lid)); } else { Modified: projects/graid/8/gnu/usr.bin/groff/tmac/mdoc.local ============================================================================== --- projects/graid/8/gnu/usr.bin/groff/tmac/mdoc.local Thu Jan 27 14:16:12 2011 (r217942) +++ projects/graid/8/gnu/usr.bin/groff/tmac/mdoc.local Thu Jan 27 14:46:01 2011 (r217943) @@ -67,7 +67,7 @@ .ds doc-volume-as-arm arm . .\" Default .Os value -.ds doc-default-operating-system FreeBSD\~8.1 +.ds doc-default-operating-system FreeBSD\~8.2 . .\" FreeBSD releases not found in doc-common .ds doc-operating-system-FreeBSD-7.2 7.2 @@ -76,6 +76,7 @@ .ds doc-operating-system-FreeBSD-8.0 8.0 .ds doc-operating-system-FreeBSD-8.1 8.1 .ds doc-operating-system-FreeBSD-8.2 8.2 +.ds doc-operating-system-FreeBSD-8.3 8.3 .ds doc-operating-system-FreeBSD-9.0 9.0 . .\" Definitions not (yet) in doc-syms Modified: projects/graid/8/lib/csu/i386-elf/crt1_s.S ============================================================================== --- projects/graid/8/lib/csu/i386-elf/crt1_s.S Thu Jan 27 14:16:12 2011 (r217942) +++ projects/graid/8/lib/csu/i386-elf/crt1_s.S Thu Jan 27 14:46:01 2011 (r217943) @@ -40,6 +40,7 @@ _start: .cfi_def_cfa_register %ebp andl $0xfffffff0,%esp # align stack leal 8(%ebp),%eax + subl $4,%esp pushl %eax # argv pushl 4(%ebp) # argc pushl %edx # rtld cleanup Modified: projects/graid/8/lib/libc/net/hesiod.c ============================================================================== --- projects/graid/8/lib/libc/net/hesiod.c Thu Jan 27 14:16:12 2011 (r217942) +++ projects/graid/8/lib/libc/net/hesiod.c Thu Jan 27 14:46:01 2011 (r217943) @@ -324,6 +324,7 @@ read_config_file(ctx, filename) ? &ctx->lhs : &ctx->rhs; *which = strdup(data); if (!*which) { + fclose(fp); errno = ENOMEM; return -1; } Modified: projects/graid/8/lib/libc/stdio/freopen.c ============================================================================== --- projects/graid/8/lib/libc/stdio/freopen.c Thu Jan 27 14:16:12 2011 (r217942) +++ projects/graid/8/lib/libc/stdio/freopen.c Thu Jan 27 14:46:01 2011 (r217943) @@ -150,14 +150,6 @@ freopen(file, mode, fp) /* Get a new descriptor to refer to the new file. */ f = _open(file, oflags, DEFFILEMODE); - if (f < 0 && isopen) { - /* If out of fd's close the old one and try again. */ - if (errno == ENFILE || errno == EMFILE) { - (void) (*fp->_close)(fp->_cookie); - isopen = 0; - f = _open(file, oflags, DEFFILEMODE); - } - } sverrno = errno; finish: @@ -165,9 +157,11 @@ finish: * Finish closing fp. Even if the open succeeded above, we cannot * keep fp->_base: it may be the wrong size. This loses the effect * of any setbuffer calls, but stdio has always done this before. + * + * Leave the existing file descriptor open until dup2() is called + * below to avoid races where a concurrent open() in another thread + * could claim the existing descriptor. */ - if (isopen) - (void) (*fp->_close)(fp->_cookie); if (fp->_flags & __SMBF) free((char *)fp->_bf._base); fp->_w = 0; @@ -186,6 +180,8 @@ finish: memset(&fp->_mbstate, 0, sizeof(mbstate_t)); if (f < 0) { /* did not get it after all */ + if (isopen) + (void) (*fp->_close)(fp->_cookie); fp->_flags = 0; /* set it free */ FUNLOCKFILE(fp); errno = sverrno; /* restore in case _close clobbered */ @@ -197,11 +193,12 @@ finish: * to maintain the descriptor. Various C library routines (perror) * assume stderr is always fd STDERR_FILENO, even if being freopen'd. */ - if (wantfd >= 0 && f != wantfd) { + if (wantfd >= 0) { if (_dup2(f, wantfd) >= 0) { (void)_close(f); f = wantfd; - } + } else + (void)_close(fp->_file); } /* Modified: projects/graid/8/lib/libc/stdlib/realpath.c ============================================================================== --- projects/graid/8/lib/libc/stdlib/realpath.c Thu Jan 27 14:16:12 2011 (r217942) +++ projects/graid/8/lib/libc/stdlib/realpath.c Thu Jan 27 14:46:01 2011 (r217943) @@ -54,7 +54,7 @@ realpath(const char * __restrict path, c char *p, *q, *s; size_t left_len, resolved_len; unsigned symlinks; - int serrno, slen, m; + int m, serrno, slen; char left[PATH_MAX], next_token[PATH_MAX], symlink[PATH_MAX]; if (path == NULL) { @@ -73,7 +73,6 @@ realpath(const char * __restrict path, c m = 1; } else m = 0; - symlinks = 0; if (path[0] == '/') { resolved[0] = '/'; @@ -86,8 +85,10 @@ realpath(const char * __restrict path, c if (getcwd(resolved, PATH_MAX) == NULL) { if (m) free(resolved); - else - strlcpy(resolved, ".", PATH_MAX); + else { + resolved[0] = '.'; + resolved[1] = '\0'; + } return (NULL); } resolved_len = strlen(resolved); Modified: projects/graid/8/lib/libc/sys/mknod.2 ============================================================================== --- projects/graid/8/lib/libc/sys/mknod.2 Thu Jan 27 14:16:12 2011 (r217942) +++ projects/graid/8/lib/libc/sys/mknod.2 Thu Jan 27 14:46:01 2011 (r217943) @@ -28,7 +28,7 @@ .\" @(#)mknod.2 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd April 10, 2008 +.Dd January 16, 2011 .Dt MKNOD 2 .Os .Sh NAME @@ -38,7 +38,7 @@ .Sh LIBRARY .Lb libc .Sh SYNOPSIS -.In unistd.h +.In sys/stat.h .Ft int .Fn mknod "const char *path" "mode_t mode" "dev_t dev" .Ft int Modified: projects/graid/8/lib/libc/sys/setpgid.2 ============================================================================== --- projects/graid/8/lib/libc/sys/setpgid.2 Thu Jan 27 14:16:12 2011 (r217942) +++ projects/graid/8/lib/libc/sys/setpgid.2 Thu Jan 27 14:46:01 2011 (r217943) @@ -54,6 +54,11 @@ to the specified If .Fa pid is zero, then the call applies to the current process. +If +.Fa pgrp +is zero, then the process id of the process specified by +.Fa pid +is used instead. .Pp If the affected process is not the invoking process, then it must be a child of the invoking process, it must not have performed an Modified: projects/graid/8/lib/libkvm/Makefile ============================================================================== --- projects/graid/8/lib/libkvm/Makefile Thu Jan 27 14:16:12 2011 (r217942) +++ projects/graid/8/lib/libkvm/Makefile Thu Jan 27 14:46:01 2011 (r217943) @@ -21,6 +21,7 @@ MAN= kvm.3 kvm_getcptime.3 kvm_geterr.3 kvm_read.3 MLINKS+=kvm_getpcpu.3 kvm_getmaxcpu.3 +MLINKS+=kvm_getpcpu.3 kvm_dpcpu_setcpu.3 MLINKS+=kvm_getprocs.3 kvm_getargv.3 kvm_getprocs.3 kvm_getenvv.3 MLINKS+=kvm_open.3 kvm_close.3 kvm_open.3 kvm_openfiles.3 MLINKS+=kvm_read.3 kvm_write.3 Modified: projects/graid/8/lib/libkvm/kvm.c ============================================================================== --- projects/graid/8/lib/libkvm/kvm.c Thu Jan 27 14:16:12 2011 (r217942) +++ projects/graid/8/lib/libkvm/kvm.c Thu Jan 27 14:46:01 2011 (r217943) @@ -416,6 +416,8 @@ _kvm_nlist(kvm_t *kd, struct nlist *nl, struct kld_sym_lookup lookup; int error; char *prefix = "", symname[1024]; /* XXX-BZ symbol name length limit? */ + int tried_vnet, tried_dpcpu; + /* * If we can't use the kld symbol lookup, revert to the * slow library call. @@ -429,6 +431,10 @@ _kvm_nlist(kvm_t *kd, struct nlist *nl, error = kvm_fdnlist_prefix(kd, nl, error, VNET_SYMPREFIX, _kvm_vnet_validaddr); + if (error > 0 && _kvm_dpcpu_initialized(kd, initialize)) + error = kvm_fdnlist_prefix(kd, nl, error, + "pcpu_entry_", _kvm_dpcpu_validaddr); + return (error); } @@ -437,6 +443,8 @@ _kvm_nlist(kvm_t *kd, struct nlist *nl, * and look it up with a kldsym(2) syscall. */ nvalid = 0; + tried_vnet = 0; + tried_dpcpu = 0; again: for (p = nl; p->n_name && p->n_name[0]; ++p) { if (p->n_type != N_UNDF) @@ -464,6 +472,10 @@ again: !strcmp(prefix, VNET_SYMPREFIX)) p->n_value = _kvm_vnet_validaddr(kd, lookup.symvalue); + else if (_kvm_dpcpu_initialized(kd, initialize) && + !strcmp(prefix, "pcpu_entry_")) + p->n_value = + _kvm_dpcpu_validaddr(kd, lookup.symvalue); else p->n_value = lookup.symvalue; ++nvalid; @@ -473,14 +485,19 @@ again: /* * Check the number of entries that weren't found. If they exist, - * try again with a prefix for virtualized symbol names. + * try again with a prefix for virtualized or DPCPU symbol names. */ error = ((p - nl) - nvalid); - if (error && _kvm_vnet_initialized(kd, initialize) && - strcmp(prefix, VNET_SYMPREFIX)) { + if (error && _kvm_vnet_initialized(kd, initialize) && !tried_vnet) { + tried_vnet = 1; prefix = VNET_SYMPREFIX; goto again; } + if (error && _kvm_dpcpu_initialized(kd, initialize) && !tried_dpcpu) { + tried_dpcpu = 1; + prefix = "pcpu_entry_"; + goto again; + } /* * Return the number of entries that weren't found. If they exist, Modified: projects/graid/8/lib/libkvm/kvm.h ============================================================================== --- projects/graid/8/lib/libkvm/kvm.h Thu Jan 27 14:16:12 2011 (r217942) +++ projects/graid/8/lib/libkvm/kvm.h Thu Jan 27 14:46:01 2011 (r217943) @@ -69,6 +69,7 @@ struct kvm_swap { __BEGIN_DECLS int kvm_close(kvm_t *); +int kvm_dpcpu_setcpu(kvm_t *, unsigned int); char **kvm_getargv(kvm_t *, const struct kinfo_proc *, int); int kvm_getcptime(kvm_t *, long *); char **kvm_getenvv(kvm_t *, const struct kinfo_proc *, int); Modified: projects/graid/8/lib/libkvm/kvm_getpcpu.3 ============================================================================== --- projects/graid/8/lib/libkvm/kvm_getpcpu.3 Thu Jan 27 14:16:12 2011 (r217942) +++ projects/graid/8/lib/libkvm/kvm_getpcpu.3 Thu Jan 27 14:46:01 2011 (r217943) @@ -28,10 +28,11 @@ .\" .\" $FreeBSD$ .\" -.Dd August 19, 2008 +.Dd February 28, 2010 .Dt KVM_GETPCPU 3 .Os .Sh NAME +.Nm kvm_dpcpu_setcpu .Nm kvm_getmaxcpu , .Nm kvm_getpcpu .Nd access per-CPU data @@ -43,20 +44,30 @@ .In sys/sysctl.h .In kvm.h .Ft int +.Fn kvm_dpcpu_setcpu "kvm_t *kd" "u_int cpu" +.Ft int .Fn kvm_getmaxcpu "kvm_t *kd" .Ft void * .Fn kvm_getpcpu "kvm_t *kd" "int cpu" .Sh DESCRIPTION The -.Fn kvm_getmaxcpu +.Fn kvm_dpcpu_setcpu , +.Fn kvm_getmaxcpu , and .Fn kvm_getpcpu functions are used to access the per-CPU data of active processors in the kernel indicated by .Fa kd . +Per-CPU storage comes in two flavours: data stored directly in a +.Vt "struct pcpu" +associated with each CPU, and dynamic per-CPU storage (DPCPU), in which a +single kernel symbol refers to different data depending on what CPU it is +accessed from. +.Pp The .Fn kvm_getmaxcpu function returns the maximum number of CPUs supported by the kernel. +.Pp The .Fn kvm_getpcpu function returns a buffer holding the per-CPU data for a single CPU. @@ -71,8 +82,22 @@ If is not active, then .Dv NULL is returned instead. +.Pp +Symbols for dynamic per-CPU data are accessed via +.Xr kvm_nlist 3 +as with other symbols. +.Nm libkvm +maintains a notion of the "current CPU", set by +.Xr kvm_dpcpu_setcpu , +which defaults to 0. +Once another CPU is selected, +.Xr kvm_nlist 3 +will return pointers to that data on the appropriate CPU. .Sh CACHING -These functions cache the nlist values for various kernel variables which are +.Fn kvm_getmaxcpu +and +.Vn kvm_getpcpu +cache the nlist values for various kernel variables which are reused in successive calls. You may call either function with .Fa kd @@ -93,7 +118,11 @@ function returns a pointer to an allocat If an error occurs, it returns -1 instead. .Pp -If either function encounters an error, +On success, the +.Fn kvm_dpcpu_setcpu +call returns 0; if an error occurs, it returns -1 instead. +.Pp +If any function encounters an error, then an error message may be retrieved via .Xr kvm_geterr 3. .Sh SEE ALSO Modified: projects/graid/8/lib/libkvm/kvm_pcpu.c ============================================================================== --- projects/graid/8/lib/libkvm/kvm_pcpu.c Thu Jan 27 14:16:12 2011 (r217942) +++ projects/graid/8/lib/libkvm/kvm_pcpu.c Thu Jan 27 14:46:01 2011 (r217943) @@ -1,8 +1,15 @@ /*- + * Copyright (c) 2010 Juniper Networks, Inc. + * Copyright (c) 2009 Robert N. M. Watson + * Copyright (c) 2009 Bjoern A. Zeeb * Copyright (c) 2008 Yahoo!, Inc. * All rights reserved. + * * Written by: John Baldwin * + * This software was developed by Robert N. M. Watson under contract + * to Juniper Networks, Inc. + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: @@ -49,6 +56,10 @@ static struct nlist kvm_pcpu_nl[] = { /* * Kernel per-CPU data state. We cache this stuff on the first * access. + * + * XXXRW: Possibly, this (and kvmpcpu_nl) should be per-kvm_t, in case the + * consumer has multiple handles in flight to differently configured + * kernels/crashdumps. */ static void **pcpu_data; static int maxcpu; @@ -150,3 +161,132 @@ kvm_getmaxcpu(kvm_t *kd) return (-1); return (maxcpu); } + +static int +_kvm_dpcpu_setcpu(kvm_t *kd, u_int cpu, int report_error) +{ + + if (!kd->dpcpu_initialized) { + if (report_error) + _kvm_err(kd, kd->program, "%s: not initialized", + __func__); + return (-1); + } + if (cpu >= kd->dpcpu_maxcpus) { + if (report_error) + _kvm_err(kd, kd->program, "%s: CPU %u too big", + __func__, cpu); + return (-1); + } + if (kd->dpcpu_off[cpu] == 0) { + if (report_error) + _kvm_err(kd, kd->program, "%s: CPU %u not found", + __func__, cpu); + return (-1); + } + kd->dpcpu_curcpu = cpu; + kd->dpcpu_curoff = kd->dpcpu_off[cpu]; + return (0); +} + +/* + * Set up libkvm to handle dynamic per-CPU memory. + */ +static int +_kvm_dpcpu_init(kvm_t *kd) +{ + struct nlist nl[] = { +#define NLIST_START_SET_PCPU 0 + { "___start_set_pcpu" }, +#define NLIST_STOP_SET_PCPU 1 + { "___stop_set_pcpu" }, +#define NLIST_DPCPU_OFF 2 + { "_dpcpu_off" }, +#define NLIST_MP_MAXCPUS 3 + { "_mp_maxcpus" }, + { NULL }, + }; + uintptr_t *dpcpu_off_buf; + size_t len; + u_int dpcpu_maxcpus; + + /* + * Locate and cache locations of important symbols using the internal + * version of _kvm_nlist, turning off initialization to avoid + * recursion in case of unresolveable symbols. + */ + if (_kvm_nlist(kd, nl, 0) != 0) + return (-1); + if (kvm_read(kd, nl[NLIST_MP_MAXCPUS].n_value, &dpcpu_maxcpus, + sizeof(dpcpu_maxcpus)) != sizeof(dpcpu_maxcpus)) + return (-1); + len = dpcpu_maxcpus * sizeof(*dpcpu_off_buf); + dpcpu_off_buf = malloc(len); + if (dpcpu_off_buf == NULL) + return (-1); + if (kvm_read(kd, nl[NLIST_DPCPU_OFF].n_value, dpcpu_off_buf, len) != + len) { + free(dpcpu_off_buf); + return (-1); + } + kd->dpcpu_start = nl[NLIST_START_SET_PCPU].n_value; + kd->dpcpu_stop = nl[NLIST_STOP_SET_PCPU].n_value; + kd->dpcpu_maxcpus = dpcpu_maxcpus; + kd->dpcpu_off = dpcpu_off_buf; + kd->dpcpu_initialized = 1; + (void)_kvm_dpcpu_setcpu(kd, 0, 0); + return (0); +} + +/* + * Check whether the dpcpu module has been initialized sucessfully or not, + * initialize it if permitted. + */ +int +_kvm_dpcpu_initialized(kvm_t *kd, int intialize) +{ + + if (kd->dpcpu_initialized || !intialize) + return (kd->dpcpu_initialized); + + (void)_kvm_dpcpu_init(kd); + + return (kd->dpcpu_initialized); +} + +/* + * Check whether the value is within the dpcpu symbol range and only if so + * adjust the offset relative to the current offset. + */ +uintptr_t +_kvm_dpcpu_validaddr(kvm_t *kd, uintptr_t value) +{ + + if (value == 0) + return (value); + + if (!kd->dpcpu_initialized) + return (value); + + if (value < kd->dpcpu_start || value >= kd->dpcpu_stop) + return (value); + + return (kd->dpcpu_curoff + value); +} + +int +kvm_dpcpu_setcpu(kvm_t *kd, u_int cpu) +{ + int ret; + + if (!kd->dpcpu_initialized) { + ret = _kvm_dpcpu_init(kd); + if (ret != 0) { + _kvm_err(kd, kd->program, "%s: init failed", + __func__); + return (ret); + } + } + + return (_kvm_dpcpu_setcpu(kd, cpu, 1)); +} Modified: projects/graid/8/lib/libkvm/kvm_private.h ============================================================================== --- projects/graid/8/lib/libkvm/kvm_private.h Thu Jan 27 14:16:12 2011 (r217942) +++ projects/graid/8/lib/libkvm/kvm_private.h Thu Jan 27 14:46:01 2011 (r217943) @@ -68,6 +68,19 @@ struct __kvm { uintptr_t vnet_stop; /* stop of kernel's vnet region */ uintptr_t vnet_current; /* vnet we're working with */ uintptr_t vnet_base; /* vnet base of current vnet */ + + /* + * Dynamic per-CPU kernel memory. We translate symbols, on-demand, + * to the data associated with dpcpu_curcpu, set with + * kvm_dpcpu_setcpu(). + */ + int dpcpu_initialized; /* dpcpu fields set up */ + uintptr_t dpcpu_start; /* start of kernel's dpcpu region */ + uintptr_t dpcpu_stop; /* stop of kernel's dpcpu region */ + u_int dpcpu_maxcpus; /* size of base array */ + uintptr_t *dpcpu_off; /* base array, indexed by CPU ID */ + u_int dpcpu_curcpu; /* CPU we're currently working with */ + uintptr_t dpcpu_curoff; /* dpcpu base of current CPU */ }; /* @@ -88,6 +101,8 @@ int _kvm_uvatop(kvm_t *, const struct p int _kvm_vnet_selectpid(kvm_t *, pid_t); int _kvm_vnet_initialized(kvm_t *, int); uintptr_t _kvm_vnet_validaddr(kvm_t *, uintptr_t); +int _kvm_dpcpu_initialized(kvm_t *, int); +uintptr_t _kvm_dpcpu_validaddr(kvm_t *, uintptr_t); #if defined(__amd64__) || defined(__i386__) || defined(__arm__) void _kvm_minidump_freevtop(kvm_t *); Modified: projects/graid/8/lib/libproc/proc_create.c ============================================================================== --- projects/graid/8/lib/libproc/proc_create.c Thu Jan 27 14:16:12 2011 (r217942) +++ projects/graid/8/lib/libproc/proc_create.c Thu Jan 27 14:46:01 2011 (r217943) @@ -84,7 +84,7 @@ proc_attach(pid_t pid, int flags, struct else *pphdl = phdl; out: - + proc_free(phdl); return (error); } Modified: projects/graid/8/lib/libusb/libusb20_compat01.c ============================================================================== --- projects/graid/8/lib/libusb/libusb20_compat01.c Thu Jan 27 14:16:12 2011 (r217942) +++ projects/graid/8/lib/libusb/libusb20_compat01.c Thu Jan 27 14:46:01 2011 (r217943) @@ -457,6 +457,11 @@ usb_parse_configuration(struct usb_confi /* allocate memory for our configuration */ ptr = malloc(a + b + c + d); + if (ptr == NULL) { + /* free config structure */ + free(ps.a.currcfg); + return (-1); + } /* "currifcw" must be first, hence this pointer is freed */ ps.b.currifcw = (void *)(ptr); Modified: projects/graid/8/libexec/ftpd/ftpd.c ============================================================================== --- projects/graid/8/libexec/ftpd/ftpd.c Thu Jan 27 14:16:12 2011 (r217942) +++ projects/graid/8/libexec/ftpd/ftpd.c Thu Jan 27 14:46:01 2011 (r217943) @@ -2133,7 +2133,7 @@ send_data(FILE *instr, FILE *outstr, siz } } ENDXFER; - reply(226, msg); + reply(226, "%s", msg); return (0); } @@ -2330,6 +2330,10 @@ statfilecmd(char *filename) code = lstat(filename, &st) == 0 && S_ISDIR(st.st_mode) ? 212 : 213; (void)snprintf(line, sizeof(line), _PATH_LS " -lgA %s", filename); fin = ftpd_popen(line, "r"); + if (fin == NULL) { + perror_reply(551, filename); + return; + } lreply(code, "Status of %s:", filename); atstart = 1; while ((c = getc(fin)) != EOF) { Modified: projects/graid/8/release/Makefile ============================================================================== --- projects/graid/8/release/Makefile Thu Jan 27 14:16:12 2011 (r217942) +++ projects/graid/8/release/Makefile Thu Jan 27 14:46:01 2011 (r217943) @@ -24,11 +24,11 @@ # Set these, release builder! # # Fixed version: -#BUILDNAME=8.1-STABLE +#BUILDNAME=8.2-STABLE # # Automatic SNAP versioning: DATE != date +%Y%m%d -BASE = 8.1 +BASE = 8.2 BUILDNAME?=${BASE}-${DATE}-SNAP # #CHROOTDIR=/junk/release Modified: projects/graid/8/release/powerpc/mkisoimages.sh ============================================================================== --- projects/graid/8/release/powerpc/mkisoimages.sh Thu Jan 27 14:16:12 2011 (r217942) +++ projects/graid/8/release/powerpc/mkisoimages.sh Thu Jan 27 14:46:01 2011 (r217943) @@ -25,7 +25,7 @@ *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-projects@FreeBSD.ORG Thu Jan 27 15:27:08 2011 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 47DDC1065670; Thu, 27 Jan 2011 15:27:08 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 339428FC12; Thu, 27 Jan 2011 15:27:08 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0RFR8lT021488; Thu, 27 Jan 2011 15:27:08 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0RFR7D3021457; Thu, 27 Jan 2011 15:27:07 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201101271527.p0RFR7D3021457@svn.freebsd.org> From: Alexander Motin Date: Thu, 27 Jan 2011 15:27:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217945 - in projects/graid/7: . contrib/bsnmp/snmpd contrib/wpa_supplicant etc etc/rc.d gnu/usr.bin/groff/tmac lib/csu/i386-elf lib/libc/stdio lib/libc/stdlib lib/libc/sys release sbin... X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Jan 2011 15:27:08 -0000 Author: mav Date: Thu Jan 27 15:27:07 2011 New Revision: 217945 URL: http://svn.freebsd.org/changeset/base/217945 Log: MFS Added: projects/graid/7/share/man/man4/rgephy.4 - copied unchanged from r217943, stable/7/share/man/man4/rgephy.4 projects/graid/7/share/man/man9/osd.9 - copied unchanged from r217943, stable/7/share/man/man9/osd.9 Modified: projects/graid/7/COPYRIGHT (contents, props changed) projects/graid/7/ObsoleteFiles.inc (contents, props changed) projects/graid/7/etc/devd.conf projects/graid/7/etc/rc.d/mountcritlocal projects/graid/7/gnu/usr.bin/groff/tmac/mdoc.local (contents, props changed) projects/graid/7/lib/csu/i386-elf/crt1_s.S projects/graid/7/lib/libc/stdio/freopen.c projects/graid/7/lib/libc/stdlib/atol.3 projects/graid/7/lib/libc/sys/mknod.2 projects/graid/7/lib/libc/sys/setpgid.2 projects/graid/7/release/Makefile projects/graid/7/sbin/ifconfig/ifmedia.c projects/graid/7/secure/lib/libcrypto/Makefile projects/graid/7/secure/lib/libssl/Makefile projects/graid/7/share/examples/etc/make.conf projects/graid/7/share/man/man4/Makefile projects/graid/7/share/man/man4/axe.4 projects/graid/7/share/man/man4/miibus.4 projects/graid/7/share/man/man4/nfe.4 projects/graid/7/share/man/man4/nve.4 projects/graid/7/share/man/man4/re.4 projects/graid/7/share/man/man4/sge.4 projects/graid/7/share/man/man4/tcp.4 projects/graid/7/share/man/man5/rc.conf.5 projects/graid/7/share/man/man5/xfs.5 projects/graid/7/share/man/man7/build.7 projects/graid/7/share/man/man9/Makefile projects/graid/7/share/mk/bsd.cpu.mk projects/graid/7/sys/amd64/amd64/machdep.c projects/graid/7/sys/amd64/ia32/ia32_signal.c projects/graid/7/sys/amd64/linux32/linux32_sysvec.c projects/graid/7/sys/arm/arm/machdep.c projects/graid/7/sys/dev/aac/aac_cam.c projects/graid/7/sys/dev/alc/if_alc.c projects/graid/7/sys/dev/alc/if_alcreg.h projects/graid/7/sys/dev/bge/if_bge.c projects/graid/7/sys/dev/bktr/bktr_os.c projects/graid/7/sys/dev/cxgb/cxgb_multiq.c projects/graid/7/sys/dev/dc/dcphy.c projects/graid/7/sys/dev/dc/pnphy.c projects/graid/7/sys/dev/e1000/if_em.c projects/graid/7/sys/dev/e1000/if_igb.c projects/graid/7/sys/dev/if_ndis/if_ndis_pccard.c projects/graid/7/sys/dev/if_ndis/if_ndis_pci.c projects/graid/7/sys/dev/mfi/mfi_cam.c projects/graid/7/sys/dev/mii/atphy.c projects/graid/7/sys/dev/mii/brgphy.c projects/graid/7/sys/dev/mii/ciphy.c projects/graid/7/sys/dev/mii/e1000phy.c projects/graid/7/sys/dev/mii/ip1000phy.c projects/graid/7/sys/dev/mii/jmphy.c projects/graid/7/sys/dev/mii/mii_physubr.c projects/graid/7/sys/dev/mii/nsgphy.c projects/graid/7/sys/dev/mii/rgephy.c projects/graid/7/sys/dev/mii/xmphy.c projects/graid/7/sys/dev/mpt/mpt_cam.c projects/graid/7/sys/dev/mpt/mpt_pci.c projects/graid/7/sys/dev/pci/vga_pci.c projects/graid/7/sys/dev/re/if_re.c projects/graid/7/sys/dev/sis/if_sis.c projects/graid/7/sys/dev/usb/uftdi.c projects/graid/7/sys/dev/usb/usbdevs projects/graid/7/sys/geom/geom_event.c projects/graid/7/sys/i386/i386/machdep.c projects/graid/7/sys/ia64/ia64/machdep.c projects/graid/7/sys/kern/kern_conf.c projects/graid/7/sys/kern/kern_exec.c projects/graid/7/sys/kern/kern_exit.c projects/graid/7/sys/kern/kern_fork.c projects/graid/7/sys/kern/kern_ktrace.c projects/graid/7/sys/kern/kern_proc.c projects/graid/7/sys/kern/p1003_1b.c projects/graid/7/sys/kern/posix4_mib.c projects/graid/7/sys/kern/uipc_sem.c projects/graid/7/sys/net/if_media.h projects/graid/7/sys/netinet/tcp_timer.c projects/graid/7/sys/pc98/pc98/machdep.c projects/graid/7/sys/powerpc/powerpc/machdep.c projects/graid/7/sys/sparc64/include/asmacros.h projects/graid/7/sys/sparc64/include/cpufunc.h projects/graid/7/sys/sparc64/sparc64/machdep.c projects/graid/7/sys/sparc64/sparc64/support.S projects/graid/7/sys/sparc64/sparc64/tick.c projects/graid/7/sys/sparc64/sparc64/tlb.c projects/graid/7/sys/sun4v/sun4v/machdep.c projects/graid/7/sys/sys/copyright.h projects/graid/7/sys/sys/ktrace.h projects/graid/7/sys/sys/param.h projects/graid/7/sys/sys/user.h projects/graid/7/sys/vm/vm_map.c projects/graid/7/sys/vm/vm_map.h projects/graid/7/tools/regression/acct/Makefile projects/graid/7/tools/regression/acct/pack.c projects/graid/7/tools/regression/acct/regress.t projects/graid/7/tools/regression/bin/date/regress.sh projects/graid/7/usr.bin/gcore/Makefile projects/graid/7/usr.bin/gcore/elfcore.c projects/graid/7/usr.bin/gcore/extern.h projects/graid/7/usr.bin/gcore/gcore.1 projects/graid/7/usr.bin/gcore/gcore.c projects/graid/7/usr.bin/stat/Makefile projects/graid/7/usr.bin/stat/stat.1 projects/graid/7/usr.bin/stat/stat.c projects/graid/7/usr.sbin/config/config.y projects/graid/7/usr.sbin/config/mkmakefile.c projects/graid/7/usr.sbin/config/mkoptions.c projects/graid/7/usr.sbin/mfiutil/Makefile projects/graid/7/usr.sbin/mfiutil/mfi_cmd.c projects/graid/7/usr.sbin/mfiutil/mfi_config.c projects/graid/7/usr.sbin/mfiutil/mfi_evt.c projects/graid/7/usr.sbin/mfiutil/mfi_flash.c projects/graid/7/usr.sbin/mfiutil/mfiutil.8 projects/graid/7/usr.sbin/newsyslog/newsyslog.c projects/graid/7/usr.sbin/pkg_install/add/main.c Directory Properties: projects/graid/7/ (props changed) projects/graid/7/Makefile (props changed) projects/graid/7/Makefile.inc1 (props changed) projects/graid/7/UPDATING (props changed) projects/graid/7/bin/ (props changed) projects/graid/7/bin/chflags/ (props changed) projects/graid/7/bin/chio/ (props changed) projects/graid/7/bin/cp/ (props changed) projects/graid/7/bin/csh/ (props changed) projects/graid/7/bin/dd/ (props changed) projects/graid/7/bin/df/ (props changed) projects/graid/7/bin/echo/ (props changed) projects/graid/7/bin/expr/ (props changed) projects/graid/7/bin/kill/ (props changed) projects/graid/7/bin/ln/ (props changed) projects/graid/7/bin/ls/ (props changed) projects/graid/7/bin/pax/ (props changed) projects/graid/7/bin/ps/ (props changed) projects/graid/7/bin/rm/ (props changed) projects/graid/7/bin/sh/ (props changed) projects/graid/7/bin/test/ (props changed) projects/graid/7/cddl/contrib/opensolaris/ (props changed) projects/graid/7/cddl/lib/libzpool/ (props changed) projects/graid/7/contrib/bind9/ (props changed) projects/graid/7/contrib/binutils/ (props changed) projects/graid/7/contrib/bsnmp/ (props changed) projects/graid/7/contrib/bsnmp/snmpd/bsnmpd.1 (props changed) projects/graid/7/contrib/cpio/ (props changed) projects/graid/7/contrib/csup/ (props changed) projects/graid/7/contrib/expat/ (props changed) projects/graid/7/contrib/gcc/ (props changed) projects/graid/7/contrib/gdb/ (props changed) projects/graid/7/contrib/gdtoa/ (props changed) projects/graid/7/contrib/groff/ (props changed) projects/graid/7/contrib/ipfilter/ (props changed) projects/graid/7/contrib/less/ (props changed) projects/graid/7/contrib/libpcap/ (props changed) projects/graid/7/contrib/ncurses/ (props changed) projects/graid/7/contrib/netcat/ (props changed) projects/graid/7/contrib/ntp/ (props changed) projects/graid/7/contrib/nvi/ (props changed) projects/graid/7/contrib/pf/ (props changed) projects/graid/7/contrib/sendmail/ (props changed) projects/graid/7/contrib/smbfs/ (props changed) projects/graid/7/contrib/tcp_wrappers/ (props changed) projects/graid/7/contrib/tcsh/ (props changed) projects/graid/7/contrib/telnet/ (props changed) projects/graid/7/contrib/top/ (props changed) projects/graid/7/contrib/traceroute/ (props changed) projects/graid/7/contrib/wpa_supplicant/ (props changed) projects/graid/7/contrib/wpa_supplicant/wpa_supplicant.conf (props changed) projects/graid/7/crypto/openssh/ (props changed) projects/graid/7/crypto/openssl/ (props changed) projects/graid/7/etc/ (props changed) projects/graid/7/games/factor/ (props changed) projects/graid/7/games/fortune/ (props changed) projects/graid/7/games/grdc/ (props changed) projects/graid/7/gnu/ (props changed) projects/graid/7/gnu/lib/libstdc++/ (props changed) projects/graid/7/gnu/usr.bin/ (props changed) projects/graid/7/gnu/usr.bin/cc/ (props changed) projects/graid/7/gnu/usr.bin/cpio/ (props changed) projects/graid/7/gnu/usr.bin/cvs/ (props changed) projects/graid/7/gnu/usr.bin/gdb/ (props changed) projects/graid/7/gnu/usr.bin/gdb/kgdb/ (props changed) projects/graid/7/gnu/usr.bin/grep/ (props changed) projects/graid/7/gnu/usr.bin/groff/ (props changed) projects/graid/7/gnu/usr.bin/man/ (props changed) projects/graid/7/gnu/usr.bin/sort/ (props changed) projects/graid/7/include/ (props changed) projects/graid/7/kerberos5/ (props changed) projects/graid/7/lib/ (props changed) projects/graid/7/lib/bind/ (props changed) projects/graid/7/lib/csu/ (props changed) projects/graid/7/lib/libarchive/ (props changed) projects/graid/7/lib/libbluetooth/ (props changed) projects/graid/7/lib/libc/ (props changed) projects/graid/7/lib/libc/stdtime/ (props changed) projects/graid/7/lib/libc_r/ (props changed) projects/graid/7/lib/libcam/ (props changed) projects/graid/7/lib/libdisk/ (props changed) projects/graid/7/lib/libdwarf/ (props changed) projects/graid/7/lib/libelf/ (props changed) projects/graid/7/lib/libexpat/ (props changed) projects/graid/7/lib/libfetch/ (props changed) projects/graid/7/lib/libftpio/ (props changed) projects/graid/7/lib/libgeom/ (props changed) projects/graid/7/lib/libgssapi/ (props changed) projects/graid/7/lib/libkse/ (props changed) projects/graid/7/lib/libkvm/ (props changed) projects/graid/7/lib/libmagic/ (props changed) projects/graid/7/lib/libmemstat/ (props changed) projects/graid/7/lib/libpmc/ (props changed) projects/graid/7/lib/libradius/ (props changed) projects/graid/7/lib/libsm/ (props changed) projects/graid/7/lib/libstand/ (props changed) projects/graid/7/lib/libthr/ (props changed) projects/graid/7/lib/libthread_db/ (props changed) projects/graid/7/lib/libufs/ (props changed) projects/graid/7/lib/libutil/ (props changed) projects/graid/7/lib/msun/ (props changed) projects/graid/7/libexec/ (props changed) projects/graid/7/libexec/ftpd/ (props changed) projects/graid/7/libexec/rpc.rquotad/ (props changed) projects/graid/7/libexec/rpc.rstatd/ (props changed) projects/graid/7/libexec/rtld-elf/ (props changed) projects/graid/7/libexec/tftpd/ (props changed) projects/graid/7/release/ (props changed) projects/graid/7/release/doc/ (props changed) projects/graid/7/release/doc/en_US.ISO8859-1/hardware/ (props changed) projects/graid/7/release/picobsd/tinyware/login/ (props changed) projects/graid/7/rescue/ (props changed) projects/graid/7/sbin/ (props changed) projects/graid/7/sbin/atacontrol/ (props changed) projects/graid/7/sbin/bsdlabel/ (props changed) projects/graid/7/sbin/clri/ (props changed) projects/graid/7/sbin/ddb/ (props changed) projects/graid/7/sbin/devd/ (props changed) projects/graid/7/sbin/devfs/ (props changed) projects/graid/7/sbin/dhclient/ (props changed) projects/graid/7/sbin/dumpfs/ (props changed) projects/graid/7/sbin/fdisk/ (props changed) projects/graid/7/sbin/fdisk_pc98/ (props changed) projects/graid/7/sbin/fsck/ (props changed) projects/graid/7/sbin/fsck_ffs/ (props changed) projects/graid/7/sbin/fsck_msdosfs/ (props changed) projects/graid/7/sbin/geom/ (props changed) projects/graid/7/sbin/geom/class/label/ (props changed) projects/graid/7/sbin/geom/class/part/ (props changed) projects/graid/7/sbin/geom/class/stripe/ (props changed) projects/graid/7/sbin/geom/misc/ (props changed) projects/graid/7/sbin/growfs/ (props changed) projects/graid/7/sbin/ifconfig/ (props changed) projects/graid/7/sbin/init/ (props changed) projects/graid/7/sbin/ipf/ (props changed) projects/graid/7/sbin/ipfw/ (props changed) projects/graid/7/sbin/md5/ (props changed) projects/graid/7/sbin/mdconfig/ (props changed) projects/graid/7/sbin/mksnap_ffs/ (props changed) projects/graid/7/sbin/mount/ (props changed) projects/graid/7/sbin/mount_msdosfs/ (props changed) projects/graid/7/sbin/natd/ (props changed) projects/graid/7/sbin/newfs/ (props changed) projects/graid/7/sbin/newfs_msdos/ (props changed) projects/graid/7/sbin/ping6/ (props changed) projects/graid/7/sbin/reboot/ (props changed) projects/graid/7/sbin/restore/ (props changed) projects/graid/7/sbin/route/ (props changed) projects/graid/7/sbin/savecore/ (props changed) projects/graid/7/sbin/sconfig/ (props changed) projects/graid/7/sbin/shutdown/ (props changed) projects/graid/7/sbin/sysctl/ (props changed) projects/graid/7/sbin/tunefs/ (props changed) projects/graid/7/secure/lib/libcrypto/ (props changed) projects/graid/7/secure/lib/libssh/ (props changed) projects/graid/7/secure/lib/libssl/ (props changed) projects/graid/7/secure/libexec/sftp-server/ (props changed) projects/graid/7/secure/usr.bin/bdes/ (props changed) projects/graid/7/secure/usr.bin/openssl/ (props changed) projects/graid/7/secure/usr.bin/ssh/ (props changed) projects/graid/7/secure/usr.sbin/sshd/ (props changed) projects/graid/7/share/ (props changed) projects/graid/7/share/colldef/ (props changed) projects/graid/7/share/dict/ (props changed) projects/graid/7/share/doc/bind9/ (props changed) projects/graid/7/share/doc/papers/jail/ (props changed) projects/graid/7/share/doc/smm/01.setup/ (props changed) projects/graid/7/share/examples/ (props changed) projects/graid/7/share/man/ (props changed) projects/graid/7/share/man/man1/ (props changed) projects/graid/7/share/man/man3/ (props changed) projects/graid/7/share/man/man4/ (props changed) projects/graid/7/share/man/man5/ (props changed) projects/graid/7/share/man/man7/ (props changed) projects/graid/7/share/man/man8/ (props changed) projects/graid/7/share/man/man9/ (props changed) projects/graid/7/share/misc/ (props changed) projects/graid/7/share/misc/iso639 (props changed) projects/graid/7/share/misc/pci_vendors (props changed) projects/graid/7/share/mk/ (props changed) projects/graid/7/share/mklocale/ (props changed) projects/graid/7/share/monetdef/ (props changed) projects/graid/7/share/msgdef/ (props changed) projects/graid/7/share/numericdef/ (props changed) projects/graid/7/share/sendmail/ (props changed) projects/graid/7/share/syscons/ (props changed) projects/graid/7/share/syscons/keymaps/ (props changed) projects/graid/7/share/termcap/ (props changed) projects/graid/7/share/timedef/ (props changed) projects/graid/7/share/zoneinfo/ (props changed) projects/graid/7/sys/ (props changed) projects/graid/7/sys/cddl/contrib/opensolaris/ (props changed) projects/graid/7/sys/contrib/dev/acpica/ (props changed) projects/graid/7/sys/contrib/pf/ (props changed) projects/graid/7/tools/ (props changed) projects/graid/7/tools/build/ (props changed) projects/graid/7/tools/build/options/ (props changed) projects/graid/7/tools/debugscripts/ (props changed) projects/graid/7/tools/regression/acct/ (props changed) projects/graid/7/tools/regression/atm/ (props changed) projects/graid/7/tools/regression/bin/ (props changed) projects/graid/7/tools/regression/bin/date/ (props changed) projects/graid/7/tools/regression/bin/sh/ (props changed) projects/graid/7/tools/regression/file/ (props changed) projects/graid/7/tools/regression/file/flock/ (props changed) projects/graid/7/tools/regression/lib/libc/ (props changed) projects/graid/7/tools/regression/usr.bin/ (props changed) projects/graid/7/tools/regression/usr.bin/jot/ (props changed) projects/graid/7/tools/regression/usr.bin/tr/ (props changed) projects/graid/7/tools/sched/ (props changed) projects/graid/7/tools/test/ (props changed) projects/graid/7/tools/tools/ (props changed) projects/graid/7/tools/tools/aac/ (props changed) projects/graid/7/tools/tools/crypto/ (props changed) projects/graid/7/tools/tools/editing/ (props changed) projects/graid/7/tools/tools/nanobsd/ (props changed) projects/graid/7/tools/tools/nanobsd/FlashDevice.sub (props changed) projects/graid/7/tools/tools/nanobsd/nanobsd.sh (props changed) projects/graid/7/tools/tools/netrate/ (props changed) projects/graid/7/tools/tools/umastat/ (props changed) projects/graid/7/tools/tools/usb/ (props changed) projects/graid/7/usr.bin/ (props changed) projects/graid/7/usr.bin/basename/ (props changed) projects/graid/7/usr.bin/bluetooth/rfcomm_sppd/ (props changed) projects/graid/7/usr.bin/calendar/ (props changed) projects/graid/7/usr.bin/catman/ (props changed) projects/graid/7/usr.bin/cksum/ (props changed) projects/graid/7/usr.bin/comm/ (props changed) projects/graid/7/usr.bin/cpuset/ (props changed) projects/graid/7/usr.bin/csup/ (props changed) projects/graid/7/usr.bin/dirname/ (props changed) projects/graid/7/usr.bin/du/ (props changed) projects/graid/7/usr.bin/fetch/ (props changed) projects/graid/7/usr.bin/file/ (props changed) projects/graid/7/usr.bin/find/ (props changed) projects/graid/7/usr.bin/finger/ (props changed) projects/graid/7/usr.bin/fold/ (props changed) projects/graid/7/usr.bin/fstat/ (props changed) projects/graid/7/usr.bin/gcore/ (props changed) projects/graid/7/usr.bin/gprof/ (props changed) projects/graid/7/usr.bin/gzip/ (props changed) projects/graid/7/usr.bin/hexdump/ (props changed) projects/graid/7/usr.bin/id/ (props changed) projects/graid/7/usr.bin/indent/ (props changed) projects/graid/7/usr.bin/ipcrm/ (props changed) projects/graid/7/usr.bin/ipcs/ (props changed) projects/graid/7/usr.bin/jot/ (props changed) projects/graid/7/usr.bin/kdump/ (props changed) projects/graid/7/usr.bin/ktrace/ (props changed) projects/graid/7/usr.bin/ldd/ (props changed) projects/graid/7/usr.bin/less/ (props changed) projects/graid/7/usr.bin/locate/ (props changed) projects/graid/7/usr.bin/lockf/ (props changed) projects/graid/7/usr.bin/logger/ (props changed) projects/graid/7/usr.bin/make/ (props changed) projects/graid/7/usr.bin/ncal/ (props changed) projects/graid/7/usr.bin/netstat/ (props changed) projects/graid/7/usr.bin/newgrp/ (props changed) projects/graid/7/usr.bin/nsupdate/ (props changed) projects/graid/7/usr.bin/pkill/ (props changed) projects/graid/7/usr.bin/procstat/ (props changed) projects/graid/7/usr.bin/quota/ (props changed) projects/graid/7/usr.bin/rpcgen/ (props changed) projects/graid/7/usr.bin/ruptime/ (props changed) projects/graid/7/usr.bin/script/ (props changed) projects/graid/7/usr.bin/sed/ (props changed) projects/graid/7/usr.bin/shar/ (props changed) projects/graid/7/usr.bin/sockstat/ (props changed) projects/graid/7/usr.bin/stat/ (props changed) projects/graid/7/usr.bin/su/ (props changed) projects/graid/7/usr.bin/systat/ (props changed) projects/graid/7/usr.bin/tail/ (props changed) projects/graid/7/usr.bin/tar/ (props changed) projects/graid/7/usr.bin/tftp/ (props changed) projects/graid/7/usr.bin/tip/ (props changed) projects/graid/7/usr.bin/top/ (props changed) projects/graid/7/usr.bin/truncate/ (props changed) projects/graid/7/usr.bin/truss/ (props changed) projects/graid/7/usr.bin/uname/ (props changed) projects/graid/7/usr.bin/unifdef/ (props changed) projects/graid/7/usr.bin/units/ (props changed) projects/graid/7/usr.bin/uudecode/ (props changed) projects/graid/7/usr.bin/vmstat/ (props changed) projects/graid/7/usr.bin/w/ (props changed) projects/graid/7/usr.bin/wc/ (props changed) projects/graid/7/usr.bin/whereis/ (props changed) projects/graid/7/usr.bin/whois/ (props changed) projects/graid/7/usr.bin/window/ (props changed) projects/graid/7/usr.bin/xargs/ (props changed) projects/graid/7/usr.bin/ypcat/ (props changed) projects/graid/7/usr.bin/ypmatch/ (props changed) projects/graid/7/usr.bin/ypwhich/ (props changed) projects/graid/7/usr.sbin/ (props changed) projects/graid/7/usr.sbin/Makefile (props changed) projects/graid/7/usr.sbin/acpi/ (props changed) projects/graid/7/usr.sbin/adduser/ (props changed) projects/graid/7/usr.sbin/arp/ (props changed) projects/graid/7/usr.sbin/bluetooth/ (props changed) projects/graid/7/usr.sbin/bluetooth/btpand/ (props changed) projects/graid/7/usr.sbin/bluetooth/hcsecd/ (props changed) projects/graid/7/usr.sbin/bluetooth/hcseriald/ (props changed) projects/graid/7/usr.sbin/bluetooth/rfcomm_pppd/ (props changed) projects/graid/7/usr.sbin/bluetooth/sdpd/ (props changed) projects/graid/7/usr.sbin/boot0cfg/ (props changed) projects/graid/7/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_processor_tbl.c (props changed) projects/graid/7/usr.sbin/bsnmpd/modules/snmp_pf/ (props changed) projects/graid/7/usr.sbin/burncd/ (props changed) projects/graid/7/usr.sbin/cdcontrol/ (props changed) projects/graid/7/usr.sbin/chown/ (props changed) projects/graid/7/usr.sbin/chroot/ (props changed) projects/graid/7/usr.sbin/config/ (props changed) projects/graid/7/usr.sbin/config/SMM.doc/ (props changed) projects/graid/7/usr.sbin/cpucontrol/ (props changed) projects/graid/7/usr.sbin/crashinfo/ (props changed) projects/graid/7/usr.sbin/cron/ (props changed) projects/graid/7/usr.sbin/cron/cron/ (props changed) projects/graid/7/usr.sbin/crunch/ (props changed) projects/graid/7/usr.sbin/cxgbtool/ (props changed) projects/graid/7/usr.sbin/eeprom/ (props changed) projects/graid/7/usr.sbin/extattr/ (props changed) projects/graid/7/usr.sbin/faithd/ (props changed) projects/graid/7/usr.sbin/fdcontrol/ (props changed) projects/graid/7/usr.sbin/fdformat/ (props changed) projects/graid/7/usr.sbin/fdread/ (props changed) projects/graid/7/usr.sbin/fdwrite/ (props changed) projects/graid/7/usr.sbin/fifolog/ (props changed) projects/graid/7/usr.sbin/freebsd-update/ (props changed) projects/graid/7/usr.sbin/fwcontrol/ (props changed) projects/graid/7/usr.sbin/gstat/ (props changed) projects/graid/7/usr.sbin/iostat/ (props changed) projects/graid/7/usr.sbin/jail/ (props changed) projects/graid/7/usr.sbin/jexec/ (props changed) projects/graid/7/usr.sbin/jls/ (props changed) projects/graid/7/usr.sbin/lpr/ (props changed) projects/graid/7/usr.sbin/mailwrapper/ (props changed) projects/graid/7/usr.sbin/makefs/ (props changed) projects/graid/7/usr.sbin/makefs/ffs/ffs_bswap.c (props changed) projects/graid/7/usr.sbin/makefs/ffs/ffs_subr.c (props changed) projects/graid/7/usr.sbin/makefs/ffs/ufs_bswap.h (props changed) projects/graid/7/usr.sbin/makefs/getid.c (props changed) projects/graid/7/usr.sbin/mergemaster/ (props changed) projects/graid/7/usr.sbin/mfiutil/ (props changed) projects/graid/7/usr.sbin/mountd/ (props changed) projects/graid/7/usr.sbin/mptutil/ (props changed) projects/graid/7/usr.sbin/mtree/ (props changed) projects/graid/7/usr.sbin/ndiscvt/ (props changed) projects/graid/7/usr.sbin/ndp/ (props changed) projects/graid/7/usr.sbin/newsyslog/ (props changed) projects/graid/7/usr.sbin/nscd/ (props changed) projects/graid/7/usr.sbin/ntp/ (props changed) projects/graid/7/usr.sbin/pciconf/ (props changed) projects/graid/7/usr.sbin/pkg_install/ (props changed) projects/graid/7/usr.sbin/pmccontrol/ (props changed) projects/graid/7/usr.sbin/pmcstat/ (props changed) projects/graid/7/usr.sbin/portsnap/ (props changed) projects/graid/7/usr.sbin/powerd/ (props changed) projects/graid/7/usr.sbin/ppp/ (props changed) projects/graid/7/usr.sbin/pstat/ (props changed) projects/graid/7/usr.sbin/pw/ (props changed) projects/graid/7/usr.sbin/pwd_mkdb/ (props changed) projects/graid/7/usr.sbin/rpc.lockd/ (props changed) projects/graid/7/usr.sbin/rpc.statd/ (props changed) projects/graid/7/usr.sbin/rpc.yppasswdd/ (props changed) projects/graid/7/usr.sbin/rtadvd/ (props changed) projects/graid/7/usr.sbin/rtsold/ (props changed) projects/graid/7/usr.sbin/sade/ (props changed) projects/graid/7/usr.sbin/service/ (props changed) projects/graid/7/usr.sbin/setfib/ (props changed) projects/graid/7/usr.sbin/sysinstall/ (props changed) projects/graid/7/usr.sbin/syslogd/ (props changed) projects/graid/7/usr.sbin/traceroute/ (props changed) projects/graid/7/usr.sbin/traceroute6/ (props changed) projects/graid/7/usr.sbin/tzsetup/ (props changed) projects/graid/7/usr.sbin/ugidfw/ (props changed) projects/graid/7/usr.sbin/wpa/wpa_supplicant/ (props changed) projects/graid/7/usr.sbin/ypserv/ (props changed) projects/graid/7/usr.sbin/zic/ (props changed) Modified: projects/graid/7/COPYRIGHT ============================================================================== --- projects/graid/7/COPYRIGHT Thu Jan 27 14:49:22 2011 (r217944) +++ projects/graid/7/COPYRIGHT Thu Jan 27 15:27:07 2011 (r217945) @@ -4,7 +4,7 @@ The compilation of software known as FreeBSD is distributed under the following terms: -Copyright (c) 1992-2010 The FreeBSD Project. All rights reserved. +Copyright (c) 1992-2011 The FreeBSD Project. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions Modified: projects/graid/7/ObsoleteFiles.inc ============================================================================== --- projects/graid/7/ObsoleteFiles.inc Thu Jan 27 14:49:22 2011 (r217944) +++ projects/graid/7/ObsoleteFiles.inc Thu Jan 27 15:27:07 2011 (r217945) @@ -14,6 +14,8 @@ # The file is partitioned: OLD_FILES first, then OLD_LIBS and OLD_DIRS last. # +# 20101114: Remove long-obsolete MAKEDEV.8 +OLD_FILES+=usr/share/man/man8/MAKEDEV.8.gz # 20101112: vgonel(9) has gone to private API a while ago OLD_FILES+=usr/share/man/man9/vgonel.9.gz # 20101025: catch up with vm_page_sleep_if_busy rename Modified: projects/graid/7/etc/devd.conf ============================================================================== --- projects/graid/7/etc/devd.conf Thu Jan 27 14:49:22 2011 (r217944) +++ projects/graid/7/etc/devd.conf Thu Jan 27 15:27:07 2011 (r217945) @@ -46,7 +46,7 @@ notify 0 { # # Try to start dhclient on Ethernet like interfaces when the link comes # up. Only devices that are configured to support DHCP will actually -# run it. No link down rule exists because dhclient automaticly exits +# run it. No link down rule exists because dhclient automatically exits # when the link goes down. # notify 0 { Modified: projects/graid/7/etc/rc.d/mountcritlocal ============================================================================== --- projects/graid/7/etc/rc.d/mountcritlocal Thu Jan 27 14:49:22 2011 (r217944) +++ projects/graid/7/etc/rc.d/mountcritlocal Thu Jan 27 15:27:07 2011 (r217945) @@ -5,13 +5,13 @@ # PROVIDE: mountcritlocal # REQUIRE: root -# KEYWORD: nojail +# KEYWORD: nojail shutdown . /etc/rc.subr name="mountcritlocal" start_cmd="mountcritlocal_start" -stop_cmd=":" +stop_cmd=sync mountcritlocal_start() { Modified: projects/graid/7/gnu/usr.bin/groff/tmac/mdoc.local ============================================================================== --- projects/graid/7/gnu/usr.bin/groff/tmac/mdoc.local Thu Jan 27 14:49:22 2011 (r217944) +++ projects/graid/7/gnu/usr.bin/groff/tmac/mdoc.local Thu Jan 27 15:27:07 2011 (r217945) @@ -64,7 +64,7 @@ .ds doc-volume-as-arm arm . .\" Default .Os value -.ds doc-default-operating-system FreeBSD\~7.3 +.ds doc-default-operating-system FreeBSD\~7.4 . .\" FreeBSD releases not found in doc-common .ds doc-operating-system-FreeBSD-6.3 6.3 @@ -75,6 +75,7 @@ .ds doc-operating-system-FreeBSD-7.4 7.4 .ds doc-operating-system-FreeBSD-8.0 8.0 .ds doc-operating-system-FreeBSD-8.1 8.1 +.ds doc-operating-system-FreeBSD-8.2 8.2 .ds doc-operating-system-FreeBSD-9.0 9.0 . .ec Modified: projects/graid/7/lib/csu/i386-elf/crt1_s.S ============================================================================== --- projects/graid/7/lib/csu/i386-elf/crt1_s.S Thu Jan 27 14:49:22 2011 (r217944) +++ projects/graid/7/lib/csu/i386-elf/crt1_s.S Thu Jan 27 15:27:07 2011 (r217945) @@ -35,6 +35,7 @@ _start: xorl %ebp,%ebp movl %esp,%ebp andl $0xfffffff0,%esp # align stack leal 8(%ebp),%eax + subl $4,%esp pushl %eax # argv pushl 4(%ebp) # argc pushl %edx # rtld cleanup Modified: projects/graid/7/lib/libc/stdio/freopen.c ============================================================================== --- projects/graid/7/lib/libc/stdio/freopen.c Thu Jan 27 14:49:22 2011 (r217944) +++ projects/graid/7/lib/libc/stdio/freopen.c Thu Jan 27 15:27:07 2011 (r217945) @@ -150,14 +150,6 @@ freopen(file, mode, fp) /* Get a new descriptor to refer to the new file. */ f = _open(file, oflags, DEFFILEMODE); - if (f < 0 && isopen) { - /* If out of fd's close the old one and try again. */ - if (errno == ENFILE || errno == EMFILE) { - (void) (*fp->_close)(fp->_cookie); - isopen = 0; - f = _open(file, oflags, DEFFILEMODE); - } - } sverrno = errno; finish: @@ -165,9 +157,11 @@ finish: * Finish closing fp. Even if the open succeeded above, we cannot * keep fp->_base: it may be the wrong size. This loses the effect * of any setbuffer calls, but stdio has always done this before. + * + * Leave the existing file descriptor open until dup2() is called + * below to avoid races where a concurrent open() in another thread + * could claim the existing descriptor. */ - if (isopen) - (void) (*fp->_close)(fp->_cookie); if (fp->_flags & __SMBF) free((char *)fp->_bf._base); fp->_w = 0; @@ -186,6 +180,8 @@ finish: memset(&fp->_extra->mbstate, 0, sizeof(mbstate_t)); if (f < 0) { /* did not get it after all */ + if (isopen) + (void) (*fp->_close)(fp->_cookie); fp->_flags = 0; /* set it free */ FUNLOCKFILE(fp); errno = sverrno; /* restore in case _close clobbered */ @@ -197,11 +193,12 @@ finish: * to maintain the descriptor. Various C library routines (perror) * assume stderr is always fd STDERR_FILENO, even if being freopen'd. */ - if (wantfd >= 0 && f != wantfd) { + if (wantfd >= 0) { if (_dup2(f, wantfd) >= 0) { (void)_close(f); f = wantfd; - } + } else + (void)_close(fp->_file); } /* Modified: projects/graid/7/lib/libc/stdlib/atol.3 ============================================================================== --- projects/graid/7/lib/libc/stdlib/atol.3 Thu Jan 27 14:49:22 2011 (r217944) +++ projects/graid/7/lib/libc/stdlib/atol.3 Thu Jan 27 15:27:07 2011 (r217945) @@ -32,7 +32,7 @@ .\" @(#)atol.3 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd November 28, 2001 +.Dd February 1, 2009 .Dt ATOL 3 .Os .Sh NAME @@ -78,13 +78,42 @@ representation. It is equivalent to: .Pp .Dl "strtoll(nptr, (char **)NULL, 10);" +.Sh COMPATIBILITY +The +.Fx +implementations of the +.Fn atol +and +.Fn atoll +functions are thin wrappers around +.Fn strtol +and +.Fn stroll +respectively, so these functions will affect the value of +.Va errno +in the same way that the +.Fn strtol +and +.Fn stroll +functions are able to. +This behavior of +.Fn atol +and +.Fn atoll +is not required by +.St -isoC +or +.St -isoC-99 , +but it is allowed by all of +.St -isoC , St -isoC-99 +and +.St -p1003.1-2001 . .Sh ERRORS The functions .Fn atol and .Fn atoll -need not -affect the value of +may affect the value of .Va errno on an error. .Sh SEE ALSO Modified: projects/graid/7/lib/libc/sys/mknod.2 ============================================================================== --- projects/graid/7/lib/libc/sys/mknod.2 Thu Jan 27 14:49:22 2011 (r217944) +++ projects/graid/7/lib/libc/sys/mknod.2 Thu Jan 27 15:27:07 2011 (r217945) @@ -28,7 +28,7 @@ .\" @(#)mknod.2 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd June 4, 1993 +.Dd January 16, 2011 .Dt MKNOD 2 .Os .Sh NAME @@ -37,7 +37,7 @@ .Sh LIBRARY .Lb libc .Sh SYNOPSIS -.In unistd.h +.In sys/stat.h .Ft int .Fn mknod "const char *path" "mode_t mode" "dev_t dev" .Sh DESCRIPTION Modified: projects/graid/7/lib/libc/sys/setpgid.2 ============================================================================== --- projects/graid/7/lib/libc/sys/setpgid.2 Thu Jan 27 14:49:22 2011 (r217944) +++ projects/graid/7/lib/libc/sys/setpgid.2 Thu Jan 27 15:27:07 2011 (r217945) @@ -54,6 +54,11 @@ to the specified If .Fa pid is zero, then the call applies to the current process. +If +.Fa pgrp +is zero, then the process id of the process specified by +.Fa pid +is used instead. .Pp If the affected process is not the invoking process, then it must be a child of the invoking process, it must not have performed an Modified: projects/graid/7/release/Makefile ============================================================================== --- projects/graid/7/release/Makefile Thu Jan 27 14:49:22 2011 (r217944) +++ projects/graid/7/release/Makefile Thu Jan 27 15:27:07 2011 (r217945) @@ -24,11 +24,11 @@ # Set these, release builder! # # Fixed version: -#BUILDNAME=7.3-STABLE +#BUILDNAME=7.4-STABLE # # Automatic SNAP versioning: DATE != date +%Y%m%d -BASE = 7.3 +BASE = 7.4 BUILDNAME?=${BASE}-${DATE}-SNAP # #CHROOTDIR=/junk/release Modified: projects/graid/7/sbin/ifconfig/ifmedia.c ============================================================================== --- projects/graid/7/sbin/ifconfig/ifmedia.c Thu Jan 27 14:49:22 2011 (r217944) +++ projects/graid/7/sbin/ifconfig/ifmedia.c Thu Jan 27 15:27:07 2011 (r217945) @@ -416,6 +416,9 @@ static struct ifmedia_description ifm_su static struct ifmedia_description ifm_shared_option_descriptions[] = IFM_SHARED_OPTION_DESCRIPTIONS; +static struct ifmedia_description ifm_shared_option_aliases[] = + IFM_SHARED_OPTION_ALIASES; + struct ifmedia_type_to_subtype { struct { struct ifmedia_description *desc; @@ -424,7 +427,7 @@ struct ifmedia_type_to_subtype { struct { struct ifmedia_description *desc; int alias; - } options[3]; + } options[4]; struct { struct ifmedia_description *desc; int alias; @@ -443,6 +446,7 @@ static struct ifmedia_type_to_subtype if }, { { &ifm_shared_option_descriptions[0], 0 }, + { &ifm_shared_option_aliases[0], 1 }, { &ifm_subtype_ethernet_option_descriptions[0], 0 }, { NULL, 0 }, }, @@ -460,6 +464,7 @@ static struct ifmedia_type_to_subtype if }, { { &ifm_shared_option_descriptions[0], 0 }, + { &ifm_shared_option_aliases[0], 1 }, { &ifm_subtype_tokenring_option_descriptions[0], 0 }, { NULL, 0 }, }, @@ -477,6 +482,7 @@ static struct ifmedia_type_to_subtype if }, { { &ifm_shared_option_descriptions[0], 0 }, + { &ifm_shared_option_aliases[0], 1 }, { &ifm_subtype_fddi_option_descriptions[0], 0 }, { NULL, 0 }, }, @@ -494,6 +500,7 @@ static struct ifmedia_type_to_subtype if }, { { &ifm_shared_option_descriptions[0], 0 }, + { &ifm_shared_option_aliases[0], 1 }, { &ifm_subtype_ieee80211_option_descriptions[0], 0 }, { NULL, 0 }, }, @@ -513,6 +520,7 @@ static struct ifmedia_type_to_subtype if }, { { &ifm_shared_option_descriptions[0], 0 }, + { &ifm_shared_option_aliases[0], 1 }, { &ifm_subtype_atm_option_descriptions[0], 0 }, { NULL, 0 }, }, Modified: projects/graid/7/secure/lib/libcrypto/Makefile ============================================================================== --- projects/graid/7/secure/lib/libcrypto/Makefile Thu Jan 27 14:49:22 2011 (r217944) +++ projects/graid/7/secure/lib/libcrypto/Makefile Thu Jan 27 15:27:07 2011 (r217945) @@ -6,7 +6,9 @@ SUBDIR= engines .include LIB= crypto -SHLIB_MAJOR= 6 +SHLIB_MAJOR= 5 + +SYMLINKS= lib${LIB}.so.5 ${SHLIBDIR}/lib${LIB}.so.6 NO_LINT= Modified: projects/graid/7/secure/lib/libssl/Makefile ============================================================================== --- projects/graid/7/secure/lib/libssl/Makefile Thu Jan 27 14:49:22 2011 (r217944) +++ projects/graid/7/secure/lib/libssl/Makefile Thu Jan 27 15:27:07 2011 (r217945) @@ -1,7 +1,9 @@ # $FreeBSD$ LIB= ssl -SHLIB_MAJOR= 6 +SHLIB_MAJOR= 5 + +SYMLINKS= lib${LIB}.so.5 ${SHLIBDIR}/lib${LIB}.so.6 NO_LINT= Modified: projects/graid/7/share/examples/etc/make.conf ============================================================================== --- projects/graid/7/share/examples/etc/make.conf Thu Jan 27 14:49:22 2011 (r217944) +++ projects/graid/7/share/examples/etc/make.conf Thu Jan 27 15:27:07 2011 (r217945) @@ -39,6 +39,8 @@ # Alpha/AXP architecture: ev67 ev6 pca56 ev56 ev5 ev45 ev4 # AMD64 architecture: opteron, athlon64, nocona, prescott, core2 # Intel ia64 architecture: itanium2, itanium +# SPARC-V9 architecture: v9 (generic 64-bit V9), ultrasparc (default +# if omitted), ultrasparc3 # # (?= allows to buildworld for a different CPUTYPE.) # Modified: projects/graid/7/share/man/man4/Makefile ============================================================================== --- projects/graid/7/share/man/man4/Makefile Thu Jan 27 14:49:22 2011 (r217944) +++ projects/graid/7/share/man/man4/Makefile Thu Jan 27 15:27:07 2011 (r217945) @@ -294,6 +294,7 @@ MAN= aac.4 \ random.4 \ rc.4 \ re.4 \ + rgephy.4 \ rl.4 \ rndtest.4 \ route.4 \ Modified: projects/graid/7/share/man/man4/axe.4 ============================================================================== --- projects/graid/7/share/man/man4/axe.4 Thu Jan 27 14:49:22 2011 (r217944) +++ projects/graid/7/share/man/man4/axe.4 Thu Jan 27 15:27:07 2011 (r217945) @@ -30,7 +30,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 20, 2008 +.Dd January 16, 2011 .Dt AXE 4 .Os .Sh NAME @@ -196,6 +196,7 @@ The driver failed to allocate an mbuf fo .Xr miibus 4 , .Xr netintro 4 , .Xr ng_ether 4 , +.Xr rgephy 4 , .Xr ifconfig 8 .Rs .%T "ASIX AX88172 AX88178 and AX88772 data sheets" Modified: projects/graid/7/share/man/man4/miibus.4 ============================================================================== --- projects/graid/7/share/man/man4/miibus.4 Thu Jan 27 14:49:22 2011 (r217944) +++ projects/graid/7/share/man/man4/miibus.4 Thu Jan 27 15:27:07 2011 (r217945) @@ -8,7 +8,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 14, 2010 +.Dd January 15, 2011 .Dt MIIBUS 4 .Os .Sh NAME @@ -157,6 +157,7 @@ but as a result are not well behaved new .Xr nve 4 , .Xr pcn 4 , .Xr re 4 , +.Xr rgephy 4 , .Xr rl 4 , .Xr rue 4 , .Xr sf 4 , Modified: projects/graid/7/share/man/man4/nfe.4 ============================================================================== --- projects/graid/7/share/man/man4/nfe.4 Thu Jan 27 14:49:22 2011 (r217944) +++ projects/graid/7/share/man/man4/nfe.4 Thu Jan 27 15:27:07 2011 (r217945) @@ -16,7 +16,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 2, 2008 +.Dd January 15, 2011 .Dt NFE 4 .Os .Sh NAME @@ -174,6 +174,7 @@ before a change takes effect. .Xr netintro 4 , .Xr pci 4 , .Xr polling 4 , +.Xr rgephy 4 , .Xr sysctl 8 , .Xr ifconfig 8 .Sh HISTORY Modified: projects/graid/7/share/man/man4/nve.4 ============================================================================== --- projects/graid/7/share/man/man4/nve.4 Thu Jan 27 14:49:22 2011 (r217944) +++ projects/graid/7/share/man/man4/nve.4 Thu Jan 27 15:27:07 2011 (r217945) @@ -26,7 +26,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 8, 2007 +.Dd January 16, 2011 .Dt NVE 4 .Os .Sh NAME @@ -124,6 +124,7 @@ bandwidth show that the card is actually .Xr miibus 4 , .Xr netintro 4 , .Xr ng_ether 4 , +.Xr rgephy 4 , .Xr ifconfig 8 .Sh HISTORY The Modified: projects/graid/7/share/man/man4/re.4 ============================================================================== --- projects/graid/7/share/man/man4/re.4 Thu Jan 27 14:49:22 2011 (r217944) +++ projects/graid/7/share/man/man4/re.4 Thu Jan 27 15:27:07 2011 (r217945) @@ -30,7 +30,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 27, 2010 +.Dd January 15, 2011 .Dt RE 4 .Os .Sh NAME @@ -178,6 +178,11 @@ prompt before booting the kernel or stor .It Va hw.re.msi_disable This tunable disables MSI support on the Ethernet hardware. The default value is 0. +.It Va hw.re.prefer_iomap +This tunable controls which register mapping should be used on the +specified device. +A non-zero value enables I/O space register mapping. +The default value is 0 to use memory space register mapping. .El .Sh DIAGNOSTICS .Bl -diag @@ -208,6 +213,7 @@ the network connection (cable). .Xr netintro 4 , .Xr ng_ether 4 , .Xr polling 4 , +.Xr rgephy 4 , .Xr vlan 4 , .Xr ifconfig 8 .Rs Copied: projects/graid/7/share/man/man4/rgephy.4 (from r217943, stable/7/share/man/man4/rgephy.4) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ projects/graid/7/share/man/man4/rgephy.4 Thu Jan 27 15:27:07 2011 (r217945, copy of r217943, stable/7/share/man/man4/rgephy.4) @@ -0,0 +1,96 @@ +.\" +.\" Copyright (c) 2011 Marius Strobl +.\" All rights reserved. +.\" +.\" 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$ +.\" +.Dd January 15 2011 $ +.Dt RGEPHY 4 +.Os +.Sh NAME +.Nm rgephy +.Nd RealTek RTL8168/8169/8110/8211 series 10/100/1000 Gigabit Ethernet PHY driver +.Sh SYNOPSIS +To compile all available PHY drivers into the kernel, +place the following line in your kernel configuration file: +.Bd -ragged -offset indent +.Cd "device miibus" +.Ed +.Pp +Alternatively, to selectively compile this driver into the kernel, +place the following lines in your kernel configuration file instead: +.Bd -ragged -offset indent +.Cd "device mii" +.Cd "device rgephy" +.Ed +.Sh DESCRIPTION +The +.Nm +driver supports the RealTek RTL8168, RTL8169, RTL8110 and RTL8211 series +integrated 10/100/1000 Gigabit Ethernet PHYs. +.Pp +In order to get a list of media types and options supported by a specific +instance of the +.Nm +driver, run +.Li ifconfig -m +on the instance of its parent MAC driver. +.Pp +Additionally, +the +.Nm +driver supports the following special media option: +.Bl -tag -width ".Cm flag0" +.It Cm flag0 +When manually setting media type and options via +.Xr ifconfig 8 , +the +.Nm +driver by default also triggers an autonegotiation advertising the selected +media. +This is done in order to work around hardware issues in certain scenarios. +It is believed that this behavior does not cause harm in general but in fact +can have an adverse effect in edge cases. +In order to manually set the media type and options without also triggering +an autonegotiation, +the +.Nm +driver allows to turn this behavior off via the +.Cm flag0 +media option. +.El +.Pp +Note that this special media option will not show up in the output of +.Xr ifconfig 8 , +even when set. +.Sh EXAMPLES +Manually set 100BASE-TX full-duplex without also triggering an +autonegotiation: +.Pp +.Dl "ifconfig re0 media 100baseTX mediaopt full-duplex,flag0" +.Sh SEE ALSO +.\".Xr ifmedia 4 , +.Xr intro 4 , +.Xr miibus 4 , +.Xr ifconfig 8 Modified: projects/graid/7/share/man/man4/sge.4 ============================================================================== --- projects/graid/7/share/man/man4/sge.4 Thu Jan 27 14:49:22 2011 (r217944) +++ projects/graid/7/share/man/man4/sge.4 Thu Jan 27 15:27:07 2011 (r217945) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 10, 2010 +.Dd January 16, 2011 .Dt SGE 4 .Os .Sh NAME @@ -105,6 +105,7 @@ SiS191 Fast/Gigabit Ethernet controller .Xr miibus 4 , .Xr netintro 4 , .Xr ng_ether 4 , +.Xr rgephy 4 , .Xr vlan 4 , .Xr ifconfig 8 .Sh HISTORY Modified: projects/graid/7/share/man/man4/tcp.4 ============================================================================== --- projects/graid/7/share/man/man4/tcp.4 Thu Jan 27 14:49:22 2011 (r217944) +++ projects/graid/7/share/man/man4/tcp.4 Thu Jan 27 15:27:07 2011 (r217945) @@ -32,7 +32,7 @@ .\" From: @(#)tcp.4 8.1 (Berkeley) 6/5/93 .\" $FreeBSD$ .\" -.Dd February 28, 2007 +.Dd January 8, 2011 .Dt TCP 4 .Os .Sh NAME @@ -289,7 +289,9 @@ Amount of time, in milliseconds, that th before keepalive probes (if enabled) are sent. .It Va keepintvl The interval, in milliseconds, between keepalive probes sent to remote -machines. +machines, when no response is received on a +.Va keepidle +probe. After .Dv TCPTV_KEEPCNT (default 8) probes are sent, with no response, the connection is dropped. Modified: projects/graid/7/share/man/man5/rc.conf.5 ============================================================================== --- projects/graid/7/share/man/man5/rc.conf.5 Thu Jan 27 14:49:22 2011 (r217944) +++ projects/graid/7/share/man/man5/rc.conf.5 Thu Jan 27 15:27:07 2011 (r217945) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 13, 2010 +.Dd January 7, 2011 .Dt RC.CONF 5 .Os .Sh NAME @@ -64,7 +64,19 @@ The file is used to override settings in .Pa /etc/rc.conf for historical reasons. -See the +In addition to +.Pa /etc/rc.conf.local +you can also place smaller configuration files for each +.Xr rc 8 +script in the +.Pa /etc/rc.conf.d +directory, which will be included by the +.Va load_rc_config +function. +For jail configurations you could use the file +.Pa /etc/rc.conf.d/jail +to store jail specific configuration options. +Also see the .Va rc_conf_files variable below. .Pp Modified: projects/graid/7/share/man/man5/xfs.5 ============================================================================== --- projects/graid/7/share/man/man5/xfs.5 Thu Jan 27 14:49:22 2011 (r217944) +++ projects/graid/7/share/man/man5/xfs.5 Thu Jan 27 15:27:07 2011 (r217945) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 16, 2007 +.Dd January 16, 2011 .Dt XFS 5 .Os .Sh NAME @@ -53,7 +53,7 @@ To mount a volume located on .Pa /dev/ad1s1 : .Pp -.Dl "mount -t xfs /dev/ad1s1 /mnt" +.Dl "mount -t xfs -o ro /dev/ad1s1 /mnt" .Sh SEE ALSO .Xr nmount 2 , .Xr unmount 2 , Modified: projects/graid/7/share/man/man7/build.7 ============================================================================== --- projects/graid/7/share/man/man7/build.7 Thu Jan 27 14:49:22 2011 (r217944) +++ projects/graid/7/share/man/man7/build.7 Thu Jan 27 15:27:07 2011 (r217945) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 1, 2006 +.Dd March 31, 2010 .Dt BUILD 7 .Os .Sh NAME @@ -311,6 +311,20 @@ should be set as with .Sh ENVIRONMENT Variables that influence all builds include: .Bl -tag -width ".Va MAKEOBJDIRPREFIX" +.It Va DEBUG_FLAGS +Defines a set of debugging flags that will be used to build all userland +binaries under +.Pa /usr/src . +When +.Va DEBUG_FLAGS +is defined, the +.Cm install +and +.Cm installworld +targets install binaries from the current +.Va MAKEOBJDIRPREFIX +without stripping, +so that debugging information is retained in the installed binaries. .It Va DESTDIR The directory hierarchy prefix where built objects will be installed. If not set, @@ -370,6 +384,69 @@ defaults to the current machine architec .El .Pp Builds under directory +.Pa /usr/src +are also influenced by defining one or more the following symbols, +using the +.Fl D +option of +.Xr make 1 : +.Bl -tag -width ".Va -DNO_KERNELDEPEND" +.It Va NO_CLEANDIR +If set, the build targets that clean parts of the object tree use the +equivalent of +.Dq make clean +instead of +.Dq make cleandir . +.It Va NO_CLEAN +If set, no object tree files are cleaned at all. +Setting +.Va NO_CLEAN +implies +.Va NO_KERNELCLEAN , +so when +.Va NO_CLEAN +is set no kernel objects are cleaned either. +.It Va NO_CTF +If set, the build process does not run the DTrace CTF conversion tools +on built objects. +.It Va NO_SHARE +If set, the build does not descend into the +.Pa /usr/src/share +subdirectory (i.e. manpages, locale data files, timezone data files and +other +.Pa /usr/src/share +files will not be rebuild from their sources). +.It Va NO_KERNELCLEAN +If set, the build process does not run +.Dq make clean +as part of the +.Cm buildkernel +target. +.It Va NO_KERNELCONFIG +If set, the build process does not run +.Xr config 8 +as part of the +.Cm buildkernel +target. +.It Va NO_KERNELDEPEND +If set, the build process does not run +.Dq make depend +as part of the +.Cm buildkernel +target. +.It Va NO_DOCUPDATE +If set, the update process does not update the source of the +.Fx +documentation as part of the +.Dq make update +target. +.It Va NO_PORTSUPDATE +If set, the update process does not update the Ports tree as part of the +.Dq make update +target. +.El +.Pp +Builds under directory .Pa /usr/doc are influenced by the following .Xr make 1 Modified: projects/graid/7/share/man/man9/Makefile ============================================================================== --- projects/graid/7/share/man/man9/Makefile Thu Jan 27 14:49:22 2011 (r217944) +++ projects/graid/7/share/man/man9/Makefile Thu Jan 27 15:27:07 2011 (r217945) @@ -157,6 +157,7 @@ MAN= accept_filter.9 \ mtx_pool.9 \ mutex.9 \ namei.9 \ + osd.9 \ panic.9 \ pbuf.9 \ p_candebug.9 \ Copied: projects/graid/7/share/man/man9/osd.9 (from r217943, stable/7/share/man/man9/osd.9) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ projects/graid/7/share/man/man9/osd.9 Thu Jan 27 15:27:07 2011 (r217945, copy of r217943, stable/7/share/man/man9/osd.9) @@ -0,0 +1,390 @@ +.\" +.\" Copyright (c) 2010 Lawrence Stewart +.\" All rights reserved. +.\" +.\" 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, +.\" without modification, immediately at the beginning of the file. +.\" 2. The name of the author may not be used to endorse or promote products +.\" derived from this software without specific prior written permission. +.\" +.\" 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$ +.\" +.Dd January 5, 2011 +.Dt OSD 9 +.Os +.Sh NAME +.Nm osd , +.Nm osd_register , +.Nm osd_deregister , +.Nm osd_set , +.Nm osd_get , +.Nm osd_del , +.Nm osd_call , +.Nm osd_exit +.Nd Object Specific Data +.Sh SYNOPSIS +.In sys/osd.h +.Ft typedef void +.Fn "\*(lp*osd_destructor_t\*(rp" "void *value" +.Ft typedef int +.Fn "\*(lp*osd_method_t\*(rp" "void *obj" "void *data" +.Ft int +.Fo osd_register +.Fa "u_int type" +.Fa "osd_destructor_t destructor" +.Fa "osd_method_t *methods" +.Fc +.Ft void +.Fo osd_deregister +.Fa "u_int type" +.Fa "u_int slot" +.Fc +.Ft int +.Fo osd_set +.Fa "u_int type" +.Fa "struct osd *osd" +.Fa "u_int slot" +.Fa "void *value" +.Fc +.Ft void * +.Fo osd_get +.Fa "u_int type" +.Fa "struct osd *osd" +.Fa "u_int slot" +.Fc +.Ft void +.Fo osd_del +.Fa "u_int type" +.Fa "struct osd *osd" +.Fa "u_int slot" +.Fc +.Ft int +.Fo osd_call +.Fa "u_int type" +.Fa "u_int method" +.Fa "void *obj" +.Fa "void *data" +.Fc +.Ft void +.Fo osd_exit +.Fa "u_int type" +.Fa "struct osd *osd" +.Fc +.Sh DESCRIPTION +The +.Nm +framework provides a mechanism to dynamically associate arbitrary data at +run-time with any kernel data structure which has been suitably modified for use +with +.Nm . +The one-off modification required involves embedding a +.Vt "struct osd" +inside the kernel data structure. +.Pp +An additional benefit is that after the initial change to a structure is made, +all subsequent use of +.Nm +with the structure involves no changes to the structure's layout. +By extension, if the data structure is part of the ABI, +.Nm +provides a way of extending the structure in an ABI preserving manner. +.Pp +The details of the embedded +.Vt "struct osd" +are not relevant to consumers of the +.Nm +framework and should not be manipulated directly. +.Pp +Data associated with a structure is referenced by the +.Nm +framework using a type/slot identifier pair. +Types are statically defined in +.In sys/osd.h +and provide a high-level grouping for slots to be registered under. +Slot identifiers are dynamically assigned by the framework when a data type is +registered using +.Fn osd_register +and remains valid until a corresponding call to +.Fn osd_deregister . +.Ss Functions +The +.Fn osd_register +function registers a type/slot identifier pair with the +.Nm +framework for use with a new data type. +The function may sleep and therefore cannot be called from a non-sleepable +context. +The +.Fa type +argument specifies which high-level type grouping from +.In sys/osd.h +the slot identifier should be allocated under. +The +.Fa destructor +argument specifies an optional osd_destructor_t function pointer that will be +called for objects of the type being registered which are later destroyed by the +.Fn osd_del +function. +NULL may be passed if no destructor is required. +The +.Fa methods +argument specifies an optional array of osd_method_t function pointers which +can be later invoked by the +.Fn osd_call +function. +NULL may be passed if no methods are required. +The +.Fa methods +argument is currently only useful with the OSD_JAIL type identifier. +.Pp +The +.Fn osd_deregister +function deregisters a previously registered type/slot identifier pair. +The function may sleep and therefore cannot be called from a non-sleepable +context. +The +.Fa type +argument specifies which high-level type grouping from +.In sys/osd.h +the slot identifier is allocated under. +The +.Fa slot +argument specifies the slot identifier which is being deregistered and should be +the value that was returned by +.Fn osd_register +when the data type was registered. +.Pp +The +.Fn osd_set +function associates a data object pointer with a kernel data structure's +.Vt struct osd +member. +The +.Fa type +argument specifies which high-level type grouping from +.In sys/osd.h +the slot identifier is allocated under. +The +.Fa osd +argument is a pointer to the kernel data structure's +.Vt struct osd +which will have the +.Fa value +pointer associated with it. +The +.Fa slot +argument specifies the slot identifier to assign the +.Fa value +pointer to. +The +.Fa value +argument points to a data object to associate with +.Fa osd . +.Pp +The +.Fn osd_get +function returns the data pointer associated with a kernel data structure's +.Vt struct osd +member from the specified type/slot identifier pair. +The +.Fa type +argument specifies which high-level type grouping from +.In sys/osd.h +the slot identifier is allocated under. +The +.Fa osd +argument is a pointer to the kernel data structure's +.Vt struct osd +to retrieve the data pointer from. +The +.Fa slot +argument specifies the slot identifier to retrieve the data pointer from. +.Pp +The +.Fn osd_del +function removes the data pointer associated with a kernel data structure's +.Vt struct osd +member from the specified type/slot identifier pair. +The +.Fa type +argument specifies which high-level type grouping from +.In sys/osd.h +the slot identifier is allocated under. +The +.Fa osd +argument is a pointer to the kernel data structure's +.Vt struct osd +to remove the data pointer from. +The +.Fa slot +argument specifies the slot identifier to remove the data pointer from. +If an osd_destructor_t function pointer was specified at registration time, the *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-projects@FreeBSD.ORG Thu Jan 27 16:47:33 2011 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5FC72106566C; Thu, 27 Jan 2011 16:47:33 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4B88D8FC1C; Thu, 27 Jan 2011 16:47:33 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0RGlXIh023862; Thu, 27 Jan 2011 16:47:33 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0RGlXNK023857; Thu, 27 Jan 2011 16:47:33 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201101271647.p0RGlXNK023857@svn.freebsd.org> From: Alexander Motin Date: Thu, 27 Jan 2011 16:47:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217947 - in projects/graid/7: lib/libcam sbin/camcontrol sys/cam sys/cam/ata sys/cam/scsi sys/conf sys/dev/ahci sys/dev/ata sys/dev/ata/chipsets sys/dev/siis sys/modules/cam X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Jan 2011 16:47:33 -0000 Author: mav Date: Thu Jan 27 16:47:33 2011 New Revision: 217947 URL: http://svn.freebsd.org/changeset/base/217947 Log: Resync ATA and CAM stuff with HEAD. Modified: projects/graid/7/lib/libcam/Makefile projects/graid/7/sbin/camcontrol/camcontrol.8 projects/graid/7/sbin/camcontrol/camcontrol.c projects/graid/7/sys/cam/ata/ata_xpt.c projects/graid/7/sys/cam/cam.c projects/graid/7/sys/cam/cam.h projects/graid/7/sys/cam/cam_ccb.h projects/graid/7/sys/cam/cam_periph.c projects/graid/7/sys/cam/cam_xpt.c projects/graid/7/sys/cam/cam_xpt_internal.h projects/graid/7/sys/cam/scsi/scsi_all.c projects/graid/7/sys/cam/scsi/scsi_all.h projects/graid/7/sys/cam/scsi/scsi_low.h projects/graid/7/sys/cam/scsi/scsi_pass.c projects/graid/7/sys/cam/scsi/scsi_target.c projects/graid/7/sys/cam/scsi/scsi_xpt.c projects/graid/7/sys/conf/files projects/graid/7/sys/dev/ahci/ahci.c projects/graid/7/sys/dev/ata/ata-all.c projects/graid/7/sys/dev/ata/ata-all.h projects/graid/7/sys/dev/ata/ata-disk.c projects/graid/7/sys/dev/ata/ata-dma.c projects/graid/7/sys/dev/ata/ata-lowlevel.c projects/graid/7/sys/dev/ata/ata-pci.h projects/graid/7/sys/dev/ata/ata-sata.c projects/graid/7/sys/dev/ata/chipsets/ata-ahci.c projects/graid/7/sys/dev/ata/chipsets/ata-cyrix.c projects/graid/7/sys/dev/ata/chipsets/ata-intel.c projects/graid/7/sys/dev/ata/chipsets/ata-marvell.c projects/graid/7/sys/dev/ata/chipsets/ata-national.c projects/graid/7/sys/dev/ata/chipsets/ata-promise.c projects/graid/7/sys/dev/ata/chipsets/ata-serverworks.c projects/graid/7/sys/dev/ata/chipsets/ata-siliconimage.c projects/graid/7/sys/dev/ata/chipsets/ata-via.c projects/graid/7/sys/dev/siis/siis.c projects/graid/7/sys/dev/siis/siis.h projects/graid/7/sys/modules/cam/Makefile Modified: projects/graid/7/lib/libcam/Makefile ============================================================================== --- projects/graid/7/lib/libcam/Makefile Thu Jan 27 16:10:25 2011 (r217946) +++ projects/graid/7/lib/libcam/Makefile Thu Jan 27 16:47:33 2011 (r217947) @@ -3,7 +3,7 @@ LIB= cam SHLIBDIR?= /lib SRCS= camlib.c scsi_cmdparse.c scsi_all.c scsi_da.c scsi_sa.c cam.c \ - ata_all.c + ata_all.c smp_all.c INCS= camlib.h DPADD= ${LIBSBUF} Modified: projects/graid/7/sbin/camcontrol/camcontrol.8 ============================================================================== --- projects/graid/7/sbin/camcontrol/camcontrol.8 Thu Jan 27 16:10:25 2011 (r217946) +++ projects/graid/7/sbin/camcontrol/camcontrol.8 Thu Jan 27 16:47:33 2011 (r217947) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 1, 2010 +.Dd November 30, 2010 .Dt CAMCONTROL 8 .Os .Sh NAME @@ -131,6 +131,43 @@ .Op Fl r Ar fmt .Ek .Nm +.Ic smpcmd +.Op device id +.Op generic args +.Aq Fl r Ar len Ar fmt Op args +.Aq Fl R Ar len Ar fmt Op args +.Nm +.Ic smprg +.Op device id +.Op generic args +.Op Fl l +.Nm +.Ic smppc +.Op device id +.Op generic args +.Aq Fl p Ar phy +.Op Fl l +.Op Fl o Ar operation +.Op Fl d Ar name +.Op Fl m Ar rate +.Op Fl M Ar rate +.Op Fl T Ar pp_timeout +.Op Fl a Ar enable|disable +.Op Fl A Ar enable|disable +.Op Fl s Ar enable|disable +.Op Fl S Ar enable|disable +.Nm +.Ic smpphylist +.Op device id +.Op generic args +.Op Fl l +.Op Fl q +.Nm +.Ic smpmaninfo +.Op device id +.Op generic args +.Op Fl l +.Nm .Ic debug .Op Fl I .Op Fl P @@ -207,9 +244,6 @@ A device identifier can take one of thre .Bl -tag -width 14n .It deviceUNIT Specify a device name and unit number combination, like "da5" or "cd3". -Note that character device node names (e.g.\& /dev/da0) are -.Em not -allowed here. .It bus:target Specify a bus number and target id. The bus number can be determined from @@ -557,6 +591,177 @@ If the format is .Sq - , 11 result registers will be written to standard output in hex. .El +.It Ic smpcmd +Allows the user to send an arbitrary Serial +Management Protocol (SMP) command to a device. +The +.Ic smpcmd +function requires the +.Fl r +argument to specify the SMP request to be sent, and the +.Fl R +argument to specify the format of the SMP response. +The syntax for the SMP request and response arguments is documented in +.Xr cam_cdbparse 3 . +.Pp +Note that SAS adapters that support SMP passthrough (at least the currently +known adapters) do not accept CRC bytes from the user in the request and do +not pass CRC bytes back to the user in the response. +Therefore users should not include the CRC bytes in the length of the +request and not expect CRC bytes to be returned in the response. +.Bl -tag -width 17n +.It Fl r Ar len Ar fmt Op args +This specifies the size of the SMP request, without the CRC bytes, and the +SMP request format. If the format is +.Sq - , +.Ar len +bytes of data will be read from standard input and written as the SMP +request. +.It Fl R Ar len Ar fmt Op args +This specifies the size of the buffer allocated for the SMP response, and +the SMP response format. +If the format is +.Sq - , +.Ar len +bytes of data will be allocated for the response and the response will be +written to standard output. +.El +.It Ic smprg +Allows the user to send the Serial Management Protocol (SMP) Report General +command to a device. +.Nm +will display the data returned by the Report General command. +If the SMP target supports the long response format, the additional data +will be requested and displayed automatically. +.Bl -tag -width 8n +.It Fl l +Request the long response format only. +Not all SMP targets support the long response format. +This option causes +.Nm +to skip sending the initial report general request without the long bit set +and only issue a report general request with the long bit set. +.El +.It Ic smppc +Allows the user to issue the Serial Management Protocol (SMP) PHY Control +command to a device. +This function should be used with some caution, as it can render devices +inaccessible, and could potentially cause data corruption as well. +The +.Fl p +argument is required to specify the PHY to operate on. +.Bl -tag -width 17n +.It Fl p Ar phy +Specify the PHY to operate on. +This argument is required. +.It Fl l +Request the long request/response format. +Not all SMP targets support the long response format. +For the PHY Control command, this currently only affects whether the +request length is set to a value other than 0. +.It Fl o Ar operation +Specify a PHY control operation. +Only one +.Fl o +operation may be specified. +The operation may be specified numerically (in decimal, hexadecimal, or octal) +or one of the following operation names may be specified: +.Bl -tag -width 16n +.It nop +No operation. +It is not necessary to specify this argument. +.It linkreset +Send the LINK RESET command to the phy. +.It hardreset +Send the HARD RESET command to the phy. +.It disable +Send the DISABLE command to the phy. +Note that the LINK RESET or HARD RESET commands should re-enable the phy. +.It clearerrlog +Send the CLEAR ERROR LOG command. +This clears the error log counters for the specified phy. +.It clearaffiliation +Send the CLEAR AFFILIATION command. +This clears the affiliation from the STP initiator port with the same SAS +address as the SMP initiator that requests the clear operation. +.It sataportsel +Send the TRANSMIT SATA PORT SELECTION SIGNAL command to the phy. +This will cause a SATA port selector to use the given phy as its active phy +and make the other phy inactive. +.It clearitnl +Send the CLEAR STP I_T NEXUS LOSS command to the PHY. +.It setdevname +Send the SET ATTACHED DEVICE NAME command to the PHY. +This requires the +.Fl d +argument to specify the device name. +.El +.It Fl d Ar name +Specify the attached device name. +This option is needed with the +.Fl o Ar setdevname +phy operation. +The name is a 64-bit number, and can be specified in decimal, hexadecimal +or octal format. +.It Fl m Ar rate +Set the minimum physical link rate for the phy. +This is a numeric argument. +Currently known link rates are: +.Bl -tag -width 5n +.It 0x0 +Do not change current value. +.It 0x8 +1.5 Gbps +.It 0x9 +3 Gbps +.It 0xa +6 Gbps +.El +.Pp +Other values may be specified for newer physical link rates. +.It Fl M Ar rate +Set the maximum physical link rate for the phy. +This is a numeric argument. +See the +.Fl m +argument description for known link rate arguments. +.It Fl T Ar pp_timeout +Set the partial pathway timeout value, in microseconds. +See the +.Tn ANSI +.Tn SAS +Protcol Layer (SPL) +specification for more information on this field. +.It Fl a Ar enable|disable +Enable or disable SATA slumber phy power conditions. +.It Fl A Ar enable|disable +Enable or disable SATA partial power conditions. +.It Fl s Ar enable|disable +Enable or disable SAS slumber phy power conditions. +.It Fl S Ar enable|disable +Enable or disable SAS partial phy power conditions. +.El +.It Ic smpphylist +List phys attached to a SAS expander, the address of the end device +attached to the phy, and the inquiry data for that device and peripheral +devices attached to that device. +The inquiry data and peripheral devices are displayed if available. +.Bl -tag -width 5n +.It Fl l +Turn on the long response format for the underlying SMP commands used for +this command. +.It Fl q +Only print out phys that are attached to a device in the CAM EDT (Existing +Device Table). +.El +.It Ic smpmaninfo +Send the SMP Report Manufacturer Information command to the device and +display the response. +.Bl -tag -width 5n +.It Fl l +Turn on the long response format for the underlying SMP commands used for +this command. +.El .It Ic debug Turn on CAM debugging printfs in the kernel. This requires options CAMDEBUG @@ -800,7 +1005,6 @@ The and .Fl y arguments can be useful for scripts. -.Pp .Bl -tag -width 6n .It Fl q Be quiet, do not print any status messages. @@ -893,7 +1097,6 @@ utility will report whether the disk is information if the command fails since the .Fl v switch was not specified. -.Pp .Bd -literal -offset indent camcontrol tur da1 -E -C 4 -t 50 -v .Ed @@ -920,7 +1123,6 @@ Display the buffer size of cd1, and display the first 10 bytes from the cache on cd1. Display SCSI sense information if the command fails. -.Pp .Bd -literal -offset indent camcontrol cmd -n cd -u 1 -v -c "3B 00 00 00 00 00 00 00 0e 00" \e -o 14 "00 00 00 00 1 2 3 4 5 6 v v v v" 7 8 9 8 @@ -933,7 +1135,6 @@ Print out sense information if the command fails. Be very careful with this command, improper use may cause data corruption. -.Pp .Bd -literal -offset indent camcontrol modepage da3 -m 1 -e -P 3 .Ed @@ -960,13 +1161,11 @@ changed. .Dl camcontrol tags da5 -N 24 .Pp Set the number of concurrent transactions for da5 to 24. -.Pp .Bd -literal -offset indent camcontrol negotiate -n da -u 4 -T disable .Ed .Pp Disable tagged queueing for da4. -.Pp .Bd -literal -offset indent camcontrol negotiate -n da -u 3 -R 20.000 -O 15 -a .Ed @@ -974,6 +1173,14 @@ camcontrol negotiate -n da -u 3 -R 20.00 Negotiate a sync rate of 20MHz and an offset of 15 with da3. Then send a Test Unit Ready command to make the settings take effect. +.Pp +.Bd -literal -offset indent +camcontrol smpcmd ses0 -v -r 4 "40 0 00 0" -R 1020 "s9 i1" +.Ed +.Pp +Send the SMP REPORT GENERAL command to ses0, and display the number of PHYs +it contains. +Display SMP errors if the command fails. .Sh SEE ALSO .Xr cam 3 , .Xr cam_cdbparse 3 , Modified: projects/graid/7/sbin/camcontrol/camcontrol.c ============================================================================== --- projects/graid/7/sbin/camcontrol/camcontrol.c Thu Jan 27 16:10:25 2011 (r217946) +++ projects/graid/7/sbin/camcontrol/camcontrol.c Thu Jan 27 16:47:33 2011 (r217947) @@ -33,11 +33,14 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include #include +#include +#include #include #include #include @@ -50,6 +53,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include "camcontrol.h" @@ -77,7 +81,12 @@ typedef enum { CAM_CMD_IDENTIFY = 0x00000013, CAM_CMD_IDLE = 0x00000014, CAM_CMD_STANDBY = 0x00000015, - CAM_CMD_SLEEP = 0x00000016 + CAM_CMD_SLEEP = 0x00000016, + CAM_CMD_SMP_CMD = 0x00000017, + CAM_CMD_SMP_RG = 0x00000018, + CAM_CMD_SMP_PC = 0x00000019, + CAM_CMD_SMP_PHYLIST = 0x0000001a, + CAM_CMD_SMP_MANINFO = 0x0000001b } cam_cmdmask; typedef enum { @@ -117,7 +126,7 @@ typedef enum { struct camcontrol_opts { const char *optname; - cam_cmdmask cmdnum; + uint32_t cmdnum; cam_argmask argnum; const char *subopt; }; @@ -126,6 +135,9 @@ struct camcontrol_opts { static const char scsicmd_opts[] = "a:c:dfi:o:r"; static const char readdefect_opts[] = "f:GP"; static const char negotiate_opts[] = "acD:M:O:qR:T:UW:"; +static const char smprg_opts[] = "l"; +static const char smppc_opts[] = "a:A:d:lm:M:o:p:s:S:T:"; +static const char smpphylist_opts[] = "lq"; #endif struct camcontrol_opts option_table[] = { @@ -145,6 +157,14 @@ struct camcontrol_opts option_table[] = #ifndef MINIMALISTIC {"cmd", CAM_CMD_SCSI_CMD, CAM_ARG_NONE, scsicmd_opts}, {"command", CAM_CMD_SCSI_CMD, CAM_ARG_NONE, scsicmd_opts}, + {"smpcmd", CAM_CMD_SMP_CMD, CAM_ARG_NONE, "r:R:"}, + {"smprg", CAM_CMD_SMP_RG, CAM_ARG_NONE, smprg_opts}, + {"smpreportgeneral", CAM_CMD_SMP_RG, CAM_ARG_NONE, smprg_opts}, + {"smppc", CAM_CMD_SMP_PC, CAM_ARG_NONE, smppc_opts}, + {"smpphycontrol", CAM_CMD_SMP_PC, CAM_ARG_NONE, smppc_opts}, + {"smpplist", CAM_CMD_SMP_PHYLIST, CAM_ARG_NONE, smpphylist_opts}, + {"smpphylist", CAM_CMD_SMP_PHYLIST, CAM_ARG_NONE, smpphylist_opts}, + {"smpmaninfo", CAM_CMD_SMP_MANINFO, CAM_ARG_NONE, "l"}, {"defects", CAM_CMD_READ_DEFECTS, CAM_ARG_NONE, readdefect_opts}, {"defectlist", CAM_CMD_READ_DEFECTS, CAM_ARG_NONE, readdefect_opts}, #endif /* MINIMALISTIC */ @@ -173,11 +193,25 @@ typedef enum { CC_OR_FOUND } camcontrol_optret; +struct cam_devitem { + struct device_match_result dev_match; + int num_periphs; + struct periph_match_result *periph_matches; + struct scsi_vpd_device_id *device_id; + int device_id_len; + STAILQ_ENTRY(cam_devitem) links; +}; + +struct cam_devlist { + STAILQ_HEAD(, cam_devitem) dev_queue; + path_id_t path_id; +}; + cam_cmdmask cmdlist; cam_argmask arglist; - -camcontrol_optret getoption(char *arg, cam_cmdmask *cmdnum, cam_argmask *argnum, +camcontrol_optret getoption(struct camcontrol_opts *table, char *arg, + uint32_t *cmdnum, cam_argmask *argnum, const char **subopt); #ifndef MINIMALISTIC static int getdevlist(struct cam_device *device); @@ -206,6 +240,21 @@ static void modepage(struct cam_device * char *combinedopt, int retry_count, int timeout); static int scsicmd(struct cam_device *device, int argc, char **argv, char *combinedopt, int retry_count, int timeout); +static int smpcmd(struct cam_device *device, int argc, char **argv, + char *combinedopt, int retry_count, int timeout); +static int smpreportgeneral(struct cam_device *device, int argc, char **argv, + char *combinedopt, int retry_count, int timeout); +static int smpphycontrol(struct cam_device *device, int argc, char **argv, + char *combinedopt, int retry_count, int timeout); +static int smpmaninfo(struct cam_device *device, int argc, char **argv, + char *combinedopt, int retry_count, int timeout); +static int getdevid(struct cam_devitem *item); +static int buildbusdevlist(struct cam_devlist *devlist); +static void freebusdevlist(struct cam_devlist *devlist); +static struct cam_devitem *findsasdevice(struct cam_devlist *devlist, + uint64_t sasaddr); +static int smpphylist(struct cam_device *device, int argc, char **argv, + char *combinedopt, int retry_count, int timeout); static int tagcontrol(struct cam_device *device, int argc, char **argv, char *combinedopt); static void cts_print(struct cam_device *device, @@ -234,13 +283,13 @@ static int atapm(struct cam_device *devi #endif camcontrol_optret -getoption(char *arg, cam_cmdmask *cmdnum, cam_argmask *argnum, - const char **subopt) +getoption(struct camcontrol_opts *table, char *arg, uint32_t *cmdnum, + cam_argmask *argnum, const char **subopt) { struct camcontrol_opts *opts; int num_matches = 0; - for (opts = option_table; (opts != NULL) && (opts->optname != NULL); + for (opts = table; (opts != NULL) && (opts->optname != NULL); opts++) { if (strncmp(opts->optname, arg, strlen(arg)) == 0) { *cmdnum = opts->cmdnum; @@ -1526,6 +1575,7 @@ rescan_or_reset_bus(int bus, int rescan) bzero(&(&matchccb.ccb_h)[1], sizeof(struct ccb_dev_match) - sizeof(struct ccb_hdr)); matchccb.ccb_h.func_code = XPT_DEV_MATCH; + matchccb.ccb_h.path_id = CAM_BUS_WILDCARD; bufsize = sizeof(struct dev_match_result) * 20; matchccb.cdm.match_buf_len = bufsize; matchccb.cdm.matches=(struct dev_match_result *)malloc(bufsize); @@ -2454,10 +2504,12 @@ scsicmd(struct cam_device *device, int a if (((retval = cam_send_ccb(device, ccb)) < 0) || ((ccb->ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP)) { + const char *warnstr = "error sending command"; + if (retval < 0) - warn("error sending command"); + warn(warnstr); else - warnx("error sending command"); + warnx(warnstr); if (arglist & CAM_ARG_VERBOSE) { cam_error_print(device, ccb, CAM_ESF_ALL, @@ -4273,121 +4325,1359 @@ bailout: } static int -atapm(struct cam_device *device, int argc, char **argv, - char *combinedopt, int retry_count, int timeout) +smpcmd(struct cam_device *device, int argc, char **argv, char *combinedopt, + int retry_count, int timeout) { + int c, error; union ccb *ccb; - int retval = 0; - int t = -1; - int c; - u_char cmd, sc; + uint8_t *smp_request = NULL, *smp_response = NULL; + int request_size = 0, response_size = 0; + int fd_request = 0, fd_response = 0; + char *datastr = NULL; + struct get_hook hook; + int retval; + int flags = 0; + /* + * Note that at the moment we don't support sending SMP CCBs to + * devices that aren't probed by CAM. + */ ccb = cam_getccb(device); - if (ccb == NULL) { - warnx("%s: error allocating ccb", __func__); + warnx("%s: error allocating CCB", __func__); return (1); } + bzero(&(&ccb->ccb_h)[1], + sizeof(union ccb) - sizeof(struct ccb_hdr)); + while ((c = getopt(argc, argv, combinedopt)) != -1) { switch (c) { - case 't': - t = atoi(optarg); + case 'R': + arglist |= CAM_ARG_CMD_IN; + response_size = strtol(optarg, NULL, 0); + if (response_size <= 0) { + warnx("invalid number of response bytes %d", + response_size); + error = 1; + goto smpcmd_bailout; + } + hook.argc = argc - optind; + hook.argv = argv + optind; + hook.got = 0; + optind++; + datastr = cget(&hook, NULL); + /* + * If the user supplied "-" instead of a format, he + * wants the data to be written to stdout. + */ + if ((datastr != NULL) + && (datastr[0] == '-')) + fd_response = 1; + + smp_response = (u_int8_t *)malloc(response_size); + if (smp_response == NULL) { + warn("can't malloc memory for SMP response"); + error = 1; + goto smpcmd_bailout; + } + break; + case 'r': + arglist |= CAM_ARG_CMD_OUT; + request_size = strtol(optarg, NULL, 0); + if (request_size <= 0) { + warnx("invalid number of request bytes %d", + request_size); + error = 1; + goto smpcmd_bailout; + } + hook.argc = argc - optind; + hook.argv = argv + optind; + hook.got = 0; + datastr = cget(&hook, NULL); + smp_request = (u_int8_t *)malloc(request_size); + if (smp_request == NULL) { + warn("can't malloc memory for SMP request"); + error = 1; + goto smpcmd_bailout; + } + bzero(smp_request, request_size); + /* + * If the user supplied "-" instead of a format, he + * wants the data to be read from stdin. + */ + if ((datastr != NULL) + && (datastr[0] == '-')) + fd_request = 1; + else + buff_encode_visit(smp_request, request_size, + datastr, + iget, &hook); + optind += hook.got; break; default: break; } } - if (strcmp(argv[1], "idle") == 0) { - if (t == -1) - cmd = ATA_IDLE_IMMEDIATE; - else - cmd = ATA_IDLE_CMD; - } else if (strcmp(argv[1], "standby") == 0) { - if (t == -1) - cmd = ATA_STANDBY_IMMEDIATE; - else - cmd = ATA_STANDBY_CMD; - } else { - cmd = ATA_SLEEP; - t = -1; + + /* + * If fd_data is set, and we're writing to the device, we need to + * read the data the user wants written from stdin. + */ + if ((fd_request == 1) && (arglist & CAM_ARG_CMD_OUT)) { + ssize_t amt_read; + int amt_to_read = request_size; + u_int8_t *buf_ptr = smp_request; + + for (amt_read = 0; amt_to_read > 0; + amt_read = read(STDIN_FILENO, buf_ptr, amt_to_read)) { + if (amt_read == -1) { + warn("error reading data from stdin"); + error = 1; + goto smpcmd_bailout; + } + amt_to_read -= amt_read; + buf_ptr += amt_read; + } } - if (t < 0) - sc = 0; - else if (t <= (240 * 5)) - sc = t / 5; - else if (t <= (11 * 30 * 60)) - sc = t / (30 * 60) + 241; - else - sc = 253; - cam_fill_ataio(&ccb->ataio, - retry_count, - NULL, - /*flags*/CAM_DIR_NONE, - MSG_SIMPLE_Q_TAG, - /*data_ptr*/NULL, - /*dxfer_len*/0, - timeout ? timeout : 30 * 1000); - ata_28bit_cmd(&ccb->ataio, cmd, 0, 0, sc); - /* Disable freezing the device queue */ - ccb->ccb_h.flags |= CAM_DEV_QFRZDIS; + if (((arglist & CAM_ARG_CMD_IN) == 0) + || ((arglist & CAM_ARG_CMD_OUT) == 0)) { + warnx("%s: need both the request (-r) and response (-R) " + "arguments", __func__); + error = 1; + goto smpcmd_bailout; + } - if (arglist & CAM_ARG_ERR_RECOVER) - ccb->ccb_h.flags |= CAM_PASS_ERR_RECOVER; + flags |= CAM_DEV_QFRZDIS; - if (cam_send_ccb(device, ccb) < 0) { - warn("error sending command"); + cam_fill_smpio(&ccb->smpio, + /*retries*/ retry_count, + /*cbfcnp*/ NULL, + /*flags*/ flags, + /*smp_request*/ smp_request, + /*smp_request_len*/ request_size, + /*smp_response*/ smp_response, + /*smp_response_len*/ response_size, + /*timeout*/ timeout ? timeout : 5000); - if (arglist & CAM_ARG_VERBOSE) + ccb->smpio.flags = SMP_FLAG_NONE; + + if (((retval = cam_send_ccb(device, ccb)) < 0) + || ((ccb->ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP)) { + const char *warnstr = "error sending command"; + + if (retval < 0) + warn(warnstr); + else + warnx(warnstr); + + if (arglist & CAM_ARG_VERBOSE) { cam_error_print(device, ccb, CAM_ESF_ALL, CAM_EPF_ALL, stderr); + } + } - retval = 1; + if (((ccb->ccb_h.status & CAM_STATUS_MASK) == CAM_REQ_CMP) + && (response_size > 0)) { + if (fd_response == 0) { + buff_decode_visit(smp_response, response_size, + datastr, arg_put, NULL); + fprintf(stdout, "\n"); + } else { + ssize_t amt_written; + int amt_to_write = response_size; + u_int8_t *buf_ptr = smp_response; + + for (amt_written = 0; (amt_to_write > 0) && + (amt_written = write(STDOUT_FILENO, buf_ptr, + amt_to_write)) > 0;){ + amt_to_write -= amt_written; + buf_ptr += amt_written; + } + if (amt_written == -1) { + warn("error writing data to stdout"); + error = 1; + goto smpcmd_bailout; + } else if ((amt_written == 0) + && (amt_to_write > 0)) { + warnx("only wrote %u bytes out of %u", + response_size - amt_to_write, + response_size); + } + } + } +smpcmd_bailout: + if (ccb != NULL) + cam_freeccb(ccb); + + if (smp_request != NULL) + free(smp_request); + + if (smp_response != NULL) + free(smp_response); + + return (error); +} + +static int +smpreportgeneral(struct cam_device *device, int argc, char **argv, + char *combinedopt, int retry_count, int timeout) +{ + union ccb *ccb; + struct smp_report_general_request *request = NULL; + struct smp_report_general_response *response = NULL; + struct sbuf *sb = NULL; + int error = 0; + int c, long_response = 0; + int retval; + + /* + * Note that at the moment we don't support sending SMP CCBs to + * devices that aren't probed by CAM. + */ + ccb = cam_getccb(device); + if (ccb == NULL) { + warnx("%s: error allocating CCB", __func__); + return (1); + } + + bzero(&(&ccb->ccb_h)[1], + sizeof(union ccb) - sizeof(struct ccb_hdr)); + + while ((c = getopt(argc, argv, combinedopt)) != -1) { + switch (c) { + case 'l': + long_response = 1; + break; + default: + break; + } + } + request = malloc(sizeof(*request)); + if (request == NULL) { + warn("%s: unable to allocate %zd bytes", __func__, + sizeof(*request)); + error = 1; goto bailout; } - if ((ccb->ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP) { - cam_error_print(device, ccb, CAM_ESF_ALL, CAM_EPF_ALL, stderr); - retval = 1; + response = malloc(sizeof(*response)); + if (response == NULL) { + warn("%s: unable to allocate %zd bytes", __func__, + sizeof(*response)); + error = 1; + goto bailout; + } + +try_long: + smp_report_general(&ccb->smpio, + retry_count, + /*cbfcnp*/ NULL, + request, + /*request_len*/ sizeof(*request), + (uint8_t *)response, + /*response_len*/ sizeof(*response), + /*long_response*/ long_response, + timeout); + + if (((retval = cam_send_ccb(device, ccb)) < 0) + || ((ccb->ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP)) { + const char *warnstr = "error sending command"; + + if (retval < 0) + warn(warnstr); + else + warnx(warnstr); + + if (arglist & CAM_ARG_VERBOSE) { + cam_error_print(device, ccb, CAM_ESF_ALL, + CAM_EPF_ALL, stderr); + } + error = 1; + goto bailout; + } + + /* + * If the device supports the long response bit, try again and see + * if we can get all of the data. + */ + if ((response->long_response & SMP_RG_LONG_RESPONSE) + && (long_response == 0)) { + ccb->ccb_h.status = CAM_REQ_INPROG; + bzero(&(&ccb->ccb_h)[1], + sizeof(union ccb) - sizeof(struct ccb_hdr)); + long_response = 1; + goto try_long; + } + + /* + * XXX KDM detect and decode SMP errors here. + */ + sb = sbuf_new_auto(); + if (sb == NULL) { + warnx("%s: error allocating sbuf", __func__); goto bailout; } + + smp_report_general_sbuf(response, sizeof(*response), sb); + + sbuf_finish(sb); + + printf("%s", sbuf_data(sb)); + bailout: - cam_freeccb(ccb); - return (retval); + if (ccb != NULL) + cam_freeccb(ccb); + + if (request != NULL) + free(request); + + if (response != NULL) + free(response); + + if (sb != NULL) + sbuf_delete(sb); + + return (error); } -#endif /* MINIMALISTIC */ +struct camcontrol_opts phy_ops[] = { + {"nop", SMP_PC_PHY_OP_NOP, CAM_ARG_NONE, NULL}, + {"linkreset", SMP_PC_PHY_OP_LINK_RESET, CAM_ARG_NONE, NULL}, + {"hardreset", SMP_PC_PHY_OP_HARD_RESET, CAM_ARG_NONE, NULL}, + {"disable", SMP_PC_PHY_OP_DISABLE, CAM_ARG_NONE, NULL}, + {"clearerrlog", SMP_PC_PHY_OP_CLEAR_ERR_LOG, CAM_ARG_NONE, NULL}, + {"clearaffiliation", SMP_PC_PHY_OP_CLEAR_AFFILIATON, CAM_ARG_NONE,NULL}, + {"sataportsel", SMP_PC_PHY_OP_TRANS_SATA_PSS, CAM_ARG_NONE, NULL}, + {"clearitnl", SMP_PC_PHY_OP_CLEAR_STP_ITN_LS, CAM_ARG_NONE, NULL}, + {"setdevname", SMP_PC_PHY_OP_SET_ATT_DEV_NAME, CAM_ARG_NONE, NULL}, + {NULL, 0, 0, NULL} +}; -void -usage(int verbose) +static int +smpphycontrol(struct cam_device *device, int argc, char **argv, + char *combinedopt, int retry_count, int timeout) { - fprintf(verbose ? stdout : stderr, -"usage: camcontrol [device id][generic args][command args]\n" -" camcontrol devlist [-v]\n" -#ifndef MINIMALISTIC -" camcontrol periphlist [dev_id][-n dev_name] [-u unit]\n" -" camcontrol tur [dev_id][generic args]\n" -" camcontrol inquiry [dev_id][generic args] [-D] [-S] [-R]\n" -" camcontrol identify [dev_id][generic args] [-v]\n" -" camcontrol reportluns [dev_id][generic args] [-c] [-l] [-r report]\n" -" camcontrol readcap [dev_id][generic args] [-b] [-h] [-H] [-N]\n" -" [-q] [-s]\n" -" camcontrol start [dev_id][generic args]\n" -" camcontrol stop [dev_id][generic args]\n" -" camcontrol load [dev_id][generic args]\n" -" camcontrol eject [dev_id][generic args]\n" -#endif /* MINIMALISTIC */ -" camcontrol rescan \n" -" camcontrol reset \n" -#ifndef MINIMALISTIC -" camcontrol defects [dev_id][generic args] <-f format> [-P][-G]\n" -" camcontrol modepage [dev_id][generic args] <-m page | -l>\n" -" [-P pagectl][-e | -b][-d]\n" -" camcontrol cmd [dev_id][generic args]\n" -" <-a cmd [args] | -c cmd [args]>\n" -" [-d] [-f] [-i len fmt|-o len fmt [args]] [-r fmt]\n" -" camcontrol debug [-I][-P][-T][-S][-X][-c]\n" + union ccb *ccb; + struct smp_phy_control_request *request = NULL; + struct smp_phy_control_response *response = NULL; + int long_response = 0; + int retval = 0; + int phy = -1; + uint32_t phy_operation = SMP_PC_PHY_OP_NOP; + int phy_op_set = 0; + uint64_t attached_dev_name = 0; + int dev_name_set = 0; + uint32_t min_plr = 0, max_plr = 0; + uint32_t pp_timeout_val = 0; + int slumber_partial = 0; + int set_pp_timeout_val = 0; + int c; + + /* + * Note that at the moment we don't support sending SMP CCBs to + * devices that aren't probed by CAM. + */ + ccb = cam_getccb(device); + if (ccb == NULL) { + warnx("%s: error allocating CCB", __func__); + return (1); + } + + bzero(&(&ccb->ccb_h)[1], + sizeof(union ccb) - sizeof(struct ccb_hdr)); + + while ((c = getopt(argc, argv, combinedopt)) != -1) { + switch (c) { + case 'a': + case 'A': + case 's': + case 'S': { + int enable = -1; + + if (strcasecmp(optarg, "enable") == 0) + enable = 1; + else if (strcasecmp(optarg, "disable") == 0) + enable = 2; + else { + warnx("%s: Invalid argument %s", __func__, + optarg); + retval = 1; + goto bailout; + } + switch (c) { + case 's': + slumber_partial |= enable << + SMP_PC_SAS_SLUMBER_SHIFT; + break; + case 'S': + slumber_partial |= enable << + SMP_PC_SAS_PARTIAL_SHIFT; + break; + case 'a': + slumber_partial |= enable << + SMP_PC_SATA_SLUMBER_SHIFT; + break; + case 'A': + slumber_partial |= enable << + SMP_PC_SATA_PARTIAL_SHIFT; + break; + default: + warnx("%s: programmer error", __func__); + retval = 1; + goto bailout; + break; /*NOTREACHED*/ + } + break; + } + case 'd': + attached_dev_name = (uintmax_t)strtoumax(optarg, + NULL,0); + dev_name_set = 1; + break; + case 'l': + long_response = 1; + break; + case 'm': + /* + * We don't do extensive checking here, so this + * will continue to work when new speeds come out. + */ + min_plr = strtoul(optarg, NULL, 0); + if ((min_plr == 0) + || (min_plr > 0xf)) { + warnx("%s: invalid link rate %x", + __func__, min_plr); + retval = 1; + goto bailout; + } + break; + case 'M': + /* + * We don't do extensive checking here, so this + * will continue to work when new speeds come out. + */ + max_plr = strtoul(optarg, NULL, 0); + if ((max_plr == 0) + || (max_plr > 0xf)) { *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-projects@FreeBSD.ORG Thu Jan 27 19:14:17 2011 Return-Path: Delivered-To: svn-src-projects@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D36181065670; Thu, 27 Jan 2011 19:14:17 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85]) by mx1.freebsd.org (Postfix) with ESMTP id 709E68FC0A; Thu, 27 Jan 2011 19:14:17 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by harmony.bsdimp.com (8.14.3/8.14.1) with ESMTP id p0RJ8AYw079074; Thu, 27 Jan 2011 12:08:10 -0700 (MST) (envelope-from imp@bsdimp.com) Message-ID: <4D41C29A.5020100@bsdimp.com> Date: Thu, 27 Jan 2011 12:08:10 -0700 From: Warner Losh User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.2.13) Gecko/20101211 Thunderbird/3.1.7 MIME-Version: 1.0 To: "Robert N. M. Watson" References: <201101251534.p0PFY7cF039182@svn.freebsd.org> <4D3FED31.8040304@FreeBSD.org> <1296054407.19051.5.camel@bauer.cse.buffalo.edu> <201101261042.38218.jhb@freebsd.org> <7FD27004-581F-4FED-858D-5819562CF111@freebsd.org> In-Reply-To: <7FD27004-581F-4FED-858D-5819562CF111@freebsd.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: src-committers@FreeBSD.org, Pawel Jakub Dawidek , John Baldwin , Ken Smith , Alexander Motin , svn-src-projects@FreeBSD.org Subject: Re: svn commit: r217828 - projects/graid/head/sys/geom/raid X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Jan 2011 19:14:17 -0000 On 01/26/2011 08:45, Robert N. M. Watson wrote: > On 26 Jan 2011, at 15:42, John Baldwin wrote: > >> On Wednesday, January 26, 2011 10:06:47 am Ken Smith wrote: >>> On Wed, 2011-01-26 at 11:45 +0200, Alexander Motin wrote: >>>> Those who want maximum robustness should use dedicated >>>> drive on the most trivial dedicated controller to make dumping reliable. >>>> If we are going above that - there are always some compromises. >>> Please remember this statement when I change dumpdev from "AUTO" >>> to "NO" in /etc/defaults/rc.conf shortly after branching stable/9. :-) >> No, I still think this is the wrong answer. Kernel dumps are not inherently >> unreliable to the point that we should not enable them by default. However, >> turning dumps off is a good way to prevent developers from debugging non- >> trivial bugs that are only triggered under real-world workloads. >> >> I think we should strive to make our dumps as reliable as possible, but >> nothing in our system is perfect (hence bugs), and if we are going to require >> absolute perfection for kernel dumps before enabling them by default then we >> might as well not ship anything at all as I can _ensure_ you the rest of the >> system we ship is _not_ absolutely perfect. > I think the real constraint on shipping with dumps enabled remains a disk space consideration. If you have a problem triggering a kernel bug, you're going to generate quite a few crash dumps in short order, and for many users, that result is not good. But the answer there may be better savecore behaviour: perhaps we should keep the last (n) (where n is small -- perhaps 2) dumps by default, with a way to mark dumps that should be saved longer. minidumps have made the world better in some ways, I can't help wonder whether that could be refined further... I don't suppose there's a way that savecore could be hacked to convert a 'full' dump into a 'mini' dump? Warner From owner-svn-src-projects@FreeBSD.ORG Thu Jan 27 19:56:16 2011 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 804FB106566B; Thu, 27 Jan 2011 19:56:16 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6FDFC8FC17; Thu, 27 Jan 2011 19:56:16 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0RJuGsk033257; Thu, 27 Jan 2011 19:56:16 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0RJuG0f033255; Thu, 27 Jan 2011 19:56:16 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201101271956.p0RJuG0f033255@svn.freebsd.org> From: Warner Losh Date: Thu, 27 Jan 2011 19:56:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217972 - projects/graid/head/sys/geom/raid X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Jan 2011 19:56:16 -0000 Author: imp Date: Thu Jan 27 19:56:15 2011 New Revision: 217972 URL: http://svn.freebsd.org/changeset/base/217972 Log: Improvements: (1) Move bio into trso so we don't have to allocate/free it all the time. Saves on error recovery hassles if we can't allocate a bio. (2) Interlock while we're doing things, so we don't duplicate each slab of work. (3) Update metadata after each bundle of slabs. (mav: please comment on frequency) (4) Transition state to active when we successfully # this makes things a little more robust, but more work there is needed Modified: projects/graid/head/sys/geom/raid/tr_raid1.c Modified: projects/graid/head/sys/geom/raid/tr_raid1.c ============================================================================== --- projects/graid/head/sys/geom/raid/tr_raid1.c Thu Jan 27 19:38:03 2011 (r217971) +++ projects/graid/head/sys/geom/raid/tr_raid1.c Thu Jan 27 19:56:15 2011 (r217972) @@ -62,6 +62,8 @@ static MALLOC_DEFINE(M_TR_raid1, "tr_rai #define TR_RAID1_REBUILD 1 #define TR_RAID1_RESYNC 2 +#define TR_RAID1_F_DOING_SOME 0x1 + struct g_raid_tr_raid1_object { struct g_raid_tr_object trso_base; int trso_starting; @@ -69,9 +71,11 @@ struct g_raid_tr_raid1_object { int trso_type; int trso_recover_slabs; /* might need to be more */ int trso_fair_io; + int trso_flags; struct g_raid_subdisk *trso_good_sd; /* specific rather than per tr */ struct g_raid_subdisk *trso_failed_sd;/* like per volume */ void *trso_buffer; /* Buffer space */ + struct bio trso_bio; }; static g_raid_tr_taste_t g_raid_tr_taste_raid1; @@ -106,6 +110,8 @@ static struct g_raid_tr_class g_raid_tr_ static void g_raid_tr_raid1_rebuild_abort(struct g_raid_tr_object *tr, struct g_raid_volume *vol); +static void g_raid_tr_raid1_maybe_rebuild(struct g_raid_tr_object *tr, + struct g_raid_volume *vol); static int g_raid_tr_taste_raid1(struct g_raid_tr_object *tr, struct g_raid_volume *volume) @@ -120,6 +126,40 @@ g_raid_tr_taste_raid1(struct g_raid_tr_o return (G_RAID_TR_TASTE_SUCCEED); } +static int +g_raid_tr_update_state_raid1(struct g_raid_volume *vol) +{ + struct g_raid_tr_raid1_object *trs; + u_int s; + int n; + + trs = (struct g_raid_tr_raid1_object *)vol->v_tr; + if (trs->trso_stopped) + s = G_RAID_VOLUME_S_STOPPED; + else { + n = g_raid_nsubdisks(vol, G_RAID_SUBDISK_S_ACTIVE); + if (n == vol->v_disks_count) { + s = G_RAID_VOLUME_S_OPTIMAL; + trs->trso_starting = 0; + } else { + if (trs->trso_starting) + s = G_RAID_VOLUME_S_STARTING; + else if (n > 0) + s = G_RAID_VOLUME_S_DEGRADED; + else + s = G_RAID_VOLUME_S_BROKEN; + } + } + g_raid_tr_raid1_maybe_rebuild(vol->v_tr, vol); + if (s != vol->v_state) { + g_raid_event_send(vol, G_RAID_VOLUME_S_ALIVE(s) ? + G_RAID_VOLUME_E_UP : G_RAID_VOLUME_E_DOWN, + G_RAID_EVENT_VOLUME); + g_raid_change_volume_state(vol, s); + } + return (0); +} + static void g_raid_tr_raid1_rebuild_some(struct g_raid_tr_object *tr, struct g_raid_subdisk *sd) @@ -127,11 +167,13 @@ g_raid_tr_raid1_rebuild_some(struct g_ra struct g_raid_tr_raid1_object *trs; struct bio *bp, *bp2; -/* XXX need interlock here? */ trs = (struct g_raid_tr_raid1_object *)tr; + if (trs->trso_flags & TR_RAID1_F_DOING_SOME) + return; + trs->trso_flags |= TR_RAID1_F_DOING_SOME; trs->trso_recover_slabs = SD_REBUILD_CLUSTER_IDLE; trs->trso_fair_io = SD_REBUILD_FAIR_IO; - bp = g_new_bio(); + bp = &trs->trso_bio; bp->bio_offset = sd->sd_rebuild_pos; bp->bio_length = MIN(SD_REBUILD_SLAB, sd->sd_volume->v_mediasize - sd->sd_rebuild_pos); @@ -167,26 +209,35 @@ static void g_raid_tr_raid1_rebuild_finish(struct g_raid_tr_object *tr, struct g_raid_volume *vol) { struct g_raid_tr_raid1_object *trs; + struct g_raid_subdisk *sd; trs = (struct g_raid_tr_raid1_object *)tr; + sd = trs->trso_failed_sd; + g_raid_change_subdisk_state(sd, G_RAID_SUBDISK_S_ACTIVE); + g_raid_tr_update_state_raid1(vol); + g_raid_write_metadata(vol->v_softc, vol, sd, sd->sd_disk); free(trs->trso_buffer, M_TR_raid1); + trs->trso_flags &= ~TR_RAID1_F_DOING_SOME; trs->trso_recover_slabs = 0; trs->trso_failed_sd = NULL; trs->trso_good_sd = NULL; trs->trso_buffer = NULL; vol->v_timeout = 0; - /* xxx transition array? */ } static void -g_raid_tr_raid1_rebuild_abort(struct g_raid_tr_object *tr, struct g_raid_volume *vol) +g_raid_tr_raid1_rebuild_abort(struct g_raid_tr_object *tr, + struct g_raid_volume *vol) { struct g_raid_tr_raid1_object *trs; + struct g_raid_subdisk *sd; trs = (struct g_raid_tr_raid1_object *)tr; - g_raid_unlock_range(tr->tro_volume, - trs->trso_failed_sd->sd_rebuild_pos, SD_REBUILD_SLAB); + sd = trs->trso_failed_sd; + g_raid_unlock_range(tr->tro_volume,sd->sd_rebuild_pos, SD_REBUILD_SLAB); + g_raid_write_metadata(vol->v_softc, vol, sd, sd->sd_disk); free(trs->trso_buffer, M_TR_raid1); + trs->trso_flags &= ~TR_RAID1_F_DOING_SOME; trs->trso_recover_slabs = 0; trs->trso_failed_sd = NULL; trs->trso_good_sd = NULL; @@ -271,40 +322,6 @@ g_raid_tr_raid1_maybe_rebuild(struct g_r } static int -g_raid_tr_update_state_raid1(struct g_raid_volume *vol) -{ - struct g_raid_tr_raid1_object *trs; - u_int s; - int n; - - trs = (struct g_raid_tr_raid1_object *)vol->v_tr; - if (trs->trso_stopped) - s = G_RAID_VOLUME_S_STOPPED; - else { - n = g_raid_nsubdisks(vol, G_RAID_SUBDISK_S_ACTIVE); - if (n == vol->v_disks_count) { - s = G_RAID_VOLUME_S_OPTIMAL; - trs->trso_starting = 0; - } else { - if (trs->trso_starting) - s = G_RAID_VOLUME_S_STARTING; - else if (n > 0) - s = G_RAID_VOLUME_S_DEGRADED; - else - s = G_RAID_VOLUME_S_BROKEN; - } - } - g_raid_tr_raid1_maybe_rebuild(vol->v_tr, vol); - if (s != vol->v_state) { - g_raid_event_send(vol, G_RAID_VOLUME_S_ALIVE(s) ? - G_RAID_VOLUME_E_UP : G_RAID_VOLUME_E_DOWN, - G_RAID_EVENT_VOLUME); - g_raid_change_volume_state(vol, s); - } - return (0); -} - -static int g_raid_tr_event_raid1(struct g_raid_tr_object *tr, struct g_raid_subdisk *sd, u_int event) { @@ -558,7 +575,7 @@ g_raid_tr_iodone_raid1(struct g_raid_tr_ bp->bio_error); if (bp->bio_error != 0) { g_raid_tr_raid1_rebuild_abort(tr, vol); - goto out; + return; } cbp = g_clone_bio(pbp); cbp->bio_cmd = BIO_WRITE; @@ -582,7 +599,6 @@ g_raid_tr_iodone_raid1(struct g_raid_tr_ "rebuild write done. Error %d", bp->bio_error); if (bp->bio_error != 0) { g_raid_tr_raid1_rebuild_abort(tr, vol); - g_destroy_bio(pbp); return; } /* XXX A lot of the following is needed when we kick of the work -- refactor */ @@ -592,11 +608,13 @@ g_raid_tr_iodone_raid1(struct g_raid_tr_ nsd->sd_rebuild_pos += pbp->bio_length; if (nsd->sd_rebuild_pos >= vol->v_mediasize) { g_raid_tr_raid1_rebuild_finish(tr, vol); - g_destroy_bio(pbp); return; } - if (--trs->trso_recover_slabs == 0) { - g_destroy_bio(pbp); + if (--trs->trso_recover_slabs <= 0) { + /* Have we done a substantial enough amount of recovery? */ + g_raid_write_metadata(vol->v_softc, vol, nsd, + nsd->sd_disk); + trs->trso_flags &= ~TR_RAID1_F_DOING_SOME; return; } pbp->bio_offset = nsd->sd_rebuild_pos; @@ -711,7 +729,6 @@ g_raid_tr_iodone_raid1(struct g_raid_tr_ bp->bio_error = 0; } } -out:; if (pbp->bio_children == pbp->bio_inbed) { pbp->bio_completed = pbp->bio_length; g_raid_iodone(pbp, bp->bio_error); From owner-svn-src-projects@FreeBSD.ORG Thu Jan 27 19:56:20 2011 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6C772106567A; Thu, 27 Jan 2011 19:56:20 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id EFF5B8FC17; Thu, 27 Jan 2011 19:56:19 +0000 (UTC) Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net [66.111.2.69]) by cyrus.watson.org (Postfix) with ESMTPSA id 8546746B39; Thu, 27 Jan 2011 14:56:19 -0500 (EST) Received: from jhbbsd.localnet (smtp.hudson-trading.com [209.249.190.9]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 73B248A009; Thu, 27 Jan 2011 14:56:18 -0500 (EST) From: John Baldwin To: Warner Losh Date: Thu, 27 Jan 2011 14:53:10 -0500 User-Agent: KMail/1.13.5 (FreeBSD/7.4-CBSD-20110107; KDE/4.4.5; amd64; ; ) References: <201101251534.p0PFY7cF039182@svn.freebsd.org> <7FD27004-581F-4FED-858D-5819562CF111@freebsd.org> <4D41C29A.5020100@bsdimp.com> In-Reply-To: <4D41C29A.5020100@bsdimp.com> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201101271453.10305.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.6 (bigwig.baldwin.cx); Thu, 27 Jan 2011 14:56:18 -0500 (EST) X-Virus-Scanned: clamav-milter 0.96.3 at bigwig.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-1.9 required=4.2 tests=BAYES_00 autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on bigwig.baldwin.cx Cc: src-committers@freebsd.org, Pawel Jakub Dawidek , Ken Smith , Alexander Motin , "Robert N. M. Watson" , svn-src-projects@freebsd.org Subject: Re: svn commit: r217828 - projects/graid/head/sys/geom/raid X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Jan 2011 19:56:20 -0000 On Thursday, January 27, 2011 2:08:10 pm Warner Losh wrote: > On 01/26/2011 08:45, Robert N. M. Watson wrote: > > On 26 Jan 2011, at 15:42, John Baldwin wrote: > > > >> On Wednesday, January 26, 2011 10:06:47 am Ken Smith wrote: > >>> On Wed, 2011-01-26 at 11:45 +0200, Alexander Motin wrote: > >>>> Those who want maximum robustness should use dedicated > >>>> drive on the most trivial dedicated controller to make dumping reliable. > >>>> If we are going above that - there are always some compromises. > >>> Please remember this statement when I change dumpdev from "AUTO" > >>> to "NO" in /etc/defaults/rc.conf shortly after branching stable/9. :-) > >> No, I still think this is the wrong answer. Kernel dumps are not inherently > >> unreliable to the point that we should not enable them by default. However, > >> turning dumps off is a good way to prevent developers from debugging non- > >> trivial bugs that are only triggered under real-world workloads. > >> > >> I think we should strive to make our dumps as reliable as possible, but > >> nothing in our system is perfect (hence bugs), and if we are going to require > >> absolute perfection for kernel dumps before enabling them by default then we > >> might as well not ship anything at all as I can _ensure_ you the rest of the > >> system we ship is _not_ absolutely perfect. > > I think the real constraint on shipping with dumps enabled remains a disk space consideration. If you have a problem triggering a kernel bug, you're going to generate quite a few crash dumps in short order, and for many users, that result is not good. But the answer there may be better savecore behaviour: perhaps we should keep the last (n) (where n is small -- perhaps 2) dumps by default, with a way to mark dumps that should be saved longer. minidumps have made the world better in some ways, I can't help wonder whether that could be refined further... > > I don't suppose there's a way that savecore could be hacked to convert a > 'full' dump into a 'mini' dump? Well, minidumps are already enabled by default so I think that is less important. Probably savecore's policy needs to change so that it saves the most recent N dumps rather than the oldest N dumps and that something like minfree needs to be enabled by default. -- John Baldwin From owner-svn-src-projects@FreeBSD.ORG Thu Jan 27 20:20:33 2011 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BC48E1065673; Thu, 27 Jan 2011 20:20:33 +0000 (UTC) (envelope-from mavbsd@gmail.com) Received: from mail-wy0-f182.google.com (mail-wy0-f182.google.com [74.125.82.182]) by mx1.freebsd.org (Postfix) with ESMTP id 00B918FC19; Thu, 27 Jan 2011 20:20:32 +0000 (UTC) Received: by wyf19 with SMTP id 19so2502451wyf.13 for ; Thu, 27 Jan 2011 12:20:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:sender:message-id:date:from:user-agent :mime-version:to:cc:subject:references:in-reply-to:content-type :content-transfer-encoding; bh=Bv1qSrLv9qUAs5tSPbqDLJZbucri+/R7gymdTXSt5Mk=; b=RG572VqH7Y5ksNh1UrIFG8yCKBhwqk0HKWTQODaO8/9FJSBTKuvb6aIbWQ20W3mqCn JvlqtOQp6exjuEf1Nod5ZKM1W3M78CZGCD9AaVNmBbtB2eIhRhNjMdHXHkBKVCiDsrtV WkcUMF8Q7nGUC8X/8sRzyVs879sEm1H2svY6M= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; b=o03ZzAln5NwiPl8C8Okdw1pRGVV5I7vQJxcc/tOBCmaza5NAcjJ3sgCuUcWAjUrwkk Q+jbAoBjQIUO1+S1QdwA9CJMyBzkW8uYqKUO9zlrWP7Il796ndzgvQkNBYCtm6Q354FZ sCprLZ4fTT9GFpKteAKEFYUBEOMLIbdvsmg3A= Received: by 10.216.19.133 with SMTP id n5mr6708980wen.83.1296159631414; Thu, 27 Jan 2011 12:20:31 -0800 (PST) Received: from mavbook.mavhome.dp.ua (95-109-156-28.dialup.umc.net.ua [95.109.156.28]) by mx.google.com with ESMTPS id 7sm8612989wet.0.2011.01.27.12.20.26 (version=SSLv3 cipher=RC4-MD5); Thu, 27 Jan 2011 12:20:30 -0800 (PST) Sender: Alexander Motin Message-ID: <4D41D37B.2040907@FreeBSD.org> Date: Thu, 27 Jan 2011 22:20:11 +0200 From: Alexander Motin User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.2.12) Gecko/20101104 Thunderbird/3.1.6 MIME-Version: 1.0 To: Warner Losh References: <201101271956.p0RJuG0f033255@svn.freebsd.org> In-Reply-To: <201101271956.p0RJuG0f033255@svn.freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-projects@freebsd.org, src-committers@FreeBSD.org Subject: Re: svn commit: r217972 - projects/graid/head/sys/geom/raid X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Jan 2011 20:20:33 -0000 On 27.01.2011 21:56, Warner Losh wrote: > (3) Update metadata after each bundle of slabs. (mav: please comment on > frequency) I would do it once for every few minutes or few percents or some comparable number of gigabytes. Doing it more often is pointless, while it may significantly affect performance, as metadata write is synchronous now. gmirror does it every MAXPHYS * 100 bytes, but I would say that doing it every 12.8MB is too often for modern HDDs speeds. -- Alexander Motin From owner-svn-src-projects@FreeBSD.ORG Thu Jan 27 21:41:26 2011 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 53DD810656C2; Thu, 27 Jan 2011 21:41:26 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 297A78FC14; Thu, 27 Jan 2011 21:41:26 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0RLfQtF037622; Thu, 27 Jan 2011 21:41:26 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0RLfQvm037620; Thu, 27 Jan 2011 21:41:26 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201101272141.p0RLfQvm037620@svn.freebsd.org> From: Warner Losh Date: Thu, 27 Jan 2011 21:41:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217989 - projects/graid/head/sys/geom/raid X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Jan 2011 21:41:26 -0000 Author: imp Date: Thu Jan 27 21:41:25 2011 New Revision: 217989 URL: http://svn.freebsd.org/changeset/base/217989 Log: Update every 100 recovery cycles. We update approx 1/gb now. Modified: projects/graid/head/sys/geom/raid/tr_raid1.c Modified: projects/graid/head/sys/geom/raid/tr_raid1.c ============================================================================== --- projects/graid/head/sys/geom/raid/tr_raid1.c Thu Jan 27 21:40:31 2011 (r217988) +++ projects/graid/head/sys/geom/raid/tr_raid1.c Thu Jan 27 21:41:25 2011 (r217989) @@ -45,6 +45,7 @@ __FBSDID("$FreeBSD$"); #define SD_REBUILD_FAIR_IO 10 /* use 1/x of the available I/O */ #define SD_REBUILD_CLUSTER_BUSY 4 #define SD_REBUILD_CLUSTER_IDLE 10 +#define SD_REBUILD_META_UPDATE 100 /* update meta data every GB or so */ /* * We don't want to hammer the disk with I/O requests when doing a rebuild or @@ -71,6 +72,7 @@ struct g_raid_tr_raid1_object { int trso_type; int trso_recover_slabs; /* might need to be more */ int trso_fair_io; + int trso_meta_update; int trso_flags; struct g_raid_subdisk *trso_good_sd; /* specific rather than per tr */ struct g_raid_subdisk *trso_failed_sd;/* like per volume */ @@ -290,9 +292,9 @@ g_raid_tr_raid1_rebuild_start(struct g_r trs->trso_type = TR_RAID1_REBUILD; trs->trso_failed_sd->sd_rebuild_pos = 0; trs->trso_buffer = malloc(SD_REBUILD_SLAB, M_TR_raid1, M_WAITOK); + trs->trso_meta_update = SD_REBUILD_META_UPDATE; vol->v_to_arg = trs; vol->v_timeout = g_raid_tr_raid1_idle_rebuild; - /* XXX what else do I need to setup the first time? */ g_raid_tr_raid1_rebuild_some(tr, trs->trso_failed_sd); } @@ -611,9 +613,11 @@ g_raid_tr_iodone_raid1(struct g_raid_tr_ return; } if (--trs->trso_recover_slabs <= 0) { - /* Have we done a substantial enough amount of recovery? */ - g_raid_write_metadata(vol->v_softc, vol, nsd, - nsd->sd_disk); + if (--trs->trso_meta_update <= 0) { + g_raid_write_metadata(vol->v_softc, + vol, nsd, nsd->sd_disk); + trs->trso_meta_update = SD_REBUILD_META_UPDATE; + } trs->trso_flags &= ~TR_RAID1_F_DOING_SOME; return; } From owner-svn-src-projects@FreeBSD.ORG Thu Jan 27 23:04:16 2011 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5C4081065673; Thu, 27 Jan 2011 23:04:16 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4C5238FC1B; Thu, 27 Jan 2011 23:04:16 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0RN4GvX042172; Thu, 27 Jan 2011 23:04:16 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0RN4Grk042170; Thu, 27 Jan 2011 23:04:16 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201101272304.p0RN4Grk042170@svn.freebsd.org> From: Warner Losh Date: Thu, 27 Jan 2011 23:04:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217992 - projects/graid/head/sys/geom/raid X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Jan 2011 23:04:16 -0000 Author: imp Date: Thu Jan 27 23:04:16 2011 New Revision: 217992 URL: http://svn.freebsd.org/changeset/base/217992 Log: Bzero the bio we setup for each slab of work. Modified: projects/graid/head/sys/geom/raid/tr_raid1.c Modified: projects/graid/head/sys/geom/raid/tr_raid1.c ============================================================================== --- projects/graid/head/sys/geom/raid/tr_raid1.c Thu Jan 27 21:45:38 2011 (r217991) +++ projects/graid/head/sys/geom/raid/tr_raid1.c Thu Jan 27 23:04:16 2011 (r217992) @@ -176,6 +176,7 @@ g_raid_tr_raid1_rebuild_some(struct g_ra trs->trso_recover_slabs = SD_REBUILD_CLUSTER_IDLE; trs->trso_fair_io = SD_REBUILD_FAIR_IO; bp = &trs->trso_bio; + memset(bp, 0, sizeof(*bp)); bp->bio_offset = sd->sd_rebuild_pos; bp->bio_length = MIN(SD_REBUILD_SLAB, sd->sd_volume->v_mediasize - sd->sd_rebuild_pos); From owner-svn-src-projects@FreeBSD.ORG Thu Jan 27 23:25:13 2011 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B975610656A9; Thu, 27 Jan 2011 23:25:13 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9FA328FC1D; Thu, 27 Jan 2011 23:25:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0RNPDBj043693; Thu, 27 Jan 2011 23:25:13 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0RNPDL1043691; Thu, 27 Jan 2011 23:25:13 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201101272325.p0RNPDL1043691@svn.freebsd.org> From: Warner Losh Date: Thu, 27 Jan 2011 23:25:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217998 - projects/graid/head/sys/geom/raid X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Jan 2011 23:25:13 -0000 Author: imp Date: Thu Jan 27 23:25:13 2011 New Revision: 217998 URL: http://svn.freebsd.org/changeset/base/217998 Log: Keep track of the state we're in wrt rebuilding. When we have a disk exit the system during a rebuild, don't try to start another rebuild on it (crazy, eh?). This fixes the crash that we were seeing on power off of a disk, as far as I'm able to test. Modified: projects/graid/head/sys/geom/raid/tr_raid1.c Modified: projects/graid/head/sys/geom/raid/tr_raid1.c ============================================================================== --- projects/graid/head/sys/geom/raid/tr_raid1.c Thu Jan 27 23:16:41 2011 (r217997) +++ projects/graid/head/sys/geom/raid/tr_raid1.c Thu Jan 27 23:25:13 2011 (r217998) @@ -110,8 +110,6 @@ static struct g_raid_tr_class g_raid_tr_ .trc_priority = 100 }; -static void g_raid_tr_raid1_rebuild_abort(struct g_raid_tr_object *tr, - struct g_raid_volume *vol); static void g_raid_tr_raid1_maybe_rebuild(struct g_raid_tr_object *tr, struct g_raid_volume *vol); @@ -202,8 +200,10 @@ g_raid_tr_raid1_idle_rebuild(struct g_ra struct g_raid_tr_raid1_object *trs; trs = (struct g_raid_tr_raid1_object *)argp; - if (trs->trso_good_sd == NULL || trs->trso_failed_sd == NULL) + if (trs->trso_good_sd == NULL || trs->trso_failed_sd == NULL) { + printf("I hit the case that's obsolete, right?\n"); return; + } g_raid_event_send(trs->trso_failed_sd, G_RAID_SUBDISK_E_TR_REBUILD_SOME, G_RAID_EVENT_SUBDISK); } @@ -221,6 +221,7 @@ g_raid_tr_raid1_rebuild_finish(struct g_ g_raid_write_metadata(vol->v_softc, vol, sd, sd->sd_disk); free(trs->trso_buffer, M_TR_raid1); trs->trso_flags &= ~TR_RAID1_F_DOING_SOME; + trs->trso_type = TR_RAID1_NONE; trs->trso_recover_slabs = 0; trs->trso_failed_sd = NULL; trs->trso_good_sd = NULL; @@ -241,6 +242,7 @@ g_raid_tr_raid1_rebuild_abort(struct g_r g_raid_write_metadata(vol->v_softc, vol, sd, sd->sd_disk); free(trs->trso_buffer, M_TR_raid1); trs->trso_flags &= ~TR_RAID1_F_DOING_SOME; + trs->trso_type = TR_RAID1_NONE; trs->trso_recover_slabs = 0; trs->trso_failed_sd = NULL; trs->trso_good_sd = NULL; @@ -317,11 +319,22 @@ g_raid_tr_raid1_maybe_rebuild(struct g_r return; na = g_raid_nsubdisks(vol, G_RAID_SUBDISK_S_ACTIVE); nr = g_raid_nsubdisks(vol, G_RAID_SUBDISK_S_REBUILD); - if (na == 0 || nr == 0) - return; - if (trs->trso_good_sd) - return; - g_raid_tr_raid1_rebuild_start(tr, vol); + switch(trs->trso_type) { + case TR_RAID1_NONE: + if (na == 0 || nr == 0) + return; + if (trs->trso_type != TR_RAID1_NONE) + return; + g_raid_tr_raid1_rebuild_start(tr, vol); + break; + case TR_RAID1_REBUILD: + /* + * We're rebuilding, maybe we need to stop... + */ + break; + case TR_RAID1_RESYNC: + break; + } } static int @@ -340,12 +353,12 @@ g_raid_tr_event_raid1(struct g_raid_tr_o g_raid_change_subdisk_state(sd, G_RAID_SUBDISK_S_REBUILD); break; case G_RAID_SUBDISK_E_FAILED: - if (trs->trso_good_sd) + if (trs->trso_type == TR_RAID1_REBUILD) g_raid_tr_raid1_rebuild_abort(tr, vol); // g_raid_change_subdisk_state(sd, G_RAID_SUBDISK_S_FAILED); break; case G_RAID_SUBDISK_E_DISCONNECTED: - if (trs->trso_good_sd) + if (trs->trso_type == TR_RAID1_REBUILD) g_raid_tr_raid1_rebuild_abort(tr, vol); g_raid_change_subdisk_state(sd, G_RAID_SUBDISK_S_NONE); break; From owner-svn-src-projects@FreeBSD.ORG Thu Jan 27 23:28:00 2011 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 716C5106564A; Thu, 27 Jan 2011 23:28:00 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 616118FC16; Thu, 27 Jan 2011 23:28:00 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0RNS0dL043900; Thu, 27 Jan 2011 23:28:00 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0RNS0Ww043898; Thu, 27 Jan 2011 23:28:00 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201101272328.p0RNS0Ww043898@svn.freebsd.org> From: Warner Losh Date: Thu, 27 Jan 2011 23:28:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217999 - projects/graid/head/sys/geom/raid X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Jan 2011 23:28:00 -0000 Author: imp Date: Thu Jan 27 23:28:00 2011 New Revision: 217999 URL: http://svn.freebsd.org/changeset/base/217999 Log: For now, bump this message down a notch.. Modified: projects/graid/head/sys/geom/raid/g_raid.c Modified: projects/graid/head/sys/geom/raid/g_raid.c ============================================================================== --- projects/graid/head/sys/geom/raid/g_raid.c Thu Jan 27 23:25:13 2011 (r217998) +++ projects/graid/head/sys/geom/raid/g_raid.c Thu Jan 27 23:28:00 2011 (r217999) @@ -1409,12 +1409,12 @@ g_raid_update_subdisk(struct g_raid_subd vol = sd->sd_volume; sx_assert(&sc->sc_lock, SX_XLOCKED); - G_RAID_DEBUG(2, "Event %s for subdisk %s.", + G_RAID_DEBUG(3, "Event %s for subdisk %s.", g_raid_subdisk_event2str(event), g_raid_get_subdiskname(sd)); - if (vol->v_tr) G_RAID_TR_EVENT(vol->v_tr, sd, event); + return (0); } From owner-svn-src-projects@FreeBSD.ORG Fri Jan 28 02:10:31 2011 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E5484106566B; Fri, 28 Jan 2011 02:10:30 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D42A28FC0A; Fri, 28 Jan 2011 02:10:30 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0S2AUdk051575; Fri, 28 Jan 2011 02:10:30 GMT (envelope-from jeff@svn.freebsd.org) Received: (from jeff@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0S2AUNf051568; Fri, 28 Jan 2011 02:10:30 GMT (envelope-from jeff@svn.freebsd.org) Message-Id: <201101280210.p0S2AUNf051568@svn.freebsd.org> From: Jeff Roberson Date: Fri, 28 Jan 2011 02:10:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r218001 - projects/ofed/head/sys/ofed/drivers/infiniband/ulp/sdp X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Jan 2011 02:10:31 -0000 Author: jeff Date: Fri Jan 28 02:10:30 2011 New Revision: 218001 URL: http://svn.freebsd.org/changeset/base/218001 Log: - Improve the tx completion interrupt and polling logic. - Don't call sdp_do_posts() immediately when the connection is established. This causes a race with mlx4 cards but not mthca. - Add disabled interrupt moderation as it did not help me but it may help in other cases. Sponsored by: Isilon Systems, iX Systems, and Panasas. Modified: projects/ofed/head/sys/ofed/drivers/infiniband/ulp/sdp/sdp.h projects/ofed/head/sys/ofed/drivers/infiniband/ulp/sdp/sdp_bcopy.c projects/ofed/head/sys/ofed/drivers/infiniband/ulp/sdp/sdp_cma.c projects/ofed/head/sys/ofed/drivers/infiniband/ulp/sdp/sdp_main.c projects/ofed/head/sys/ofed/drivers/infiniband/ulp/sdp/sdp_rx.c projects/ofed/head/sys/ofed/drivers/infiniband/ulp/sdp/sdp_tx.c Modified: projects/ofed/head/sys/ofed/drivers/infiniband/ulp/sdp/sdp.h ============================================================================== --- projects/ofed/head/sys/ofed/drivers/infiniband/ulp/sdp/sdp.h Fri Jan 28 00:22:03 2011 (r218000) +++ projects/ofed/head/sys/ofed/drivers/infiniband/ulp/sdp/sdp.h Fri Jan 28 02:10:30 2011 (r218001) @@ -316,7 +316,6 @@ struct sdp_tx_ring { atomic_t tail; struct ib_cq *cq; - int una_seq; atomic_t credits; #define tx_credits(ssk) (atomic_read(&ssk->tx_ring.credits)) Modified: projects/ofed/head/sys/ofed/drivers/infiniband/ulp/sdp/sdp_bcopy.c ============================================================================== --- projects/ofed/head/sys/ofed/drivers/infiniband/ulp/sdp/sdp_bcopy.c Fri Jan 28 00:22:03 2011 (r218000) +++ projects/ofed/head/sys/ofed/drivers/infiniband/ulp/sdp/sdp_bcopy.c Fri Jan 28 02:10:30 2011 (r218001) @@ -163,10 +163,10 @@ out: void sdp_post_sends(struct sdp_sock *ssk, int wait) { - /* TODO: nonagle? */ struct mbuf *mb; int post_count = 0; struct socket *sk; + int low; sk = ssk->socket; if (unlikely(!ssk->id)) { @@ -177,7 +177,7 @@ sdp_post_sends(struct sdp_sock *ssk, int } return; } - +again: if (sdp_tx_ring_slots_left(ssk) < SDP_TX_SIZE / 2) sdp_xmit_poll(ssk, 1); @@ -242,8 +242,13 @@ sdp_post_sends(struct sdp_sock *ssk, int sdp_post_send(ssk, mb); post_count++; } - if (post_count) - sdp_xmit_poll(ssk, 0); + low = (sdp_tx_ring_slots_left(ssk) <= SDP_MIN_TX_CREDITS); + if (post_count || low) { + if (low) + sdp_arm_tx_cq(ssk); + if (sdp_xmit_poll(ssk, low)) + goto again; + } return; allocfail: Modified: projects/ofed/head/sys/ofed/drivers/infiniband/ulp/sdp/sdp_cma.c ============================================================================== --- projects/ofed/head/sys/ofed/drivers/infiniband/ulp/sdp/sdp_cma.c Fri Jan 28 00:22:03 2011 (r218000) +++ projects/ofed/head/sys/ofed/drivers/infiniband/ulp/sdp/sdp_cma.c Fri Jan 28 02:10:30 2011 (r218001) @@ -192,7 +192,7 @@ sdp_response_handler(struct socket *sk, ssk = sdp_sk(sk); SDP_WLOCK(ssk); ssk->state = TCPS_ESTABLISHED; -/* sdp_set_default_moderation(ssk); */ + sdp_set_default_moderation(ssk); if (ssk->flags & SDP_DROPPED) { SDP_WUNLOCK(ssk); return 0; @@ -212,7 +212,6 @@ sdp_response_handler(struct socket *sk, ssk->fport = dst_addr->sin_port; ssk->faddr = dst_addr->sin_addr.s_addr; soisconnected(sk); - sdp_do_posts(ssk); SDP_WUNLOCK(ssk); return 0; @@ -229,15 +228,13 @@ sdp_connected_handler(struct socket *sk, SDP_WLOCK(ssk); ssk->state = TCPS_ESTABLISHED; -/* sdp_set_default_moderation(ssk); */ + sdp_set_default_moderation(ssk); if (sk->so_options & SO_KEEPALIVE) sdp_start_keepalive_timer(sk); - if ((ssk->flags & SDP_DROPPED) == 0) { + if ((ssk->flags & SDP_DROPPED) == 0) soisconnected(sk); - sdp_do_posts(ssk); - } SDP_WUNLOCK(ssk); return 0; } Modified: projects/ofed/head/sys/ofed/drivers/infiniband/ulp/sdp/sdp_main.c ============================================================================== --- projects/ofed/head/sys/ofed/drivers/infiniband/ulp/sdp/sdp_main.c Fri Jan 28 00:22:03 2011 (r218000) +++ projects/ofed/head/sys/ofed/drivers/infiniband/ulp/sdp/sdp_main.c Fri Jan 28 02:10:30 2011 (r218001) @@ -1385,15 +1385,11 @@ deliver: sbdrop_locked(sb, len); /* Notify protocol that we drained some data. */ - if ((so->so_proto->pr_flags & PR_WANTRCVD) && - (((flags & MSG_WAITALL) && uio->uio_resid > 0) || - !(flags & MSG_SOCALLBCK))) { - SOCKBUF_UNLOCK(sb); - SDP_WLOCK(ssk); - sdp_do_posts(ssk); - SDP_WUNLOCK(ssk); - SOCKBUF_LOCK(sb); - } + SOCKBUF_UNLOCK(sb); + SDP_WLOCK(ssk); + sdp_do_posts(ssk); + SDP_WUNLOCK(ssk); + SOCKBUF_LOCK(sb); } /* @@ -1699,6 +1695,18 @@ sdp_ctloutput(struct socket *so, struct } #undef SDP_WLOCK_RECHECK +int sdp_mod_count = 0; +int sdp_mod_usec = 0; + +void +sdp_set_default_moderation(struct sdp_sock *ssk) +{ + if (sdp_mod_count <= 0 || sdp_mod_usec <= 0) + return; + ib_modify_cq(ssk->rx_ring.cq, sdp_mod_count, sdp_mod_usec); +} + + static void sdp_dev_add(struct ib_device *device) { Modified: projects/ofed/head/sys/ofed/drivers/infiniband/ulp/sdp/sdp_rx.c ============================================================================== --- projects/ofed/head/sys/ofed/drivers/infiniband/ulp/sdp/sdp_rx.c Fri Jan 28 00:22:03 2011 (r218000) +++ projects/ofed/head/sys/ofed/drivers/infiniband/ulp/sdp/sdp_rx.c Fri Jan 28 02:10:30 2011 (r218001) @@ -33,7 +33,7 @@ SDP_MODPARAM_INT(rcvbuf_initial_size, 32 * 1024, "Receive buffer initial size in bytes."); -SDP_MODPARAM_SINT(rcvbuf_scale, 0x10, +SDP_MODPARAM_SINT(rcvbuf_scale, 0x8, "Receive buffer size scale factor."); /* Like tcp_fin - called when SDP_MID_DISCONNECT is received */ @@ -161,31 +161,31 @@ sdp_post_recv(struct sdp_sock *ssk) static inline int sdp_post_recvs_needed(struct sdp_sock *ssk) { - int scale = rcvbuf_scale; - int buffer_size = ssk->recv_bytes; + unsigned long bytes_in_process; unsigned long max_bytes; + int buffer_size; + int posted; if (!ssk->qp_active || !ssk->socket) return 0; - max_bytes = ssk->socket->so_snd.sb_mbmax * scale; - if (unlikely(rx_ring_posted(ssk) >= SDP_RX_SIZE)) + posted = rx_ring_posted(ssk); + if (posted >= SDP_RX_SIZE) return 0; + if (posted < SDP_MIN_TX_CREDITS) + return 1; - if (likely(rx_ring_posted(ssk) >= SDP_MIN_TX_CREDITS)) { - unsigned long bytes_in_process = - (rx_ring_posted(ssk) - SDP_MIN_TX_CREDITS) * - buffer_size; - bytes_in_process += ssk->socket->so_rcv.sb_cc; - if (bytes_in_process >= max_bytes) { - sdp_prf(ssk->socket, NULL, - "bytes_in_process:%ld > max_bytes:%ld", - bytes_in_process, max_bytes); - return 0; - } - } + buffer_size = ssk->recv_bytes; + max_bytes = max(ssk->socket->so_snd.sb_hiwat, + (1 + SDP_MIN_TX_CREDITS) * buffer_size); + max_bytes *= rcvbuf_scale; + /* + * Compute bytes in the receive queue and socket buffer. + */ + bytes_in_process = (posted - SDP_MIN_TX_CREDITS) * buffer_size; + bytes_in_process += ssk->socket->so_rcv.sb_cc; - return 1; + return bytes_in_process < max_bytes; } static inline void Modified: projects/ofed/head/sys/ofed/drivers/infiniband/ulp/sdp/sdp_tx.c ============================================================================== --- projects/ofed/head/sys/ofed/drivers/infiniband/ulp/sdp/sdp_tx.c Fri Jan 28 00:22:03 2011 (r218000) +++ projects/ofed/head/sys/ofed/drivers/infiniband/ulp/sdp/sdp_tx.c Fri Jan 28 02:10:30 2011 (r218001) @@ -134,7 +134,7 @@ sdp_post_send(struct sdp_sock *ssk, stru sge->lkey = ssk->sdp_dev->mr->lkey; } tx_wr.next = NULL; - tx_wr.wr_id = ring_head(ssk->tx_ring) | SDP_OP_SEND; + tx_wr.wr_id = mseq | SDP_OP_SEND; tx_wr.sg_list = ibsge; tx_wr.num_sge = i; tx_wr.opcode = IB_WR_SEND; @@ -178,11 +178,8 @@ sdp_send_completion(struct sdp_sock *ssk dev = ssk->ib_device; tx_req = &tx_ring->buffer[mseq & (SDP_TX_SIZE - 1)]; mb = tx_req->mb; - sdp_cleanup_sdp_buf(ssk, tx_req, DMA_TO_DEVICE); - tx_ring->una_seq += mb->m_pkthdr.len - sizeof(struct sdp_bsdh); - #ifdef SDP_ZCOPY /* TODO: AIO and real zcopy code; add their context support here */ if (BZCOPY_STATE(mb)) @@ -201,10 +198,6 @@ sdp_handle_send_comp(struct sdp_sock *ss struct mbuf *mb = NULL; struct sdp_bsdh *h; - mb = sdp_send_completion(ssk, wc->wr_id); - if (unlikely(!mb)) - return -1; - if (unlikely(wc->status)) { if (wc->status != IB_WC_WR_FLUSH_ERR) { sdp_prf(ssk->socket, mb, "Send completion with error. " @@ -215,6 +208,10 @@ sdp_handle_send_comp(struct sdp_sock *ss } } + mb = sdp_send_completion(ssk, wc->wr_id); + if (unlikely(!mb)) + return -1; + h = mtod(mb, struct sdp_bsdh *); sdp_prf1(ssk->socket, mb, "tx completion. mseq:%d", ntohl(h->mseq)); sdp_dbg(ssk->socket, "tx completion. %p %d mseq:%d", @@ -300,21 +297,10 @@ sdp_process_tx_cq(struct sdp_sock *ssk) } while (n == SDP_NUM_WC); if (wc_processed) { - struct socket *sk = ssk->socket; sdp_post_sends(ssk, M_DONTWAIT); sdp_prf1(sk, NULL, "Waking sendmsg. inflight=%d", (u32) tx_ring_posted(ssk)); sowwakeup(ssk->socket); - /* - * If there is no room in the tx queue we arm the tx cq - * to force an interrupt. - */ - if (tx_ring_posted(ssk) && sk->so_snd.sb_cc >= - sk->so_snd.sb_mbmax - ssk->xmit_size_goal) { - sdp_prf(ssk->socket, NULL, "pending tx - rearming"); - sdp_arm_tx_cq(ssk); - } - } return wc_processed; From owner-svn-src-projects@FreeBSD.ORG Fri Jan 28 02:11:16 2011 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 30CCB106566B; Fri, 28 Jan 2011 02:11:16 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 210108FC0A; Fri, 28 Jan 2011 02:11:16 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0S2BGYb051645; Fri, 28 Jan 2011 02:11:16 GMT (envelope-from jeff@svn.freebsd.org) Received: (from jeff@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0S2BGaw051643; Fri, 28 Jan 2011 02:11:16 GMT (envelope-from jeff@svn.freebsd.org) Message-Id: <201101280211.p0S2BGaw051643@svn.freebsd.org> From: Jeff Roberson Date: Fri, 28 Jan 2011 02:11:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r218002 - projects/ofed/head/usr.sbin/ndp X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Jan 2011 02:11:16 -0000 Author: jeff Date: Fri Jan 28 02:11:15 2011 New Revision: 218002 URL: http://svn.freebsd.org/changeset/base/218002 Log: - Add support for printing infiniband addresses. Sponsored by: Isilon Systems, iX Systems, and Panasas. Modified: projects/ofed/head/usr.sbin/ndp/ndp.c Modified: projects/ofed/head/usr.sbin/ndp/ndp.c ============================================================================== --- projects/ofed/head/usr.sbin/ndp/ndp.c Fri Jan 28 02:10:30 2011 (r218001) +++ projects/ofed/head/usr.sbin/ndp/ndp.c Fri Jan 28 02:11:15 2011 (r218002) @@ -826,10 +826,18 @@ ether_str(sdl) static char hbuf[NI_MAXHOST]; u_char *cp; - if (sdl->sdl_alen) { + if (sdl->sdl_alen == ETHER_ADDR_LEN) { cp = (u_char *)LLADDR(sdl); snprintf(hbuf, sizeof(hbuf), "%x:%x:%x:%x:%x:%x", cp[0], cp[1], cp[2], cp[3], cp[4], cp[5]); + } else if (sdl->sdl_alen == 20) { + cp = (u_char *)LLADDR(sdl); + snprintf(hbuf, sizeof(hbuf), + "%x:%x:%x:%x:%x%x:%x:%x:%x:%x%x:%x:%x:%x:%x%x:%x:%x:%x:%x", + cp[0], cp[1], cp[2], cp[3], cp[4], cp[5], cp[6], cp[7], + cp[8], cp[9], cp[10], cp[11], cp[12], cp[13], cp[14], + cp[15], cp[16], cp[17], cp[18], cp[19]); + } else snprintf(hbuf, sizeof(hbuf), "(incomplete)"); From owner-svn-src-projects@FreeBSD.ORG Fri Jan 28 02:11:42 2011 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2100D1065670; Fri, 28 Jan 2011 02:11:42 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 114A78FC0A; Fri, 28 Jan 2011 02:11:42 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0S2Bf38051688; Fri, 28 Jan 2011 02:11:41 GMT (envelope-from jeff@svn.freebsd.org) Received: (from jeff@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0S2Bfbg051686; Fri, 28 Jan 2011 02:11:41 GMT (envelope-from jeff@svn.freebsd.org) Message-Id: <201101280211.p0S2Bfbg051686@svn.freebsd.org> From: Jeff Roberson Date: Fri, 28 Jan 2011 02:11:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r218003 - projects/ofed/head/usr.bin/netstat X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Jan 2011 02:11:42 -0000 Author: jeff Date: Fri Jan 28 02:11:41 2011 New Revision: 218003 URL: http://svn.freebsd.org/changeset/base/218003 Log: - Remove some debugging output I accidentally committed. Sponsored by: Isilon Systems, iX Systems, and Panasas. Modified: projects/ofed/head/usr.bin/netstat/inet.c Modified: projects/ofed/head/usr.bin/netstat/inet.c ============================================================================== --- projects/ofed/head/usr.bin/netstat/inet.c Fri Jan 28 02:11:15 2011 (r218002) +++ projects/ofed/head/usr.bin/netstat/inet.c Fri Jan 28 02:11:41 2011 (r218003) @@ -363,18 +363,12 @@ protopr(u_long off, const char *name, in } /* Ignore sockets for protocols other than the desired one. */ - if (so->xso_protocol != proto) { - printf("%s proto %d, proto %d\n", - name, so->xso_protocol, proto); + if (so->xso_protocol != proto) continue; - } /* Ignore PCBs which were freed during copyout. */ - if (inp->inp_gencnt > oxig->xig_gen) { - printf("%s gencnt %jd, xig gen %jd\n", - name, inp->inp_gencnt, oxig->xig_gen); + if (inp->inp_gencnt > oxig->xig_gen) continue; - } if ((af1 == AF_INET && (inp->inp_vflag & INP_IPV4) == 0) #ifdef INET6 From owner-svn-src-projects@FreeBSD.ORG Fri Jan 28 02:12:43 2011 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 95FC81065670; Fri, 28 Jan 2011 02:12:43 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 82F978FC0C; Fri, 28 Jan 2011 02:12:43 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0S2ChRK051763; Fri, 28 Jan 2011 02:12:43 GMT (envelope-from jeff@svn.freebsd.org) Received: (from jeff@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0S2ChZG051752; Fri, 28 Jan 2011 02:12:43 GMT (envelope-from jeff@svn.freebsd.org) Message-Id: <201101280212.p0S2ChZG051752@svn.freebsd.org> From: Jeff Roberson Date: Fri, 28 Jan 2011 02:12:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r218004 - in projects/ofed/head/contrib/ofed/dapl: dapl/openib_cma dapl/openib_cma/linux dapl/openib_scm dapl/openib_scm/linux dapl/openib_ucm/linux dapl/udapl/linux dat/include/dat2 da... X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Jan 2011 02:12:43 -0000 Author: jeff Date: Fri Jan 28 02:12:43 2011 New Revision: 218004 URL: http://svn.freebsd.org/changeset/base/218004 Log: - Port dapl include files to support freebsd. Sponsored by: Isilon Systems, iX Systems, and Panasas. Modified: projects/ofed/head/contrib/ofed/dapl/dapl/openib_cma/device.c projects/ofed/head/contrib/ofed/dapl/dapl/openib_cma/linux/openib_osd.h projects/ofed/head/contrib/ofed/dapl/dapl/openib_scm/device.c projects/ofed/head/contrib/ofed/dapl/dapl/openib_scm/linux/openib_osd.h projects/ofed/head/contrib/ofed/dapl/dapl/openib_ucm/linux/openib_osd.h projects/ofed/head/contrib/ofed/dapl/dapl/udapl/linux/dapl_osd.h projects/ofed/head/contrib/ofed/dapl/dat/include/dat2/dat_platform_specific.h projects/ofed/head/contrib/ofed/dapl/dat/udat/linux/dat_osd.h projects/ofed/head/contrib/ofed/dapl/test/dtest/dtest.c projects/ofed/head/contrib/ofed/dapl/test/dtest/dtestcm.c Modified: projects/ofed/head/contrib/ofed/dapl/dapl/openib_cma/device.c ============================================================================== --- projects/ofed/head/contrib/ofed/dapl/dapl/openib_cma/device.c Fri Jan 28 02:11:41 2011 (r218003) +++ projects/ofed/head/contrib/ofed/dapl/dapl/openib_cma/device.c Fri Jan 28 02:12:43 2011 (r218004) @@ -154,7 +154,9 @@ static int getipaddr_netdev(char *name, /* Fill in the structure */ snprintf(ifr.ifr_name, IFNAMSIZ, "%s", name); +#ifndef __FreeBSD__ ifr.ifr_hwaddr.sa_family = ARPHRD_INFINIBAND; +#endif /* Create a socket fd */ skfd = socket(PF_INET, SOCK_STREAM, 0); @@ -661,8 +663,8 @@ void dapli_thread(void *arg) /* work thread for uAT, uCM, CQ, and async events */ void dapli_thread(void *arg) { - struct pollfd ufds[__FD_SETSIZE]; - struct _ib_hca_transport *uhca[__FD_SETSIZE] = { NULL }; + struct pollfd ufds[FD_SETSIZE]; + struct _ib_hca_transport *uhca[FD_SETSIZE] = { NULL }; struct _ib_hca_transport *hca; int ret, idx, fds; char rbuf[2]; Modified: projects/ofed/head/contrib/ofed/dapl/dapl/openib_cma/linux/openib_osd.h ============================================================================== --- projects/ofed/head/contrib/ofed/dapl/dapl/openib_cma/linux/openib_osd.h Fri Jan 28 02:11:41 2011 (r218003) +++ projects/ofed/head/contrib/ofed/dapl/dapl/openib_cma/linux/openib_osd.h Fri Jan 28 02:12:43 2011 (r218004) @@ -1,7 +1,7 @@ #ifndef OPENIB_OSD_H #define OPENIB_OSD_H -#include +#include #include #if __BYTE_ORDER == __BIG_ENDIAN Modified: projects/ofed/head/contrib/ofed/dapl/dapl/openib_scm/device.c ============================================================================== --- projects/ofed/head/contrib/ofed/dapl/dapl/openib_scm/device.c Fri Jan 28 02:11:41 2011 (r218003) +++ projects/ofed/head/contrib/ofed/dapl/dapl/openib_scm/device.c Fri Jan 28 02:12:43 2011 (r218004) @@ -646,8 +646,8 @@ void dapli_thread(void *arg) /* work thread for uAT, uCM, CQ, and async events */ void dapli_thread(void *arg) { - struct pollfd ufds[__FD_SETSIZE]; - struct _ib_hca_transport *uhca[__FD_SETSIZE] = { NULL }; + struct pollfd ufds[FD_SETSIZE]; + struct _ib_hca_transport *uhca[FD_SETSIZE] = { NULL }; struct _ib_hca_transport *hca; int ret, idx, fds; char rbuf[2]; Modified: projects/ofed/head/contrib/ofed/dapl/dapl/openib_scm/linux/openib_osd.h ============================================================================== --- projects/ofed/head/contrib/ofed/dapl/dapl/openib_scm/linux/openib_osd.h Fri Jan 28 02:11:41 2011 (r218003) +++ projects/ofed/head/contrib/ofed/dapl/dapl/openib_scm/linux/openib_osd.h Fri Jan 28 02:12:43 2011 (r218004) @@ -1,7 +1,7 @@ #ifndef OPENIB_OSD_H #define OPENIB_OSD_H -#include +#include #include #if __BYTE_ORDER == __BIG_ENDIAN Modified: projects/ofed/head/contrib/ofed/dapl/dapl/openib_ucm/linux/openib_osd.h ============================================================================== --- projects/ofed/head/contrib/ofed/dapl/dapl/openib_ucm/linux/openib_osd.h Fri Jan 28 02:11:41 2011 (r218003) +++ projects/ofed/head/contrib/ofed/dapl/dapl/openib_ucm/linux/openib_osd.h Fri Jan 28 02:12:43 2011 (r218004) @@ -1,7 +1,9 @@ #ifndef OPENIB_OSD_H #define OPENIB_OSD_H -#include +#include +#include +#include #include #if __BYTE_ORDER == __BIG_ENDIAN Modified: projects/ofed/head/contrib/ofed/dapl/dapl/udapl/linux/dapl_osd.h ============================================================================== --- projects/ofed/head/contrib/ofed/dapl/dapl/udapl/linux/dapl_osd.h Fri Jan 28 02:11:41 2011 (r218003) +++ projects/ofed/head/contrib/ofed/dapl/dapl/udapl/linux/dapl_osd.h Fri Jan 28 02:12:43 2011 (r218004) @@ -45,9 +45,9 @@ * This file is defined for Linux systems only, including it on any * other build will cause an error */ -#ifndef __linux__ +#if !defined(__linux__) && !defined(__FreeBSD__) #error UNDEFINED OS TYPE -#endif /* __linux__ */ +#endif /* __linux__ || __freebsd__ */ #if !defined (__i386__) && !defined (__ia64__) && !defined(__x86_64__) && !defined(__PPC__) && !defined(__PPC64__) #error UNDEFINED ARCH @@ -67,7 +67,7 @@ #include #include #include /* for getaddrinfo */ -#include +#include #include /* for IOCTL's */ Modified: projects/ofed/head/contrib/ofed/dapl/dat/include/dat2/dat_platform_specific.h ============================================================================== --- projects/ofed/head/contrib/ofed/dapl/dat/include/dat2/dat_platform_specific.h Fri Jan 28 02:11:41 2011 (r218003) +++ projects/ofed/head/contrib/ofed/dapl/dat/include/dat2/dat_platform_specific.h Fri Jan 28 02:12:43 2011 (r218004) @@ -255,8 +255,46 @@ typedef PHYSICAL_ADDRESS DAT_PADDR; #endif /* __KDAPL__ */ /* Windoze ends */ +#elif defined(__FreeBSD__) +#include +#include +#include +#include +typedef u_int32_t DAT_UINT32; /* unsigned host order, 32 bits */ +typedef u_int64_t DAT_UINT64; /* unsigned host order, 64 bits */ +typedef unsigned long long DAT_UVERYLONG; /* unsigned longest native to compiler */ + +typedef void * DAT_PVOID; +typedef int DAT_COUNT; +typedef DAT_UINT64 DAT_PADDR; + +#ifndef UINT64_C +#define UINT64_C(c) c ## ULL +#endif /* UINT64_C */ + +#define DAT_IA_HANDLE_TO_UL(a) (unsigned long)(a) +#define DAT_UL_TO_IA_HANDLE(a) (DAT_IA_HANDLE)(a) + + +typedef struct dat_comm { + int domain; + int type; + int protocol; +} DAT_COMM; + +typedef int DAT_FD; /* DAT File Descriptor */ + +typedef struct sockaddr DAT_SOCK_ADDR; /* Socket address header native to OS */ +typedef struct sockaddr_in6 DAT_SOCK_ADDR6; /* Socket address header native to OS */ +#define DAT_AF_INET AF_INET +#define DAT_AF_INET6 AF_INET6 + +#define DAT_API +#define DAT_EXPORT extern + +/* Linux ends */ #else #error dat_platform_specific.h : OS type not defined #endif Modified: projects/ofed/head/contrib/ofed/dapl/dat/udat/linux/dat_osd.h ============================================================================== --- projects/ofed/head/contrib/ofed/dapl/dat/udat/linux/dat_osd.h Fri Jan 28 02:11:41 2011 (r218003) +++ projects/ofed/head/contrib/ofed/dapl/dat/udat/linux/dat_osd.h Fri Jan 28 02:12:43 2011 (r218004) @@ -48,9 +48,9 @@ * This file is defined for Linux systems only, including it on any * other build will cause an error */ -#ifndef __linux__ +#if defined(__linux__) || defined(__freebsd__) #error "UNDEFINED OS TYPE" -#endif /* __linux__ */ +#endif /* __linux__ || FreeBSD */ #include Modified: projects/ofed/head/contrib/ofed/dapl/test/dtest/dtest.c ============================================================================== --- projects/ofed/head/contrib/ofed/dapl/test/dtest/dtest.c Fri Jan 28 02:11:41 2011 (r218003) +++ projects/ofed/head/contrib/ofed/dapl/test/dtest/dtest.c Fri Jan 28 02:12:43 2011 (r218004) @@ -63,8 +63,8 @@ #else // _WIN32 || _WIN64 -#include -#include +#include +#include #include #include #include Modified: projects/ofed/head/contrib/ofed/dapl/test/dtest/dtestcm.c ============================================================================== --- projects/ofed/head/contrib/ofed/dapl/test/dtest/dtestcm.c Fri Jan 28 02:11:41 2011 (r218003) +++ projects/ofed/head/contrib/ofed/dapl/test/dtest/dtestcm.c Fri Jan 28 02:12:43 2011 (r218004) @@ -64,8 +64,8 @@ #else // _WIN32 || _WIN64 -#include -#include +#include +#include #include #include #include From owner-svn-src-projects@FreeBSD.ORG Fri Jan 28 05:52:03 2011 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 10C7A106566B; Fri, 28 Jan 2011 05:52:03 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 008448FC13; Fri, 28 Jan 2011 05:52:03 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0S5q2WO058887; Fri, 28 Jan 2011 05:52:02 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0S5q2oN058885; Fri, 28 Jan 2011 05:52:02 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201101280552.p0S5q2oN058885@svn.freebsd.org> From: Warner Losh Date: Fri, 28 Jan 2011 05:52:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r218006 - projects/graid/head/sys/geom/raid X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Jan 2011 05:52:03 -0000 Author: imp Date: Fri Jan 28 05:52:02 2011 New Revision: 218006 URL: http://svn.freebsd.org/changeset/base/218006 Log: Eliminate caching of the good SD in the rebuild. We likely need to be a little more careful... Try to be a little more careful about resetting the rebuild position. Finally, when rebuilding and a write occurs, we need to comare its position against the rebuild position, not the partion offset... This might fix at least some of the corruption that we're seeing with the random_read program... Modified: projects/graid/head/sys/geom/raid/tr_raid1.c Modified: projects/graid/head/sys/geom/raid/tr_raid1.c ============================================================================== --- projects/graid/head/sys/geom/raid/tr_raid1.c Fri Jan 28 05:42:14 2011 (r218005) +++ projects/graid/head/sys/geom/raid/tr_raid1.c Fri Jan 28 05:52:02 2011 (r218006) @@ -42,10 +42,10 @@ __FBSDID("$FreeBSD$"); #define SD_READ_THRESHOLD 10 /* errors to cause a rebuild */ #define SD_REBUILD_SLAB (1 << 20) /* One transation in a rebuild */ -#define SD_REBUILD_FAIR_IO 10 /* use 1/x of the available I/O */ +#define SD_REBUILD_FAIR_IO 20 /* use 1/x of the available I/O */ #define SD_REBUILD_CLUSTER_BUSY 4 #define SD_REBUILD_CLUSTER_IDLE 10 -#define SD_REBUILD_META_UPDATE 100 /* update meta data every GB or so */ +#define SD_REBUILD_META_UPDATE 500 /* update meta data every 5 GB or so */ /* * We don't want to hammer the disk with I/O requests when doing a rebuild or @@ -74,7 +74,6 @@ struct g_raid_tr_raid1_object { int trso_fair_io; int trso_meta_update; int trso_flags; - struct g_raid_subdisk *trso_good_sd; /* specific rather than per tr */ struct g_raid_subdisk *trso_failed_sd;/* like per volume */ void *trso_buffer; /* Buffer space */ struct bio trso_bio; @@ -110,6 +109,8 @@ static struct g_raid_tr_class g_raid_tr_ .trc_priority = 100 }; +static struct g_raid_subdisk *g_raid_tr_raid1_find_good_drive( + struct g_raid_volume *vol); static void g_raid_tr_raid1_maybe_rebuild(struct g_raid_tr_object *tr, struct g_raid_volume *vol); @@ -182,7 +183,7 @@ g_raid_tr_raid1_rebuild_some(struct g_ra bp->bio_cmd = BIO_READ; bp2 = g_clone_bio(bp); bp2->bio_cflags = G_RAID_BIO_FLAG_SYNC; - bp2->bio_caller1 = trs->trso_good_sd; + bp2->bio_caller1 = g_raid_tr_raid1_find_good_drive(sd->sd_volume); g_raid_lock_range(sd->sd_volume, /* Lock callback starts I/O */ bp2->bio_offset, bp2->bio_length, bp2); } @@ -200,7 +201,7 @@ g_raid_tr_raid1_idle_rebuild(struct g_ra struct g_raid_tr_raid1_object *trs; trs = (struct g_raid_tr_raid1_object *)argp; - if (trs->trso_good_sd == NULL || trs->trso_failed_sd == NULL) { + if (trs->trso_failed_sd == NULL) { printf("I hit the case that's obsolete, right?\n"); return; } @@ -216,6 +217,7 @@ g_raid_tr_raid1_rebuild_finish(struct g_ trs = (struct g_raid_tr_raid1_object *)tr; sd = trs->trso_failed_sd; + sd->sd_rebuild_pos = 0; g_raid_change_subdisk_state(sd, G_RAID_SUBDISK_S_ACTIVE); g_raid_tr_update_state_raid1(vol); g_raid_write_metadata(vol->v_softc, vol, sd, sd->sd_disk); @@ -224,7 +226,6 @@ g_raid_tr_raid1_rebuild_finish(struct g_ trs->trso_type = TR_RAID1_NONE; trs->trso_recover_slabs = 0; trs->trso_failed_sd = NULL; - trs->trso_good_sd = NULL; trs->trso_buffer = NULL; vol->v_timeout = 0; } @@ -238,6 +239,7 @@ g_raid_tr_raid1_rebuild_abort(struct g_r trs = (struct g_raid_tr_raid1_object *)tr; sd = trs->trso_failed_sd; +// sd->sd_rebuild_pos = 0; /* We may need this here... */ g_raid_unlock_range(tr->tro_volume,sd->sd_rebuild_pos, SD_REBUILD_SLAB); g_raid_write_metadata(vol->v_softc, vol, sd, sd->sd_disk); free(trs->trso_buffer, M_TR_raid1); @@ -245,7 +247,6 @@ g_raid_tr_raid1_rebuild_abort(struct g_r trs->trso_type = TR_RAID1_NONE; trs->trso_recover_slabs = 0; trs->trso_failed_sd = NULL; - trs->trso_good_sd = NULL; trs->trso_buffer = NULL; vol->v_timeout = 0; } @@ -278,6 +279,7 @@ g_raid_tr_raid1_rebuild_start(struct g_r { /* XXX ---- XXX Should this be based on trs state or vol state? XXX --- XXX */ struct g_raid_tr_raid1_object *trs; + struct g_raid_subdisk *sd; trs = (struct g_raid_tr_raid1_object *)tr; if (trs->trso_failed_sd) { @@ -285,15 +287,20 @@ g_raid_tr_raid1_rebuild_start(struct g_r (intmax_t)trs->trso_failed_sd->sd_rebuild_pos); return; } - trs->trso_good_sd = g_raid_tr_raid1_find_good_drive(vol); + sd = g_raid_tr_raid1_find_good_drive(vol); trs->trso_failed_sd = g_raid_tr_raid1_find_failed_drive(vol); - if (trs->trso_good_sd == NULL || trs->trso_failed_sd == NULL) { + if (sd == NULL || trs->trso_failed_sd == NULL) { G_RAID_DEBUG(1, "No failed disk to rebuild. night night."); return; } - G_RAID_DEBUG(2, "Kicking off a rebuild..."); + G_RAID_DEBUG(2, "Kicking off a rebuild at %jd...", + trs->trso_failed_sd->sd_rebuild_pos); trs->trso_type = TR_RAID1_REBUILD; - trs->trso_failed_sd->sd_rebuild_pos = 0; +/* + * I'm not sure when to reset this and when to use what's there already. + * XXX + */ +// trs->trso_failed_sd->sd_rebuild_pos = 0; trs->trso_buffer = malloc(SD_REBUILD_SLAB, M_TR_raid1, M_WAITOK); trs->trso_meta_update = SD_REBUILD_META_UPDATE; vol->v_to_arg = trs; @@ -466,7 +473,7 @@ g_raid_tr_iostart_raid1_write(struct g_r * writable, the rest will be written as part of the * that process. */ - if (bp->bio_offset >= sd->sd_offset) + if (bp->bio_offset >= sd->sd_rebuild_pos) continue; break; case G_RAID_SUBDISK_S_RESYNC: @@ -642,7 +649,8 @@ g_raid_tr_iodone_raid1(struct g_raid_tr_ cbp->bio_offset = nsd->sd_rebuild_pos; cbp->bio_length = MIN(SD_REBUILD_SLAB, vol->v_mediasize - nsd->sd_rebuild_pos); - cbp->bio_caller1 = trs->trso_good_sd; + cbp->bio_caller1 = + g_raid_tr_raid1_find_good_drive(vol); G_RAID_LOGREQ(4, bp, "Rebuild read at %jd.", cbp->bio_offset); g_raid_lock_range(sd->sd_volume, /* Lock callback starts I/O */ @@ -652,7 +660,7 @@ g_raid_tr_iodone_raid1(struct g_raid_tr_ /* * read good sd, read bad sd in parallel. * when both done, compare the buffers. write - * good_sd to failed_sd if different. do the + * good to the failed if different. do the * next bit of work. */ panic("Somehow, we think we're doing a resync"); From owner-svn-src-projects@FreeBSD.ORG Fri Jan 28 06:58:15 2011 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A452A106566C; Fri, 28 Jan 2011 06:58:15 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 79EE98FC08; Fri, 28 Jan 2011 06:58:15 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0S6wFqM061591; Fri, 28 Jan 2011 06:58:15 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0S6wFTN061589; Fri, 28 Jan 2011 06:58:15 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201101280658.p0S6wFTN061589@svn.freebsd.org> From: Warner Losh Date: Fri, 28 Jan 2011 06:58:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r218008 - projects/graid/head/sys/geom/raid X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Jan 2011 06:58:15 -0000 Author: imp Date: Fri Jan 28 06:58:14 2011 New Revision: 218008 URL: http://svn.freebsd.org/changeset/base/218008 Log: Abort the rebuild if no good disk can be found to rebuild from. Modified: projects/graid/head/sys/geom/raid/tr_raid1.c Modified: projects/graid/head/sys/geom/raid/tr_raid1.c ============================================================================== --- projects/graid/head/sys/geom/raid/tr_raid1.c Fri Jan 28 06:12:59 2011 (r218007) +++ projects/graid/head/sys/geom/raid/tr_raid1.c Fri Jan 28 06:58:14 2011 (r218008) @@ -109,8 +109,10 @@ static struct g_raid_tr_class g_raid_tr_ .trc_priority = 100 }; +static void g_raid_tr_raid1_rebuild_abort(struct g_raid_tr_object *tr, + struct g_raid_volume *vol); static struct g_raid_subdisk *g_raid_tr_raid1_find_good_drive( - struct g_raid_volume *vol); + struct g_raid_volume *vol); static void g_raid_tr_raid1_maybe_rebuild(struct g_raid_tr_object *tr, struct g_raid_volume *vol); @@ -166,11 +168,17 @@ g_raid_tr_raid1_rebuild_some(struct g_ra struct g_raid_subdisk *sd) { struct g_raid_tr_raid1_object *trs; + struct g_raid_subdisk *good_sd; struct bio *bp, *bp2; trs = (struct g_raid_tr_raid1_object *)tr; if (trs->trso_flags & TR_RAID1_F_DOING_SOME) return; + good_sd = g_raid_tr_raid1_find_good_drive(sd->sd_volume); + if (good_sd == NULL) { + g_raid_tr_raid1_rebuild_abort(tr, sd->sd_volume); + return; + } trs->trso_flags |= TR_RAID1_F_DOING_SOME; trs->trso_recover_slabs = SD_REBUILD_CLUSTER_IDLE; trs->trso_fair_io = SD_REBUILD_FAIR_IO; @@ -183,7 +191,7 @@ g_raid_tr_raid1_rebuild_some(struct g_ra bp->bio_cmd = BIO_READ; bp2 = g_clone_bio(bp); bp2->bio_cflags = G_RAID_BIO_FLAG_SYNC; - bp2->bio_caller1 = g_raid_tr_raid1_find_good_drive(sd->sd_volume); + bp2->bio_caller1 = good_sd; g_raid_lock_range(sd->sd_volume, /* Lock callback starts I/O */ bp2->bio_offset, bp2->bio_length, bp2); } @@ -561,7 +569,7 @@ g_raid_tr_iodone_raid1(struct g_raid_tr_ struct g_raid_subdisk *sd, struct bio *bp) { struct bio *cbp; - struct g_raid_subdisk *nsd; + struct g_raid_subdisk *nsd, *good_sd; struct g_raid_volume *vol; struct bio *pbp; struct g_raid_tr_raid1_object *trs; @@ -642,6 +650,11 @@ g_raid_tr_iodone_raid1(struct g_raid_tr_ trs->trso_flags &= ~TR_RAID1_F_DOING_SOME; return; } + good_sd = g_raid_tr_raid1_find_good_drive(vol); + if (good_sd == NULL) { + g_raid_tr_raid1_rebuild_abort(tr, vol); + return; + } pbp->bio_offset = nsd->sd_rebuild_pos; cbp = g_clone_bio(pbp); cbp->bio_cmd = BIO_READ; @@ -649,8 +662,7 @@ g_raid_tr_iodone_raid1(struct g_raid_tr_ cbp->bio_offset = nsd->sd_rebuild_pos; cbp->bio_length = MIN(SD_REBUILD_SLAB, vol->v_mediasize - nsd->sd_rebuild_pos); - cbp->bio_caller1 = - g_raid_tr_raid1_find_good_drive(vol); + cbp->bio_caller1 = good_sd; G_RAID_LOGREQ(4, bp, "Rebuild read at %jd.", cbp->bio_offset); g_raid_lock_range(sd->sd_volume, /* Lock callback starts I/O */ From owner-svn-src-projects@FreeBSD.ORG Fri Jan 28 13:48:22 2011 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EE4C8106564A; Fri, 28 Jan 2011 13:48:22 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DE26C8FC1C; Fri, 28 Jan 2011 13:48:22 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0SDmMm9081304; Fri, 28 Jan 2011 13:48:22 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0SDmMhw081302; Fri, 28 Jan 2011 13:48:22 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201101281348.p0SDmMhw081302@svn.freebsd.org> From: Alexander Motin Date: Fri, 28 Jan 2011 13:48:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r218016 - projects/graid/head/sys/geom/raid X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Jan 2011 13:48:23 -0000 Author: mav Date: Fri Jan 28 13:48:22 2011 New Revision: 218016 URL: http://svn.freebsd.org/changeset/base/218016 Log: Add `graid label` ability to create arrays missing some disks by specifying NONE instead of their names. It can be used, for example, to migrate from non-RAID setup to RAID1 or if further redundant disks are not available at the moment. Add some checks to validate subdisk sizes. Creating too small subdisk could cause crash, while for too large it may be impossible to write metadata. Modified: projects/graid/head/sys/geom/raid/md_intel.c Modified: projects/graid/head/sys/geom/raid/md_intel.c ============================================================================== --- projects/graid/head/sys/geom/raid/md_intel.c Fri Jan 28 11:56:14 2011 (r218015) +++ projects/graid/head/sys/geom/raid/md_intel.c Fri Jan 28 13:48:22 2011 (r218016) @@ -1229,6 +1229,11 @@ g_raid_md_ctl_intel(struct g_raid_md_obj error = -6; break; } + if (strcmp(diskname, "NONE") == 0) { + cp = NULL; + pp = NULL; + goto makedisk; + } if (strncmp(diskname, "/dev/", 5) == 0) diskname += 5; g_topology_lock(); @@ -1258,12 +1263,19 @@ g_raid_md_ctl_intel(struct g_raid_md_obj error = -7; break; } - +makedisk: pd = malloc(sizeof(*pd), M_MD_INTEL, M_WAITOK | M_ZERO); pd->pd_disk_pos = i; disk = g_raid_create_disk(sc); disk->d_md_data = (void *)pd; disk->d_consumer = cp; + if (cp == NULL) { + strcpy(&pd->pd_disk_meta.serial[0], "NONE"); + pd->pd_disk_meta.id = 0; + pd->pd_disk_meta.id = 0xffffffff; + pd->pd_disk_meta.flags = INTEL_F_ASSIGNED; + continue; + } cp->private = disk; g_topology_unlock(); @@ -1331,7 +1343,20 @@ g_raid_md_ctl_intel(struct g_raid_md_obj } strip = *striparg; } - size -= (size % strip); + + /* Round size down to strip or sector. */ + if (level == G_RAID_VOLUME_RL_RAID1) + size -= (size % sectorsize); + else + size -= (size % strip); + if (size <= 0) { + 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, ... */ mdi->mdio_started = 1; @@ -1343,9 +1368,11 @@ g_raid_md_ctl_intel(struct g_raid_md_obj vol->v_disks_count = numdisks; if (level == G_RAID_VOLUME_RL_RAID0) vol->v_mediasize = size * numdisks; + else if (level == G_RAID_VOLUME_RL_RAID1) + vol->v_mediasize = size; else if (level == G_RAID_VOLUME_RL_RAID5) vol->v_mediasize = size * (numdisks - 1); - else + else /* RAID10 */ vol->v_mediasize = size * (numdisks / 2); vol->v_sectorsize = sectorsize; g_raid_start_volume(vol); @@ -1358,14 +1385,23 @@ g_raid_md_ctl_intel(struct g_raid_md_obj sd->sd_offset = 0; sd->sd_size = size; TAILQ_INSERT_TAIL(&disk->d_subdisks, sd, sd_next); - g_raid_change_disk_state(disk, G_RAID_DISK_S_ACTIVE); - 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); + if (sd->sd_disk->d_consumer != NULL) { + g_raid_change_disk_state(disk, + G_RAID_DISK_S_ACTIVE); + 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); + } else { + g_raid_change_disk_state(disk, G_RAID_DISK_S_OFFLINE); + } } /* Write metadata based on created entities. */ g_raid_md_write_intel(md, NULL, NULL, NULL); + + /* Pickup any STALE/SPARE disks to refill array if needed. */ + g_raid_md_intel_refill(sc); return (0); } if (strcmp(verb, "add") == 0) { @@ -1476,14 +1512,24 @@ g_raid_md_ctl_intel(struct g_raid_md_obj } strip = *striparg; } + + /* Round offset up to strip. */ size -= ((strip - off) % strip); off += ((strip - off) % strip); - size -= (size % strip); + /* Round size down to strip or sector. */ + if (level == G_RAID_VOLUME_RL_RAID1) + size -= (size % sectorsize); + else + size -= (size % strip); if (size <= 0) { - gctl_error(req, "No free space."); + 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, ... */ vol = g_raid_create_volume(sc, volname); @@ -1494,9 +1540,11 @@ g_raid_md_ctl_intel(struct g_raid_md_obj vol->v_disks_count = numdisks; if (level == G_RAID_VOLUME_RL_RAID0) vol->v_mediasize = size * numdisks; + else if (level == G_RAID_VOLUME_RL_RAID1) + vol->v_mediasize = size; else if (level == G_RAID_VOLUME_RL_RAID5) vol->v_mediasize = size * (numdisks - 1); - else + else /* RAID10 */ vol->v_mediasize = size * (numdisks / 2); vol->v_sectorsize = sectorsize; g_raid_start_volume(vol); From owner-svn-src-projects@FreeBSD.ORG Fri Jan 28 16:28:58 2011 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2B1C51065672; Fri, 28 Jan 2011 16:28:58 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 014248FC12; Fri, 28 Jan 2011 16:28:58 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0SGSvVs087225; Fri, 28 Jan 2011 16:28:57 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0SGSvVp087223; Fri, 28 Jan 2011 16:28:57 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201101281628.p0SGSvVp087223@svn.freebsd.org> From: Alexander Motin Date: Fri, 28 Jan 2011 16:28:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r218023 - projects/graid/head/sys/geom/raid X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Jan 2011 16:28:58 -0000 Author: mav Date: Fri Jan 28 16:28:57 2011 New Revision: 218023 URL: http://svn.freebsd.org/changeset/base/218023 Log: Add support for storing rebuild position in metadata and reading it back. Not sure this implementation is compatible, but it should be enough for now. Modified: projects/graid/head/sys/geom/raid/md_intel.c Modified: projects/graid/head/sys/geom/raid/md_intel.c ============================================================================== --- projects/graid/head/sys/geom/raid/md_intel.c Fri Jan 28 16:20:15 2011 (r218022) +++ projects/graid/head/sys/geom/raid/md_intel.c Fri Jan 28 16:28:57 2011 (r218023) @@ -650,6 +650,10 @@ nofit: } else { g_raid_change_subdisk_state(sd, G_RAID_SUBDISK_S_REBUILD); + sd->sd_rebuild_pos = + (off_t)mvol->curr_migr_unit * + sd->sd_volume->v_strip_size * + mmap0->total_domains; } } else if (mvol->migr_type == INTEL_MT_VERIFY || mvol->migr_type == INTEL_MT_REPAIR) { @@ -662,6 +666,10 @@ nofit: } else { g_raid_change_subdisk_state(sd, G_RAID_SUBDISK_S_RESYNC); + sd->sd_rebuild_pos = + (off_t)mvol->curr_migr_unit * + sd->sd_volume->v_strip_size * + mmap0->total_domains; } } g_raid_event_send(sd, G_RAID_SUBDISK_E_NEW, @@ -1822,7 +1830,7 @@ g_raid_md_write_intel(struct g_raid_md_o struct intel_raid_conf *meta; struct intel_raid_vol *mvol; struct intel_raid_map *mmap0, *mmap1; - off_t sectorsize = 512; + off_t sectorsize = 512, pos; const char *version, *cv; int vi, sdi, numdisks, len, state; @@ -1924,6 +1932,7 @@ g_raid_md_write_intel(struct g_raid_md_o /* Check for any recovery in progress. */ state = G_RAID_SUBDISK_S_ACTIVE; + pos = 0x7fffffffffffffffllu; for (sdi = 0; sdi < vol->v_disks_count; sdi++) { sd = &vol->v_subdisks[sdi]; if (sd->sd_state == G_RAID_SUBDISK_S_REBUILD) @@ -1931,6 +1940,10 @@ g_raid_md_write_intel(struct g_raid_md_o else if (sd->sd_state == G_RAID_SUBDISK_S_RESYNC && state != G_RAID_SUBDISK_S_REBUILD) state = G_RAID_SUBDISK_S_RESYNC; + if ((sd->sd_state == G_RAID_SUBDISK_S_REBUILD || + sd->sd_state == G_RAID_SUBDISK_S_RESYNC) && + sd->sd_rebuild_pos < pos) + pos = sd->sd_rebuild_pos; } if (state == G_RAID_SUBDISK_S_REBUILD) { mvol->migr_state = 1; @@ -1974,6 +1987,8 @@ g_raid_md_write_intel(struct g_raid_md_o /* If there are two maps - copy common and update. */ if (mvol->migr_state) { + mvol->curr_migr_unit = pos / + vol->v_strip_size / mmap0->total_domains; mmap1 = intel_get_map(mvol, 1); memcpy(mmap1, mmap0, sizeof(struct intel_raid_map)); mmap0->status = INTEL_S_READY; From owner-svn-src-projects@FreeBSD.ORG Fri Jan 28 18:42:18 2011 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 77AB41065672; Fri, 28 Jan 2011 18:42:18 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 636028FC13; Fri, 28 Jan 2011 18:42:18 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0SIgI9H095051; Fri, 28 Jan 2011 18:42:18 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0SIgHRP095016; Fri, 28 Jan 2011 18:42:17 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201101281842.p0SIgHRP095016@svn.freebsd.org> From: Dimitry Andric Date: Fri, 28 Jan 2011 18:42:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r218029 - in projects/binutils-2.17: . bin/ps bin/sh contrib/top etc/periodic/daily gnu/lib/libgcc gnu/lib/libgomp gnu/usr.bin/binutils lib/libc lib/libc/sys lib/libelf libexec/rtld-elf... X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Jan 2011 18:42:18 -0000 Author: dim Date: Fri Jan 28 18:42:17 2011 New Revision: 218029 URL: http://svn.freebsd.org/changeset/base/218029 Log: Sync: merge r217802 through r218028 from ^/head. Added: projects/binutils-2.17/share/doc/papers/kernmalloc/appendix.ms - copied unchanged from r218024, head/share/doc/papers/kernmalloc/appendix.ms projects/binutils-2.17/share/doc/papers/sysperf/appendix.ms - copied unchanged from r218024, head/share/doc/papers/sysperf/appendix.ms projects/binutils-2.17/sys/dev/ath/ath_rate/sample/tx_schedules.h - copied unchanged from r218024, head/sys/dev/ath/ath_rate/sample/tx_schedules.h projects/binutils-2.17/sys/modules/khelp/h_ertt/ - copied from r218024, head/sys/modules/khelp/h_ertt/ projects/binutils-2.17/sys/netinet/khelp/ - copied from r218024, head/sys/netinet/khelp/ projects/binutils-2.17/tools/regression/bin/sh/builtins/trap7.0 - copied unchanged from r218024, head/tools/regression/bin/sh/builtins/trap7.0 Modified: projects/binutils-2.17/Makefile projects/binutils-2.17/bin/ps/ps.1 projects/binutils-2.17/bin/sh/var.c projects/binutils-2.17/etc/periodic/daily/800.scrub-zfs projects/binutils-2.17/gnu/lib/libgcc/Makefile projects/binutils-2.17/gnu/lib/libgomp/Makefile projects/binutils-2.17/gnu/usr.bin/binutils/Makefile.inc0 projects/binutils-2.17/lib/libc/Makefile projects/binutils-2.17/lib/libc/sys/Makefile.inc projects/binutils-2.17/lib/libc/sys/ptrace.2 projects/binutils-2.17/lib/libelf/elf_data.c projects/binutils-2.17/libexec/rtld-elf/amd64/rtld_machdep.h projects/binutils-2.17/libexec/rtld-elf/arm/rtld_machdep.h projects/binutils-2.17/libexec/rtld-elf/i386/rtld_machdep.h projects/binutils-2.17/libexec/rtld-elf/ia64/rtld_machdep.h projects/binutils-2.17/libexec/rtld-elf/map_object.c projects/binutils-2.17/libexec/rtld-elf/mips/rtld_machdep.h projects/binutils-2.17/libexec/rtld-elf/powerpc/rtld_machdep.h projects/binutils-2.17/libexec/rtld-elf/powerpc64/rtld_machdep.h projects/binutils-2.17/libexec/rtld-elf/rtld.c projects/binutils-2.17/libexec/rtld-elf/sparc64/rtld_machdep.h projects/binutils-2.17/sbin/fdisk/fdisk.c projects/binutils-2.17/sbin/geom/class/part/gpart.8 projects/binutils-2.17/sbin/hastctl/hastctl.c projects/binutils-2.17/sbin/hastd/control.c projects/binutils-2.17/sbin/hastd/hast.h projects/binutils-2.17/sbin/hastd/hastd.c projects/binutils-2.17/sbin/hastd/pjdlog.c projects/binutils-2.17/sbin/hastd/pjdlog.h projects/binutils-2.17/sbin/iscontrol/config.c projects/binutils-2.17/sbin/iscontrol/fsm.c projects/binutils-2.17/sbin/mount/mount.8 projects/binutils-2.17/share/doc/papers/kernmalloc/Makefile projects/binutils-2.17/share/doc/papers/sysperf/Makefile projects/binutils-2.17/share/examples/etc/make.conf projects/binutils-2.17/share/man/man4/altq.4 projects/binutils-2.17/share/man/man4/ixgb.4 projects/binutils-2.17/share/man/man4/nfe.4 projects/binutils-2.17/share/man/man4/re.4 projects/binutils-2.17/share/man/man4/rgephy.4 projects/binutils-2.17/share/man/man7/build.7 projects/binutils-2.17/share/man/man9/Makefile projects/binutils-2.17/share/man/man9/sbuf.9 projects/binutils-2.17/sys/amd64/amd64/machdep.c projects/binutils-2.17/sys/amd64/amd64/vm_machdep.c projects/binutils-2.17/sys/amd64/linux32/linux.h projects/binutils-2.17/sys/amd64/linux32/linux32_machdep.c projects/binutils-2.17/sys/cam/ata/ata_xpt.c projects/binutils-2.17/sys/cddl/compat/opensolaris/kern/opensolaris_atomic.c projects/binutils-2.17/sys/cddl/compat/opensolaris/sys/atomic.h projects/binutils-2.17/sys/compat/linprocfs/linprocfs.c projects/binutils-2.17/sys/compat/linux/linux_misc.c projects/binutils-2.17/sys/dev/ath/ath_hal/ah.c projects/binutils-2.17/sys/dev/ath/ath_hal/ah.h projects/binutils-2.17/sys/dev/ath/ath_hal/ah_debug.h projects/binutils-2.17/sys/dev/ath/ath_hal/ah_eeprom_v4k.c projects/binutils-2.17/sys/dev/ath/ath_hal/ah_eeprom_v4k.h projects/binutils-2.17/sys/dev/ath/ath_hal/ar5212/ar5212.h projects/binutils-2.17/sys/dev/ath/ath_hal/ar5416/ar2133.c projects/binutils-2.17/sys/dev/ath/ath_hal/ar5416/ar5416.h projects/binutils-2.17/sys/dev/ath/ath_hal/ar5416/ar5416_ani.c projects/binutils-2.17/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c projects/binutils-2.17/sys/dev/ath/ath_hal/ar5416/ar5416_xmit.c projects/binutils-2.17/sys/dev/ath/ath_hal/ar5416/ar5416reg.h projects/binutils-2.17/sys/dev/ath/ath_hal/ar9002/ar9285v2.ini projects/binutils-2.17/sys/dev/ath/ath_rate/sample/sample.c projects/binutils-2.17/sys/dev/cxgb/cxgb_sge.c projects/binutils-2.17/sys/dev/md/md.c projects/binutils-2.17/sys/dev/mii/miidevs projects/binutils-2.17/sys/dev/mii/rlphy.c projects/binutils-2.17/sys/dev/re/if_re.c projects/binutils-2.17/sys/dev/siis/siis.c projects/binutils-2.17/sys/dev/siis/siis.h projects/binutils-2.17/sys/fs/nfs/nfsport.h projects/binutils-2.17/sys/fs/procfs/procfs_dbregs.c projects/binutils-2.17/sys/fs/procfs/procfs_fpregs.c projects/binutils-2.17/sys/fs/procfs/procfs_map.c projects/binutils-2.17/sys/fs/procfs/procfs_regs.c projects/binutils-2.17/sys/geom/geom_disk.c projects/binutils-2.17/sys/geom/journal/g_journal.c projects/binutils-2.17/sys/geom/part/g_part.c projects/binutils-2.17/sys/geom/part/g_part.h projects/binutils-2.17/sys/geom/part/g_part_bsd.c projects/binutils-2.17/sys/geom/part/g_part_ebr.c projects/binutils-2.17/sys/geom/part/g_part_gpt.c projects/binutils-2.17/sys/geom/part/g_part_mbr.c projects/binutils-2.17/sys/i386/i386/machdep.c projects/binutils-2.17/sys/i386/linux/linux_machdep.c projects/binutils-2.17/sys/kern/kern_descrip.c projects/binutils-2.17/sys/kern/kern_fork.c projects/binutils-2.17/sys/kern/kern_jail.c projects/binutils-2.17/sys/kern/kern_malloc.c projects/binutils-2.17/sys/kern/kern_proc.c projects/binutils-2.17/sys/kern/kern_sig.c projects/binutils-2.17/sys/kern/kern_sysctl.c projects/binutils-2.17/sys/kern/subr_lock.c projects/binutils-2.17/sys/kern/subr_sleepqueue.c projects/binutils-2.17/sys/kern/subr_trap.c projects/binutils-2.17/sys/kern/subr_witness.c projects/binutils-2.17/sys/kern/sys_process.c projects/binutils-2.17/sys/kern/uipc_syscalls.c projects/binutils-2.17/sys/kern/vfs_subr.c projects/binutils-2.17/sys/mips/include/sf_buf.h projects/binutils-2.17/sys/mips/mips/uio_machdep.c projects/binutils-2.17/sys/mips/mips/vm_machdep.c projects/binutils-2.17/sys/modules/khelp/Makefile projects/binutils-2.17/sys/net/if.c projects/binutils-2.17/sys/netinet/if_ether.c projects/binutils-2.17/sys/netinet/in_pcb.c projects/binutils-2.17/sys/netinet/sctp_cc_functions.c projects/binutils-2.17/sys/netinet/sctp_constants.h projects/binutils-2.17/sys/netinet/sctp_output.c projects/binutils-2.17/sys/netinet/sctp_pcb.h projects/binutils-2.17/sys/netinet/sctp_structs.h projects/binutils-2.17/sys/netinet/sctp_sysctl.h projects/binutils-2.17/sys/netinet/sctp_usrreq.c projects/binutils-2.17/sys/pci/if_rlreg.h projects/binutils-2.17/sys/powerpc/aim/trap.c projects/binutils-2.17/sys/powerpc/powerpc/exec_machdep.c projects/binutils-2.17/sys/sys/diskmbr.h projects/binutils-2.17/sys/sys/gpt.h projects/binutils-2.17/sys/sys/proc.h projects/binutils-2.17/sys/sys/ptrace.h projects/binutils-2.17/sys/sys/sysctl.h projects/binutils-2.17/sys/sys/sysent.h projects/binutils-2.17/sys/vm/uma_core.c projects/binutils-2.17/sys/vm/vm_phys.c projects/binutils-2.17/sys/vm/vm_reserv.c projects/binutils-2.17/tools/tools/ath/ath_ee_v4k_print/v4k.c projects/binutils-2.17/usr.bin/csup/updater.c projects/binutils-2.17/usr.bin/getopt/getopt.1 projects/binutils-2.17/usr.bin/ktrdump/ktrdump.8 projects/binutils-2.17/usr.bin/ktrdump/ktrdump.c projects/binutils-2.17/usr.bin/man/man.sh projects/binutils-2.17/usr.sbin/Makefile.mips projects/binutils-2.17/usr.sbin/usbdump/usbdump.c Directory Properties: projects/binutils-2.17/ (props changed) projects/binutils-2.17/cddl/contrib/opensolaris/ (props changed) projects/binutils-2.17/contrib/bind9/ (props changed) projects/binutils-2.17/contrib/binutils/ (props changed) projects/binutils-2.17/contrib/bzip2/ (props changed) projects/binutils-2.17/contrib/dialog/ (props changed) projects/binutils-2.17/contrib/ee/ (props changed) projects/binutils-2.17/contrib/expat/ (props changed) projects/binutils-2.17/contrib/file/ (props changed) projects/binutils-2.17/contrib/gdb/ (props changed) projects/binutils-2.17/contrib/gdtoa/ (props changed) projects/binutils-2.17/contrib/gnu-sort/ (props changed) projects/binutils-2.17/contrib/groff/ (props changed) projects/binutils-2.17/contrib/less/ (props changed) projects/binutils-2.17/contrib/libpcap/ (props changed) projects/binutils-2.17/contrib/llvm/ (props changed) projects/binutils-2.17/contrib/llvm/tools/clang/ (props changed) projects/binutils-2.17/contrib/ncurses/ (props changed) projects/binutils-2.17/contrib/netcat/ (props changed) projects/binutils-2.17/contrib/ntp/ (props changed) projects/binutils-2.17/contrib/one-true-awk/ (props changed) projects/binutils-2.17/contrib/openbsm/ (props changed) projects/binutils-2.17/contrib/openpam/ (props changed) projects/binutils-2.17/contrib/pf/ (props changed) projects/binutils-2.17/contrib/sendmail/ (props changed) projects/binutils-2.17/contrib/tcpdump/ (props changed) projects/binutils-2.17/contrib/tcsh/ (props changed) projects/binutils-2.17/contrib/top/ (props changed) projects/binutils-2.17/contrib/top/install-sh (props changed) projects/binutils-2.17/contrib/tzcode/stdtime/ (props changed) projects/binutils-2.17/contrib/tzcode/zic/ (props changed) projects/binutils-2.17/contrib/tzdata/ (props changed) projects/binutils-2.17/contrib/wpa/ (props changed) projects/binutils-2.17/contrib/xz/ (props changed) projects/binutils-2.17/crypto/openssh/ (props changed) projects/binutils-2.17/crypto/openssl/ (props changed) projects/binutils-2.17/lib/libc/ (props changed) projects/binutils-2.17/lib/libc/stdtime/ (props changed) projects/binutils-2.17/lib/libutil/ (props changed) projects/binutils-2.17/lib/libz/ (props changed) projects/binutils-2.17/sbin/ (props changed) projects/binutils-2.17/sbin/ipfw/ (props changed) projects/binutils-2.17/share/mk/bsd.arch.inc.mk (props changed) projects/binutils-2.17/share/zoneinfo/ (props changed) projects/binutils-2.17/sys/ (props changed) projects/binutils-2.17/sys/amd64/include/xen/ (props changed) projects/binutils-2.17/sys/cddl/contrib/opensolaris/ (props changed) projects/binutils-2.17/sys/contrib/dev/acpica/ (props changed) projects/binutils-2.17/sys/contrib/octeon-sdk/ (props changed) projects/binutils-2.17/sys/contrib/pf/ (props changed) projects/binutils-2.17/sys/contrib/x86emu/ (props changed) projects/binutils-2.17/usr.bin/calendar/ (props changed) projects/binutils-2.17/usr.bin/csup/ (props changed) projects/binutils-2.17/usr.bin/procstat/ (props changed) projects/binutils-2.17/usr.sbin/zic/ (props changed) Modified: projects/binutils-2.17/Makefile ============================================================================== --- projects/binutils-2.17/Makefile Fri Jan 28 18:28:06 2011 (r218028) +++ projects/binutils-2.17/Makefile Fri Jan 28 18:42:17 2011 (r218029) @@ -28,7 +28,8 @@ # delete-old-dirs - Delete obsolete directories. # delete-old-files - Delete obsolete files. # delete-old-libs - Delete obsolete libraries. -# targets - Print a list of supported TARGET/TARGET_ARCH pairs. +# targets - Print a list of supported TARGET/TARGET_ARCH pairs +# for world and kernel targets. # # This makefile is simple by design. The FreeBSD make automatically reads # the /usr/share/mk/sys.mk unless the -m argument is specified on the @@ -297,7 +298,7 @@ TARGET_ARCHES_${target}?= ${target} .endfor targets: - @echo "Supported TARGETS/TARGET_ARCH pairs" + @echo "Supported TARGET/TARGET_ARCH pairs for world and kernel targets" .for target in ${TARGETS} .for target_arch in ${TARGET_ARCHES_${target}} @echo " ${target}/${target_arch}" Modified: projects/binutils-2.17/bin/ps/ps.1 ============================================================================== --- projects/binutils-2.17/bin/ps/ps.1 Fri Jan 28 18:28:06 2011 (r218028) +++ projects/binutils-2.17/bin/ps/ps.1 Fri Jan 28 18:42:17 2011 (r218029) @@ -288,6 +288,7 @@ the include file .It Dv "P_ADVLOCK" Ta No "0x00001 Process may hold a POSIX advisory lock" .It Dv "P_CONTROLT" Ta No "0x00002 Has a controlling terminal" .It Dv "P_KTHREAD" Ta No "0x00004 Kernel thread" +.It Dv "P_FOLLOWFORK" Ta No "0x00008 Attach debugger to new children" .It Dv "P_PPWAIT" Ta No "0x00010 Parent is waiting for child to exec/exit" .It Dv "P_PROFIL" Ta No "0x00020 Has started profiling" .It Dv "P_STOPPROF" Ta No "0x00040 Has thread in requesting to stop prof" Modified: projects/binutils-2.17/bin/sh/var.c ============================================================================== --- projects/binutils-2.17/bin/sh/var.c Fri Jan 28 18:28:06 2011 (r218028) +++ projects/binutils-2.17/bin/sh/var.c Fri Jan 28 18:42:17 2011 (r218029) @@ -600,9 +600,8 @@ var_compare(const void *a, const void *b /* - * Command to list all variables which are set. Currently this command - * is invoked from the set command when the set command is called without - * any variables. + * Command to list all variables which are set. This is invoked from the + * set command when it is called without any options or operands. */ int @@ -840,9 +839,7 @@ setvarcmd(int argc, char **argv) /* - * The unset builtin command. We unset the function before we unset the - * variable to allow a function to be unset when there is a readonly variable - * with the same name. + * The unset builtin command. */ int Modified: projects/binutils-2.17/etc/periodic/daily/800.scrub-zfs ============================================================================== --- projects/binutils-2.17/etc/periodic/daily/800.scrub-zfs Fri Jan 28 18:28:06 2011 (r218028) +++ projects/binutils-2.17/etc/periodic/daily/800.scrub-zfs Fri Jan 28 18:42:17 2011 (r218029) @@ -5,6 +5,10 @@ # If there is a global system configuration file, suck it in. # + +newline=" +" # A single newline + if [ -r /etc/defaults/periodic.conf ] then . /etc/defaults/periodic.conf @@ -24,17 +28,19 @@ case "$daily_scrub_zfs_enable" in for pool in ${daily_scrub_zfs_pools}; do # sanity check - _status=$(zpool list ${pool} | sed -n -e '$p') + _status=$(zpool list "${pool}" 2> /dev/null) if [ $? -ne 0 ]; then echo " WARNING: pool '${pool}' specified in" echo " '/etc/periodic.conf:daily_scrub_zfs_pools'" echo " does not exist" continue fi - if echo ${_status} | grep -q FAULTED; then + _status=${_status##*$newline} + case ${_status} in + *FAULTED*) echo "Skipping faulted pool: ${pool}" - continue - fi + continue ;; + esac # successful only if there is at least one pool to scrub rc=0 Modified: projects/binutils-2.17/gnu/lib/libgcc/Makefile ============================================================================== --- projects/binutils-2.17/gnu/lib/libgcc/Makefile Fri Jan 28 18:28:06 2011 (r218028) +++ projects/binutils-2.17/gnu/lib/libgcc/Makefile Fri Jan 28 18:42:17 2011 (r218029) @@ -121,8 +121,8 @@ LIB2FUNCS_EXTRA = floatunsidf.c floatuns .if ${TARGET_CPUARCH} == mips LIB2FUNCS_EXTRA = floatunsidf.c floatunsisf.c -# XXX do we need n32 here? -.if ${TARGET_ARCH:Mmips64*} != "" +# ABIs other than o32 need this +.if ${TARGET_ARCH:Mmipse[lb]} == "" LIB2FUNCS_EXTRA+= floatdidf.c fixunsdfsi.c LIB2FUNCS_EXTRA+= floatdisf.c floatundidf.c LIB2FUNCS_EXTRA+= fixsfdi.c floatundisf.c Modified: projects/binutils-2.17/gnu/lib/libgomp/Makefile ============================================================================== --- projects/binutils-2.17/gnu/lib/libgomp/Makefile Fri Jan 28 18:28:06 2011 (r218028) +++ projects/binutils-2.17/gnu/lib/libgomp/Makefile Fri Jan 28 18:42:17 2011 (r218029) @@ -25,7 +25,7 @@ VERSION_MAP= ${SRCDIR}/libgomp.map # Target-specific OpenMP configuration .if ${MACHINE_CPUARCH} == arm || ${MACHINE_CPUARCH} == i386 || \ ${MACHINE_ARCH} == powerpc || \ - ${MACHINE_ARCH} == mipsel || ${MACHINE_ARCH} == mipseb + (${MACHINE_CPUARCH} == mips && ${MACHINE_ARCH:Mmips64*} == "") OMP_LOCK_ALIGN = 4 OMP_LOCK_KIND= 4 OMP_LOCK_SIZE= 4 Modified: projects/binutils-2.17/gnu/usr.bin/binutils/Makefile.inc0 ============================================================================== --- projects/binutils-2.17/gnu/usr.bin/binutils/Makefile.inc0 Fri Jan 28 18:28:06 2011 (r218028) +++ projects/binutils-2.17/gnu/usr.bin/binutils/Makefile.inc0 Fri Jan 28 18:42:17 2011 (r218029) @@ -30,7 +30,7 @@ SRCDIR= ${.CURDIR}/${RELSRC} .if ${TARGET_CPUARCH} == "arm" || ${TARGET_CPUARCH} == "i386" || \ ${TARGET_ARCH} == "powerpc" || \ - ${TARGET_ARCH} == "mipsel" || ${TARGET_ARCH} == "mipseb" + (${TARGET_CPUARCH} == "mips" && ${TARGET_ARCH:Mmips64*} == "") CFLAGS+= -DBFD_DEFAULT_TARGET_SIZE=32 .else CFLAGS+= -DBFD_DEFAULT_TARGET_SIZE=64 Modified: projects/binutils-2.17/lib/libc/Makefile ============================================================================== --- projects/binutils-2.17/lib/libc/Makefile Fri Jan 28 18:28:06 2011 (r218028) +++ projects/binutils-2.17/lib/libc/Makefile Fri Jan 28 18:42:17 2011 (r218029) @@ -68,6 +68,7 @@ NOASM= ${LIBC_ARCH} != "ia64" && \ ${LIBC_ARCH} != "powerpc64" && \ ${LIBC_ARCH} != "sparc64" && \ + ${MACHINE_ARCH:Mmipsn32*} == "" && \ ${MACHINE_ARCH:Mmips64*} == "" .include "${.CURDIR}/quad/Makefile.inc" .endif Modified: projects/binutils-2.17/lib/libc/sys/Makefile.inc ============================================================================== --- projects/binutils-2.17/lib/libc/sys/Makefile.inc Fri Jan 28 18:28:06 2011 (r218028) +++ projects/binutils-2.17/lib/libc/sys/Makefile.inc Fri Jan 28 18:42:17 2011 (r218029) @@ -53,16 +53,23 @@ SYM_MAPS+= ${.CURDIR}/sys/Symbol.map # Generated files CLEANFILES+= ${SASM} ${SPSEUDO} +.if ${MACHINE_CPUARCH} == "amd64" || ${MACHINE_CPUARCH} == "i386" || \ + ${MACHINE_CPUARCH} == "powerpc" +NOTE_GNU_STACK='\t.section .note.GNU-stack,"",%%progbits\n' +.else +NOTE_GNU_STACK='' +.endif + ${SASM}: printf '#include "compat.h"\n' > ${.TARGET} printf '#include "SYS.h"\nRSYSCALL(${.PREFIX})\n' >> ${.TARGET} - printf '\t.section .note.GNU-stack,"",%%progbits\n' >>${.TARGET} + printf ${NOTE_GNU_STACK} >>${.TARGET} ${SPSEUDO}: printf '#include "compat.h"\n' > ${.TARGET} printf '#include "SYS.h"\nPSEUDO(${.PREFIX:S/_//})\n' \ >> ${.TARGET} - printf '\t.section .note.GNU-stack,"",%%progbits\n' >>${.TARGET} + printf ${NOTE_GNU_STACK} >>${.TARGET} MAN+= abort2.2 accept.2 access.2 acct.2 adjtime.2 \ aio_cancel.2 aio_error.2 aio_read.2 aio_return.2 \ Modified: projects/binutils-2.17/lib/libc/sys/ptrace.2 ============================================================================== --- projects/binutils-2.17/lib/libc/sys/ptrace.2 Fri Jan 28 18:28:06 2011 (r218028) +++ projects/binutils-2.17/lib/libc/sys/ptrace.2 Fri Jan 28 18:42:17 2011 (r218029) @@ -2,7 +2,7 @@ .\" $NetBSD: ptrace.2,v 1.2 1995/02/27 12:35:37 cgd Exp $ .\" .\" This file is in the public domain. -.Dd July 10, 2010 +.Dd January 23, 2011 .Dt PTRACE 2 .Os .Sh NAME @@ -295,6 +295,8 @@ struct ptrace_lwpinfo { sigset_t pl_sigmask; sigset_t pl_siglist; siginfo_t pl_siginfo; + char pl_tdname[MAXCOMLEN + 1]; + int pl_child_pid; }; .Ed .Pp @@ -345,6 +347,14 @@ Indicates that member of .Vt "struct ptrace_lwpinfo" contains valid information. +.It PL_FLAG_FORKED +Indicates that the process is returning from a call to +.Fn fork 2 +that created a new child process. +The process identifier of the new process is available in the +.Va pl_child_pid +member of +.Vt "struct ptrace_lwpinfo" . .El .It pl_sigmask The current signal mask of the LWP @@ -356,11 +366,20 @@ on an LWP siglist until the thread is se The siginfo that accompanies the signal pending. Only valid for .Dv PL_EVENT_SIGNAL -kind of stop, when -.Va pl_flags -has +stop when .Dv PL_FLAG_SI -set. +is set in +.Va pl_flags . +.It pl_tdname +The name of the thread. +.It pl_child_pid +The process identifier of the new child process. +Only valid for a +.Dv PL_EVENT_SIGNAL +stop when +.Dv PL_FLAG_FORKED +is set in +.Va pl_flags . .El .It PT_GETNUMLWPS This request returns the number of kernel threads associated with the @@ -391,6 +410,21 @@ This request will trace the specified pr .It PT_SYSCALL This request will trace the specified process on each system call entry and exit. +.It PT_FOLLOW_FORK +This request controls tracing for new child processes of a traced process. +If +.Fa data +is non-zero, +then new child processes will enable tracing and stop before executing their +first instruction. +If +.Fa data +is zero, then new child processes will execute without tracing enabled. +By default, tracing is not enabled for new child processes. +Child processes do not inherit this property. +The traced process will set the +.Dv PL_FLAG_FORKED +flag upon exit from a system call that creates a new process. .It PT_VM_TIMESTAMP This request returns the generation number or timestamp of the memory map of the traced process as the return value from @@ -567,6 +601,7 @@ function appeared in .At v7 . .Sh BUGS The +.Dv PL_FLAG_FORKED , .Dv PL_FLAG_SCE , .Dv PL_FLAG_SCX and Modified: projects/binutils-2.17/lib/libelf/elf_data.c ============================================================================== --- projects/binutils-2.17/lib/libelf/elf_data.c Fri Jan 28 18:28:06 2011 (r218028) +++ projects/binutils-2.17/lib/libelf/elf_data.c Fri Jan 28 18:42:17 2011 (r218029) @@ -115,8 +115,10 @@ elf_getdata(Elf_Scn *s, Elf_Data *d) d->d_type = elftype; d->d_version = e->e_version; - if (sh_type == SHT_NOBITS) + if (sh_type == SHT_NOBITS || sh_size == 0) { + STAILQ_INSERT_TAIL(&s->s_data, d, d_next); return (d); + } if ((d->d_buf = malloc(msz*count)) == NULL) { (void) _libelf_release_data(d); Modified: projects/binutils-2.17/libexec/rtld-elf/amd64/rtld_machdep.h ============================================================================== --- projects/binutils-2.17/libexec/rtld-elf/amd64/rtld_machdep.h Fri Jan 28 18:28:06 2011 (r218028) +++ projects/binutils-2.17/libexec/rtld-elf/amd64/rtld_machdep.h Fri Jan 28 18:42:17 2011 (r218029) @@ -73,4 +73,7 @@ typedef struct { extern void *__tls_get_addr(tls_index *ti); +#define RTLD_DEFAULT_STACK_PF_EXEC PF_X +#define RTLD_DEFAULT_STACK_EXEC PROT_EXEC + #endif Modified: projects/binutils-2.17/libexec/rtld-elf/arm/rtld_machdep.h ============================================================================== --- projects/binutils-2.17/libexec/rtld-elf/arm/rtld_machdep.h Fri Jan 28 18:28:06 2011 (r218028) +++ projects/binutils-2.17/libexec/rtld-elf/arm/rtld_machdep.h Fri Jan 28 18:42:17 2011 (r218029) @@ -69,4 +69,7 @@ void _rtld_bind_start(void); extern void *__tls_get_addr(tls_index *ti); +#define RTLD_DEFAULT_STACK_PF_EXEC PF_X +#define RTLD_DEFAULT_STACK_EXEC PROT_EXEC + #endif Modified: projects/binutils-2.17/libexec/rtld-elf/i386/rtld_machdep.h ============================================================================== --- projects/binutils-2.17/libexec/rtld-elf/i386/rtld_machdep.h Fri Jan 28 18:28:06 2011 (r218028) +++ projects/binutils-2.17/libexec/rtld-elf/i386/rtld_machdep.h Fri Jan 28 18:42:17 2011 (r218029) @@ -74,4 +74,7 @@ typedef struct { extern void *___tls_get_addr(tls_index *ti) __attribute__((__regparm__(1))); extern void *__tls_get_addr(tls_index *ti); +#define RTLD_DEFAULT_STACK_PF_EXEC PF_X +#define RTLD_DEFAULT_STACK_EXEC PROT_EXEC + #endif Modified: projects/binutils-2.17/libexec/rtld-elf/ia64/rtld_machdep.h ============================================================================== --- projects/binutils-2.17/libexec/rtld-elf/ia64/rtld_machdep.h Fri Jan 28 18:28:06 2011 (r218028) +++ projects/binutils-2.17/libexec/rtld-elf/ia64/rtld_machdep.h Fri Jan 28 18:42:17 2011 (r218029) @@ -65,4 +65,7 @@ void call_initfini_pointer(const struct extern void *__tls_get_addr(unsigned long module, unsigned long offset); +#define RTLD_DEFAULT_STACK_PF_EXEC 0 +#define RTLD_DEFAULT_STACK_EXEC 0 + #endif Modified: projects/binutils-2.17/libexec/rtld-elf/map_object.c ============================================================================== --- projects/binutils-2.17/libexec/rtld-elf/map_object.c Fri Jan 28 18:28:06 2011 (r218028) +++ projects/binutils-2.17/libexec/rtld-elf/map_object.c Fri Jan 28 18:42:17 2011 (r218029) @@ -101,7 +101,7 @@ map_object(int fd, const char *path, con phdyn = phinterp = phtls = NULL; phdr_vaddr = 0; segs = alloca(sizeof(segs[0]) * hdr->e_phnum); - stack_flags = PF_X | PF_R | PF_W; + stack_flags = RTLD_DEFAULT_STACK_PF_EXEC | PF_R | PF_W; while (phdr < phlimit) { switch (phdr->p_type) { Modified: projects/binutils-2.17/libexec/rtld-elf/mips/rtld_machdep.h ============================================================================== --- projects/binutils-2.17/libexec/rtld-elf/mips/rtld_machdep.h Fri Jan 28 18:28:06 2011 (r218028) +++ projects/binutils-2.17/libexec/rtld-elf/mips/rtld_machdep.h Fri Jan 28 18:42:17 2011 (r218029) @@ -69,4 +69,7 @@ void _rtld_bind_start(void); extern void *__tls_get_addr(tls_index *ti); +#define RTLD_DEFAULT_STACK_PF_EXEC PF_X +#define RTLD_DEFAULT_STACK_EXEC PROT_EXEC + #endif Modified: projects/binutils-2.17/libexec/rtld-elf/powerpc/rtld_machdep.h ============================================================================== --- projects/binutils-2.17/libexec/rtld-elf/powerpc/rtld_machdep.h Fri Jan 28 18:28:06 2011 (r218028) +++ projects/binutils-2.17/libexec/rtld-elf/powerpc/rtld_machdep.h Fri Jan 28 18:42:17 2011 (r218029) @@ -84,4 +84,7 @@ typedef struct { extern void *__tls_get_addr(tls_index* ti); +#define RTLD_DEFAULT_STACK_PF_EXEC PF_X +#define RTLD_DEFAULT_STACK_EXEC PROT_EXEC + #endif Modified: projects/binutils-2.17/libexec/rtld-elf/powerpc64/rtld_machdep.h ============================================================================== --- projects/binutils-2.17/libexec/rtld-elf/powerpc64/rtld_machdep.h Fri Jan 28 18:28:06 2011 (r218028) +++ projects/binutils-2.17/libexec/rtld-elf/powerpc64/rtld_machdep.h Fri Jan 28 18:42:17 2011 (r218029) @@ -76,4 +76,7 @@ typedef struct { extern void *__tls_get_addr(tls_index* ti); +#define RTLD_DEFAULT_STACK_PF_EXEC PF_X +#define RTLD_DEFAULT_STACK_EXEC PROT_EXEC + #endif Modified: projects/binutils-2.17/libexec/rtld-elf/rtld.c ============================================================================== --- projects/binutils-2.17/libexec/rtld-elf/rtld.c Fri Jan 28 18:28:06 2011 (r218028) +++ projects/binutils-2.17/libexec/rtld-elf/rtld.c Fri Jan 28 18:42:17 2011 (r218029) @@ -191,7 +191,7 @@ extern Elf_Dyn _DYNAMIC; int osreldate, pagesize; -static int stack_prot = PROT_READ | PROT_WRITE | PROT_EXEC; +static int stack_prot = PROT_READ | PROT_WRITE | RTLD_DEFAULT_STACK_EXEC; static int max_stack_flags; /* @@ -1385,7 +1385,7 @@ init_rtld(caddr_t mapbase, Elf_Auxinfo * digest_dynamic1(&objtmp, 1, &dyn_rpath, &dyn_soname); assert(objtmp.needed == NULL); #if !defined(__mips__) - /* MIPS and SH{3,5} have a bogus DT_TEXTREL. */ + /* MIPS has a bogus DT_TEXTREL. */ assert(!objtmp.textrel); #endif @@ -2800,7 +2800,12 @@ get_program_var_addr(const char *name, R donelist_init(&donelist); if (symlook_global(&req, &donelist) != 0) return (NULL); - return ((const void **)(req.defobj_out->relocbase + req.sym_out->st_value)); + if (ELF_ST_TYPE(req.sym_out->st_info) == STT_FUNC) + return ((const void **)make_function_pointer(req.sym_out, + req.defobj_out)); + else + return ((const void **)(req.defobj_out->relocbase + + req.sym_out->st_value)); } /* Modified: projects/binutils-2.17/libexec/rtld-elf/sparc64/rtld_machdep.h ============================================================================== --- projects/binutils-2.17/libexec/rtld-elf/sparc64/rtld_machdep.h Fri Jan 28 18:28:06 2011 (r218028) +++ projects/binutils-2.17/libexec/rtld-elf/sparc64/rtld_machdep.h Fri Jan 28 18:42:17 2011 (r218029) @@ -65,4 +65,7 @@ typedef struct { extern void *__tls_get_addr(tls_index *ti); +#define RTLD_DEFAULT_STACK_PF_EXEC 0 +#define RTLD_DEFAULT_STACK_EXEC 0 + #endif Modified: projects/binutils-2.17/sbin/fdisk/fdisk.c ============================================================================== --- projects/binutils-2.17/sbin/fdisk/fdisk.c Fri Jan 28 18:28:06 2011 (r218028) +++ projects/binutils-2.17/sbin/fdisk/fdisk.c Fri Jan 28 18:42:17 2011 (r218029) @@ -49,7 +49,10 @@ __FBSDID("$FreeBSD$"); int iotest; -#define NOSECTORS ((u_int32_t)-1) +#define NO_DISK_SECTORS ((u_int32_t)-1) +#define NO_TRACK_CYLINDERS 1023 +#define NO_TRACK_HEADS 255 +#define NO_TRACK_SECTORS 63 #define LBUF 100 static char lbuf[LBUF]; @@ -62,7 +65,7 @@ static char lbuf[LBUF]; * Created. */ -#define Decimal(str, ans, tmp, nbits) if (decimal(str, &tmp, ans, nbits)) ans = tmp +#define Decimal(str, ans, tmp, maxval) if (decimal(str, &tmp, ans, maxval)) ans = tmp #define RoundCyl(x) ((((x) + cylsecs - 1) / cylsecs) * cylsecs) @@ -247,7 +250,7 @@ static int get_params(void); static int read_s0(void); static int write_s0(void); static int ok(const char *str); -static int decimal(const char *str, int *num, int deflt, int nbits); +static int decimal(const char *str, int *num, int deflt, uint32_t maxval); static int read_config(char *config_file); static void reset_boot(void); static int sanitize_partition(struct dos_partition *); @@ -572,9 +575,9 @@ change_part(int i) } do { - Decimal("sysid (165=FreeBSD)", partp->dp_typ, tmp, sizeof(partp->dp_typ) * 8); - Decimal("start", partp->dp_start, tmp, sizeof(partp->dp_start) * 8); - Decimal("size", partp->dp_size, tmp, sizeof(partp->dp_size) * 8); + Decimal("sysid (165=FreeBSD)", partp->dp_typ, tmp, 255); + Decimal("start", partp->dp_start, tmp, NO_DISK_SECTORS); + Decimal("size", partp->dp_size, tmp, NO_DISK_SECTORS); if (!sanitize_partition(partp)) { warnx("ERROR: failed to adjust; setting sysid to 0"); partp->dp_typ = 0; @@ -586,9 +589,9 @@ change_part(int i) tcyl = DPCYL(partp->dp_scyl,partp->dp_ssect); thd = partp->dp_shd; tsec = DPSECT(partp->dp_ssect); - Decimal("beginning cylinder", tcyl, tmp, 10); - Decimal("beginning head", thd, tmp, sizeof(partp->dp_shd) * 8); - Decimal("beginning sector", tsec, tmp, 6); + Decimal("beginning cylinder", tcyl, tmp, NO_TRACK_CYLINDERS); + Decimal("beginning head", thd, tmp, NO_TRACK_HEADS); + Decimal("beginning sector", tsec, tmp, NO_TRACK_SECTORS); partp->dp_scyl = DOSCYL(tcyl); partp->dp_ssect = DOSSECT(tsec,tcyl); partp->dp_shd = thd; @@ -596,9 +599,9 @@ change_part(int i) tcyl = DPCYL(partp->dp_ecyl,partp->dp_esect); thd = partp->dp_ehd; tsec = DPSECT(partp->dp_esect); - Decimal("ending cylinder", tcyl, tmp, 10); - Decimal("ending head", thd, tmp, sizeof(partp->dp_ehd) * 8); - Decimal("ending sector", tsec, tmp, 6); + Decimal("ending cylinder", tcyl, tmp, NO_TRACK_CYLINDERS); + Decimal("ending head", thd, tmp, NO_TRACK_HEADS); + Decimal("ending sector", tsec, tmp, NO_TRACK_SECTORS); partp->dp_ecyl = DOSCYL(tcyl); partp->dp_esect = DOSSECT(tsec,tcyl); partp->dp_ehd = thd; @@ -915,16 +918,12 @@ ok(const char *str) } static int -decimal(const char *str, int *num, int deflt, int nbits) +decimal(const char *str, int *num, int deflt, uint32_t maxval) { - long long acc = 0, limit; + long long acc = 0; int c; char *cp; - if (nbits == 0) { - nbits = sizeof(*num) * 8; - } - limit = (long long)1 << nbits; while (1) { printf("Supply a decimal value for \"%s\" [%d] ", str, deflt); fflush(stdout); @@ -941,7 +940,7 @@ decimal(const char *str, int *num, int d return 0; while ((c = *cp++)) { if (c <= '9' && c >= '0') { - if (acc < limit) + if (maxval > 0 && acc <= maxval) acc = acc * 10 + c - '0'; } else break; @@ -949,10 +948,11 @@ decimal(const char *str, int *num, int d if (c == ' ' || c == '\t') while ((c = *cp) && (c == ' ' || c == '\t')) cp++; if (!c) { - if (acc >= limit) { - acc = limit - 1; - printf("%s is too big, it will be truncated to %lld\n", - lbuf, acc); + if (maxval > 0 && acc > maxval) { + acc = maxval; + printf("%s exceeds maximum value allowed for " + "this field. The value has been reduced " + "to %lld\n", lbuf, acc); } *num = acc; return 1; @@ -1108,7 +1108,7 @@ str2sectors(const char *str) if (str == end || *end == '\0') { warnx("ERROR line %d: unexpected size: \'%s\'", current_line_number, str); - return NOSECTORS; + return NO_DISK_SECTORS; } if (*end == 'K') @@ -1120,7 +1120,7 @@ str2sectors(const char *str) else { warnx("ERROR line %d: unexpected modifier: %c " "(not K/M/G)", current_line_number, *end); - return NOSECTORS; + return NO_DISK_SECTORS; } return val; @@ -1170,7 +1170,7 @@ process_partition(CMD *command) } } else { partp->dp_start = str2sectors(command->args[2].arg_str); - if (partp->dp_start == NOSECTORS) + if (partp->dp_start == NO_DISK_SECTORS) break; } } else @@ -1182,7 +1182,7 @@ process_partition(CMD *command) dos_cylsecs) - partp->dp_start; else { partp->dp_size = str2sectors(command->args[3].arg_str); - if (partp->dp_size == NOSECTORS) + if (partp->dp_size == NO_DISK_SECTORS) break; } prev_cyl_boundary = ((partp->dp_start + partp->dp_size) / Modified: projects/binutils-2.17/sbin/geom/class/part/gpart.8 ============================================================================== --- projects/binutils-2.17/sbin/geom/class/part/gpart.8 Fri Jan 28 18:28:06 2011 (r218028) +++ projects/binutils-2.17/sbin/geom/class/part/gpart.8 Fri Jan 28 18:42:17 2011 (r218029) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 12, 2011 +.Dd January 28, 2011 .Dt GPART 8 .Os .Sh NAME @@ -509,6 +509,11 @@ utility also allows the user to specify for partition types that do not have symbol names. The symbolic names currently understood are: .Bl -tag -width ".Cm freebsd-vinum" +.It Cm bios-boot +The system partition dedicated to second stage of the boot loader program. +Usually it used by GRUB 2 loader when the partition table is GPT. +The scheme-specific type is +.Qq Li "!21686148-6449-6E6F-744E-656564454649" . .It Cm efi The system partition for computers that use the Extensible Firmware Interface (EFI). Modified: projects/binutils-2.17/sbin/hastctl/hastctl.c ============================================================================== --- projects/binutils-2.17/sbin/hastctl/hastctl.c Fri Jan 28 18:28:06 2011 (r218028) +++ projects/binutils-2.17/sbin/hastctl/hastctl.c Fri Jan 28 18:42:17 2011 (r218029) @@ -430,6 +430,7 @@ main(int argc, char *argv[]) break; } + pjdlog_init(PJDLOG_MODE_STD); pjdlog_debug_set(debug); cfg = yy_config_parse(cfgpath, true); Modified: projects/binutils-2.17/sbin/hastd/control.c ============================================================================== --- projects/binutils-2.17/sbin/hastd/control.c Fri Jan 28 18:28:06 2011 (r218028) +++ projects/binutils-2.17/sbin/hastd/control.c Fri Jan 28 18:42:17 2011 (r218029) @@ -278,6 +278,7 @@ control_handle(struct hastd_config *cfg) return; } + cfg->hc_controlin = conn; nvin = nvout = NULL; role = HAST_ROLE_UNDEF; @@ -384,6 +385,7 @@ close: if (nvout != NULL) nv_free(nvout); proto_close(conn); + cfg->hc_controlin = NULL; } /* Modified: projects/binutils-2.17/sbin/hastd/hast.h ============================================================================== --- projects/binutils-2.17/sbin/hastd/hast.h Fri Jan 28 18:28:06 2011 (r218028) +++ projects/binutils-2.17/sbin/hastd/hast.h Fri Jan 28 18:42:17 2011 (r218029) @@ -101,6 +101,8 @@ struct hastd_config { char hc_controladdr[HAST_ADDRSIZE]; /* Protocol-specific data. */ struct proto_conn *hc_controlconn; + /* Incoming control connection. */ + struct proto_conn *hc_controlin; /* Address to listen on. */ char hc_listenaddr[HAST_ADDRSIZE]; /* Protocol-specific data. */ Modified: projects/binutils-2.17/sbin/hastd/hastd.c ============================================================================== --- projects/binutils-2.17/sbin/hastd/hastd.c Fri Jan 28 18:28:06 2011 (r218028) +++ projects/binutils-2.17/sbin/hastd/hastd.c Fri Jan 28 18:42:17 2011 (r218029) @@ -666,6 +666,7 @@ main_loop(void) case SIGTERM: sigexit_received = true; terminate_workers(); + proto_close(cfg->hc_controlconn); exit(EX_OK); break; case SIGCHLD: @@ -772,6 +773,7 @@ main(int argc, char *argv[]) argc -= optind; argv += optind; + pjdlog_init(PJDLOG_MODE_STD); pjdlog_debug_set(debuglevel); g_gate_load(); Modified: projects/binutils-2.17/sbin/hastd/pjdlog.c ============================================================================== --- projects/binutils-2.17/sbin/hastd/pjdlog.c Fri Jan 28 18:28:06 2011 (r218028) +++ projects/binutils-2.17/sbin/hastd/pjdlog.c Fri Jan 28 18:42:17 2011 (r218029) @@ -1,5 +1,6 @@ /*- * Copyright (c) 2009-2010 The FreeBSD Foundation + * Copyright (c) 2011 Pawel Jakub Dawidek * All rights reserved. * * This software was developed by Pawel Jakub Dawidek under sponsorship from @@ -33,6 +34,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -40,10 +42,37 @@ __FBSDID("$FreeBSD$"); #include "pjdlog.h" +static bool pjdlog_initialized = false; static int pjdlog_mode = PJDLOG_MODE_STD; static int pjdlog_debug_level = 0; static char pjdlog_prefix[128]; +void +pjdlog_init(int mode) +{ + + assert(!pjdlog_initialized); + assert(mode == PJDLOG_MODE_STD || mode == PJDLOG_MODE_SYSLOG); + + if (mode == PJDLOG_MODE_SYSLOG) + openlog(NULL, LOG_PID | LOG_NDELAY, LOG_DAEMON); + pjdlog_mode = mode; + + pjdlog_initialized = true; +} + +void +pjdlog_fini(void) +{ + + assert(pjdlog_initialized); + + if (pjdlog_mode == PJDLOG_MODE_SYSLOG) + closelog(); + + pjdlog_initialized = false; +} + /* * Configure where the logs should go. * By default they are send to stdout/stderr, but after going into background @@ -54,12 +83,18 @@ void pjdlog_mode_set(int mode) { + assert(pjdlog_initialized); assert(mode == PJDLOG_MODE_STD || mode == PJDLOG_MODE_SYSLOG); - pjdlog_mode = mode; + if (pjdlog_mode == mode) + return; if (mode == PJDLOG_MODE_SYSLOG) - openlog(NULL, LOG_PID, LOG_DAEMON); + openlog(NULL, LOG_PID | LOG_NDELAY, LOG_DAEMON); + else /* if (mode == PJDLOG_MODE_STD) */ + closelog(); + + pjdlog_mode = mode; } /* @@ -69,6 +104,8 @@ int pjdlog_mode_get(void) { + assert(pjdlog_initialized); + return (pjdlog_mode); } @@ -80,6 +117,7 @@ void pjdlog_debug_set(int level) { + assert(pjdlog_initialized); assert(level >= 0); pjdlog_debug_level = level; @@ -92,6 +130,8 @@ int pjdlog_debug_get(void) { + assert(pjdlog_initialized); + return (pjdlog_debug_level); } @@ -104,6 +144,8 @@ pjdlog_prefix_set(const char *fmt, ...) { va_list ap; + assert(pjdlog_initialized); + va_start(ap, fmt); pjdlogv_prefix_set(fmt, ap); va_end(ap); @@ -117,6 +159,7 @@ void pjdlogv_prefix_set(const char *fmt, va_list ap) { + assert(pjdlog_initialized); assert(fmt != NULL); vsnprintf(pjdlog_prefix, sizeof(pjdlog_prefix), fmt, ap); @@ -159,6 +202,8 @@ pjdlog_common(int loglevel, int debuglev { va_list ap; + assert(pjdlog_initialized); + va_start(ap, fmt); pjdlogv_common(loglevel, debuglevel, error, fmt, ap); va_end(ap); @@ -173,6 +218,7 @@ pjdlogv_common(int loglevel, int debugle va_list ap) { + assert(pjdlog_initialized); assert(loglevel == LOG_EMERG || loglevel == LOG_ALERT || loglevel == LOG_CRIT || loglevel == LOG_ERR || loglevel == LOG_WARNING || loglevel == LOG_NOTICE || @@ -249,6 +295,8 @@ void pjdlogv(int loglevel, const char *fmt, va_list ap) { + assert(pjdlog_initialized); + /* LOG_DEBUG is invalid here, pjdlogv?_debug() should be used. */ assert(loglevel == LOG_EMERG || loglevel == LOG_ALERT || loglevel == LOG_CRIT || loglevel == LOG_ERR || @@ -266,6 +314,8 @@ pjdlog(int loglevel, const char *fmt, .. { va_list ap; + assert(pjdlog_initialized); + va_start(ap, fmt); pjdlogv(loglevel, fmt, ap); va_end(ap); @@ -278,6 +328,8 @@ void pjdlogv_debug(int debuglevel, const char *fmt, va_list ap) { + assert(pjdlog_initialized); + pjdlogv_common(LOG_DEBUG, debuglevel, -1, fmt, ap); } @@ -289,6 +341,8 @@ pjdlog_debug(int debuglevel, const char { va_list ap; + assert(pjdlog_initialized); + va_start(ap, fmt); pjdlogv_debug(debuglevel, fmt, ap); va_end(ap); @@ -301,6 +355,8 @@ void pjdlogv_errno(int loglevel, const char *fmt, va_list ap) { + assert(pjdlog_initialized); + pjdlogv_common(loglevel, 0, errno, fmt, ap); } @@ -312,6 +368,8 @@ pjdlog_errno(int loglevel, const char *f { va_list ap; + assert(pjdlog_initialized); + va_start(ap, fmt); pjdlogv_errno(loglevel, fmt, ap); va_end(ap); @@ -324,6 +382,8 @@ void pjdlogv_exit(int exitcode, const char *fmt, va_list ap) { + assert(pjdlog_initialized); + pjdlogv_errno(LOG_ERR, fmt, ap); exit(exitcode); /* NOTREACHED */ @@ -337,6 +397,8 @@ pjdlog_exit(int exitcode, const char *fm { va_list ap; + assert(pjdlog_initialized); + va_start(ap, fmt); pjdlogv_exit(exitcode, fmt, ap); /* NOTREACHED */ @@ -350,6 +412,8 @@ void pjdlogv_exitx(int exitcode, const char *fmt, va_list ap) { + assert(pjdlog_initialized); + pjdlogv(LOG_ERR, fmt, ap); exit(exitcode); /* NOTREACHED */ @@ -363,6 +427,8 @@ pjdlog_exitx(int exitcode, const char *f { va_list ap; + assert(pjdlog_initialized); + va_start(ap, fmt); pjdlogv_exitx(exitcode, fmt, ap); /* NOTREACHED */ @@ -374,17 +440,38 @@ pjdlog_exitx(int exitcode, const char *f */ void pjdlog_verify(const char *func, const char *file, int line, - const char *failedexpr) + const char *failedexpr, const char *fmt, ...) { + va_list ap; - if (func == NULL) { - pjdlog_critical("Assertion failed: (%s), file %s, line %d.", - failedexpr, file, line); + assert(pjdlog_initialized); + + /* + * When there is no message we pass __func__ as 'fmt'. + * It would be cleaner to pass NULL or "", but gcc generates a warning + * for both of those. + */ + if (fmt != func) { + va_start(ap, fmt); + pjdlogv_critical(fmt, ap); + va_end(ap); + } + if (failedexpr == NULL) { + if (func == NULL) { + pjdlog_critical("Aborted at file %s, line %d.", file, + line); + } else { + pjdlog_critical("Aborted at function %s, file %s, line %d.", + func, file, line); + } } else { - pjdlog_critical("Assertion failed: (%s), function %s, file %s, line %d.", - failedexpr, func, file, line); + if (func == NULL) { + pjdlog_critical("Assertion failed: (%s), file %s, line %d.", + failedexpr, file, line); + } else { + pjdlog_critical("Assertion failed: (%s), function %s, file %s, line %d.", + failedexpr, func, file, line); + } } abort(); - /* NOTREACHED */ } - Modified: projects/binutils-2.17/sbin/hastd/pjdlog.h ============================================================================== --- projects/binutils-2.17/sbin/hastd/pjdlog.h Fri Jan 28 18:28:06 2011 (r218028) +++ projects/binutils-2.17/sbin/hastd/pjdlog.h Fri Jan 28 18:42:17 2011 (r218029) @@ -1,5 +1,6 @@ /*- * Copyright (c) 2009-2010 The FreeBSD Foundation + * Copyright (c) 2011 Pawel Jakub Dawidek * All rights reserved. * * This software was developed by Pawel Jakub Dawidek under sponsorship from @@ -41,6 +42,9 @@ #define PJDLOG_MODE_STD 0 #define PJDLOG_MODE_SYSLOG 1 +void pjdlog_init(int mode); +void pjdlog_fini(void); + void pjdlog_mode_set(int mode); int pjdlog_mode_get(void); @@ -86,16 +90,28 @@ void pjdlog_exitx(int exitcode, const ch void pjdlogv_exitx(int exitcode, const char *fmt, va_list ap) __printflike(2, 0) __dead2; void pjdlog_verify(const char *func, const char *file, int line, - const char *failedexpr) __dead2; + const char *failedexpr, const char *fmt, ...) __printflike(5, 6); #define PJDLOG_VERIFY(expr) do { \ - if (!(expr)) \ - pjdlog_verify(__func__, __FILE__, __LINE__, #expr); \ + if (!(expr)) { \ + pjdlog_verify(__func__, __FILE__, __LINE__, #expr, \ + __func__); \ + } \ +} while (0) +#define PJDLOG_RVERIFY(expr, ...) do { \ + if (!(expr)) { \ + pjdlog_verify(__func__, __FILE__, __LINE__, #expr, \ + __VA_ARGS__); \ + } \ } while (0) +#define PJDLOG_ABORT(...) pjdlog_verify(__func__, __FILE__, \ + __LINE__, NULL, __VA_ARGS__) #ifdef NDEBUG #define PJDLOG_ASSERT(expr) do { } while (0) +#define PJDLOG_RASSERT(...) do { } while (0) #else #define PJDLOG_ASSERT(expr) PJDLOG_VERIFY(expr) +#define PJDLOG_RASSERT(...) PJDLOG_RVERIFY(__VA_ARGS__) #endif #endif /* !_PJDLOG_H_ */ Modified: projects/binutils-2.17/sbin/iscontrol/config.c ============================================================================== --- projects/binutils-2.17/sbin/iscontrol/config.c Fri Jan 28 18:28:06 2011 (r218028) +++ projects/binutils-2.17/sbin/iscontrol/config.c Fri Jan 28 18:42:17 2011 (r218029) @@ -295,7 +295,7 @@ keyLookup(char *key) { textkey_t *tk; - for(tk = keyMap; tk->name; tk++) { + for(tk = keyMap; tk->name && strcmp(tk->name, "end"); tk++) { if(strcasecmp(key, tk->name) == 0) return tk; } Modified: projects/binutils-2.17/sbin/iscontrol/fsm.c ============================================================================== --- projects/binutils-2.17/sbin/iscontrol/fsm.c Fri Jan 28 18:28:06 2011 (r218028) +++ projects/binutils-2.17/sbin/iscontrol/fsm.c Fri Jan 28 18:42:17 2011 (r218029) @@ -359,8 +359,8 @@ doCAM(isess_t *sess) | for now will do this for each lun ... */ for(n = i = 0; i < sess->cam.target_nluns; i++) { - debug(2, "CAM path_id=%d target_id=%d target_lun=%d", - sess->cam.path_id, sess->cam.target_id, sess->cam.target_lun[i]); + debug(2, "CAM path_id=%d target_id=%d", + sess->cam.path_id, sess->cam.target_id); sess->camdev = cam_open_btl(sess->cam.path_id, sess->cam.target_id, i, O_RDWR, NULL); Modified: projects/binutils-2.17/sbin/mount/mount.8 ============================================================================== --- projects/binutils-2.17/sbin/mount/mount.8 Fri Jan 28 18:28:06 2011 (r218028) +++ projects/binutils-2.17/sbin/mount/mount.8 Fri Jan 28 18:42:17 2011 (r218029) @@ -28,7 +28,7 @@ .\" @(#)mount.8 8.8 (Berkeley) 6/16/94 .\" $FreeBSD$ .\" -.Dd February 10, 2010 +.Dd January 25, 2011 .Dt MOUNT 8 .Os .Sh NAME @@ -208,7 +208,11 @@ This option is useful on file systems where there are large numbers of files and performance is more critical than updating the file access time (which is rarely ever important). -This option is currently only supported on local file systems. +This option is not supported on network file systems when the +server is FreeBSD. +Support in network files servers on other operating systems +with a FreeBSD client is possible, +but should be tested before it is relied on. .It Cm noauto This file system should be skipped when .Nm Modified: projects/binutils-2.17/share/doc/papers/kernmalloc/Makefile ============================================================================== --- projects/binutils-2.17/share/doc/papers/kernmalloc/Makefile Fri Jan 28 18:28:06 2011 (r218028) +++ projects/binutils-2.17/share/doc/papers/kernmalloc/Makefile Fri Jan 28 18:42:17 2011 (r218029) *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-projects@FreeBSD.ORG Sat Jan 29 00:21:40 2011 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A9D65106564A; Sat, 29 Jan 2011 00:21:40 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 998CF8FC0C; Sat, 29 Jan 2011 00:21:40 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0T0LeZa006314; Sat, 29 Jan 2011 00:21:40 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0T0Le4G006312; Sat, 29 Jan 2011 00:21:40 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201101290021.p0T0Le4G006312@svn.freebsd.org> From: Warner Losh Date: Sat, 29 Jan 2011 00:21:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r218052 - projects/graid/head/sys/geom/raid X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 29 Jan 2011 00:21:40 -0000 Author: imp Date: Sat Jan 29 00:21:40 2011 New Revision: 218052 URL: http://svn.freebsd.org/changeset/base/218052 Log: Stop leaking BIOs on rebuild. We used to leak 20k of them on a 20GB rebuild. Now we leak none. Also, if g_clone_bp() fails during a rebuild, just stop rebuilding for a while. Maybe the next step here would be actually reusing the BPs since we don't really need to clone them for a rebuild (we do for resync however). # But we do leak them when we do actual I/O to the disk still :( Modified: projects/graid/head/sys/geom/raid/tr_raid1.c Modified: projects/graid/head/sys/geom/raid/tr_raid1.c ============================================================================== --- projects/graid/head/sys/geom/raid/tr_raid1.c Fri Jan 28 23:44:57 2011 (r218051) +++ projects/graid/head/sys/geom/raid/tr_raid1.c Sat Jan 29 00:21:40 2011 (r218052) @@ -179,9 +179,6 @@ g_raid_tr_raid1_rebuild_some(struct g_ra g_raid_tr_raid1_rebuild_abort(tr, sd->sd_volume); return; } - trs->trso_flags |= TR_RAID1_F_DOING_SOME; - trs->trso_recover_slabs = SD_REBUILD_CLUSTER_IDLE; - trs->trso_fair_io = SD_REBUILD_FAIR_IO; bp = &trs->trso_bio; memset(bp, 0, sizeof(*bp)); bp->bio_offset = sd->sd_rebuild_pos; @@ -190,8 +187,13 @@ g_raid_tr_raid1_rebuild_some(struct g_ra bp->bio_data = trs->trso_buffer; bp->bio_cmd = BIO_READ; bp2 = g_clone_bio(bp); + if (bp2 == NULL) /* We'll try again later */ + return; bp2->bio_cflags = G_RAID_BIO_FLAG_SYNC; bp2->bio_caller1 = good_sd; + trs->trso_recover_slabs = SD_REBUILD_CLUSTER_IDLE; + trs->trso_fair_io = SD_REBUILD_FAIR_IO; + trs->trso_flags |= TR_RAID1_F_DOING_SOME; g_raid_lock_range(sd->sd_volume, /* Lock callback starts I/O */ bp2->bio_offset, bp2->bio_length, bp2); } @@ -609,11 +611,23 @@ g_raid_tr_iodone_raid1(struct g_raid_tr_ return; } cbp = g_clone_bio(pbp); + if (cbp == NULL) { + /* + * By flagging that we're not doing anything, + * we'll pick up the rebuild at a later point + * either by timeout or when we steal a small + * part of the active I/O. + */ + g_destroy_bio(bp); /* reuse? */ + trs->trso_flags &= ~TR_RAID1_F_DOING_SOME; + return; + } cbp->bio_cmd = BIO_WRITE; cbp->bio_cflags = G_RAID_BIO_FLAG_SYNC; cbp->bio_offset = bp->bio_offset; cbp->bio_length = bp->bio_length; G_RAID_LOGREQ(4, bp, "Queueing reguild write."); + g_destroy_bio(bp); /* reuse? */ g_raid_subdisk_iostart(trs->trso_failed_sd, cbp); } else { /* @@ -630,8 +644,10 @@ g_raid_tr_iodone_raid1(struct g_raid_tr_ "rebuild write done. Error %d", bp->bio_error); if (bp->bio_error != 0) { g_raid_tr_raid1_rebuild_abort(tr, vol); + g_destroy_bio(bp); /* reuse? */ return; } + g_destroy_bio(bp); /* reuse? */ /* XXX A lot of the following is needed when we kick of the work -- refactor */ nsd = trs->trso_failed_sd; g_raid_unlock_range(sd->sd_volume, @@ -657,6 +673,16 @@ g_raid_tr_iodone_raid1(struct g_raid_tr_ } pbp->bio_offset = nsd->sd_rebuild_pos; cbp = g_clone_bio(pbp); + if (cbp == NULL) { + /* + * By flagging that we're not doing anything, + * we'll pick up the rebuild at a later point + * either by timeout or when we steal a small + * part of the active I/O. + */ + trs->trso_flags &= ~TR_RAID1_F_DOING_SOME; + return; + } cbp->bio_cmd = BIO_READ; cbp->bio_cflags = G_RAID_BIO_FLAG_SYNC; cbp->bio_offset = nsd->sd_rebuild_pos; From owner-svn-src-projects@FreeBSD.ORG Sat Jan 29 00:33:04 2011 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7EA961065670; Sat, 29 Jan 2011 00:33:04 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6E66E8FC16; Sat, 29 Jan 2011 00:33:04 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0T0X4hv006642; Sat, 29 Jan 2011 00:33:04 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0T0X48l006640; Sat, 29 Jan 2011 00:33:04 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201101290033.p0T0X48l006640@svn.freebsd.org> From: Warner Losh Date: Sat, 29 Jan 2011 00:33:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r218053 - projects/graid/head/sys/geom/raid X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 29 Jan 2011 00:33:04 -0000 Author: imp Date: Sat Jan 29 00:33:04 2011 New Revision: 218053 URL: http://svn.freebsd.org/changeset/base/218053 Log: Kill bio leak in the normal I/O path. Now we can survive the raid_rebuild_test.sh without leaking anything. Before, we'd leak 40k bio when testing on a 200MB volume each time the test is run. # I haven't looked at tr_raid0.c to see if that's affected also. Modified: projects/graid/head/sys/geom/raid/tr_raid1.c Modified: projects/graid/head/sys/geom/raid/tr_raid1.c ============================================================================== --- projects/graid/head/sys/geom/raid/tr_raid1.c Sat Jan 29 00:21:40 2011 (r218052) +++ projects/graid/head/sys/geom/raid/tr_raid1.c Sat Jan 29 00:33:04 2011 (r218053) @@ -575,7 +575,7 @@ g_raid_tr_iodone_raid1(struct g_raid_tr_ struct g_raid_volume *vol; struct bio *pbp; struct g_raid_tr_raid1_object *trs; - int i; + int i, error; trs = (struct g_raid_tr_raid1_object *)tr; pbp = bp->bio_parent; @@ -793,9 +793,11 @@ g_raid_tr_iodone_raid1(struct g_raid_tr_ bp->bio_error = 0; } } + error = bp->bio_error; + g_destroy_bio(bp); if (pbp->bio_children == pbp->bio_inbed) { pbp->bio_completed = pbp->bio_length; - g_raid_iodone(pbp, bp->bio_error); + g_raid_iodone(pbp, error); } } From owner-svn-src-projects@FreeBSD.ORG Sat Jan 29 09:17:36 2011 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B80A3106566B; Sat, 29 Jan 2011 09:17:36 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A9A2B8FC08; Sat, 29 Jan 2011 09:17:36 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0T9HaPX025156; Sat, 29 Jan 2011 09:17:36 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0T9Hatq025154; Sat, 29 Jan 2011 09:17:36 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201101290917.p0T9Hatq025154@svn.freebsd.org> From: Alexander Motin Date: Sat, 29 Jan 2011 09:17:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r218062 - projects/graid/head/sys/geom/raid X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 29 Jan 2011 09:17:36 -0000 Author: mav Date: Sat Jan 29 09:17:36 2011 New Revision: 218062 URL: http://svn.freebsd.org/changeset/base/218062 Log: When dirty flag set in metadata, report all disks as STALE instead of ACTIVE. In such case transformation module should make own decisions and shift some of them to ACTIVE and rebuild the others. Modified: projects/graid/head/sys/geom/raid/md_intel.c Modified: projects/graid/head/sys/geom/raid/md_intel.c ============================================================================== --- projects/graid/head/sys/geom/raid/md_intel.c Sat Jan 29 08:52:06 2011 (r218061) +++ projects/graid/head/sys/geom/raid/md_intel.c Sat Jan 29 09:17:36 2011 (r218062) @@ -635,6 +635,9 @@ nofit: if (mmap0->disk_idx[sd->sd_pos] & INTEL_DI_RBLD) { g_raid_change_subdisk_state(sd, G_RAID_SUBDISK_S_NEW); + } else if (mvol->dirty) { + g_raid_change_subdisk_state(sd, + G_RAID_SUBDISK_S_STALE); } else { g_raid_change_subdisk_state(sd, G_RAID_SUBDISK_S_ACTIVE); From owner-svn-src-projects@FreeBSD.ORG Sat Jan 29 09:42:31 2011 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7B2001065670; Sat, 29 Jan 2011 09:42:31 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6CA818FC0C; Sat, 29 Jan 2011 09:42:31 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0T9gVK9025795; Sat, 29 Jan 2011 09:42:31 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0T9gVuP025793; Sat, 29 Jan 2011 09:42:31 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201101290942.p0T9gVuP025793@svn.freebsd.org> From: Alexander Motin Date: Sat, 29 Jan 2011 09:42:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r218063 - projects/graid/head/sys/geom/raid X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 29 Jan 2011 09:42:31 -0000 Author: mav Date: Sat Jan 29 09:42:31 2011 New Revision: 218063 URL: http://svn.freebsd.org/changeset/base/218063 Log: Plug BIOs leak in RAID0. Add basic error handling. Modified: projects/graid/head/sys/geom/raid/tr_raid0.c Modified: projects/graid/head/sys/geom/raid/tr_raid0.c ============================================================================== --- projects/graid/head/sys/geom/raid/tr_raid0.c Sat Jan 29 09:17:36 2011 (r218062) +++ projects/graid/head/sys/geom/raid/tr_raid0.c Sat Jan 29 09:42:31 2011 (r218063) @@ -334,6 +334,9 @@ g_raid_tr_iodone_raid0(struct g_raid_tr_ struct bio *pbp; pbp = bp->bio_parent; + if (pbp->bio_error == 0) + pbp->bio_error = bp->bio_error; + g_destroy_bio(bp); pbp->bio_inbed++; if (pbp->bio_children == pbp->bio_inbed) { pbp->bio_completed = pbp->bio_length;