From owner-svn-src-stable-8@FreeBSD.ORG Thu Mar 28 05:35:49 2013 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 2DBC436A; Thu, 28 Mar 2013 05:35:49 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 110FD93A; Thu, 28 Mar 2013 05:35:49 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r2S5ZmKH010618; Thu, 28 Mar 2013 05:35:48 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r2S5Zl94010609; Thu, 28 Mar 2013 05:35:47 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201303280535.r2S5Zl94010609@svn.freebsd.org> From: Xin LI Date: Thu, 28 Mar 2013 05:35:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r248807 - in stable/8: contrib/bind9 lib/bind lib/bind/dns lib/bind/dns/dns X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Mar 2013 05:35:49 -0000 Author: delphij Date: Thu Mar 28 05:35:46 2013 New Revision: 248807 URL: http://svnweb.freebsd.org/changeset/base/248807 Log: MFC r248788 (erwin): Update BIND to 9.8.4-P2 Removed the check for regex.h in configure in order to disable regex syntax checking, as it exposes BIND to a critical flaw in libregex on some platforms. [RT #32688] Approved by: re (rodrigc, kib) Modified: stable/8/contrib/bind9/CHANGES stable/8/contrib/bind9/config.h.in stable/8/contrib/bind9/configure.in stable/8/contrib/bind9/version stable/8/lib/bind/config.h stable/8/lib/bind/dns/code.h stable/8/lib/bind/dns/dns/enumclass.h stable/8/lib/bind/dns/dns/enumtype.h stable/8/lib/bind/dns/dns/rdatastruct.h Directory Properties: stable/8/contrib/bind9/ (props changed) stable/8/lib/bind/ (props changed) Modified: stable/8/contrib/bind9/CHANGES ============================================================================== --- stable/8/contrib/bind9/CHANGES Thu Mar 28 04:13:52 2013 (r248806) +++ stable/8/contrib/bind9/CHANGES Thu Mar 28 05:35:46 2013 (r248807) @@ -1,3 +1,10 @@ + --- 9.8.4-P2 released --- + +3516. [security] Removed the check for regex.h in configure in order + to disable regex syntax checking, as it exposes + BIND to a critical flaw in libregex on some + platforms. [RT #32688] + --- 9.8.4-P1 released --- 3407. [security] Named could die on specific queries with dns64 enabled. Modified: stable/8/contrib/bind9/config.h.in ============================================================================== --- stable/8/contrib/bind9/config.h.in Thu Mar 28 04:13:52 2013 (r248806) +++ stable/8/contrib/bind9/config.h.in Thu Mar 28 05:35:46 2013 (r248807) @@ -286,9 +286,6 @@ int sigwait(const unsigned int *set, int /* Define if your OpenSSL version supports GOST. */ #undef HAVE_OPENSSL_GOST -/* Define to 1 if you have the header file. */ -#undef HAVE_REGEX_H - /* Define to 1 if you have the `setegid' function. */ #undef HAVE_SETEGID Modified: stable/8/contrib/bind9/configure.in ============================================================================== --- stable/8/contrib/bind9/configure.in Thu Mar 28 04:13:52 2013 (r248806) +++ stable/8/contrib/bind9/configure.in Thu Mar 28 05:35:46 2013 (r248807) @@ -298,7 +298,7 @@ esac AC_HEADER_STDC -AC_CHECK_HEADERS(fcntl.h regex.h sys/time.h unistd.h sys/sockio.h sys/select.h sys/param.h sys/sysctl.h net/if6.h,,, +AC_CHECK_HEADERS(fcntl.h sys/time.h unistd.h sys/sockio.h sys/select.h sys/param.h sys/sysctl.h net/if6.h,,, [$ac_includes_default #ifdef HAVE_SYS_PARAM_H # include Modified: stable/8/contrib/bind9/version ============================================================================== --- stable/8/contrib/bind9/version Thu Mar 28 04:13:52 2013 (r248806) +++ stable/8/contrib/bind9/version Thu Mar 28 05:35:46 2013 (r248807) @@ -7,4 +7,4 @@ MAJORVER=9 MINORVER=8 PATCHVER=4 RELEASETYPE=-P -RELEASEVER=1 +RELEASEVER=2 Modified: stable/8/lib/bind/config.h ============================================================================== --- stable/8/lib/bind/config.h Thu Mar 28 04:13:52 2013 (r248806) +++ stable/8/lib/bind/config.h Thu Mar 28 05:35:46 2013 (r248807) @@ -286,9 +286,6 @@ int sigwait(const unsigned int *set, int /* Define if your OpenSSL version supports GOST. */ /* #undef HAVE_OPENSSL_GOST */ -/* Define to 1 if you have the header file. */ -#define HAVE_REGEX_H 1 - /* Define to 1 if you have the `setegid' function. */ #define HAVE_SETEGID 1 Modified: stable/8/lib/bind/dns/code.h ============================================================================== --- stable/8/lib/bind/dns/code.h Thu Mar 28 04:13:52 2013 (r248806) +++ stable/8/lib/bind/dns/code.h Thu Mar 28 05:35:46 2013 (r248807) @@ -1,7 +1,7 @@ /* $FreeBSD$ */ /* - * Copyright (C) 2004-2012 Internet Systems Consortium, Inc. ("ISC") + * Copyright (C) 2004-2013 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 1998-2003 Internet Software Consortium. * * Permission to use, copy, modify, and distribute this software for any Modified: stable/8/lib/bind/dns/dns/enumclass.h ============================================================================== --- stable/8/lib/bind/dns/dns/enumclass.h Thu Mar 28 04:13:52 2013 (r248806) +++ stable/8/lib/bind/dns/dns/enumclass.h Thu Mar 28 05:35:46 2013 (r248807) @@ -1,7 +1,7 @@ /* $FreeBSD$ */ /* - * Copyright (C) 2004-2012 Internet Systems Consortium, Inc. ("ISC") + * Copyright (C) 2004-2013 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 1998-2003 Internet Software Consortium. * * Permission to use, copy, modify, and distribute this software for any Modified: stable/8/lib/bind/dns/dns/enumtype.h ============================================================================== --- stable/8/lib/bind/dns/dns/enumtype.h Thu Mar 28 04:13:52 2013 (r248806) +++ stable/8/lib/bind/dns/dns/enumtype.h Thu Mar 28 05:35:46 2013 (r248807) @@ -1,7 +1,7 @@ /* $FreeBSD$ */ /* - * Copyright (C) 2004-2012 Internet Systems Consortium, Inc. ("ISC") + * Copyright (C) 2004-2013 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 1998-2003 Internet Software Consortium. * * Permission to use, copy, modify, and distribute this software for any Modified: stable/8/lib/bind/dns/dns/rdatastruct.h ============================================================================== --- stable/8/lib/bind/dns/dns/rdatastruct.h Thu Mar 28 04:13:52 2013 (r248806) +++ stable/8/lib/bind/dns/dns/rdatastruct.h Thu Mar 28 05:35:46 2013 (r248807) @@ -1,7 +1,7 @@ /* $FreeBSD$ */ /* - * Copyright (C) 2004-2012 Internet Systems Consortium, Inc. ("ISC") + * Copyright (C) 2004-2013 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 1998-2003 Internet Software Consortium. * * Permission to use, copy, modify, and distribute this software for any From owner-svn-src-stable-8@FreeBSD.ORG Thu Mar 28 06:48:08 2013 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 67E5B697; Thu, 28 Mar 2013 06:48:08 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 4BBA3F71; Thu, 28 Mar 2013 06:48:08 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r2S6m8xE032237; Thu, 28 Mar 2013 06:48:08 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r2S6m6EP032224; Thu, 28 Mar 2013 06:48:06 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201303280648.r2S6m6EP032224@svn.freebsd.org> From: Xin LI Date: Thu, 28 Mar 2013 06:48:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r248816 - stable/8/crypto/openssl/ssl X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Mar 2013 06:48:08 -0000 Author: delphij Date: Thu Mar 28 06:48:06 2013 New Revision: 248816 URL: http://svnweb.freebsd.org/changeset/base/248816 Log: MFV r248595: - Integrate OpenSSL revisions fb092ef4fca897344daf7189526f5f26be6487ce, a93cc7c57333f4538cbcdedd2e961a5a38caa52d, and 76c61a5d1adb92388f39e585e4af860a20feb9bb. This removes the newly added orig_len field of SSL3_RECORD and restored ABI. Approved by: benl Modified: stable/8/crypto/openssl/ssl/d1_pkt.c stable/8/crypto/openssl/ssl/s3_cbc.c stable/8/crypto/openssl/ssl/s3_enc.c stable/8/crypto/openssl/ssl/s3_pkt.c stable/8/crypto/openssl/ssl/ssl3.h stable/8/crypto/openssl/ssl/ssl_locl.h stable/8/crypto/openssl/ssl/t1_enc.c Directory Properties: stable/8/crypto/openssl/ (props changed) Modified: stable/8/crypto/openssl/ssl/d1_pkt.c ============================================================================== --- stable/8/crypto/openssl/ssl/d1_pkt.c Thu Mar 28 06:39:27 2013 (r248815) +++ stable/8/crypto/openssl/ssl/d1_pkt.c Thu Mar 28 06:48:06 2013 (r248816) @@ -330,8 +330,8 @@ dtls1_process_record(SSL *s) int i,al; int enc_err; SSL_SESSION *sess; - SSL3_RECORD *rr; - unsigned int mac_size; + SSL3_RECORD *rr; + unsigned int mac_size, orig_len; unsigned char md[EVP_MAX_MD_SIZE]; rr= &(s->s3->rrec); @@ -362,7 +362,7 @@ dtls1_process_record(SSL *s) /* decrypt in place in 'rr->input' */ rr->data=rr->input; - rr->orig_len=rr->length; + orig_len=rr->length; enc_err = s->method->ssl3_enc->enc(s,0); /* enc_err is: @@ -399,10 +399,10 @@ printf("\n"); * therefore we can safely process the record in a different * amount of time if it's too short to possibly contain a MAC. */ - if (rr->orig_len < mac_size || + if (orig_len < mac_size || /* CBC records must have a padding length byte too. */ (EVP_CIPHER_CTX_mode(s->enc_read_ctx) == EVP_CIPH_CBC_MODE && - rr->orig_len < mac_size+1)) + orig_len < mac_size+1)) { al=SSL_AD_DECODE_ERROR; SSLerr(SSL_F_DTLS1_PROCESS_RECORD,SSL_R_LENGTH_TOO_SHORT); @@ -417,12 +417,12 @@ printf("\n"); * without leaking the contents of the padding bytes. * */ mac = mac_tmp; - ssl3_cbc_copy_mac(mac_tmp, rr, mac_size); + ssl3_cbc_copy_mac(mac_tmp, rr, mac_size, orig_len); rr->length -= mac_size; } else { - /* In this case there's no padding, so |rec->orig_len| + /* In this case there's no padding, so |orig_len| * equals |rec->length| and we checked that there's * enough bytes for |mac_size| above. */ rr->length -= mac_size; Modified: stable/8/crypto/openssl/ssl/s3_cbc.c ============================================================================== --- stable/8/crypto/openssl/ssl/s3_cbc.c Thu Mar 28 06:39:27 2013 (r248815) +++ stable/8/crypto/openssl/ssl/s3_cbc.c Thu Mar 28 06:48:06 2013 (r248816) @@ -116,7 +116,9 @@ int ssl3_cbc_remove_padding(const SSL* s good = constant_time_ge(rec->length, padding_length+overhead); /* SSLv3 requires that the padding is minimal. */ good &= constant_time_ge(block_size, padding_length+1); - rec->length -= good & (padding_length+1); + padding_length = good & (padding_length+1); + rec->length -= padding_length; + rec->type |= padding_length<<8; /* kludge: pass padding length */ return (int)((good & 1) | (~good & -1)); } @@ -202,7 +204,9 @@ int tls1_cbc_remove_padding(const SSL* s good <<= sizeof(good)*8-1; good = DUPLICATE_MSB_TO_ALL(good); - rec->length -= good & (padding_length+1); + padding_length = good & (padding_length+1); + rec->length -= padding_length; + rec->type |= padding_length<<8; /* kludge: pass padding length */ /* We can always safely skip the explicit IV. We check at the beginning * of this function that the record has at least enough space for the @@ -217,7 +221,6 @@ int tls1_cbc_remove_padding(const SSL* s rec->data += block_size; rec->input += block_size; rec->length -= block_size; - rec->orig_len -= block_size; } return (int)((good & 1) | (~good & -1)); @@ -245,7 +248,7 @@ int tls1_cbc_remove_padding(const SSL* s */ void ssl3_cbc_copy_mac(unsigned char* out, const SSL3_RECORD *rec, - unsigned md_size) + unsigned md_size,unsigned orig_len) { #if defined(CBC_MAC_ROTATE_IN_PLACE) unsigned char rotated_mac_buf[EVP_MAX_MD_SIZE*2]; @@ -264,7 +267,7 @@ void ssl3_cbc_copy_mac(unsigned char* ou unsigned div_spoiler; unsigned rotate_offset; - OPENSSL_assert(rec->orig_len >= md_size); + OPENSSL_assert(orig_len >= md_size); OPENSSL_assert(md_size <= EVP_MAX_MD_SIZE); #if defined(CBC_MAC_ROTATE_IN_PLACE) @@ -272,8 +275,8 @@ void ssl3_cbc_copy_mac(unsigned char* ou #endif /* This information is public so it's safe to branch based on it. */ - if (rec->orig_len > md_size + 255 + 1) - scan_start = rec->orig_len - (md_size + 255 + 1); + if (orig_len > md_size + 255 + 1) + scan_start = orig_len - (md_size + 255 + 1); /* div_spoiler contains a multiple of md_size that is used to cause the * modulo operation to be constant time. Without this, the time varies * based on the amount of padding when running on Intel chips at least. @@ -286,9 +289,9 @@ void ssl3_cbc_copy_mac(unsigned char* ou rotate_offset = (div_spoiler + mac_start - scan_start) % md_size; memset(rotated_mac, 0, md_size); - for (i = scan_start; i < rec->orig_len;) + for (i = scan_start; i < orig_len;) { - for (j = 0; j < md_size && i < rec->orig_len; i++, j++) + for (j = 0; j < md_size && i < orig_len; i++, j++) { unsigned char mac_started = constant_time_ge(i, mac_start); unsigned char mac_ended = constant_time_ge(i, mac_end); Modified: stable/8/crypto/openssl/ssl/s3_enc.c ============================================================================== --- stable/8/crypto/openssl/ssl/s3_enc.c Thu Mar 28 06:39:27 2013 (r248815) +++ stable/8/crypto/openssl/ssl/s3_enc.c Thu Mar 28 06:48:06 2013 (r248816) @@ -504,8 +504,6 @@ int ssl3_enc(SSL *s, int send) EVP_Cipher(ds,rec->data,rec->input,l); - rec->orig_len = rec->length; - if (s->read_hash != NULL) mac_size = EVP_MD_size(s->read_hash); @@ -587,7 +585,7 @@ int ssl3_mac(SSL *ssl, unsigned char *md EVP_MD_CTX md_ctx; const EVP_MD *hash; unsigned char *p,rec_char; - size_t md_size; + size_t md_size, orig_len; int npad; if (send) @@ -608,6 +606,10 @@ int ssl3_mac(SSL *ssl, unsigned char *md md_size=EVP_MD_size(hash); npad=(48/md_size)*md_size; + /* kludge: ssl3_cbc_remove_padding passes padding length in rec->type */ + orig_len = rec->length+md_size+((unsigned int)rec->type>>8); + rec->type &= 0xff; + if (!send && EVP_CIPHER_CTX_mode(ssl->enc_read_ctx) == EVP_CIPH_CBC_MODE && ssl3_cbc_record_digest_supported(hash)) @@ -639,7 +641,7 @@ int ssl3_mac(SSL *ssl, unsigned char *md hash, md, &md_size, header, rec->input, - rec->length + md_size, rec->orig_len, + rec->length + md_size, orig_len, mac_sec, md_size, 1 /* is SSLv3 */); } Modified: stable/8/crypto/openssl/ssl/s3_pkt.c ============================================================================== --- stable/8/crypto/openssl/ssl/s3_pkt.c Thu Mar 28 06:39:27 2013 (r248815) +++ stable/8/crypto/openssl/ssl/s3_pkt.c Thu Mar 28 06:48:06 2013 (r248816) @@ -246,7 +246,7 @@ static int ssl3_get_record(SSL *s) unsigned char *p; unsigned char md[EVP_MAX_MD_SIZE]; short version; - unsigned mac_size; + unsigned mac_size, orig_len; size_t extra; rr= &(s->s3->rrec); @@ -351,7 +351,7 @@ again: /* decrypt in place in 'rr->input' */ rr->data=rr->input; - rr->orig_len=rr->length; + orig_len=rr->length; enc_err = s->method->ssl3_enc->enc(s,0); /* enc_err is: @@ -387,10 +387,10 @@ printf("\n"); * therefore we can safely process the record in a different * amount of time if it's too short to possibly contain a MAC. */ - if (rr->orig_len < mac_size || + if (orig_len < mac_size || /* CBC records must have a padding length byte too. */ (EVP_CIPHER_CTX_mode(s->enc_read_ctx) == EVP_CIPH_CBC_MODE && - rr->orig_len < mac_size+1)) + orig_len < mac_size+1)) { al=SSL_AD_DECODE_ERROR; SSLerr(SSL_F_SSL3_GET_RECORD,SSL_R_LENGTH_TOO_SHORT); @@ -405,12 +405,12 @@ printf("\n"); * without leaking the contents of the padding bytes. * */ mac = mac_tmp; - ssl3_cbc_copy_mac(mac_tmp, rr, mac_size); + ssl3_cbc_copy_mac(mac_tmp, rr, mac_size, orig_len); rr->length -= mac_size; } else { - /* In this case there's no padding, so |rec->orig_len| + /* In this case there's no padding, so |orig_len| * equals |rec->length| and we checked that there's * enough bytes for |mac_size| above. */ rr->length -= mac_size; Modified: stable/8/crypto/openssl/ssl/ssl3.h ============================================================================== --- stable/8/crypto/openssl/ssl/ssl3.h Thu Mar 28 06:39:27 2013 (r248815) +++ stable/8/crypto/openssl/ssl/ssl3.h Thu Mar 28 06:48:06 2013 (r248816) @@ -304,10 +304,6 @@ typedef struct ssl3_record_st /*r */ unsigned char *comp; /* only used with decompression - malloc()ed */ /*r */ unsigned long epoch; /* epoch number, needed by DTLS1 */ /*r */ PQ_64BIT seq_num; /* sequence number, needed by DTLS1 */ -/*rw*/ unsigned int orig_len; /* How many bytes were available before padding - was removed? This is used to implement the - MAC check in constant time for CBC records. - */ } SSL3_RECORD; typedef struct ssl3_buffer_st Modified: stable/8/crypto/openssl/ssl/ssl_locl.h ============================================================================== --- stable/8/crypto/openssl/ssl/ssl_locl.h Thu Mar 28 06:39:27 2013 (r248815) +++ stable/8/crypto/openssl/ssl/ssl_locl.h Thu Mar 28 06:48:06 2013 (r248816) @@ -1015,7 +1015,7 @@ int ssl_parse_clienthello_renegotiate_ex /* s3_cbc.c */ void ssl3_cbc_copy_mac(unsigned char* out, const SSL3_RECORD *rec, - unsigned md_size); + unsigned md_size,unsigned orig_len); int ssl3_cbc_remove_padding(const SSL* s, SSL3_RECORD *rec, unsigned block_size, Modified: stable/8/crypto/openssl/ssl/t1_enc.c ============================================================================== --- stable/8/crypto/openssl/ssl/t1_enc.c Thu Mar 28 06:39:27 2013 (r248815) +++ stable/8/crypto/openssl/ssl/t1_enc.c Thu Mar 28 06:48:06 2013 (r248816) @@ -689,7 +689,7 @@ int tls1_mac(SSL *ssl, unsigned char *md SSL3_RECORD *rec; unsigned char *mac_sec,*seq; const EVP_MD *hash; - size_t md_size; + size_t md_size, orig_len; int i; HMAC_CTX hmac; unsigned char header[13]; @@ -727,6 +727,10 @@ int tls1_mac(SSL *ssl, unsigned char *md else memcpy(header, seq, 8); + /* kludge: tls1_cbc_remove_padding passes padding length in rec->type */ + orig_len = rec->length+md_size+((unsigned int)rec->type>>8); + rec->type &= 0xff; + header[8]=rec->type; header[9]=(unsigned char)(ssl->version>>8); header[10]=(unsigned char)(ssl->version); @@ -745,7 +749,7 @@ int tls1_mac(SSL *ssl, unsigned char *md hash, md, &md_size, header, rec->input, - rec->length + md_size, rec->orig_len, + rec->length + md_size, orig_len, ssl->s3->read_mac_secret, EVP_MD_size(ssl->read_hash), 0 /* not SSLv3 */); @@ -764,7 +768,7 @@ int tls1_mac(SSL *ssl, unsigned char *md ssl->enc_read_ctx, hash, &hmac, rec->input, - rec->length, rec->orig_len); + rec->length, orig_len); #endif } From owner-svn-src-stable-8@FreeBSD.ORG Thu Mar 28 06:56:14 2013 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 71CFADB9; Thu, 28 Mar 2013 06:56:14 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 63DA26F; Thu, 28 Mar 2013 06:56:14 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r2S6uDKY035082; Thu, 28 Mar 2013 06:56:13 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r2S6uD3O035081; Thu, 28 Mar 2013 06:56:13 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201303280656.r2S6uD3O035081@svn.freebsd.org> From: Xin LI Date: Thu, 28 Mar 2013 06:56:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r248818 - stable/8/sys/conf X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Mar 2013 06:56:14 -0000 Author: delphij Date: Thu Mar 28 06:56:13 2013 New Revision: 248818 URL: http://svnweb.freebsd.org/changeset/base/248818 Log: 8.4-BETA1 is done, identify as 8.4-PRERELEASE again. Modified: stable/8/sys/conf/newvers.sh Modified: stable/8/sys/conf/newvers.sh ============================================================================== --- stable/8/sys/conf/newvers.sh Thu Mar 28 06:51:29 2013 (r248817) +++ stable/8/sys/conf/newvers.sh Thu Mar 28 06:56:13 2013 (r248818) @@ -32,7 +32,7 @@ TYPE="FreeBSD" REVISION="8.4" -BRANCH="BETA1" +BRANCH="PRERELEASE" if [ "X${BRANCH_OVERRIDE}" != "X" ]; then BRANCH=${BRANCH_OVERRIDE} fi From owner-svn-src-stable-8@FreeBSD.ORG Thu Mar 28 06:59:59 2013 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 247F7194; Thu, 28 Mar 2013 06:59:59 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 16D959C; Thu, 28 Mar 2013 06:59:59 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r2S6xw6B035593; Thu, 28 Mar 2013 06:59:58 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r2S6xwAL035592; Thu, 28 Mar 2013 06:59:58 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201303280659.r2S6xwAL035592@svn.freebsd.org> From: Xin LI Date: Thu, 28 Mar 2013 06:59:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r248819 - stable/8/sys/sys X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Mar 2013 06:59:59 -0000 Author: delphij Date: Thu Mar 28 06:59:58 2013 New Revision: 248819 URL: http://svnweb.freebsd.org/changeset/base/248819 Log: Bump __FreeBSD_version to 804500 now that releng/8.4 has been branched. Modified: stable/8/sys/sys/param.h Modified: stable/8/sys/sys/param.h ============================================================================== --- stable/8/sys/sys/param.h Thu Mar 28 06:56:13 2013 (r248818) +++ stable/8/sys/sys/param.h Thu Mar 28 06:59:58 2013 (r248819) @@ -58,7 +58,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 803501 /* Master, propagated to newvers */ +#define __FreeBSD_version 804500 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From owner-svn-src-stable-8@FreeBSD.ORG Thu Mar 28 09:03:16 2013 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 3B10882F; Thu, 28 Mar 2013 09:03:16 +0000 (UTC) (envelope-from gavin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 2D3D4892; Thu, 28 Mar 2013 09:03:16 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r2S93Fd4073699; Thu, 28 Mar 2013 09:03:15 GMT (envelope-from gavin@svn.freebsd.org) Received: (from gavin@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r2S93FEO073698; Thu, 28 Mar 2013 09:03:15 GMT (envelope-from gavin@svn.freebsd.org) Message-Id: <201303280903.r2S93FEO073698@svn.freebsd.org> From: Gavin Atkinson Date: Thu, 28 Mar 2013 09:03:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r248821 - stable/8/lib/libc/stdlib X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Mar 2013 09:03:16 -0000 Author: gavin Date: Thu Mar 28 09:03:15 2013 New Revision: 248821 URL: http://svnweb.freebsd.org/changeset/base/248821 Log: When r241373 was merged, one file appears to have been missed from the commit. Merge it: Remove undefined behavior from sranddev() and srandomdev(). This doesn't actually work with any modern C compiler: In particular, both clang and modern gcc verisons silently elide any xor operation with 'junk'. No mergeinfo changes with this commit as r241475 already updated the mergeinfo. Modified: stable/8/lib/libc/stdlib/random.c Modified: stable/8/lib/libc/stdlib/random.c ============================================================================== --- stable/8/lib/libc/stdlib/random.c Thu Mar 28 08:13:52 2013 (r248820) +++ stable/8/lib/libc/stdlib/random.c Thu Mar 28 09:03:15 2013 (r248821) @@ -315,10 +315,9 @@ srandomdev() if (!done) { struct timeval tv; - unsigned long junk; gettimeofday(&tv, NULL); - srandom((getpid() << 16) ^ tv.tv_sec ^ tv.tv_usec ^ junk); + srandom((getpid() << 16) ^ tv.tv_sec ^ tv.tv_usec); return; } From owner-svn-src-stable-8@FreeBSD.ORG Thu Mar 28 09:51:38 2013 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 1DA6F15A; Thu, 28 Mar 2013 09:51:38 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 0FC11A96; Thu, 28 Mar 2013 09:51:38 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r2S9pbOi088423; Thu, 28 Mar 2013 09:51:37 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r2S9pb1i088422; Thu, 28 Mar 2013 09:51:37 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201303280951.r2S9pb1i088422@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Thu, 28 Mar 2013 09:51:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r248822 - stable/8/sys/netinet6 X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Mar 2013 09:51:38 -0000 Author: ae Date: Thu Mar 28 09:51:37 2013 New Revision: 248822 URL: http://svnweb.freebsd.org/changeset/base/248822 Log: MFC r248180: Take the inpcb rlock before calculating checksum, it was accidentally moved in r191672. Modified: stable/8/sys/netinet6/raw_ip6.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/netinet6/ (props changed) Modified: stable/8/sys/netinet6/raw_ip6.c ============================================================================== --- stable/8/sys/netinet6/raw_ip6.c Thu Mar 28 09:03:15 2013 (r248821) +++ stable/8/sys/netinet6/raw_ip6.c Thu Mar 28 09:51:37 2013 (r248822) @@ -195,6 +195,7 @@ rip6_input(struct mbuf **mp, int *offp, &ip6->ip6_dst) != 0) continue; } + INP_RLOCK(in6p); if (in6p->in6p_cksum != -1) { V_rip6stat.rip6s_isum++; if (in6_cksum(m, proto, *offp, @@ -204,7 +205,6 @@ rip6_input(struct mbuf **mp, int *offp, continue; } } - INP_RLOCK(in6p); /* * If this raw socket has multicast state, and we * have received a multicast, check if this socket From owner-svn-src-stable-8@FreeBSD.ORG Thu Mar 28 13:38:03 2013 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 74F3EC97; Thu, 28 Mar 2013 13:38:03 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 65D4A857; Thu, 28 Mar 2013 13:38:03 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r2SDc3PS055350; Thu, 28 Mar 2013 13:38:03 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r2SDc3iV055349; Thu, 28 Mar 2013 13:38:03 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201303281338.r2SDc3iV055349@svn.freebsd.org> From: Dag-Erling Smørgrav Date: Thu, 28 Mar 2013 13:38:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r248828 - stable/8/crypto/openssh X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Mar 2013 13:38:03 -0000 Author: des Date: Thu Mar 28 13:38:02 2013 New Revision: 248828 URL: http://svnweb.freebsd.org/changeset/base/248828 Log: MFH (r248465): revert upstream decommissioning of authorized_keys2 Modified: stable/8/crypto/openssh/sshd_config Directory Properties: stable/8/crypto/openssh/ (props changed) Modified: stable/8/crypto/openssh/sshd_config ============================================================================== --- stable/8/crypto/openssh/sshd_config Thu Mar 28 12:46:04 2013 (r248827) +++ stable/8/crypto/openssh/sshd_config Thu Mar 28 13:38:02 2013 (r248828) @@ -50,8 +50,7 @@ #PubkeyAuthentication yes # The default is to check both .ssh/authorized_keys and .ssh/authorized_keys2 -# but this is overridden so installations will only check .ssh/authorized_keys -AuthorizedKeysFile .ssh/authorized_keys +#AuthorizedKeysFile .ssh/authorized_keys .ssh/authorized_keys2 #AuthorizedPrincipalsFile none From owner-svn-src-stable-8@FreeBSD.ORG Thu Mar 28 14:39:51 2013 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id B8EA336B; Thu, 28 Mar 2013 14:39:51 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id AAF3CC23; Thu, 28 Mar 2013 14:39:51 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r2SEdpTE074464; Thu, 28 Mar 2013 14:39:51 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r2SEdpbI074462; Thu, 28 Mar 2013 14:39:51 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201303281439.r2SEdpbI074462@svn.freebsd.org> From: Konstantin Belousov Date: Thu, 28 Mar 2013 14:39:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r248832 - in stable/8/sys: fs/tmpfs ufs/ufs X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Mar 2013 14:39:51 -0000 Author: kib Date: Thu Mar 28 14:39:50 2013 New Revision: 248832 URL: http://svnweb.freebsd.org/changeset/base/248832 Log: MFC r248422: Remove negative name cache entry pointing to the target name, which could be instantiated while tdvp was unlocked. Modified: stable/8/sys/fs/tmpfs/tmpfs_vnops.c stable/8/sys/ufs/ufs/ufs_vnops.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/fs/ (props changed) stable/8/sys/ufs/ (props changed) Modified: stable/8/sys/fs/tmpfs/tmpfs_vnops.c ============================================================================== --- stable/8/sys/fs/tmpfs/tmpfs_vnops.c Thu Mar 28 14:25:09 2013 (r248831) +++ stable/8/sys/fs/tmpfs/tmpfs_vnops.c Thu Mar 28 14:39:50 2013 (r248832) @@ -1282,6 +1282,7 @@ tmpfs_rename(struct vop_rename_args *v) cache_purge(fvp); if (tvp != NULL) cache_purge(tvp); + cache_purge_negative(tdvp); error = 0; Modified: stable/8/sys/ufs/ufs/ufs_vnops.c ============================================================================== --- stable/8/sys/ufs/ufs/ufs_vnops.c Thu Mar 28 14:25:09 2013 (r248831) +++ stable/8/sys/ufs/ufs/ufs_vnops.c Thu Mar 28 14:39:50 2013 (r248832) @@ -1538,6 +1538,7 @@ relock: cache_purge(fvp); if (tvp) cache_purge(tvp); + cache_purge_negative(tdvp); unlockout: vput(fdvp); From owner-svn-src-stable-8@FreeBSD.ORG Thu Mar 28 17:27:47 2013 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 5E5A665A; Thu, 28 Mar 2013 17:27:47 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 3775E7E8; Thu, 28 Mar 2013 17:27:47 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r2SHRlnt034693; Thu, 28 Mar 2013 17:27:47 GMT (envelope-from sbruno@svn.freebsd.org) Received: (from sbruno@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r2SHRlaK034692; Thu, 28 Mar 2013 17:27:47 GMT (envelope-from sbruno@svn.freebsd.org) Message-Id: <201303281727.r2SHRlaK034692@svn.freebsd.org> From: Sean Bruno Date: Thu, 28 Mar 2013 17:27:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r248839 - stable/8/sys/dev/ciss X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Mar 2013 17:27:47 -0000 Author: sbruno Date: Thu Mar 28 17:27:46 2013 New Revision: 248839 URL: http://svnweb.freebsd.org/changeset/base/248839 Log: MFC r247279 The 5300 series ciss(4) board does not work in performant mode with our currnet initialization sequence. Set it to simple mode only so that systems can be updated from stable/7 to newer installations. At some point, we should figure out why we cannot initialize performant mode on this board. PR: kern/153361 Reviewed by: scottl Obtained from: Yahoo! Inc Modified: stable/8/sys/dev/ciss/ciss.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/dev/ (props changed) stable/8/sys/dev/ciss/ (props changed) Modified: stable/8/sys/dev/ciss/ciss.c ============================================================================== --- stable/8/sys/dev/ciss/ciss.c Thu Mar 28 17:07:02 2013 (r248838) +++ stable/8/sys/dev/ciss/ciss.c Thu Mar 28 17:27:46 2013 (r248839) @@ -281,6 +281,7 @@ TUNABLE_INT("hw.ciss.force_interrupt", & #define CISS_BOARD_SA5 1 #define CISS_BOARD_SA5B 2 #define CISS_BOARD_NOMSI (1<<4) +#define CISS_BOARD_SIMPLE (1<<5) static struct { @@ -289,7 +290,8 @@ static struct int flags; char *desc; } ciss_vendor_data[] = { - { 0x0e11, 0x4070, CISS_BOARD_SA5|CISS_BOARD_NOMSI, "Compaq Smart Array 5300" }, + { 0x0e11, 0x4070, CISS_BOARD_SA5|CISS_BOARD_NOMSI|CISS_BOARD_SIMPLE, + "Compaq Smart Array 5300" }, { 0x0e11, 0x4080, CISS_BOARD_SA5B|CISS_BOARD_NOMSI, "Compaq Smart Array 5i" }, { 0x0e11, 0x4082, CISS_BOARD_SA5B|CISS_BOARD_NOMSI, "Compaq Smart Array 532" }, { 0x0e11, 0x4083, CISS_BOARD_SA5B|CISS_BOARD_NOMSI, "HP Smart Array 5312" }, @@ -681,8 +683,15 @@ ciss_init_pci(struct ciss_softc *sc) supported_methods = CISS_TRANSPORT_METHOD_PERF; break; default: - supported_methods = sc->ciss_cfg->supported_methods; - break; + /* + * Override the capabilities of the BOARD and specify SIMPLE + * MODE + */ + if (ciss_vendor_data[i].flags & CISS_BOARD_SIMPLE) + supported_methods = CISS_TRANSPORT_METHOD_SIMPLE; + else + supported_methods = sc->ciss_cfg->supported_methods; + break; } setup: From owner-svn-src-stable-8@FreeBSD.ORG Fri Mar 29 00:22:43 2013 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id E74F38F1; Fri, 29 Mar 2013 00:22:43 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id C1051D12; Fri, 29 Mar 2013 00:22:43 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r2T0Mhsh062599; Fri, 29 Mar 2013 00:22:43 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r2T0Mhhf062598; Fri, 29 Mar 2013 00:22:43 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201303290022.r2T0Mhhf062598@svn.freebsd.org> From: Pyun YongHyeon Date: Fri, 29 Mar 2013 00:22:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r248859 - stable/8/sys/dev/bge X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Mar 2013 00:22:44 -0000 Author: yongari Date: Fri Mar 29 00:22:43 2013 New Revision: 248859 URL: http://svnweb.freebsd.org/changeset/base/248859 Log: MFC r248226: r241438 broke IPMI access on Sun Fire X2200 M2(BCM5715). Fix the IPMI regression by sending BGE_FW_DRV_STATE_UNLOAD to ASF/IPMI firmware in driver attach phase. Sending heartheat to ASF/IPMI is enabled only after upping interface so setting driver state to BGE_FW_DRV_STATE_START in attach phase broke IPMI access. While I'm here, add NVRAM arbitration lock before performing controller reset. ASF/IPMI firmware may be able to access the NVRAM while controller reset is in progress. Without the arbitration lock before resetting the controller, ASF/IPMI may not initialize properly. Modified: stable/8/sys/dev/bge/if_bge.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/dev/ (props changed) stable/8/sys/dev/bge/ (props changed) Modified: stable/8/sys/dev/bge/if_bge.c ============================================================================== --- stable/8/sys/dev/bge/if_bge.c Fri Mar 29 00:21:36 2013 (r248858) +++ stable/8/sys/dev/bge/if_bge.c Fri Mar 29 00:22:43 2013 (r248859) @@ -3637,15 +3637,15 @@ bge_attach(device_t dev) } bge_stop_fw(sc); - bge_sig_pre_reset(sc, BGE_RESET_START); + bge_sig_pre_reset(sc, BGE_RESET_SHUTDOWN); if (bge_reset(sc)) { device_printf(sc->bge_dev, "chip reset failed\n"); error = ENXIO; goto fail; } - bge_sig_legacy(sc, BGE_RESET_START); - bge_sig_post_reset(sc, BGE_RESET_START); + bge_sig_legacy(sc, BGE_RESET_SHUTDOWN); + bge_sig_post_reset(sc, BGE_RESET_SHUTDOWN); if (bge_chipinit(sc)) { device_printf(sc->bge_dev, "chip initialization failed\n"); @@ -3998,6 +3998,20 @@ bge_reset(struct bge_softc *sc) } else write_op = bge_writereg_ind; + if (sc->bge_asicrev != BGE_ASICREV_BCM5700 && + sc->bge_asicrev != BGE_ASICREV_BCM5701) { + CSR_WRITE_4(sc, BGE_NVRAM_SWARB, BGE_NVRAMSWARB_SET1); + for (i = 0; i < 8000; i++) { + if (CSR_READ_4(sc, BGE_NVRAM_SWARB) & + BGE_NVRAMSWARB_GNT1) + break; + DELAY(20); + } + if (i == 8000) { + if (bootverbose) + device_printf(dev, "NVRAM lock timedout!\n"); + } + } /* Take APE lock when performing reset. */ bge_ape_lock(sc, BGE_APE_LOCK_GRC); From owner-svn-src-stable-8@FreeBSD.ORG Fri Mar 29 02:09:48 2013 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 36B8E854; Fri, 29 Mar 2013 02:09:48 +0000 (UTC) (envelope-from bryanv@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 194302FE; Fri, 29 Mar 2013 02:09:48 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r2T29lLQ097616; Fri, 29 Mar 2013 02:09:47 GMT (envelope-from bryanv@svn.freebsd.org) Received: (from bryanv@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r2T29loS097612; Fri, 29 Mar 2013 02:09:47 GMT (envelope-from bryanv@svn.freebsd.org) Message-Id: <201303290209.r2T29loS097612@svn.freebsd.org> From: Bryan Venteicher Date: Fri, 29 Mar 2013 02:09:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r248861 - in stable/8/sys: amd64/conf conf i386/conf X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Mar 2013 02:09:48 -0000 Author: bryanv Date: Fri Mar 29 02:09:46 2013 New Revision: 248861 URL: http://svnweb.freebsd.org/changeset/base/248861 Log: MFC 247870: Remove the virtio dependency entry for the VirtIO device drivers. This will prevent the kernel from linking if the device driver are included without the virtio module. Remove pci and scbus for the same reason. Also explain the relationship and necessity of the virtio and virtio_pci modules. Currently in FreeBSD, we only support VirtIO PCI, but it could be replaced with a different interface (like MMIO) and the device (network, block, etc) will still function. Modified: stable/8/sys/amd64/conf/NOTES stable/8/sys/conf/files.amd64 stable/8/sys/conf/files.i386 stable/8/sys/i386/conf/NOTES Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/ (props changed) stable/8/sys/conf/ (props changed) stable/8/sys/i386/ (props changed) Modified: stable/8/sys/amd64/conf/NOTES ============================================================================== --- stable/8/sys/amd64/conf/NOTES Fri Mar 29 00:32:31 2013 (r248860) +++ stable/8/sys/amd64/conf/NOTES Fri Mar 29 02:09:46 2013 (r248861) @@ -424,6 +424,13 @@ options SAFE_RNDTEST # enable rndtest s # # VirtIO support +# +# The virtio entry provides a generic bus for use by the device drivers. +# It must be combined with an interface that communicates with the host. +# Multiple such interfaces defined by the VirtIO specification. FreeBSD +# only has support for PCI. Therefore, virtio_pci must be statically +# compiled in or loaded as a module for the device drivers to function. +# device virtio # Generic VirtIO bus (required) device virtio_pci # VirtIO PCI Interface device vtnet # VirtIO Ethernet device Modified: stable/8/sys/conf/files.amd64 ============================================================================== --- stable/8/sys/conf/files.amd64 Fri Mar 29 00:32:31 2013 (r248860) +++ stable/8/sys/conf/files.amd64 Fri Mar 29 02:09:46 2013 (r248861) @@ -357,11 +357,11 @@ dev/virtio/virtio.c optional virtio dev/virtio/virtqueue.c optional virtio dev/virtio/virtio_bus_if.m optional virtio dev/virtio/virtio_if.m optional virtio -dev/virtio/pci/virtio_pci.c optional virtio_pci virtio pci -dev/virtio/network/if_vtnet.c optional vtnet virtio -dev/virtio/block/virtio_blk.c optional virtio_blk virtio -dev/virtio/balloon/virtio_balloon.c optional virtio_balloon virtio -dev/virtio/scsi/virtio_scsi.c optional virtio_scsi virtio scbus +dev/virtio/pci/virtio_pci.c optional virtio_pci +dev/virtio/network/if_vtnet.c optional vtnet +dev/virtio/block/virtio_blk.c optional virtio_blk +dev/virtio/balloon/virtio_balloon.c optional virtio_balloon +dev/virtio/scsi/virtio_scsi.c optional virtio_scsi isa/syscons_isa.c optional sc isa/vga_isa.c optional vga kern/link_elf_obj.c standard Modified: stable/8/sys/conf/files.i386 ============================================================================== --- stable/8/sys/conf/files.i386 Fri Mar 29 00:32:31 2013 (r248860) +++ stable/8/sys/conf/files.i386 Fri Mar 29 02:09:46 2013 (r248861) @@ -362,11 +362,11 @@ dev/virtio/virtio.c optional virtio dev/virtio/virtqueue.c optional virtio dev/virtio/virtio_bus_if.m optional virtio dev/virtio/virtio_if.m optional virtio -dev/virtio/pci/virtio_pci.c optional virtio_pci virtio pci -dev/virtio/network/if_vtnet.c optional vtnet virtio -dev/virtio/block/virtio_blk.c optional virtio_blk virtio -dev/virtio/balloon/virtio_balloon.c optional virtio_balloon virtio -dev/virtio/scsi/virtio_scsi.c optional virtio_scsi virtio scbus +dev/virtio/pci/virtio_pci.c optional virtio_pci +dev/virtio/network/if_vtnet.c optional vtnet +dev/virtio/block/virtio_blk.c optional virtio_blk +dev/virtio/balloon/virtio_balloon.c optional virtio_balloon +dev/virtio/scsi/virtio_scsi.c optional virtio_scsi i386/acpica/OsdEnvironment.c optional acpi i386/acpica/acpi_machdep.c optional acpi i386/acpica/acpi_wakeup.c optional acpi Modified: stable/8/sys/i386/conf/NOTES ============================================================================== --- stable/8/sys/i386/conf/NOTES Fri Mar 29 00:32:31 2013 (r248860) +++ stable/8/sys/i386/conf/NOTES Fri Mar 29 02:09:46 2013 (r248861) @@ -766,6 +766,13 @@ device glxsb # AMD Geode LX Security B # # VirtIO support +# +# The virtio entry provides a generic bus for use by the device drivers. +# It must be combined with an interface that communicates with the host. +# Multiple such interfaces defined by the VirtIO specification. FreeBSD +# only has support for PCI. Therefore, virtio_pci must be statically +# compiled in or loaded as a module for the device drivers to function. +# device virtio # Generic VirtIO bus (required) device virtio_pci # VirtIO PCI Interface device vtnet # VirtIO Ethernet device From owner-svn-src-stable-8@FreeBSD.ORG Fri Mar 29 13:23:43 2013 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id D1F23AAE; Fri, 29 Mar 2013 13:23:43 +0000 (UTC) (envelope-from tijl@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id B57C7319; Fri, 29 Mar 2013 13:23:43 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r2TDNhQT097356; Fri, 29 Mar 2013 13:23:43 GMT (envelope-from tijl@svn.freebsd.org) Received: (from tijl@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r2TDNhmi097355; Fri, 29 Mar 2013 13:23:43 GMT (envelope-from tijl@svn.freebsd.org) Message-Id: <201303291323.r2TDNhmi097355@svn.freebsd.org> From: Tijl Coosemans Date: Fri, 29 Mar 2013 13:23:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r248880 - stable/8/sys/kern X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Mar 2013 13:23:43 -0000 Author: tijl Date: Fri Mar 29 13:23:43 2013 New Revision: 248880 URL: http://svnweb.freebsd.org/changeset/base/248880 Log: MFC r248256: - Fix two possible overflows when testing if ELF program headers are on the first page: 1. Cast uint16_t operands in a multiplication to unsigned int because otherwise the implicit promotion to int results in a signed multiplication that can overflow and the behaviour on integer overflow is undefined. 2. Replace (offset + size > PAGE_SIZE) with (size > PAGE_SIZE - offset) because the sum may overflow. - Use the same tests to see if the path to the interpreter is on the first page. There's no overflow here because size is already limited by MAXPATHLEN, but the compiler optimises the new tests better. Also fix an off-by-one error. - Simplify tests to see if an ELF note program header is on the first page. This also fixes an off-by-one error. Reviewed by: kib Modified: stable/8/sys/kern/imgact_elf.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/kern/ (props changed) Modified: stable/8/sys/kern/imgact_elf.c ============================================================================== --- stable/8/sys/kern/imgact_elf.c Fri Mar 29 13:17:34 2013 (r248879) +++ stable/8/sys/kern/imgact_elf.c Fri Mar 29 13:23:43 2013 (r248880) @@ -629,9 +629,8 @@ __elfN(load_file)(struct proc *p, const } /* Only support headers that fit within first page for now */ - /* (multiplication of two Elf_Half fields will not overflow) */ if ((hdr->e_phoff > PAGE_SIZE) || - (hdr->e_phentsize * hdr->e_phnum) > PAGE_SIZE - hdr->e_phoff) { + (u_int)hdr->e_phentsize * hdr->e_phnum > PAGE_SIZE - hdr->e_phoff) { error = ENOEXEC; goto fail; } @@ -713,7 +712,7 @@ __CONCAT(exec_, __elfN(imgact))(struct i */ if ((hdr->e_phoff > PAGE_SIZE) || - (hdr->e_phoff + hdr->e_phentsize * hdr->e_phnum) > PAGE_SIZE) { + (u_int)hdr->e_phentsize * hdr->e_phnum > PAGE_SIZE - hdr->e_phoff) { /* Only support headers in first page for now */ return (ENOEXEC); } @@ -732,8 +731,8 @@ __CONCAT(exec_, __elfN(imgact))(struct i if (phdr[i].p_type == PT_INTERP) { /* Path to interpreter */ if (phdr[i].p_filesz > MAXPATHLEN || - phdr[i].p_offset >= PAGE_SIZE || - phdr[i].p_offset + phdr[i].p_filesz >= PAGE_SIZE) + phdr[i].p_offset > PAGE_SIZE || + phdr[i].p_filesz > PAGE_SIZE - phdr[i].p_offset) return (ENOEXEC); interp = imgp->image_header + phdr[i].p_offset; interp_name_len = phdr[i].p_filesz; @@ -1417,9 +1416,8 @@ __elfN(parse_notes)(struct image_params const char *note_name; int i; - if (pnote == NULL || pnote->p_offset >= PAGE_SIZE || - pnote->p_filesz > PAGE_SIZE || - pnote->p_offset + pnote->p_filesz >= PAGE_SIZE) + if (pnote == NULL || pnote->p_offset > PAGE_SIZE || + pnote->p_filesz > PAGE_SIZE - pnote->p_offset) return (FALSE); note = note0 = (const Elf_Note *)(imgp->image_header + pnote->p_offset); From owner-svn-src-stable-8@FreeBSD.ORG Fri Mar 29 14:18:57 2013 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 7ECD07FB; Fri, 29 Mar 2013 14:18:57 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 58C7D843; Fri, 29 Mar 2013 14:18:57 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r2TEIvKg013397; Fri, 29 Mar 2013 14:18:57 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r2TEIvdN013396; Fri, 29 Mar 2013 14:18:57 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201303291418.r2TEIvdN013396@svn.freebsd.org> From: Glen Barber Date: Fri, 29 Mar 2013 14:18:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r248889 - stable/8/release/doc/en_US.ISO8859-1/hardware X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Mar 2013 14:18:57 -0000 Author: gjb (doc,ports committer) Date: Fri Mar 29 14:18:56 2013 New Revision: 248889 URL: http://svnweb.freebsd.org/changeset/base/248889 Log: MFC r248857: - Update hardware notes to reflect that amd64 is no longer "young" - Bump copyright year Modified: stable/8/release/doc/en_US.ISO8859-1/hardware/article.xml Directory Properties: stable/8/release/doc/ (props changed) stable/8/release/doc/en_US.ISO8859-1/hardware/ (props changed) Modified: stable/8/release/doc/en_US.ISO8859-1/hardware/article.xml ============================================================================== --- stable/8/release/doc/en_US.ISO8859-1/hardware/article.xml Fri Mar 29 14:18:49 2013 (r248888) +++ stable/8/release/doc/en_US.ISO8859-1/hardware/article.xml Fri Mar 29 14:18:56 2013 (r248889) @@ -31,6 +31,7 @@ 2010 2011 2012 + 2013 The &os; Documentation Project @@ -135,20 +136,13 @@ to &intel; EM64T as 64-bit extension technology or IA-32e. - The largest tested memory configuration to date is 64GB. - SMP support has been recently completed and is reasonably - robust. + Both Uniprocessor (UP) and Symmetric Multi-processor (SMP) + configurations are supported. In many respects, &os;/&arch.amd64; is similar to - &os;/&arch.i386;, in terms of drivers supported. There may be - some issues with 64-bit cleanliness in some (particularly - older) drivers. Generally, drivers that already function - correctly on other 64-bit platforms should work. - - &os;/&arch.amd64; is a very young platform on &os;. While - the core &os; kernel and base system components are generally - fairly robust, there are likely to still be rough edges, - particularly with third party packages. + &os;/&arch.i386;, in terms of drivers supported. Generally, + drivers that already function correctly on other 64-bit + platforms should work. From owner-svn-src-stable-8@FreeBSD.ORG Sat Mar 30 00:22:27 2013 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 1A206E0E; Sat, 30 Mar 2013 00:22:27 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id F0CB719B; Sat, 30 Mar 2013 00:22:26 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r2U0MQCE001772; Sat, 30 Mar 2013 00:22:26 GMT (envelope-from mckusick@svn.freebsd.org) Received: (from mckusick@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r2U0MQwR001771; Sat, 30 Mar 2013 00:22:26 GMT (envelope-from mckusick@svn.freebsd.org) Message-Id: <201303300022.r2U0MQwR001771@svn.freebsd.org> From: Kirk McKusick Date: Sat, 30 Mar 2013 00:22:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r248923 - in stable/8/sys: . amd64/amd64 dev/sound i386/i386 ufs/ffs X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 Mar 2013 00:22:27 -0000 Author: mckusick Date: Sat Mar 30 00:22:26 2013 New Revision: 248923 URL: http://svnweb.freebsd.org/changeset/base/248923 Log: MFC of 246289: For UFS2 i_blocks is unsigned. The current "sanity" check that it has gone below zero after the blocks in its inode are freed is a no-op which the compiler fails to warn about because of the use of the DIP macro. Change the sanity check to compare the number of blocks being freed against the value i_blocks. If the number of blocks being freed exceeds i_blocks, just set i_blocks to zero. Reported by: Pedro Giffuni (pfg@) Modified: stable/8/sys/ufs/ffs/ffs_inode.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/Makefile (props changed) stable/8/sys/amd64/ (props changed) stable/8/sys/amd64/amd64/intr_machdep.c (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/arm/ (props changed) stable/8/sys/boot/ (props changed) stable/8/sys/bsm/ (props changed) stable/8/sys/cam/ (props changed) stable/8/sys/cddl/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/compat/ (props changed) stable/8/sys/conf/ (props changed) stable/8/sys/contrib/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/crypto/ (props changed) stable/8/sys/ddb/ (props changed) stable/8/sys/dev/ (props changed) stable/8/sys/dev/aac/ (props changed) stable/8/sys/dev/acpi_support/ (props changed) stable/8/sys/dev/acpica/ (props changed) stable/8/sys/dev/adb/ (props changed) stable/8/sys/dev/adlink/ (props changed) stable/8/sys/dev/advansys/ (props changed) stable/8/sys/dev/ae/ (props changed) stable/8/sys/dev/age/ (props changed) stable/8/sys/dev/agp/ (props changed) stable/8/sys/dev/aha/ (props changed) stable/8/sys/dev/ahb/ (props changed) stable/8/sys/dev/ahci/ (props changed) stable/8/sys/dev/aic/ (props changed) stable/8/sys/dev/aic7xxx/ (props changed) stable/8/sys/dev/alc/ (props changed) stable/8/sys/dev/ale/ (props changed) stable/8/sys/dev/amd/ (props changed) stable/8/sys/dev/amdsbwd/ (props changed) stable/8/sys/dev/amdtemp/ (props changed) stable/8/sys/dev/amr/ (props changed) stable/8/sys/dev/an/ (props changed) stable/8/sys/dev/arcmsr/ (props changed) stable/8/sys/dev/asmc/ (props changed) stable/8/sys/dev/asr/ (props changed) stable/8/sys/dev/ata/ (props changed) stable/8/sys/dev/ath/ (props changed) stable/8/sys/dev/atkbdc/ (props changed) stable/8/sys/dev/auxio/ (props changed) stable/8/sys/dev/bce/ (props changed) stable/8/sys/dev/bfe/ (props changed) stable/8/sys/dev/bge/ (props changed) stable/8/sys/dev/bktr/ (props changed) stable/8/sys/dev/bm/ (props changed) stable/8/sys/dev/buslogic/ (props changed) stable/8/sys/dev/bwi/ (props changed) stable/8/sys/dev/bwn/ (props changed) stable/8/sys/dev/cardbus/ (props changed) stable/8/sys/dev/cas/ (props changed) stable/8/sys/dev/ce/ (props changed) stable/8/sys/dev/cfe/ (props changed) stable/8/sys/dev/cfi/ (props changed) stable/8/sys/dev/ciss/ (props changed) stable/8/sys/dev/cm/ (props changed) stable/8/sys/dev/cmx/ (props changed) stable/8/sys/dev/coretemp/ (props changed) stable/8/sys/dev/cp/ (props changed) stable/8/sys/dev/cpuctl/ (props changed) stable/8/sys/dev/cpufreq/ (props changed) stable/8/sys/dev/cs/ (props changed) stable/8/sys/dev/ct/ (props changed) stable/8/sys/dev/ctau/ (props changed) stable/8/sys/dev/cx/ (props changed) stable/8/sys/dev/cxgb/ (props changed) stable/8/sys/dev/cxgbe/ (props changed) stable/8/sys/dev/cy/ (props changed) stable/8/sys/dev/dc/ (props changed) stable/8/sys/dev/dcons/ (props changed) stable/8/sys/dev/de/ (props changed) stable/8/sys/dev/digi/ (props changed) stable/8/sys/dev/dpms/ (props changed) stable/8/sys/dev/dpt/ (props changed) stable/8/sys/dev/drm/ (props changed) stable/8/sys/dev/e1000/ (props changed) stable/8/sys/dev/ed/ (props changed) stable/8/sys/dev/eisa/ (props changed) stable/8/sys/dev/en/ (props changed) stable/8/sys/dev/ep/ (props changed) stable/8/sys/dev/esp/ (props changed) stable/8/sys/dev/et/ (props changed) stable/8/sys/dev/ex/ (props changed) stable/8/sys/dev/exca/ (props changed) stable/8/sys/dev/fatm/ (props changed) stable/8/sys/dev/fb/ (props changed) stable/8/sys/dev/fdc/ (props changed) stable/8/sys/dev/fe/ (props changed) stable/8/sys/dev/firewire/ (props changed) stable/8/sys/dev/flash/ (props changed) stable/8/sys/dev/fxp/ (props changed) stable/8/sys/dev/gem/ (props changed) stable/8/sys/dev/glxsb/ (props changed) stable/8/sys/dev/hatm/ (props changed) stable/8/sys/dev/hifn/ (props changed) stable/8/sys/dev/hme/ (props changed) stable/8/sys/dev/hpt27xx/ (props changed) stable/8/sys/dev/hptiop/ (props changed) stable/8/sys/dev/hptmv/ (props changed) stable/8/sys/dev/hptrr/ (props changed) stable/8/sys/dev/hwpmc/ (props changed) stable/8/sys/dev/ic/ (props changed) stable/8/sys/dev/ichsmb/ (props changed) stable/8/sys/dev/ichwd/ (props changed) stable/8/sys/dev/ida/ (props changed) stable/8/sys/dev/ie/ (props changed) stable/8/sys/dev/ieee488/ (props changed) stable/8/sys/dev/if_ndis/ (props changed) stable/8/sys/dev/iicbus/ (props changed) stable/8/sys/dev/iir/ (props changed) stable/8/sys/dev/io/ (props changed) stable/8/sys/dev/ipmi/ (props changed) stable/8/sys/dev/ips/ (props changed) stable/8/sys/dev/ipw/ (props changed) stable/8/sys/dev/isci/ (props changed) stable/8/sys/dev/iscsi/ (props changed) stable/8/sys/dev/isp/ (props changed) stable/8/sys/dev/ispfw/ (props changed) stable/8/sys/dev/iwi/ (props changed) stable/8/sys/dev/iwn/ (props changed) stable/8/sys/dev/ixgb/ (props changed) stable/8/sys/dev/ixgbe/ (props changed) stable/8/sys/dev/jme/ (props changed) stable/8/sys/dev/joy/ (props changed) stable/8/sys/dev/kbd/ (props changed) stable/8/sys/dev/kbdmux/ (props changed) stable/8/sys/dev/ksyms/ (props changed) stable/8/sys/dev/le/ (props changed) stable/8/sys/dev/led/ (props changed) stable/8/sys/dev/lge/ (props changed) stable/8/sys/dev/lindev/ (props changed) stable/8/sys/dev/lmc/ (props changed) stable/8/sys/dev/malo/ (props changed) stable/8/sys/dev/mc146818/ (props changed) stable/8/sys/dev/mca/ (props changed) stable/8/sys/dev/mcd/ (props changed) stable/8/sys/dev/md/ (props changed) stable/8/sys/dev/mem/ (props changed) stable/8/sys/dev/mfi/ (props changed) stable/8/sys/dev/mge/ (props changed) stable/8/sys/dev/mii/ (props changed) stable/8/sys/dev/mk48txx/ (props changed) stable/8/sys/dev/mlx/ (props changed) stable/8/sys/dev/mly/ (props changed) stable/8/sys/dev/mmc/ (props changed) stable/8/sys/dev/mn/ (props changed) stable/8/sys/dev/mps/ (props changed) stable/8/sys/dev/mpt/ (props changed) stable/8/sys/dev/mse/ (props changed) stable/8/sys/dev/msk/ (props changed) stable/8/sys/dev/mvs/ (props changed) stable/8/sys/dev/mwl/ (props changed) stable/8/sys/dev/mxge/ (props changed) stable/8/sys/dev/my/ (props changed) stable/8/sys/dev/ncv/ (props changed) stable/8/sys/dev/netmap/ (props changed) stable/8/sys/dev/nfe/ (props changed) stable/8/sys/dev/nge/ (props changed) stable/8/sys/dev/nmdm/ (props changed) stable/8/sys/dev/nsp/ (props changed) stable/8/sys/dev/null/ (props changed) stable/8/sys/dev/nve/ (props changed) stable/8/sys/dev/nvram/ (props changed) stable/8/sys/dev/nxge/ (props changed) stable/8/sys/dev/oce/ (props changed) stable/8/sys/dev/ofw/ (props changed) stable/8/sys/dev/patm/ (props changed) stable/8/sys/dev/pbio/ (props changed) stable/8/sys/dev/pccard/ (props changed) stable/8/sys/dev/pccbb/ (props changed) stable/8/sys/dev/pcf/ (props changed) stable/8/sys/dev/pci/ (props changed) stable/8/sys/dev/pcn/ (props changed) stable/8/sys/dev/pdq/ (props changed) stable/8/sys/dev/powermac_nvram/ (props changed) stable/8/sys/dev/ppbus/ (props changed) stable/8/sys/dev/ppc/ (props changed) stable/8/sys/dev/pst/ (props changed) stable/8/sys/dev/puc/ (props changed) stable/8/sys/dev/quicc/ (props changed) stable/8/sys/dev/ral/ (props changed) stable/8/sys/dev/random/ (props changed) stable/8/sys/dev/rc/ (props changed) stable/8/sys/dev/re/ (props changed) stable/8/sys/dev/rndtest/ (props changed) stable/8/sys/dev/rp/ (props changed) stable/8/sys/dev/safe/ (props changed) stable/8/sys/dev/sbni/ (props changed) stable/8/sys/dev/scc/ (props changed) stable/8/sys/dev/scd/ (props changed) stable/8/sys/dev/sdhci/ (props changed) stable/8/sys/dev/sec/ (props changed) stable/8/sys/dev/sf/ (props changed) stable/8/sys/dev/sge/ (props changed) stable/8/sys/dev/si/ (props changed) stable/8/sys/dev/siba/ (props changed) stable/8/sys/dev/siis/ (props changed) stable/8/sys/dev/sio/ (props changed) stable/8/sys/dev/sis/ (props changed) stable/8/sys/dev/sk/ (props changed) stable/8/sys/dev/smbus/ (props changed) stable/8/sys/dev/smc/ (props changed) stable/8/sys/dev/sn/ (props changed) stable/8/sys/dev/snc/ (props changed) stable/8/sys/dev/snp/ (props changed) stable/8/sys/dev/sound/ (props changed) stable/8/sys/dev/sound/chip.h (props changed) stable/8/sys/dev/sound/clone.c (props changed) stable/8/sys/dev/sound/clone.h (props changed) stable/8/sys/dev/sound/driver.c (props changed) stable/8/sys/dev/sound/isa/ (props changed) stable/8/sys/dev/sound/macio/ (props changed) stable/8/sys/dev/sound/midi/ (props changed) stable/8/sys/dev/sound/pci/ (props changed) stable/8/sys/dev/sound/pcm/ (props changed) stable/8/sys/dev/sound/sbus/ (props changed) stable/8/sys/dev/sound/unit.c (props changed) stable/8/sys/dev/sound/unit.h (props changed) stable/8/sys/dev/sound/usb/ (props changed) stable/8/sys/dev/sound/version.h (props changed) stable/8/sys/dev/speaker/ (props changed) stable/8/sys/dev/spibus/ (props changed) stable/8/sys/dev/ste/ (props changed) stable/8/sys/dev/stg/ (props changed) stable/8/sys/dev/stge/ (props changed) stable/8/sys/dev/streams/ (props changed) stable/8/sys/dev/sym/ (props changed) stable/8/sys/dev/syscons/ (props changed) stable/8/sys/dev/tdfx/ (props changed) stable/8/sys/dev/ti/ (props changed) stable/8/sys/dev/tl/ (props changed) stable/8/sys/dev/tpm/ (props changed) stable/8/sys/dev/trm/ (props changed) stable/8/sys/dev/tsec/ (props changed) stable/8/sys/dev/twa/ (props changed) stable/8/sys/dev/twe/ (props changed) stable/8/sys/dev/tws/ (props changed) stable/8/sys/dev/tx/ (props changed) stable/8/sys/dev/txp/ (props changed) stable/8/sys/dev/uart/ (props changed) stable/8/sys/dev/ubsec/ (props changed) stable/8/sys/dev/usb/ (props changed) stable/8/sys/dev/utopia/ (props changed) stable/8/sys/dev/vge/ (props changed) stable/8/sys/dev/viawd/ (props changed) stable/8/sys/dev/virtio/ (props changed) stable/8/sys/dev/vkbd/ (props changed) stable/8/sys/dev/vr/ (props changed) stable/8/sys/dev/vte/ (props changed) stable/8/sys/dev/vx/ (props changed) stable/8/sys/dev/watchdog/ (props changed) stable/8/sys/dev/wb/ (props changed) stable/8/sys/dev/wbwd/ (props changed) stable/8/sys/dev/wds/ (props changed) stable/8/sys/dev/wi/ (props changed) stable/8/sys/dev/wl/ (props changed) stable/8/sys/dev/wpi/ (props changed) stable/8/sys/dev/xe/ (props changed) stable/8/sys/dev/xen/ (props changed) stable/8/sys/dev/xl/ (props changed) stable/8/sys/fs/ (props changed) stable/8/sys/gdb/ (props changed) stable/8/sys/geom/ (props changed) stable/8/sys/gnu/ (props changed) stable/8/sys/i386/ (props changed) stable/8/sys/i386/i386/intr_machdep.c (props changed) stable/8/sys/ia64/ (props changed) stable/8/sys/isa/ (props changed) stable/8/sys/kern/ (props changed) stable/8/sys/kgssapi/ (props changed) stable/8/sys/libkern/ (props changed) stable/8/sys/mips/ (props changed) stable/8/sys/modules/ (props changed) stable/8/sys/net/ (props changed) stable/8/sys/net80211/ (props changed) stable/8/sys/netatalk/ (props changed) stable/8/sys/netgraph/ (props changed) stable/8/sys/netinet/ (props changed) stable/8/sys/netinet6/ (props changed) stable/8/sys/netipsec/ (props changed) stable/8/sys/netipx/ (props changed) stable/8/sys/netnatm/ (props changed) stable/8/sys/netncp/ (props changed) stable/8/sys/netsmb/ (props changed) stable/8/sys/nfs/ (props changed) stable/8/sys/nfsclient/ (props changed) stable/8/sys/nfsserver/ (props changed) stable/8/sys/nlm/ (props changed) stable/8/sys/opencrypto/ (props changed) stable/8/sys/pc98/ (props changed) stable/8/sys/pci/ (props changed) stable/8/sys/powerpc/ (props changed) stable/8/sys/rpc/ (props changed) stable/8/sys/security/ (props changed) stable/8/sys/sparc64/ (props changed) stable/8/sys/sun4v/ (props changed) stable/8/sys/sys/ (props changed) stable/8/sys/tools/ (props changed) stable/8/sys/ufs/ (props changed) stable/8/sys/vm/ (props changed) stable/8/sys/x86/ (props changed) stable/8/sys/xdr/ (props changed) stable/8/sys/xen/ (props changed) Modified: stable/8/sys/ufs/ffs/ffs_inode.c ============================================================================== --- stable/8/sys/ufs/ffs/ffs_inode.c Fri Mar 29 22:58:15 2013 (r248922) +++ stable/8/sys/ufs/ffs/ffs_inode.c Sat Mar 30 00:22:26 2013 (r248923) @@ -508,9 +508,9 @@ done: */ ip->i_size = length; DIP_SET(ip, i_size, length); - DIP_SET(ip, i_blocks, DIP(ip, i_blocks) - blocksreleased); - - if (DIP(ip, i_blocks) < 0) /* sanity */ + if (DIP(ip, i_blocks) >= blocksreleased) + DIP_SET(ip, i_blocks, DIP(ip, i_blocks) - blocksreleased); + else /* sanity */ DIP_SET(ip, i_blocks, 0); ip->i_flag |= IN_CHANGE; #ifdef QUOTA From owner-svn-src-stable-8@FreeBSD.ORG Sat Mar 30 00:33:47 2013 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 1B218FE1; Sat, 30 Mar 2013 00:33:47 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 0C6A41D1; Sat, 30 Mar 2013 00:33:47 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r2U0XkAk004995; Sat, 30 Mar 2013 00:33:46 GMT (envelope-from mckusick@svn.freebsd.org) Received: (from mckusick@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r2U0XkbN004992; Sat, 30 Mar 2013 00:33:46 GMT (envelope-from mckusick@svn.freebsd.org) Message-Id: <201303300033.r2U0XkbN004992@svn.freebsd.org> From: Kirk McKusick Date: Sat, 30 Mar 2013 00:33:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r248924 - in stable/8/sbin: fsck_ffs fsdb X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 Mar 2013 00:33:47 -0000 Author: mckusick Date: Sat Mar 30 00:33:46 2013 New Revision: 248924 URL: http://svnweb.freebsd.org/changeset/base/248924 Log: MFC of 246812 and 246823: MFC 246812: Update fsck_ffs buffer cache manager to use TAILQ macros. No functional changes. MFC 246823: Remove write only assignments and thus fix the build after struct bufarea TAILQ conversion (r246812). Modified: stable/8/sbin/fsck_ffs/fsck.h stable/8/sbin/fsck_ffs/fsutil.c stable/8/sbin/fsdb/fsdbutil.c Directory Properties: stable/8/sbin/fsck_ffs/ (props changed) stable/8/sbin/fsdb/ (props changed) Modified: stable/8/sbin/fsck_ffs/fsck.h ============================================================================== --- stable/8/sbin/fsck_ffs/fsck.h Sat Mar 30 00:22:26 2013 (r248923) +++ stable/8/sbin/fsck_ffs/fsck.h Sat Mar 30 00:33:46 2013 (r248924) @@ -64,10 +64,13 @@ #include #include +#include + #define MAXDUP 10 /* limit on dup blks (per inode) */ #define MAXBAD 10 /* limit on bad blks (per inode) */ -#define MAXBUFSPACE 40*1024 /* maximum space to allocate to buffers */ -#define INOBUFSIZE 56*1024 /* size of buffer to read inodes in pass1 */ +#define MINBUFS 10 /* minimum number of buffers required */ +#define MAXBUFS 40 /* maximum space to allocate to buffers */ +#define INOBUFSIZE 64*1024 /* size of buffer to read inodes in pass1 */ union dinode { struct ufs1_dinode dp1; @@ -127,8 +130,7 @@ struct inostatlist { * buffer cache structure. */ struct bufarea { - struct bufarea *b_next; /* free list queue */ - struct bufarea *b_prev; /* free list queue */ + TAILQ_ENTRY(bufarea) b_list; /* buffer list */ ufs2_daddr_t b_bno; int b_size; int b_errs; @@ -156,10 +158,11 @@ struct bufarea { (bp)->b_un.b_indir2[i] = (val); \ } while (0) -#define B_INUSE 1 +/* + * Buffer flags + */ +#define B_INUSE 0x00000001 /* Buffer is in use */ -#define MINBUFS 5 /* minimum number of buffers required */ -struct bufarea bufhead; /* head of list of other blks in filesys */ struct bufarea sblk; /* file system superblock */ struct bufarea cgblk; /* cylinder group blocks */ struct bufarea *pdirbp; /* current directory contents */ Modified: stable/8/sbin/fsck_ffs/fsutil.c ============================================================================== --- stable/8/sbin/fsck_ffs/fsutil.c Sat Mar 30 00:22:26 2013 (r248923) +++ stable/8/sbin/fsck_ffs/fsutil.c Sat Mar 30 00:33:46 2013 (r248924) @@ -67,6 +67,8 @@ long diskreads, totalreads; /* Disk cach struct timeval slowio_starttime; int slowio_delay_usec = 10000; /* Initial IO delay for background fsck */ int slowio_pollcnt; +static TAILQ_HEAD(buflist, bufarea) bufhead; /* head of buffer cache list */ +static int numbufs; /* size of buffer cache */ int ftypeok(union dinode *dp) @@ -161,8 +163,8 @@ bufinit(void) errx(EEXIT, "cannot allocate buffer pool"); cgblk.b_un.b_buf = bufp; initbarea(&cgblk); - bufhead.b_next = bufhead.b_prev = &bufhead; - bufcnt = MAXBUFSPACE / sblock.fs_bsize; + TAILQ_INIT(&bufhead); + bufcnt = MAXBUFS; if (bufcnt < MINBUFS) bufcnt = MINBUFS; for (i = 0; i < bufcnt; i++) { @@ -174,13 +176,10 @@ bufinit(void) errx(EEXIT, "cannot allocate buffer pool"); } bp->b_un.b_buf = bufp; - bp->b_prev = &bufhead; - bp->b_next = bufhead.b_next; - bufhead.b_next->b_prev = bp; - bufhead.b_next = bp; + TAILQ_INSERT_HEAD(&bufhead, bp, b_list); initbarea(bp); } - bufhead.b_size = i; /* save number of buffers */ + numbufs = i; /* save number of buffers */ } /* @@ -191,23 +190,19 @@ getdatablk(ufs2_daddr_t blkno, long size { struct bufarea *bp; - for (bp = bufhead.b_next; bp != &bufhead; bp = bp->b_next) + TAILQ_FOREACH(bp, &bufhead, b_list) if (bp->b_bno == fsbtodb(&sblock, blkno)) goto foundit; - for (bp = bufhead.b_prev; bp != &bufhead; bp = bp->b_prev) + TAILQ_FOREACH_REVERSE(bp, &bufhead, buflist, b_list) if ((bp->b_flags & B_INUSE) == 0) break; - if (bp == &bufhead) + if (bp == NULL) errx(EEXIT, "deadlocked buffer pool"); getblk(bp, blkno, size); /* fall through */ foundit: - bp->b_prev->b_next = bp->b_next; - bp->b_next->b_prev = bp->b_prev; - bp->b_prev = &bufhead; - bp->b_next = bufhead.b_next; - bufhead.b_next->b_prev = bp; - bufhead.b_next = bp; + TAILQ_REMOVE(&bufhead, bp, b_list); + TAILQ_INSERT_HEAD(&bufhead, bp, b_list); bp->b_flags |= B_INUSE; return (bp); } @@ -273,7 +268,7 @@ void ckfini(int markclean) { struct bufarea *bp, *nbp; - int ofsmodified, cnt = 0; + int ofsmodified, cnt; if (bkgrdflag) { unlink(snapname); @@ -294,6 +289,10 @@ ckfini(int markclean) rerun = 1; } } + if (debug && totalreads > 0) + printf("cache with %d buffers missed %ld of %ld (%d%%)\n", + numbufs, diskreads, totalreads, + (int)(diskreads * 100 / totalreads)); if (fswritefd < 0) { (void)close(fsreadfd); return; @@ -308,15 +307,16 @@ ckfini(int markclean) } flush(fswritefd, &cgblk); free(cgblk.b_un.b_buf); - for (bp = bufhead.b_prev; bp && bp != &bufhead; bp = nbp) { + cnt = 0; + TAILQ_FOREACH_REVERSE_SAFE(bp, &bufhead, buflist, b_list, nbp) { + TAILQ_REMOVE(&bufhead, bp, b_list); cnt++; flush(fswritefd, bp); - nbp = bp->b_prev; free(bp->b_un.b_buf); free((char *)bp); } - if (bufhead.b_size != cnt) - errx(EEXIT, "panic: lost %d buffers", bufhead.b_size - cnt); + if (numbufs != cnt) + errx(EEXIT, "panic: lost %d buffers", numbufs - cnt); pbp = pdirbp = (struct bufarea *)0; if (cursnapshot == 0 && sblock.fs_clean != markclean) { if ((sblock.fs_clean = markclean) != 0) { @@ -342,9 +342,6 @@ ckfini(int markclean) rerun = 1; } } - if (debug && totalreads > 0) - printf("cache missed %ld of %ld (%d%%)\n", diskreads, - totalreads, (int)(diskreads * 100 / totalreads)); (void)close(fsreadfd); (void)close(fswritefd); } Modified: stable/8/sbin/fsdb/fsdbutil.c ============================================================================== --- stable/8/sbin/fsdb/fsdbutil.c Sat Mar 30 00:22:26 2013 (r248923) +++ stable/8/sbin/fsdb/fsdbutil.c Sat Mar 30 00:33:46 2013 (r248924) @@ -238,7 +238,6 @@ printindir(ufs2_daddr_t blk, int level, /* for the final indirect level, don't use the cache */ bp = &buf; bp->b_un.b_buf = bufp; - bp->b_prev = bp->b_next = bp; initbarea(bp); getblk(bp, blk, sblock.fs_bsize); From owner-svn-src-stable-8@FreeBSD.ORG Sat Mar 30 20:57:36 2013 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 8A3C6509; Sat, 30 Mar 2013 20:57:36 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 6D6B4C16; Sat, 30 Mar 2013 20:57:36 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r2UKva01065306; Sat, 30 Mar 2013 20:57:36 GMT (envelope-from mckusick@svn.freebsd.org) Received: (from mckusick@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r2UKvZWW065301; Sat, 30 Mar 2013 20:57:35 GMT (envelope-from mckusick@svn.freebsd.org) Message-Id: <201303302057.r2UKvZWW065301@svn.freebsd.org> From: Kirk McKusick Date: Sat, 30 Mar 2013 20:57:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r248936 - in stable/8/sys: . amd64/amd64 dev/sound geom i386/i386 kern sys ufs/ffs X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 Mar 2013 20:57:36 -0000 Author: mckusick Date: Sat Mar 30 20:57:35 2013 New Revision: 248936 URL: http://svnweb.freebsd.org/changeset/base/248936 Log: MFC of 246876, 246877, and 247387: MFC reviewed by: kib MFC 246876: Add barrier write capability to the VFS buffer interface. A barrier write is a disk write request that tells the disk that the buffer being written must be committed to the media along with any writes that preceeded it before any future blocks may be written to the drive. Barrier writes are provided by adding the functions bbarrierwrite (bwrite with barrier) and babarrierwrite (bawrite with barrier). Following a bbarrierwrite the client knows that the requested buffer is on the media. It does not ensure that buffers written before that buffer are on the media. It only ensure that buffers written before that buffer will get to the media before any buffers written after that buffer. A flush command must be sent to the disk to ensure that all earlier written buffers are on the media. Reviewed by: kib Tested by: Peter Holm MFC 246877: The UFS2 filesystem allocates new blocks of inodes as they are needed. When a cylinder group runs short of inodes, a new block for inodes is allocated, zero'ed, and written to the disk. The zero'ed inodes must be on the disk before the cylinder group can be updated to claim them. If the cylinder group claiming the new inodes were written before the zero'ed block of inodes, the system could crash with the filesystem in an unrecoverable state. Rather than adding a soft updates dependency to ensure that the new inode block is written before it is claimed by the cylinder group map, we just do a barrier write of the zero'ed inode block to ensure that it will get written before the updated cylinder group map can be written. This change should only slow down bulk loading of newly created filesystems since that is the primary time that new inode blocks need to be created. Reported by: Robert Watson Reviewed by: kib Tested by: Peter Holm MFC 247387: An inode block must not be blockingly read while cg block is owned. The order is inode buffer lock -> snaplk -> cg buffer lock, reversing the order causes deadlocks. Inode block must not be written while cg block buffer is owned. The FFS copy on write needs to allocate a block to copy the content of the inode block, and the cylinder group selected for the allocation might be the same as the owned cg block. The reserved block detection code in the ffs_copyonwrite() and ffs_bp_snapblk() is unable to detect the situation, because the locked cg buffer is not exposed to it. In order to maintain the dependency between initialized inode block and the cg_initediblk pointer, look up the inode buffer in non-blocking mode. If succeeded, brelse cg block, initialize the inode block and write it. After the write is finished, reread cg block and update the cg_initediblk. If inode block is already locked by another thread, let the another thread initialize it. If another thread raced with us after we started writing inode block, the situation is detected by an update of cg_initediblk. Note that double-initialization of the inode block is harmless, the block cannot be used until cg_initediblk is incremented. Sponsored by: The FreeBSD Foundation In collaboration with: pho Reviewed by: mckusick X-MFC-note: after r246877 Modified: stable/8/sys/geom/geom_vfs.c stable/8/sys/kern/vfs_bio.c stable/8/sys/kern/vfs_cluster.c stable/8/sys/sys/buf.h stable/8/sys/ufs/ffs/ffs_alloc.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/Makefile (props changed) stable/8/sys/amd64/ (props changed) stable/8/sys/amd64/amd64/intr_machdep.c (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/arm/ (props changed) stable/8/sys/boot/ (props changed) stable/8/sys/bsm/ (props changed) stable/8/sys/cam/ (props changed) stable/8/sys/cddl/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/compat/ (props changed) stable/8/sys/conf/ (props changed) stable/8/sys/contrib/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/crypto/ (props changed) stable/8/sys/ddb/ (props changed) stable/8/sys/dev/ (props changed) stable/8/sys/dev/aac/ (props changed) stable/8/sys/dev/acpi_support/ (props changed) stable/8/sys/dev/acpica/ (props changed) stable/8/sys/dev/adb/ (props changed) stable/8/sys/dev/adlink/ (props changed) stable/8/sys/dev/advansys/ (props changed) stable/8/sys/dev/ae/ (props changed) stable/8/sys/dev/age/ (props changed) stable/8/sys/dev/agp/ (props changed) stable/8/sys/dev/aha/ (props changed) stable/8/sys/dev/ahb/ (props changed) stable/8/sys/dev/ahci/ (props changed) stable/8/sys/dev/aic/ (props changed) stable/8/sys/dev/aic7xxx/ (props changed) stable/8/sys/dev/alc/ (props changed) stable/8/sys/dev/ale/ (props changed) stable/8/sys/dev/amd/ (props changed) stable/8/sys/dev/amdsbwd/ (props changed) stable/8/sys/dev/amdtemp/ (props changed) stable/8/sys/dev/amr/ (props changed) stable/8/sys/dev/an/ (props changed) stable/8/sys/dev/arcmsr/ (props changed) stable/8/sys/dev/asmc/ (props changed) stable/8/sys/dev/asr/ (props changed) stable/8/sys/dev/ata/ (props changed) stable/8/sys/dev/ath/ (props changed) stable/8/sys/dev/atkbdc/ (props changed) stable/8/sys/dev/auxio/ (props changed) stable/8/sys/dev/bce/ (props changed) stable/8/sys/dev/bfe/ (props changed) stable/8/sys/dev/bge/ (props changed) stable/8/sys/dev/bktr/ (props changed) stable/8/sys/dev/bm/ (props changed) stable/8/sys/dev/buslogic/ (props changed) stable/8/sys/dev/bwi/ (props changed) stable/8/sys/dev/bwn/ (props changed) stable/8/sys/dev/cardbus/ (props changed) stable/8/sys/dev/cas/ (props changed) stable/8/sys/dev/ce/ (props changed) stable/8/sys/dev/cfe/ (props changed) stable/8/sys/dev/cfi/ (props changed) stable/8/sys/dev/ciss/ (props changed) stable/8/sys/dev/cm/ (props changed) stable/8/sys/dev/cmx/ (props changed) stable/8/sys/dev/coretemp/ (props changed) stable/8/sys/dev/cp/ (props changed) stable/8/sys/dev/cpuctl/ (props changed) stable/8/sys/dev/cpufreq/ (props changed) stable/8/sys/dev/cs/ (props changed) stable/8/sys/dev/ct/ (props changed) stable/8/sys/dev/ctau/ (props changed) stable/8/sys/dev/cx/ (props changed) stable/8/sys/dev/cxgb/ (props changed) stable/8/sys/dev/cxgbe/ (props changed) stable/8/sys/dev/cy/ (props changed) stable/8/sys/dev/dc/ (props changed) stable/8/sys/dev/dcons/ (props changed) stable/8/sys/dev/de/ (props changed) stable/8/sys/dev/digi/ (props changed) stable/8/sys/dev/dpms/ (props changed) stable/8/sys/dev/dpt/ (props changed) stable/8/sys/dev/drm/ (props changed) stable/8/sys/dev/e1000/ (props changed) stable/8/sys/dev/ed/ (props changed) stable/8/sys/dev/eisa/ (props changed) stable/8/sys/dev/en/ (props changed) stable/8/sys/dev/ep/ (props changed) stable/8/sys/dev/esp/ (props changed) stable/8/sys/dev/et/ (props changed) stable/8/sys/dev/ex/ (props changed) stable/8/sys/dev/exca/ (props changed) stable/8/sys/dev/fatm/ (props changed) stable/8/sys/dev/fb/ (props changed) stable/8/sys/dev/fdc/ (props changed) stable/8/sys/dev/fe/ (props changed) stable/8/sys/dev/firewire/ (props changed) stable/8/sys/dev/flash/ (props changed) stable/8/sys/dev/fxp/ (props changed) stable/8/sys/dev/gem/ (props changed) stable/8/sys/dev/glxsb/ (props changed) stable/8/sys/dev/hatm/ (props changed) stable/8/sys/dev/hifn/ (props changed) stable/8/sys/dev/hme/ (props changed) stable/8/sys/dev/hpt27xx/ (props changed) stable/8/sys/dev/hptiop/ (props changed) stable/8/sys/dev/hptmv/ (props changed) stable/8/sys/dev/hptrr/ (props changed) stable/8/sys/dev/hwpmc/ (props changed) stable/8/sys/dev/ic/ (props changed) stable/8/sys/dev/ichsmb/ (props changed) stable/8/sys/dev/ichwd/ (props changed) stable/8/sys/dev/ida/ (props changed) stable/8/sys/dev/ie/ (props changed) stable/8/sys/dev/ieee488/ (props changed) stable/8/sys/dev/if_ndis/ (props changed) stable/8/sys/dev/iicbus/ (props changed) stable/8/sys/dev/iir/ (props changed) stable/8/sys/dev/io/ (props changed) stable/8/sys/dev/ipmi/ (props changed) stable/8/sys/dev/ips/ (props changed) stable/8/sys/dev/ipw/ (props changed) stable/8/sys/dev/isci/ (props changed) stable/8/sys/dev/iscsi/ (props changed) stable/8/sys/dev/isp/ (props changed) stable/8/sys/dev/ispfw/ (props changed) stable/8/sys/dev/iwi/ (props changed) stable/8/sys/dev/iwn/ (props changed) stable/8/sys/dev/ixgb/ (props changed) stable/8/sys/dev/ixgbe/ (props changed) stable/8/sys/dev/jme/ (props changed) stable/8/sys/dev/joy/ (props changed) stable/8/sys/dev/kbd/ (props changed) stable/8/sys/dev/kbdmux/ (props changed) stable/8/sys/dev/ksyms/ (props changed) stable/8/sys/dev/le/ (props changed) stable/8/sys/dev/led/ (props changed) stable/8/sys/dev/lge/ (props changed) stable/8/sys/dev/lindev/ (props changed) stable/8/sys/dev/lmc/ (props changed) stable/8/sys/dev/malo/ (props changed) stable/8/sys/dev/mc146818/ (props changed) stable/8/sys/dev/mca/ (props changed) stable/8/sys/dev/mcd/ (props changed) stable/8/sys/dev/md/ (props changed) stable/8/sys/dev/mem/ (props changed) stable/8/sys/dev/mfi/ (props changed) stable/8/sys/dev/mge/ (props changed) stable/8/sys/dev/mii/ (props changed) stable/8/sys/dev/mk48txx/ (props changed) stable/8/sys/dev/mlx/ (props changed) stable/8/sys/dev/mly/ (props changed) stable/8/sys/dev/mmc/ (props changed) stable/8/sys/dev/mn/ (props changed) stable/8/sys/dev/mps/ (props changed) stable/8/sys/dev/mpt/ (props changed) stable/8/sys/dev/mse/ (props changed) stable/8/sys/dev/msk/ (props changed) stable/8/sys/dev/mvs/ (props changed) stable/8/sys/dev/mwl/ (props changed) stable/8/sys/dev/mxge/ (props changed) stable/8/sys/dev/my/ (props changed) stable/8/sys/dev/ncv/ (props changed) stable/8/sys/dev/netmap/ (props changed) stable/8/sys/dev/nfe/ (props changed) stable/8/sys/dev/nge/ (props changed) stable/8/sys/dev/nmdm/ (props changed) stable/8/sys/dev/nsp/ (props changed) stable/8/sys/dev/null/ (props changed) stable/8/sys/dev/nve/ (props changed) stable/8/sys/dev/nvram/ (props changed) stable/8/sys/dev/nxge/ (props changed) stable/8/sys/dev/oce/ (props changed) stable/8/sys/dev/ofw/ (props changed) stable/8/sys/dev/patm/ (props changed) stable/8/sys/dev/pbio/ (props changed) stable/8/sys/dev/pccard/ (props changed) stable/8/sys/dev/pccbb/ (props changed) stable/8/sys/dev/pcf/ (props changed) stable/8/sys/dev/pci/ (props changed) stable/8/sys/dev/pcn/ (props changed) stable/8/sys/dev/pdq/ (props changed) stable/8/sys/dev/powermac_nvram/ (props changed) stable/8/sys/dev/ppbus/ (props changed) stable/8/sys/dev/ppc/ (props changed) stable/8/sys/dev/pst/ (props changed) stable/8/sys/dev/puc/ (props changed) stable/8/sys/dev/quicc/ (props changed) stable/8/sys/dev/ral/ (props changed) stable/8/sys/dev/random/ (props changed) stable/8/sys/dev/rc/ (props changed) stable/8/sys/dev/re/ (props changed) stable/8/sys/dev/rndtest/ (props changed) stable/8/sys/dev/rp/ (props changed) stable/8/sys/dev/safe/ (props changed) stable/8/sys/dev/sbni/ (props changed) stable/8/sys/dev/scc/ (props changed) stable/8/sys/dev/scd/ (props changed) stable/8/sys/dev/sdhci/ (props changed) stable/8/sys/dev/sec/ (props changed) stable/8/sys/dev/sf/ (props changed) stable/8/sys/dev/sge/ (props changed) stable/8/sys/dev/si/ (props changed) stable/8/sys/dev/siba/ (props changed) stable/8/sys/dev/siis/ (props changed) stable/8/sys/dev/sio/ (props changed) stable/8/sys/dev/sis/ (props changed) stable/8/sys/dev/sk/ (props changed) stable/8/sys/dev/smbus/ (props changed) stable/8/sys/dev/smc/ (props changed) stable/8/sys/dev/sn/ (props changed) stable/8/sys/dev/snc/ (props changed) stable/8/sys/dev/snp/ (props changed) stable/8/sys/dev/sound/ (props changed) stable/8/sys/dev/sound/chip.h (props changed) stable/8/sys/dev/sound/clone.c (props changed) stable/8/sys/dev/sound/clone.h (props changed) stable/8/sys/dev/sound/driver.c (props changed) stable/8/sys/dev/sound/isa/ (props changed) stable/8/sys/dev/sound/macio/ (props changed) stable/8/sys/dev/sound/midi/ (props changed) stable/8/sys/dev/sound/pci/ (props changed) stable/8/sys/dev/sound/pcm/ (props changed) stable/8/sys/dev/sound/sbus/ (props changed) stable/8/sys/dev/sound/unit.c (props changed) stable/8/sys/dev/sound/unit.h (props changed) stable/8/sys/dev/sound/usb/ (props changed) stable/8/sys/dev/sound/version.h (props changed) stable/8/sys/dev/speaker/ (props changed) stable/8/sys/dev/spibus/ (props changed) stable/8/sys/dev/ste/ (props changed) stable/8/sys/dev/stg/ (props changed) stable/8/sys/dev/stge/ (props changed) stable/8/sys/dev/streams/ (props changed) stable/8/sys/dev/sym/ (props changed) stable/8/sys/dev/syscons/ (props changed) stable/8/sys/dev/tdfx/ (props changed) stable/8/sys/dev/ti/ (props changed) stable/8/sys/dev/tl/ (props changed) stable/8/sys/dev/tpm/ (props changed) stable/8/sys/dev/trm/ (props changed) stable/8/sys/dev/tsec/ (props changed) stable/8/sys/dev/twa/ (props changed) stable/8/sys/dev/twe/ (props changed) stable/8/sys/dev/tws/ (props changed) stable/8/sys/dev/tx/ (props changed) stable/8/sys/dev/txp/ (props changed) stable/8/sys/dev/uart/ (props changed) stable/8/sys/dev/ubsec/ (props changed) stable/8/sys/dev/usb/ (props changed) stable/8/sys/dev/utopia/ (props changed) stable/8/sys/dev/vge/ (props changed) stable/8/sys/dev/viawd/ (props changed) stable/8/sys/dev/virtio/ (props changed) stable/8/sys/dev/vkbd/ (props changed) stable/8/sys/dev/vr/ (props changed) stable/8/sys/dev/vte/ (props changed) stable/8/sys/dev/vx/ (props changed) stable/8/sys/dev/watchdog/ (props changed) stable/8/sys/dev/wb/ (props changed) stable/8/sys/dev/wbwd/ (props changed) stable/8/sys/dev/wds/ (props changed) stable/8/sys/dev/wi/ (props changed) stable/8/sys/dev/wl/ (props changed) stable/8/sys/dev/wpi/ (props changed) stable/8/sys/dev/xe/ (props changed) stable/8/sys/dev/xen/ (props changed) stable/8/sys/dev/xl/ (props changed) stable/8/sys/fs/ (props changed) stable/8/sys/gdb/ (props changed) stable/8/sys/geom/ (props changed) stable/8/sys/gnu/ (props changed) stable/8/sys/i386/ (props changed) stable/8/sys/i386/i386/intr_machdep.c (props changed) stable/8/sys/ia64/ (props changed) stable/8/sys/isa/ (props changed) stable/8/sys/kern/ (props changed) stable/8/sys/kgssapi/ (props changed) stable/8/sys/libkern/ (props changed) stable/8/sys/mips/ (props changed) stable/8/sys/modules/ (props changed) stable/8/sys/net/ (props changed) stable/8/sys/net80211/ (props changed) stable/8/sys/netatalk/ (props changed) stable/8/sys/netgraph/ (props changed) stable/8/sys/netinet/ (props changed) stable/8/sys/netinet6/ (props changed) stable/8/sys/netipsec/ (props changed) stable/8/sys/netipx/ (props changed) stable/8/sys/netnatm/ (props changed) stable/8/sys/netncp/ (props changed) stable/8/sys/netsmb/ (props changed) stable/8/sys/nfs/ (props changed) stable/8/sys/nfsclient/ (props changed) stable/8/sys/nfsserver/ (props changed) stable/8/sys/nlm/ (props changed) stable/8/sys/opencrypto/ (props changed) stable/8/sys/pc98/ (props changed) stable/8/sys/pci/ (props changed) stable/8/sys/powerpc/ (props changed) stable/8/sys/rpc/ (props changed) stable/8/sys/security/ (props changed) stable/8/sys/sparc64/ (props changed) stable/8/sys/sun4v/ (props changed) stable/8/sys/sys/ (props changed) stable/8/sys/tools/ (props changed) stable/8/sys/ufs/ (props changed) stable/8/sys/vm/ (props changed) stable/8/sys/x86/ (props changed) stable/8/sys/xdr/ (props changed) stable/8/sys/xen/ (props changed) Modified: stable/8/sys/geom/geom_vfs.c ============================================================================== --- stable/8/sys/geom/geom_vfs.c Sat Mar 30 17:46:03 2013 (r248935) +++ stable/8/sys/geom/geom_vfs.c Sat Mar 30 20:57:35 2013 (r248936) @@ -127,6 +127,10 @@ g_vfs_strategy(struct bufobj *bo, struct bip->bio_done = g_vfs_done; bip->bio_caller2 = bp; bip->bio_length = bp->b_bcount; + if (bp->b_flags & B_BARRIER) { + bip->bio_flags |= BIO_ORDERED; + bp->b_flags &= ~B_BARRIER; + } g_io_request(bip, cp); } Modified: stable/8/sys/kern/vfs_bio.c ============================================================================== --- stable/8/sys/kern/vfs_bio.c Sat Mar 30 17:46:03 2013 (r248935) +++ stable/8/sys/kern/vfs_bio.c Sat Mar 30 20:57:35 2013 (r248936) @@ -206,6 +206,9 @@ SYSCTL_INT(_vfs, OID_AUTO, flushbufqtarg static long notbufdflashes; SYSCTL_LONG(_vfs, OID_AUTO, notbufdflashes, CTLFLAG_RD, ¬bufdflashes, 0, "Number of dirty buffer flushes done by the bufdaemon helpers"); +static long barrierwrites; +SYSCTL_LONG(_vfs, OID_AUTO, barrierwrites, CTLFLAG_RW, &barrierwrites, 0, + "Number of barrier writes"); /* * Wakeup point for bufdaemon, as well as indicator of whether it is already @@ -870,6 +873,9 @@ bufwrite(struct buf *bp) return (0); } + if (bp->b_flags & B_BARRIER) + barrierwrites++; + oldflags = bp->b_flags; BUF_ASSERT_HELD(bp); @@ -989,6 +995,8 @@ bdwrite(struct buf *bp) CTR3(KTR_BUF, "bdwrite(%p) vp %p flags %X", bp, bp->b_vp, bp->b_flags); KASSERT(bp->b_bufobj != NULL, ("No b_bufobj %p", bp)); + KASSERT((bp->b_flags & B_BARRIER) == 0, + ("Barrier request in delayed write %p", bp)); BUF_ASSERT_HELD(bp); if (bp->b_flags & B_INVAL) { @@ -1149,6 +1157,40 @@ bawrite(struct buf *bp) } /* + * babarrierwrite: + * + * Asynchronous barrier write. Start output on a buffer, but do not + * wait for it to complete. Place a write barrier after this write so + * that this buffer and all buffers written before it are committed to + * the disk before any buffers written after this write are committed + * to the disk. The buffer is released when the output completes. + */ +void +babarrierwrite(struct buf *bp) +{ + + bp->b_flags |= B_ASYNC | B_BARRIER; + (void) bwrite(bp); +} + +/* + * bbarrierwrite: + * + * Synchronous barrier write. Start output on a buffer and wait for + * it to complete. Place a write barrier after this write so that + * this buffer and all buffers written before it are committed to + * the disk before any buffers written after this write are committed + * to the disk. The buffer is released when the output completes. + */ +int +bbarrierwrite(struct buf *bp) +{ + + bp->b_flags |= B_BARRIER; + return (bwrite(bp)); +} + +/* * bwillwrite: * * Called prior to the locking of any vnodes when we are expecting to Modified: stable/8/sys/kern/vfs_cluster.c ============================================================================== --- stable/8/sys/kern/vfs_cluster.c Sat Mar 30 17:46:03 2013 (r248935) +++ stable/8/sys/kern/vfs_cluster.c Sat Mar 30 20:57:35 2013 (r248936) @@ -944,11 +944,17 @@ cluster_wbuild(vp, size, start_lbn, len) } bp->b_bcount += size; bp->b_bufsize += size; - bundirty(tbp); - tbp->b_flags &= ~B_DONE; - tbp->b_ioflags &= ~BIO_ERROR; + /* + * If any of the clustered buffers have their + * B_BARRIER flag set, transfer that request to + * the cluster. + */ + bp->b_flags |= (tbp->b_flags & B_BARRIER); + tbp->b_flags &= ~(B_DONE | B_BARRIER); tbp->b_flags |= B_ASYNC; + tbp->b_ioflags &= ~BIO_ERROR; tbp->b_iocmd = BIO_WRITE; + bundirty(tbp); reassignbuf(tbp); /* put on clean list */ bufobj_wref(tbp->b_bufobj); BUF_KERNPROC(tbp); Modified: stable/8/sys/sys/buf.h ============================================================================== --- stable/8/sys/sys/buf.h Sat Mar 30 17:46:03 2013 (r248935) +++ stable/8/sys/sys/buf.h Sat Mar 30 20:57:35 2013 (r248936) @@ -205,7 +205,7 @@ struct buf { #define B_00000800 0x00000800 /* Available flag. */ #define B_00001000 0x00001000 /* Available flag. */ #define B_INVAL 0x00002000 /* Does not contain valid info. */ -#define B_00004000 0x00004000 /* Available flag. */ +#define B_BARRIER 0x00004000 /* Write this and all preceeding first. */ #define B_NOCACHE 0x00008000 /* Do not cache block after use. */ #define B_MALLOC 0x00010000 /* malloced b_data */ #define B_CLUSTEROK 0x00020000 /* Pagein op, so swap() can count it. */ @@ -485,6 +485,8 @@ int breadn(struct vnode *, daddr_t, int, struct ucred *, struct buf **); void bdwrite(struct buf *); void bawrite(struct buf *); +void babarrierwrite(struct buf *); +int bbarrierwrite(struct buf *); void bdirty(struct buf *); void bundirty(struct buf *); void bufstrategy(struct bufobj *, struct buf *); Modified: stable/8/sys/ufs/ffs/ffs_alloc.c ============================================================================== --- stable/8/sys/ufs/ffs/ffs_alloc.c Sat Mar 30 17:46:03 2013 (r248935) +++ stable/8/sys/ufs/ffs/ffs_alloc.c Sat Mar 30 20:57:35 2013 (r248936) @@ -1706,6 +1706,17 @@ fail: return (0); } +static inline struct buf * +getinobuf(struct inode *ip, u_int cg, u_int32_t cginoblk, int gbflags) +{ + struct fs *fs; + + fs = ip->i_fs; + return (getblk(ip->i_devvp, fsbtodb(fs, ino_to_fsba(fs, + cg * fs->fs_ipg + cginoblk)), (int)fs->fs_bsize, 0, 0, + gbflags)); +} + /* * Determine whether an inode can be allocated. * @@ -1729,9 +1740,11 @@ ffs_nodealloccg(ip, cg, ipref, mode) u_int8_t *inosused; struct ufs2_dinode *dp2; int error, start, len, loc, map, i; + u_int32_t old_initediblk; fs = ip->i_fs; ump = ip->i_ump; +check_nifree: if (fs->fs_cs(fs, cg).cs_nifree == 0) return (0); UFS_UNLOCK(ump); @@ -1743,13 +1756,13 @@ ffs_nodealloccg(ip, cg, ipref, mode) return (0); } cgp = (struct cg *)bp->b_data; +restart: if (!cg_chkmagic(cgp) || cgp->cg_cs.cs_nifree == 0) { brelse(bp); UFS_LOCK(ump); return (0); } bp->b_xflags |= BX_BKGRDWRITE; - cgp->cg_old_time = cgp->cg_time = time_second; inosused = cg_inosused(cgp); if (ipref) { ipref %= fs->fs_ipg; @@ -1777,26 +1790,83 @@ ffs_nodealloccg(ip, cg, ipref, mode) panic("ffs_nodealloccg: block not in map"); } ipref = i * NBBY + ffs(map) - 1; - cgp->cg_irotor = ipref; gotit: /* * Check to see if we need to initialize more inodes. */ - ibp = NULL; if (fs->fs_magic == FS_UFS2_MAGIC && ipref + INOPB(fs) > cgp->cg_initediblk && cgp->cg_initediblk < cgp->cg_niblk) { - ibp = getblk(ip->i_devvp, fsbtodb(fs, - ino_to_fsba(fs, cg * fs->fs_ipg + cgp->cg_initediblk)), - (int)fs->fs_bsize, 0, 0, 0); + old_initediblk = cgp->cg_initediblk; + + /* + * Free the cylinder group lock before writing the + * initialized inode block. Entering the + * babarrierwrite() with the cylinder group lock + * causes lock order violation between the lock and + * snaplk. + * + * Another thread can decide to initialize the same + * inode block, but whichever thread first gets the + * cylinder group lock after writing the newly + * allocated inode block will update it and the other + * will realize that it has lost and leave the + * cylinder group unchanged. + */ + ibp = getinobuf(ip, cg, old_initediblk, GB_LOCK_NOWAIT); + brelse(bp); + if (ibp == NULL) { + /* + * The inode block buffer is already owned by + * another thread, which must initialize it. + * Wait on the buffer to allow another thread + * to finish the updates, with dropped cg + * buffer lock, then retry. + */ + ibp = getinobuf(ip, cg, old_initediblk, 0); + brelse(ibp); + UFS_LOCK(ump); + goto check_nifree; + } bzero(ibp->b_data, (int)fs->fs_bsize); dp2 = (struct ufs2_dinode *)(ibp->b_data); for (i = 0; i < INOPB(fs); i++) { dp2->di_gen = arc4random() / 2 + 1; dp2++; } - cgp->cg_initediblk += INOPB(fs); + /* + * Rather than adding a soft updates dependency to ensure + * that the new inode block is written before it is claimed + * by the cylinder group map, we just do a barrier write + * here. The barrier write will ensure that the inode block + * gets written before the updated cylinder group map can be + * written. The barrier write should only slow down bulk + * loading of newly created filesystems. + */ + babarrierwrite(ibp); + + /* + * After the inode block is written, try to update the + * cg initediblk pointer. If another thread beat us + * to it, then leave it unchanged as the other thread + * has already set it correctly. + */ + error = bread(ip->i_devvp, fsbtodb(fs, cgtod(fs, cg)), + (int)fs->fs_cgsize, NOCRED, &bp); + UFS_LOCK(ump); + ACTIVECLEAR(fs, cg); + UFS_UNLOCK(ump); + if (error != 0) { + brelse(bp); + return (error); + } + cgp = (struct cg *)bp->b_data; + if (cgp->cg_initediblk == old_initediblk) + cgp->cg_initediblk += INOPB(fs); + goto restart; } + cgp->cg_old_time = cgp->cg_time = time_second; + cgp->cg_irotor = ipref; UFS_LOCK(ump); ACTIVECLEAR(fs, cg); setbit(inosused, ipref); @@ -1813,8 +1883,6 @@ gotit: if (DOINGSOFTDEP(ITOV(ip))) softdep_setup_inomapdep(bp, ip, cg * fs->fs_ipg + ipref); bdwrite(bp); - if (ibp != NULL) - bawrite(ibp); return ((ino_t)(cg * fs->fs_ipg + ipref)); }