Re: svn commit: r212617 - head/sys/ufs/ffs

2010-09-25 Thread Brian Somers
On Fri, 24 Sep 2010 12:20:25 -0700 Kirk McKusick  wrote:
> > Date: Thu, 16 Sep 2010 20:10:38 -0700
> > From: Doug Barton 
> > To: "Carlos A. M. dos Santos" 
> > CC: Brian Somers , Kirk McKusick ,
> > svn-src-head@FreeBSD.org, svn-src-...@freebsd.org,
> > src-committ...@freebsd.org
> > Subject: Re: svn commit: r212617 - head/sys/ufs/ffs
> > 
> > On 9/16/2010 7:29 PM, Carlos A. M. dos Santos wrote:
> > > On Thu, Sep 16, 2010 at 5:44 AM, Brian Somers  wrote:
> > >> If INVARIANTS is not defined, the above i++ will not happen.
> > >
> > > Which does not cause any harm, since "i" is a local variable, not used
> > > anywhere else in the function. A picky compiler would complain,
> > > however, that the variable is never read.
> > 
> > If 'i' is only ever used in the INVARIANTS case then it should be 
> > appropriately wrapped everywhere it appears. While the _current_ 
> > situation may be harmless, in the future lack of an appropriate 
> > indication of its use may cause a problem. This isn't just a pedantic 
> > concern, we had a case like this that broke the build just recently.
> > 
> > 
> > Doug
> > 
> > -- 
> > 
> > ... and that's just a little bit of history repeating.
> > -- Propellerheads
> > 
> > Improve the effectiveness of your Internet presence with
> > a domain name makeover!http://SupersetSolutions.com/
> 
> What is the appropriate ifdef for a variable used only inside a KASSERT?
> 
>   Kirk McKusick

I'd guess '#ifdef INVARIANTS' (from looking at systm.h).

-- 
Brian Somers  
Don't _EVER_ lose your sense of humour !   


signature.asc
Description: PGP signature


svn commit: r213160 - head/share/man/man4

2010-09-25 Thread MIHIRA Sanpei Yoshiro
Author: sanpei
Date: Sat Sep 25 08:19:34 2010
New Revision: 213160
URL: http://svn.freebsd.org/changeset/base/213160

Log:
  Add Planex UE-200TX-G2 to list of supported devices.
  
  MFC after:1 day

Modified:
  head/share/man/man4/axe.4

Modified: head/share/man/man4/axe.4
==
--- head/share/man/man4/axe.4   Sat Sep 25 06:27:09 2010(r213159)
+++ head/share/man/man4/axe.4   Sat Sep 25 08:19:34 2010(r213160)
@@ -188,6 +188,8 @@ Cisco-Linksys USB200Mv2
 D-Link DUBE100B1
 .It
 Planex UE-200TX-G
+.It
+Planex UE-200TX-G2
 .El
 .Sh DIAGNOSTICS
 .Bl -diag
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r213161 - head/lib/libthr/thread

2010-09-25 Thread David Xu
Author: davidxu
Date: Sat Sep 25 08:36:46 2010
New Revision: 213161
URL: http://svn.freebsd.org/changeset/base/213161

Log:
  Add missing field.

Modified:
  head/lib/libthr/thread/thr_private.h

Modified: head/lib/libthr/thread/thr_private.h
==
--- head/lib/libthr/thread/thr_private.hSat Sep 25 08:19:34 2010
(r213160)
+++ head/lib/libthr/thread/thr_private.hSat Sep 25 08:36:46 2010
(r213161)
@@ -452,6 +452,7 @@ struct pthread {
 #ifdef _PTHREAD_FORCED_UNWIND
struct _Unwind_Exceptionex;
void*unwind_stackend;
+   int unwind_disabled;
 #endif
 
/*
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r213162 - in head: share/man/man4 sys/netinet

2010-09-25 Thread Lawrence Stewart
Author: lstewart
Date: Sat Sep 25 09:16:46 2010
New Revision: 213162
URL: http://svn.freebsd.org/changeset/base/213162

Log:
  Log the number of segments currently in the reassembly queue.
  
  Sponsored by: FreeBSD Foundation

Modified:
  head/share/man/man4/siftr.4
  head/sys/netinet/siftr.c

Modified: head/share/man/man4/siftr.4
==
--- head/share/man/man4/siftr.4 Sat Sep 25 08:36:46 2010(r213161)
+++ head/share/man/man4/siftr.4 Sat Sep 25 09:16:46 2010(r213162)
@@ -30,7 +30,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd June 23, 2010
+.Dd September 25, 2010
 .Dt SIFTR 4
 .Os
 .Sh NAME
@@ -198,7 +198,7 @@ The data is CSV formatted.
 .Bd -literal -offset indent
 o,0xbec491a5,1238556193.463551,172.16.7.28,22,172.16.2.5,55931, \\
 1073725440,172312,6144,66560,66608,8,1,4,1448,936,1,996,255, \\
-33304,208,66608,0,208
+33304,208,66608,0,208,0
 .Ed
 .Pp
 Field descriptions are as follows:
@@ -328,6 +328,10 @@ The current number of bytes in the socke
 The current number of unacknowledged bytes in-flight.
 Bytes acknowledged via SACK are not excluded from this count.
 .El
+.Bl -tag -offset indent
+.It Va 26
+The current number of segments in the reassembly queue.
+.El
 .Pp
 The third type of log message is written to the file when the module is 
disabled
 and ceases collecting data from the running kernel.

Modified: head/sys/netinet/siftr.c
==
--- head/sys/netinet/siftr.cSat Sep 25 08:36:46 2010(r213161)
+++ head/sys/netinet/siftr.cSat Sep 25 09:16:46 2010(r213162)
@@ -55,7 +55,7 @@
  * SIFTR should be directed to him via email: lastew...@swin.edu.au
  *
  * Initial release date: June 2007
- * Most recent update: June 2010
+ * Most recent update: September 2010
  **/
 
 #include 
@@ -105,7 +105,7 @@ __FBSDID("$FreeBSD$");
  */
 #define V_MAJOR1
 #define V_BACKBREAK2
-#define V_BACKCOMPAT   3
+#define V_BACKCOMPAT   4
 #define MODVERSION __CONCAT(V_MAJOR, __CONCAT(V_BACKBREAK, V_BACKCOMPAT))
 #define MODVERSION_STR __XSTRING(V_MAJOR) "." __XSTRING(V_BACKBREAK) "." \
 __XSTRING(V_BACKCOMPAT)
@@ -226,6 +226,8 @@ struct pkt_node {
u_int   rcv_buf_cc;
/* Number of bytes inflight that we are waiting on ACKs for. */
u_int   sent_inflight_bytes;
+   /* Number of segments currently in the reassembly queue. */
+   int t_segqlen;
/* Link to next pkt_node in the list. */
STAILQ_ENTRY(pkt_node)  nodes;
 };
@@ -442,7 +444,7 @@ siftr_process_pkt(struct pkt_node * pkt_
MAX_LOG_MSG_LEN,
"%c,0x%08x,%zd.%06ld,%x:%x:%x:%x:%x:%x:%x:%x,%u,%x:%x:%x:"
"%x:%x:%x:%x:%x,%u,%ld,%ld,%ld,%ld,%ld,%u,%u,%u,%u,%u,%u,"
-   "%u,%d,%u,%u,%u,%u,%u\n",
+   "%u,%d,%u,%u,%u,%u,%u,%u\n",
direction[pkt_node->direction],
pkt_node->hash,
pkt_node->tval.tv_sec,
@@ -482,7 +484,8 @@ siftr_process_pkt(struct pkt_node * pkt_
pkt_node->snd_buf_cc,
pkt_node->rcv_buf_hiwater,
pkt_node->rcv_buf_cc,
-   pkt_node->sent_inflight_bytes);
+   pkt_node->sent_inflight_bytes,
+   pkt_node->t_segqlen);
} else { /* IPv4 packet */
pkt_node->ip_laddr[0] = FIRST_OCTET(pkt_node->ip_laddr[3]);
pkt_node->ip_laddr[1] = SECOND_OCTET(pkt_node->ip_laddr[3]);
@@ -498,7 +501,7 @@ siftr_process_pkt(struct pkt_node * pkt_
log_buf->ae_bytesused = snprintf(log_buf->ae_data,
MAX_LOG_MSG_LEN,
"%c,0x%08x,%jd.%06ld,%u.%u.%u.%u,%u,%u.%u.%u.%u,%u,%ld,%ld,"
-   "%ld,%ld,%ld,%u,%u,%u,%u,%u,%u,%u,%d,%u,%u,%u,%u,%u\n",
+   "%ld,%ld,%ld,%u,%u,%u,%u,%u,%u,%u,%d,%u,%u,%u,%u,%u,%u\n",
direction[pkt_node->direction],
pkt_node->hash,
(intmax_t)pkt_node->tval.tv_sec,
@@ -530,7 +533,8 @@ siftr_process_pkt(struct pkt_node * pkt_
pkt_node->snd_buf_cc,
pkt_node->rcv_buf_hiwater,
pkt_node->rcv_buf_cc,
-   pkt_node->sent_inflight_bytes);
+   pkt_node->sent_inflight_bytes,
+   pkt_node->t_segqlen);
 #ifdef SIFTR_IPV6
}
 #endif
@@ -790,6 +794,7 @@ siftr_siftdata(struct pkt_node *pn, stru
pn->rcv_buf_hiwater = inp->inp_socket->so_rcv.sb_hiwat;
pn->rcv_buf_cc = inp->inp_socket->so_rcv.sb_cc;
pn->sent_inflight_bytes = tp->snd_max - tp->snd_una;
+   pn->t_segqlen = tp->t_segqlen;
 
/* We've finished accessing the tcb so release the lock. */
if (inp_locally_locked)
___

Re: svn commit: r213161 - head/lib/libthr/thread

2010-09-25 Thread Anonymous
David Xu  writes:

> Author: davidxu
> Date: Sat Sep 25 08:36:46 2010
> New Revision: 213161
> URL: http://svn.freebsd.org/changeset/base/213161
>
> Log:
>   Add missing field.
>
> Modified:
>   head/lib/libthr/thread/thr_private.h
>
> Modified: head/lib/libthr/thread/thr_private.h
> ==
> --- head/lib/libthr/thread/thr_private.h  Sat Sep 25 08:19:34 2010
> (r213160)
> +++ head/lib/libthr/thread/thr_private.h  Sat Sep 25 08:36:46 2010
> (r213161)
> @@ -452,6 +452,7 @@ struct pthread {
>  #ifdef _PTHREAD_FORCED_UNWIND
>   struct _Unwind_Exceptionex;
>   void*unwind_stackend;
> + int unwind_disabled;
>  #endif
>  
>   /*

What about NO_THREAD_UNWIND_STACK in src.conf?

  cc -O2 -pipe -DPTHREAD_KERNEL -I/usr/src/lib/libthr/../libc/include 
-I/usr/src/lib/libthr/thread  -I/usr/src/lib/libthr/../../include 
-I/usr/src/lib/libthr/arch/amd64/include -I/usr/src/lib/libthr/sys 
-I/usr/src/lib/libthr/../../libexec/rtld-elf 
-I/usr/src/lib/libthr/../../libexec/rtld-elf/amd64 
-I/usr/src/lib/libthr/../libthread_db -Winline -D_PTHREADS_INVARIANTS 
-DSYSCALL_COMPAT -ggdb -std=gnu99 -Wsystem-headers -Wall -Wno-format-y2k -W 
-Wno-unused-parameter -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith 
-Wno-uninitialized -Wno-pointer-sign -c /usr/src/lib/libthr/thread/thr_clean.c
  /usr/src/lib/libthr/thread/thr_clean.c: In function '_pthread_cleanup_push':
  /usr/src/lib/libthr/thread/thr_clean.c:84: error: 'struct pthread' has no 
member named 'unwind_disabled'
  *** Error code 1
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r213163 - head/lib/libthr/thread

2010-09-25 Thread David Xu
Author: davidxu
Date: Sat Sep 25 09:43:24 2010
New Revision: 213163
URL: http://svn.freebsd.org/changeset/base/213163

Log:
  Only access unwind_disabled when _PTHREAD_FORCED_UNWIND is defined.

Modified:
  head/lib/libthr/thread/thr_clean.c

Modified: head/lib/libthr/thread/thr_clean.c
==
--- head/lib/libthr/thread/thr_clean.c  Sat Sep 25 09:16:46 2010
(r213162)
+++ head/lib/libthr/thread/thr_clean.c  Sat Sep 25 09:43:24 2010
(r213163)
@@ -80,8 +80,9 @@ _pthread_cleanup_push(void (*routine) (v
 {
struct pthread  *curthread = _get_curthread();
struct pthread_cleanup *newbuf;
-
+#ifdef _PTHREAD_FORCED_UNWIND
curthread->unwind_disabled = 1;
+#endif
if ((newbuf = (struct pthread_cleanup *)
malloc(sizeof(struct _pthread_cleanup_info))) != NULL) {
newbuf->routine = routine;
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r213105 - head/sys/dev/mpt

2010-09-25 Thread Marius Strobl
On Sat, Sep 25, 2010 at 01:45:44PM +1000, Lawrence Stewart wrote:
> Hi Marius,
> 
> On 09/25/10 02:40, Marius Strobl wrote:
> > Author: marius
> > Date: Fri Sep 24 16:40:46 2010
> > New Revision: 213105
> > URL: http://svn.freebsd.org/changeset/base/213105
> > 
> > Log:
> >   Improve r56796; the reply handler actually may remove the request from
> >   the chain in which case it shouldn't be removed twice.
> >   Reported by:  Staale Kristoffersen
> 
> Can you please provide a bit of extra commentary about the symptoms of
> the issue this patch addresses? Like Staale, I'm running a FreeBSD
> server which uses mpt for its disk subsystem (SunFire X4100 with 2 x
> SATA 2.5" disks in RAID-1) and I've had a series of long running
> problems with the performance of the controller. I'm keeping a close eye
> on all mpt related commits and hope to find the cause sometime.
> 

In case the reply handler also removed the request this triggered
a sanity check in TAILQ_REMOVE with INVARIANTS compiled in, causing
a panic. I don't think it had a negative impact with INVARIANTS
disabled. Also, in order to hit the problem you first had to run
into a timeout leading to an IOC rest like here:
http://folk.uio.no/stalk/mpt/timeout.txt
i.e. I don't think this is related to your performance issue.

Marius

___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r213164 - head/sys/geom/eli

2010-09-25 Thread Pawel Jakub Dawidek
Author: pjd
Date: Sat Sep 25 10:31:05 2010
New Revision: 213164
URL: http://svn.freebsd.org/changeset/base/213164

Log:
  Ignore errors from BIO_FLUSH. It might confuse users that provider wasn't
  really killed. What we really care about are write errors only.
  
  MFC after:2 weeks

Modified:
  head/sys/geom/eli/g_eli_ctl.c

Modified: head/sys/geom/eli/g_eli_ctl.c
==
--- head/sys/geom/eli/g_eli_ctl.c   Sat Sep 25 09:43:24 2010
(r213163)
+++ head/sys/geom/eli/g_eli_ctl.c   Sat Sep 25 10:31:05 2010
(r213164)
@@ -688,7 +688,7 @@ g_eli_ctl_delkey(struct gctl_req *req, s
 * Flush write cache so we don't overwrite data N times in cache
 * and only once on disk.
 */
-   g_io_flush(cp);
+   (void)g_io_flush(cp);
}
bzero(&md, sizeof(md));
bzero(sector, sizeof(sector));
@@ -739,13 +739,11 @@ g_eli_kill_one(struct g_eli_softc *sc)
if (error == 0)
error = err;
}
-   err = g_io_flush(cp);
-   if (err != 0) {
-   G_ELI_DEBUG(0, "Cannot flush %s (error=%d).",
-   pp->name, err);
-   if (error == 0)
-   error = err;
-   }
+   /*
+* Flush write cache so we don't overwrite data N times
+* in cache and only once on disk.
+*/
+   (void)g_io_flush(cp);
}
free(sector, M_ELI);
}
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r213165 - head/sys/geom/eli

2010-09-25 Thread Pawel Jakub Dawidek
Author: pjd
Date: Sat Sep 25 10:32:04 2010
New Revision: 213165
URL: http://svn.freebsd.org/changeset/base/213165

Log:
  Change g_eli_debug to int, so one can turn off any GELI output by setting
  kern.geom.eli.debug sysctl to -1.
  
  MFC after:2 weeks

Modified:
  head/sys/geom/eli/g_eli.c
  head/sys/geom/eli/g_eli.h

Modified: head/sys/geom/eli/g_eli.c
==
--- head/sys/geom/eli/g_eli.c   Sat Sep 25 10:31:05 2010(r213164)
+++ head/sys/geom/eli/g_eli.c   Sat Sep 25 10:32:04 2010(r213165)
@@ -56,9 +56,9 @@ MALLOC_DEFINE(M_ELI, "eli data", "GEOM_E
 
 SYSCTL_DECL(_kern_geom);
 SYSCTL_NODE(_kern_geom, OID_AUTO, eli, CTLFLAG_RW, 0, "GEOM_ELI stuff");
-u_int g_eli_debug = 0;
+int g_eli_debug = 0;
 TUNABLE_INT("kern.geom.eli.debug", &g_eli_debug);
-SYSCTL_UINT(_kern_geom_eli, OID_AUTO, debug, CTLFLAG_RW, &g_eli_debug, 0,
+SYSCTL_INT(_kern_geom_eli, OID_AUTO, debug, CTLFLAG_RW, &g_eli_debug, 0,
 "Debug level");
 static u_int g_eli_tries = 3;
 TUNABLE_INT("kern.geom.eli.tries", &g_eli_tries);

Modified: head/sys/geom/eli/g_eli.h
==
--- head/sys/geom/eli/g_eli.h   Sat Sep 25 10:31:05 2010(r213164)
+++ head/sys/geom/eli/g_eli.h   Sat Sep 25 10:32:04 2010(r213165)
@@ -105,7 +105,7 @@
 #defineG_ELI_KEY_SHIFT 20
 
 #ifdef _KERNEL
-extern u_int g_eli_debug;
+extern int g_eli_debug;
 extern u_int g_eli_overwrites;
 extern u_int g_eli_batch;
 
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r213166 - head/sys/crypto/aesni

2010-09-25 Thread Pawel Jakub Dawidek
Author: pjd
Date: Sat Sep 25 10:32:52 2010
New Revision: 213166
URL: http://svn.freebsd.org/changeset/base/213166

Log:
  Fix two copy&paste bugs.
  
  MFC after:2 weeks

Modified:
  head/sys/crypto/aesni/aesni_wrap.c

Modified: head/sys/crypto/aesni/aesni_wrap.c
==
--- head/sys/crypto/aesni/aesni_wrap.c  Sat Sep 25 10:32:04 2010
(r213165)
+++ head/sys/crypto/aesni/aesni_wrap.c  Sat Sep 25 10:32:52 2010
(r213166)
@@ -232,7 +232,7 @@ aesni_cipher_setup_common(struct aesni_s
 
aesni_set_enckey(key, ses->enc_schedule, ses->rounds);
aesni_set_deckey(ses->enc_schedule, ses->dec_schedule, ses->rounds);
-   if (ses->algo == CRYPTO_AES_XTS)
+   if (ses->algo == CRYPTO_AES_CBC)
arc4rand(ses->iv, sizeof(ses->iv), 0);
else /* if (ses->algo == CRYPTO_AES_XTS) */ {
aesni_set_enckey(key + keylen / 16, ses->xts_schedule,
@@ -306,7 +306,7 @@ aesni_cipher_process(struct aesni_sessio
aesni_decrypt_cbc(ses->rounds, ses->dec_schedule,
enccrd->crd_len, buf, ses->iv);
} else /* if (ses->algo == CRYPTO_AES_XTS) */ {
-   aesni_decrypt_xts(ses->rounds, ses->enc_schedule,
+   aesni_decrypt_xts(ses->rounds, ses->dec_schedule,
ses->xts_schedule, enccrd->crd_len, buf, buf,
ses->iv);
}
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r213167 - head/tools/regression/geom_eli

2010-09-25 Thread Pawel Jakub Dawidek
Author: pjd
Date: Sat Sep 25 10:34:11 2010
New Revision: 213167
URL: http://svn.freebsd.org/changeset/base/213167

Log:
  - Use $md instead of md0, which fixes tests when md(4) device is already
present.
  - Correct message - we create GPT, not MBR.
  
  MFC after:2 weeks

Modified:
  head/tools/regression/geom_eli/resize.t

Modified: head/tools/regression/geom_eli/resize.t
==
--- head/tools/regression/geom_eli/resize.t Sat Sep 25 10:32:52 2010
(r213166)
+++ head/tools/regression/geom_eli/resize.t Sat Sep 25 10:34:11 2010
(r213167)
@@ -124,8 +124,8 @@ geli detach ${md}a.eli
 # 1g to 20m, 2g to 30m and keyfile to tmp.key, and adding -B none
 # to geli init.
 
-gpart create -s GPT md0 || echo -n "not "
-echo ok $i - "Installed an MBR on md0"
+gpart create -s GPT $md || echo -n "not "
+echo ok $i - "Installed an GPT on md0"
 i=$((i + 1))
 gpart add -s 20m -t freebsd-ufs -i 1 $md || echo -n "not "
 echo ok $i - "Added a 20m partition in slot 1"
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r213168 - head/tools/regression/geom_eli

2010-09-25 Thread Pawel Jakub Dawidek
Author: pjd
Date: Sat Sep 25 10:34:42 2010
New Revision: 213168
URL: http://svn.freebsd.org/changeset/base/213168

Log:
  Update regression tests after AES-XTS addition.
  
  MFC after:2 weeks

Modified:
  head/tools/regression/geom_eli/init-a.t
  head/tools/regression/geom_eli/init.t
  head/tools/regression/geom_eli/integrity-copy.t
  head/tools/regression/geom_eli/integrity-data.t
  head/tools/regression/geom_eli/integrity-hmac.t
  head/tools/regression/geom_eli/onetime-a.t
  head/tools/regression/geom_eli/onetime.t

Modified: head/tools/regression/geom_eli/init-a.t
==
--- head/tools/regression/geom_eli/init-a.t Sat Sep 25 10:34:11 2010
(r213167)
+++ head/tools/regression/geom_eli/init-a.t Sat Sep 25 10:34:42 2010
(r213168)
@@ -6,15 +6,22 @@ no=45
 sectors=100
 keyfile=`mktemp /tmp/$base.XX` || exit 1
 
-echo "1..660"
+echo "1..1380"
 
 i=1
-for cipher in aes:0 aes:128 aes:192 aes:256 \
+for cipher in aes:0 aes:128 aes:256 \
+aes-xts:0 aes-xts:128 aes-xts:256 \
+aes-cbc:0 aes-cbc:128 aes-cbc:192 aes-cbc:256 \
 3des:0 3des:192 \
+3des-cbc:0 3des-cbc:192 \
 blowfish:0 blowfish:128 blowfish:160 blowfish:192 blowfish:224 \
 blowfish:256 blowfish:288 blowfish:320 blowfish:352 blowfish:384 \
 blowfish:416 blowfish:448 \
-camellia:0 camellia:128 camellia:192 camellia:256; do
+blowfish-cbc:0 blowfish-cbc:128 blowfish-cbc:160 blowfish-cbc:192 
blowfish-cbc:224 \
+blowfish-cbc:256 blowfish-cbc:288 blowfish-cbc:320 blowfish-cbc:352 
blowfish-cbc:384 \
+blowfish-cbc:416 blowfish-cbc:448 \
+camellia:0 camellia:128 camellia:192 camellia:256 \
+camellia-cbc:0 camellia-cbc:128 camellia-cbc:192 camellia-cbc:256; do
ealgo=${cipher%%:*}
keylen=${cipher##*:}
for aalgo in hmac/md5 hmac/sha1 hmac/ripemd160 hmac/sha256 hmac/sha384 
hmac/sha512; do

Modified: head/tools/regression/geom_eli/init.t
==
--- head/tools/regression/geom_eli/init.t   Sat Sep 25 10:34:11 2010
(r213167)
+++ head/tools/regression/geom_eli/init.t   Sat Sep 25 10:34:42 2010
(r213168)
@@ -6,15 +6,22 @@ no=45
 sectors=100
 keyfile=`mktemp /tmp/$base.XX` || exit 1
 
-echo "1..220"
+echo "1..460"
 
 i=1
-for cipher in aes:0 aes:128 aes:192 aes:256 \
+for cipher in aes:0 aes:128 aes:256 \
+aes-xts:0 aes-xts:128 aes-xts:256 \
+aes-cbc:0 aes-cbc:128 aes-cbc:192 aes-cbc:256 \
 3des:0 3des:192 \
+3des-cbc:0 3des-cbc:192 \
 blowfish:0 blowfish:128 blowfish:160 blowfish:192 blowfish:224 \
 blowfish:256 blowfish:288 blowfish:320 blowfish:352 blowfish:384 \
 blowfish:416 blowfish:448 \
-camellia:0 camellia:128 camellia:192 camellia:256; do
+blowfish-cbc:0 blowfish-cbc:128 blowfish-cbc:160 blowfish-cbc:192 
blowfish-cbc:224 \
+blowfish-cbc:256 blowfish-cbc:288 blowfish-cbc:320 blowfish-cbc:352 
blowfish-cbc:384 \
+blowfish-cbc:416 blowfish-cbc:448 \
+camellia:0 camellia:128 camellia:192 camellia:256 \
+camellia-cbc:0 camellia-cbc:128 camellia-cbc:192 camellia-cbc:256; do
ealgo=${cipher%%:*}
keylen=${cipher##*:}
for secsize in 512 1024 2048 4096 8192; do

Modified: head/tools/regression/geom_eli/integrity-copy.t
==
--- head/tools/regression/geom_eli/integrity-copy.t Sat Sep 25 10:34:11 
2010(r213167)
+++ head/tools/regression/geom_eli/integrity-copy.t Sat Sep 25 10:34:42 
2010(r213168)
@@ -7,15 +7,22 @@ sectors=100
 keyfile=`mktemp /tmp/$base.XX` || exit 1
 sector=`mktemp /tmp/$base.XX` || exit 1
 
-echo "1..2640"
+echo "1..5520"
 
 i=1
-for cipher in aes:0 aes:128 aes:192 aes:256 \
+for cipher in aes:0 aes:128 aes:256 \
+aes-xts:0 aes-xts:128 aes-xts:256 \
+aes-cbc:0 aes-cbc:128 aes-cbc:192 aes-cbc:256 \
 3des:0 3des:192 \
+3des-cbc:0 3des-cbc:192 \
 blowfish:0 blowfish:128 blowfish:160 blowfish:192 blowfish:224 \
 blowfish:256 blowfish:288 blowfish:320 blowfish:352 blowfish:384 \
 blowfish:416 blowfish:448 \
-camellia:0 camellia:128 camellia:192 camellia:256; do
+blowfish-cbc:0 blowfish-cbc:128 blowfish-cbc:160 blowfish-cbc:192 
blowfish-cbc:224 \
+blowfish-cbc:256 blowfish-cbc:288 blowfish-cbc:320 blowfish-cbc:352 
blowfish-cbc:384 \
+blowfish-cbc:416 blowfish-cbc:448 \
+camellia:0 camellia:128 camellia:192 camellia:256 \
+camellia-cbc:0 camellia-cbc:128 camellia-cbc:192 camellia-cbc:256; do
ealgo=${cipher%%:*}
keylen=${cipher##*:}
for aalgo in hmac/md5 hmac/sha1 hmac/ripemd160 hmac/sha256 hmac/sha384 
hmac/sha512; do

Modified: head/tools/regression/geom_eli/integrity-data.t
==
--- head/tools/regression/geom_eli/integrity-data.t Sat Sep 25 10:34:11 
20

Re: svn commit: r213167 - head/tools/regression/geom_eli

2010-09-25 Thread Ronald Klop
On Sat, 25 Sep 2010 12:34:11 +0200, Pawel Jakub Dawidek   
wrote:



Author: pjd
Date: Sat Sep 25 10:34:11 2010
New Revision: 213167
URL: http://svn.freebsd.org/changeset/base/213167

Log:
  - Use $md instead of md0, which fixes tests when md(4) device is  
already

present.
  - Correct message - we create GPT, not MBR.
 MFC after: 2 weeks

Modified:
  head/tools/regression/geom_eli/resize.t

Modified: head/tools/regression/geom_eli/resize.t
==
--- head/tools/regression/geom_eli/resize.t	Sat Sep 25 10:32:52  
2010	(r213166)
+++ head/tools/regression/geom_eli/resize.t	Sat Sep 25 10:34:11  
2010	(r213167)

@@ -124,8 +124,8 @@ geli detach ${md}a.eli
 # 1g to 20m, 2g to 30m and keyfile to tmp.key, and adding -B none
 # to geli init.
-gpart create -s GPT md0 || echo -n "not "
-echo ok $i - "Installed an MBR on md0"
+gpart create -s GPT $md || echo -n "not "
+echo ok $i - "Installed an GPT on md0"
 i=$((i + 1))
 gpart add -s 20m -t freebsd-ufs -i 1 $md || echo -n "not "
 echo ok $i - "Added a 20m partition in slot 1"


Hi,

You still use md0 in the message in stead of $md.

Ronald.
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r213098 - in head/sys: amd64/conf i386/conf pc98/conf powerpc/conf sparc64/conf

2010-09-25 Thread Andreas Tobler

Hi!

On 24.09.10 11:04, David Xu wrote:

Author: davidxu
Date: Fri Sep 24 09:04:16 2010
New Revision: 213098
URL: http://svn.freebsd.org/changeset/base/213098

Log:
   Now userland POSIX semaphore is based on umtx. The kernel module
   is only used to support binary compatible, if want to run old
   binary, you need to kldload the module.


I guess this is also valid for powerpc/GENERIC64, right? Or do we need 
some work here?


Thanks,
Andreas



Modified:
   head/sys/amd64/conf/GENERIC
   head/sys/i386/conf/GENERIC
   head/sys/pc98/conf/GENERIC
   head/sys/powerpc/conf/GENERIC


Index: sys/powerpc/conf/GENERIC64
===
--- sys/powerpc/conf/GENERIC64  (revision 213168)
+++ sys/powerpc/conf/GENERIC64  (working copy)
@@ -59,7 +59,6 @@
 optionsSYSVSHM #SYSV-style shared memory
 optionsSYSVMSG #SYSV-style message queues
 optionsSYSVSEM #SYSV-style semaphores
-optionsP1003_1B_SEMAPHORES # POSIX-style semaphores
 options_KPOSIX_PRIORITY_SCHEDULING #Posix P1003_1B real-time extensions
 optionsHWPMC_HOOKS # Necessary kernel hooks for hwpmc(4)
 optionsAUDIT   # Security event auditing

___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r213098 - in head/sys: amd64/conf i386/conf pc98/conf powerpc/conf sparc64/conf

2010-09-25 Thread David Xu

Andreas Tobler wrote:

Hi!

On 24.09.10 11:04, David Xu wrote:

Author: davidxu
Date: Fri Sep 24 09:04:16 2010
New Revision: 213098
URL: http://svn.freebsd.org/changeset/base/213098

Log:
   Now userland POSIX semaphore is based on umtx. The kernel module
   is only used to support binary compatible, if want to run old
   binary, you need to kldload the module.


I guess this is also valid for powerpc/GENERIC64, right? Or do we need 
some work here?


Thanks,
Andreas

You can remove it without extra work.

Regards,
David Xu

___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r213098 - in head/sys: amd64/conf i386/conf pc98/conf powerpc/conf sparc64/conf

2010-09-25 Thread Nathan Whitehorn
On 09/24/10 11:04, David Xu wrote:
> Author: davidxu
> Date: Fri Sep 24 09:04:16 2010
> New Revision: 213098
> URL: http://svn.freebsd.org/changeset/base/213098
> 
> Log:
>   Now userland POSIX semaphore is based on umtx. The kernel module
>   is only used to support binary compatible, if want to run old
>   binary, you need to kldload the module.
> 
> Modified:
>   head/sys/amd64/conf/GENERIC
>   head/sys/i386/conf/GENERIC
>   head/sys/pc98/conf/GENERIC
>   head/sys/powerpc/conf/GENERIC
>   head/sys/sparc64/conf/GENERIC
> 

You missed the powerpc64 GENERIC, which is named
/sys/powerpc/conf/GENERIC64. It looks like you skipped sun4v too.
-Nathan
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r213169 - head/tools/regression/acltools

2010-09-25 Thread Edward Tomasz Napierala
Author: trasz
Date: Sat Sep 25 14:33:35 2010
New Revision: 213169
URL: http://svn.freebsd.org/changeset/base/213169

Log:
  Add a shell script to generate a test script for trivial ACLs.

Added:
  head/tools/regression/acltools/mktrivial.sh   (contents, props changed)

Added: head/tools/regression/acltools/mktrivial.sh
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/tools/regression/acltools/mktrivial.sh Sat Sep 25 14:33:35 2010
(r213169)
@@ -0,0 +1,53 @@
+#!/bin/sh
+#
+# Copyright (c) 2010 Edward Tomasz NapieraƂa 
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+#notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+#notice, this list of conditions and the following disclaimer in the
+#documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+# SUCH DAMAGE.
+#
+# $FreeBSD$
+#
+
+# This shell script generates an input file for the "run" script, used
+# to verify generation of trivial ACLs.
+
+echo "$ touch f"
+touch f
+
+for s in `jot 7 0 7`; do
+   for u in `jot 7 0 7`; do
+   for g in `jot 7 0 7`; do
+   for o in `jot 7 0 7`; do
+   echo "$ chmod 0$s$u$g$o f"
+   chmod "0$s$u$g$o" f
+   echo "$ ls -l f | cut -d' ' -f1"
+   ls -l f | cut -d' ' -f1 | sed 's/^/> /'
+   echo "$ getfacl -q f"
+   getfacl -q f | sed 's/^/> /'
+   done
+   done
+   done
+done
+
+echo "$ rm f"
+rm f
+
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r213170 - head/tools/regression/acltools

2010-09-25 Thread Edward Tomasz Napierala
Author: trasz
Date: Sat Sep 25 14:54:31 2010
New Revision: 213170
URL: http://svn.freebsd.org/changeset/base/213170

Log:
  Don't leave zombies behind.

Modified:
  head/tools/regression/acltools/run

Modified: head/tools/regression/acltools/run
==
--- head/tools/regression/acltools/run  Sat Sep 25 14:33:35 2010
(r213169)
+++ head/tools/regression/acltools/run  Sat Sep 25 14:54:31 2010
(r213170)
@@ -271,6 +271,8 @@ sub exec_test($$) {
   *STDOUT->autoflush();
   *OUT->autoflush();
 
+  $SIG{CHLD} = 'IGNORE';
+
   if (fork()) {
 # Server
 if (*IN_DUP) {
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r213171 - head/tools/regression/geom_eli

2010-09-25 Thread Pawel Jakub Dawidek
Author: pjd
Date: Sat Sep 25 15:37:41 2010
New Revision: 213171
URL: http://svn.freebsd.org/changeset/base/213171

Log:
  Don't hardcode md0 in message, use $md instead.
  
  Reported by:  Ronald Klop 

Modified:
  head/tools/regression/geom_eli/resize.t

Modified: head/tools/regression/geom_eli/resize.t
==
--- head/tools/regression/geom_eli/resize.t Sat Sep 25 14:54:31 2010
(r213170)
+++ head/tools/regression/geom_eli/resize.t Sat Sep 25 15:37:41 2010
(r213171)
@@ -125,7 +125,7 @@ geli detach ${md}a.eli
 # to geli init.
 
 gpart create -s GPT $md || echo -n "not "
-echo ok $i - "Installed an GPT on md0"
+echo ok $i - "Installed an GPT on ${md}"
 i=$((i + 1))
 gpart add -s 20m -t freebsd-ufs -i 1 $md || echo -n "not "
 echo ok $i - "Added a 20m partition in slot 1"
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r213167 - head/tools/regression/geom_eli

2010-09-25 Thread Pawel Jakub Dawidek
On Sat, Sep 25, 2010 at 01:19:11PM +0200, Ronald Klop wrote:
> On Sat, 25 Sep 2010 12:34:11 +0200, Pawel Jakub Dawidek   
> wrote:
> 
> >Author: pjd
> >Date: Sat Sep 25 10:34:11 2010
> >New Revision: 213167
> >URL: http://svn.freebsd.org/changeset/base/213167
> >
> >Log:
> >  - Use $md instead of md0, which fixes tests when md(4) device is  
> >already
> >present.
> >  - Correct message - we create GPT, not MBR.
> > MFC after:  2 weeks
> >
> >Modified:
> >  head/tools/regression/geom_eli/resize.t
> >
> >Modified: head/tools/regression/geom_eli/resize.t
> >==
> >--- head/tools/regression/geom_eli/resize.t  Sat Sep 25 10:32:52  
> >2010 (r213166)
> >+++ head/tools/regression/geom_eli/resize.t  Sat Sep 25 10:34:11  
> >2010 (r213167)
> >@@ -124,8 +124,8 @@ geli detach ${md}a.eli
> > # 1g to 20m, 2g to 30m and keyfile to tmp.key, and adding -B none
> > # to geli init.
> >-gpart create -s GPT md0 || echo -n "not "
> >-echo ok $i - "Installed an MBR on md0"
> >+gpart create -s GPT $md || echo -n "not "
> >+echo ok $i - "Installed an GPT on md0"
> > i=$((i + 1))
> > gpart add -s 20m -t freebsd-ufs -i 1 $md || echo -n "not "
> > echo ok $i - "Added a 20m partition in slot 1"
> 
> Hi,
> 
> You still use md0 in the message in stead of $md.

Fix committed, thanks.

-- 
Pawel Jakub Dawidek   http://www.wheelsystems.com
p...@freebsd.org   http://www.FreeBSD.org
FreeBSD committer Am I Evil? Yes, I Am!


pgpIMULBjtSM4.pgp
Description: PGP signature


svn commit: r213172 - head/sbin/geom/class/eli

2010-09-25 Thread Pawel Jakub Dawidek
Author: pjd
Date: Sat Sep 25 17:38:57 2010
New Revision: 213172
URL: http://svn.freebsd.org/changeset/base/213172

Log:
  - Add support for loading passphrase from a file (-J and -j options).
This is especially useful for things like installers, where regular
geli prompt can't be used.
  - Add support for specifing multiple -K or -k options, so there is no
need to cat all keyfiles and read them from standard input.
  
  Requested by: Kris Moore , thompsa
  MFC after:2 weeks

Modified:
  head/sbin/geom/class/eli/geli.8
  head/sbin/geom/class/eli/geom_eli.c

Modified: head/sbin/geom/class/eli/geli.8
==
--- head/sbin/geom/class/eli/geli.8 Sat Sep 25 15:37:41 2010
(r213171)
+++ head/sbin/geom/class/eli/geli.8 Sat Sep 25 17:38:57 2010
(r213172)
@@ -24,7 +24,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd September 23, 2010
+.Dd September 25, 2010
 .Dt GELI 8
 .Os
 .Sh NAME
@@ -56,6 +56,7 @@ utility:
 .Op Fl B Ar backupfile
 .Op Fl e Ar ealgo
 .Op Fl i Ar iterations
+.Op Fl J Ar newpassfile
 .Op Fl K Ar newkeyfile
 .Op Fl l Ar keylen
 .Op Fl s Ar sectorsize
@@ -66,6 +67,7 @@ utility:
 .Nm
 .Cm attach
 .Op Fl dprv
+.Op Fl j Ar passfile
 .Op Fl k Ar keyfile
 .Ar prov
 .Nm
@@ -91,6 +93,8 @@ utility:
 .Cm setkey
 .Op Fl pPv
 .Op Fl i Ar iterations
+.Op Fl j Ar passfile
+.Op Fl J Ar newpassfile
 .Op Fl k Ar keyfile
 .Op Fl K Ar newkeyfile
 .Op Fl n Ar keyno
@@ -223,7 +227,7 @@ The metadata can be recovered with the
 subcommand described below.
 .Pp
 Additional options include:
-.Bl -tag -width ".Fl a Ar newkeyfile"
+.Bl -tag -width ".Fl J Ar newpassfile"
 .It Fl a Ar aalgo
 Enable data integrity verification (authentication) using the given algorithm.
 This will reduce size of available storage and also reduce speed.
@@ -272,15 +276,19 @@ If this option is not specified,
 .Nm
 will find the number of iterations which is equal to 2 seconds of crypto work.
 If 0 is given, PKCS#5v2 will not be used.
+.It Fl J Ar newpassfile
+Specifies a file which contains the passphrase or its part.
+If
+.Ar newpassfile
+is given as -, standard input will be used.
+Only the first line (excluding new-line character) is taken from the given 
file.
+This argument can be specified multiple times.
 .It Fl K Ar newkeyfile
 Specifies a file which contains part of the key.
 If
 .Ar newkeyfile
 is given as -, standard input will be used.
-Here is how more than one file with a key component can be used:
-.Bd -literal -offset indent
-# cat key1 key2 key3 | geli init -K - /dev/da0
-.Ed
+This argument can be specified multiple times.
 .It Fl l Ar keylen
 Key length to use with the given cryptographic algorithm.
 If not given, the default key length for the given algorithm is used, which is:
@@ -309,7 +317,7 @@ provider's name with an
 suffix.
 .Pp
 Additional options include:
-.Bl -tag -width ".Fl a Ar keyfile"
+.Bl -tag -width ".Fl j Ar passfile"
 .It Fl d
 If specified, a decrypted provider will be detached automatically on last 
close.
 This can help with short memory - user does not have to remember to detach the
@@ -321,6 +329,13 @@ Probably a better choice is the
 option for the
 .Cm detach
 subcommand.
+.It Fl j Ar passfile
+Specifies a file which contains the passphrase or its part.
+For more information see the description of the
+.Fl J
+option for the
+.Cm init
+subcommand.
 .It Fl k Ar keyfile
 Specifies a file which contains part of the key.
 For more information see the description of the
@@ -409,13 +424,17 @@ When a provider is attached, the user do
 an old passphrase/keyfile.
 .Pp
 Additional options include:
-.Bl -tag -width ".Fl a Ar iterations"
+.Bl -tag -width ".Fl J Ar newpassfile"
 .It Fl i Ar iterations
 Number of iterations to use with PKCS#5v2.
 If 0 is given, PKCS#5v2 will not be used.
 To be able to use this option with
 .Cm setkey
 subcommand, only one key have to be defined and this key has to be changed.
+.It Fl j Ar passfile
+Specifies a file which contains the old passphrase or its part.
+.It Fl J Ar newpassfile
+Specifies a file which contains the new passphrase or its part.
 .It Fl k Ar keyfile
 Specifies a file which contains part of the old key.
 .It Fl K Ar newkeyfile
@@ -638,7 +657,7 @@ keyfile:
 # dd if=/dev/random of=/boot/keys/da0.key0 bs=32k count=1
 # dd if=/dev/random of=/boot/keys/da0.key1 bs=32k count=1
 # dd if=/dev/random of=/boot/keys/da0.key2 bs=32k count=1
-# cat /boot/keys/da0.key0 /boot/keys/da0.key1 /boot/keys/da0.key2 | geli init 
-b -K - da0
+# geli init -b -K /boot/keys/da0.key0 -K /boot/keys/da0.key1 -K 
/boot/keys/da0.key2 da0
 Enter new passphrase:
 Reenter new passphrase:
 # dd if=/dev/random of=/dev/da1s3a bs=1m
@@ -711,6 +730,22 @@ update the metadata:
 # geli resize -s 1g ada0p1
 # geli attach -k keyfile -p ada0p1
 .Ed
+.Pp
+Initialize provider with passphrase split into two files.
+The provider can be attached by giving those two files or by giving
+.Dq foobar
+passphrase on
+.Nm
+pro

svn commit: r213173 - head/tools/regression/geom_eli

2010-09-25 Thread Pawel Jakub Dawidek
Author: pjd
Date: Sat Sep 25 17:41:02 2010
New Revision: 213173
URL: http://svn.freebsd.org/changeset/base/213173

Log:
  Add some regression tests for newly added -J and -j options.
  
  MFC after:2 weeks

Added:
  head/tools/regression/geom_eli/init-J.t   (contents, props changed)

Added: head/tools/regression/geom_eli/init-J.t
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/tools/regression/geom_eli/init-J.t Sat Sep 25 17:41:02 2010
(r213173)
@@ -0,0 +1,126 @@
+#!/bin/sh
+# $FreeBSD$
+
+base=`basename $0`
+no=45
+sectors=100
+keyfile0=`mktemp /tmp/$base.XX` || exit 1
+keyfile1=`mktemp /tmp/$base.XX` || exit 1
+passfile0=`mktemp /tmp/$base.XX` || exit 1
+passfile1=`mktemp /tmp/$base.XX` || exit 1
+mdconfig -a -t malloc -s `expr $sectors + 1` -u $no || exit 1
+
+echo "1..150"
+
+dd if=/dev/random of=${keyfile0} bs=512 count=16 >/dev/null 2>&1
+dd if=/dev/random of=${keyfile1} bs=512 count=16 >/dev/null 2>&1
+dd if=/dev/random bs=512 count=16 2>/dev/null | sha1 > ${passfile0}
+dd if=/dev/random bs=512 count=16 2>/dev/null | sha1 > ${passfile1}
+
+i=1
+for iter in -1 0 64; do
+   geli init -i ${iter} -B none -J ${passfile0} -P md${no} 2>/dev/null && 
echo -n "not "
+   echo "ok ${i}"; i=$((i+1))
+   geli init -i ${iter} -B none -J ${passfile0} -P -K ${keyfile0} md${no} 
2>/dev/null && echo -n "not "
+   echo "ok ${i}"; i=$((i+1))
+   geli init -i ${iter} -B none -J ${passfile0} -K ${keyfile0} md${no} 
2>/dev/null || echo -n "not "
+   echo "ok ${i}"; i=$((i+1))
+   geli attach -k ${keyfile0} -p md${no} 2>/dev/null && echo -n "not "
+   echo "ok ${i}"; i=$((i+1))
+   geli attach -j ${passfile0} md${no} 2>/dev/null && echo -n "not "
+   echo "ok ${i}"; i=$((i+1))
+   geli attach -j ${keyfile0} md${no} 2>/dev/null && echo -n "not "
+   echo "ok ${i}"; i=$((i+1))
+   geli attach -k ${passfile0} -p md${no} 2>/dev/null && echo -n "not "
+   echo "ok ${i}"; i=$((i+1))
+   geli attach -j ${keyfile0} -k ${passfile0} md${no} 2>/dev/null && echo 
-n "not "
+   echo "ok ${i}"; i=$((i+1))
+   geli attach -j ${keyfile0} -k ${keyfile0} md${no} 2>/dev/null && echo 
-n "not "
+   echo "ok ${i}"; i=$((i+1))
+   geli attach -j ${passfile0} -k ${passfile0} md${no} 2>/dev/null && echo 
-n "not "
+   echo "ok ${i}"; i=$((i+1))
+   geli attach -j ${passfile0} -k ${keyfile0} md${no} 2>/dev/null || echo 
-n "not "
+   echo "ok ${i}"; i=$((i+1))
+   geli detach md${no} || echo -n "not "
+   echo "ok ${i}"; i=$((i+1))
+   cat ${keyfile0} | geli attach -j ${passfile0} -k - md${no} 2>/dev/null 
|| echo -n "not "
+   echo "ok ${i}"; i=$((i+1))
+   geli detach md${no} || echo -n "not "
+   echo "ok ${i}"; i=$((i+1))
+   cat ${passfile0} | geli attach -j - -k ${keyfile0} md${no} 2>/dev/null 
|| echo -n "not "
+   echo "ok ${i}"; i=$((i+1))
+   geli detach md${no} || echo -n "not "
+   echo "ok ${i}"; i=$((i+1))
+
+   geli init -i ${iter} -B none -J ${passfile0} -J ${passfile1} -P md${no} 
2>/dev/null && echo -n "not "
+   echo "ok ${i}"; i=$((i+1))
+   geli init -i ${iter} -B none -J ${passfile0} -J ${passfile1} -P -K 
${keyfile0} -K ${keyfile1} md${no} 2>/dev/null && echo -n "not "
+   echo "ok ${i}"; i=$((i+1))
+   geli init -i ${iter} -B none -J ${passfile0} -J ${passfile1} -K 
${keyfile0} -K ${keyfile1} md${no} 2>/dev/null || echo -n "not "
+   echo "ok ${i}"; i=$((i+1))
+   geli attach -k ${keyfile0} -p md${no} 2>/dev/null && echo -n "not "
+   echo "ok ${i}"; i=$((i+1))
+   geli attach -k ${keyfile1} -p md${no} 2>/dev/null && echo -n "not "
+   echo "ok ${i}"; i=$((i+1))
+   geli attach -j ${passfile0} md${no} 2>/dev/null && echo -n "not "
+   echo "ok ${i}"; i=$((i+1))
+   geli attach -j ${passfile1} md${no} 2>/dev/null && echo -n "not "
+   echo "ok ${i}"; i=$((i+1))
+   geli attach -k ${keyfile0} -k ${keyfile1} -p md${no} 2>/dev/null && 
echo -n "not "
+   echo "ok ${i}"; i=$((i+1))
+   geli attach -j ${passfile0} -j ${passfile1} md${no} 2>/dev/null && echo 
-n "not "
+   echo "ok ${i}"; i=$((i+1))
+   geli attach -k ${keyfile0} -j ${passfile0} md${no} 2>/dev/null && echo 
-n "not "
+   echo "ok ${i}"; i=$((i+1))
+   geli attach -k ${keyfile0} -j ${passfile1} md${no} 2>/dev/null && echo 
-n "not "
+   echo "ok ${i}"; i=$((i+1))
+   geli attach -k ${keyfile1} -j ${passfile0} md${no} 2>/dev/null && echo 
-n "not "
+   echo "ok ${i}"; i=$((i+1))
+   geli attach -k ${keyfile1} -j ${passfile1} md${no} 2>/dev/null && echo 
-n "not "
+   echo "ok ${i}"; i=$((i+1))
+   geli attach -k ${keyfile0} -j ${passfile0} -j ${passfile1} md${no} 
2>/dev/null && echo -n "not "
+   echo "ok ${i}"; i=$((i+1))
+   geli attach -k ${keyfile1} -j ${passfile0} -j ${passfile1} md

svn commit: r213174 - head/sys/geom/part

2010-09-25 Thread Andrey V. Elsukov
Author: ae
Date: Sat Sep 25 18:27:29 2010
New Revision: 213174
URL: http://svn.freebsd.org/changeset/base/213174

Log:
  Some schemes can allocate memory for internal purposes but when
  GEOM does withering this memory doesn't freed. Add G_PART_DESTROY
  call to g_part_wither. Also add missed g_free() call to G_PART_READ
  method for MBR and PC98 schemes.
  
  Submitted by: jh (previous version)
  Reviewed by:  pjd
  Approved by:  kib (mentor)

Modified:
  head/sys/geom/part/g_part.c
  head/sys/geom/part/g_part_mbr.c
  head/sys/geom/part/g_part_pc98.c

Modified: head/sys/geom/part/g_part.c
==
--- head/sys/geom/part/g_part.c Sat Sep 25 17:41:02 2010(r213173)
+++ head/sys/geom/part/g_part.c Sat Sep 25 18:27:29 2010(r213174)
@@ -1273,6 +1273,7 @@ g_part_wither(struct g_geom *gp, int err
 
table = gp->softc;
if (table != NULL) {
+   G_PART_DESTROY(table, NULL);
while ((entry = LIST_FIRST(&table->gpt_entry)) != NULL) {
LIST_REMOVE(entry, gpe_entry);
g_free(entry);

Modified: head/sys/geom/part/g_part_mbr.c
==
--- head/sys/geom/part/g_part_mbr.c Sat Sep 25 17:41:02 2010
(r213173)
+++ head/sys/geom/part/g_part_mbr.c Sat Sep 25 18:27:29 2010
(r213174)
@@ -465,6 +465,7 @@ g_part_mbr_read(struct g_part_table *bas
basetable->gpt_first = basetable->gpt_sectors;
basetable->gpt_last = msize - (msize % basetable->gpt_sectors) - 1;
 
+   g_free(buf);
return (0);
 }
 

Modified: head/sys/geom/part/g_part_pc98.c
==
--- head/sys/geom/part/g_part_pc98.cSat Sep 25 17:41:02 2010
(r213173)
+++ head/sys/geom/part/g_part_pc98.cSat Sep 25 18:27:29 2010
(r213174)
@@ -458,6 +458,7 @@ g_part_pc98_read(struct g_part_table *ba
basetable->gpt_first = cyl;
basetable->gpt_last = msize - (msize % cyl) - 1;
 
+   g_free(buf);
return (0);
 }
 
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r213180 - in head/sys: powerpc/conf sun4v/conf

2010-09-25 Thread David Xu
Author: davidxu
Date: Sun Sep 26 01:41:53 2010
New Revision: 213180
URL: http://svn.freebsd.org/changeset/base/213180

Log:
  Follow r213098, kernel POSIX semaphore module is no longer
  needed.

Modified:
  head/sys/powerpc/conf/GENERIC64
  head/sys/sun4v/conf/GENERIC

Modified: head/sys/powerpc/conf/GENERIC64
==
--- head/sys/powerpc/conf/GENERIC64 Sat Sep 25 21:55:40 2010
(r213179)
+++ head/sys/powerpc/conf/GENERIC64 Sun Sep 26 01:41:53 2010
(r213180)
@@ -59,7 +59,6 @@ options   STACK   #stack(9) support
 optionsSYSVSHM #SYSV-style shared memory
 optionsSYSVMSG #SYSV-style message queues
 optionsSYSVSEM #SYSV-style semaphores
-optionsP1003_1B_SEMAPHORES # POSIX-style semaphores
 options_KPOSIX_PRIORITY_SCHEDULING #Posix P1003_1B real-time extensions
 optionsHWPMC_HOOKS # Necessary kernel hooks for hwpmc(4)
 optionsAUDIT   # Security event auditing

Modified: head/sys/sun4v/conf/GENERIC
==
--- head/sys/sun4v/conf/GENERIC Sat Sep 25 21:55:40 2010(r213179)
+++ head/sys/sun4v/conf/GENERIC Sun Sep 26 01:41:53 2010(r213180)
@@ -57,7 +57,6 @@ options   STACK   # stack(9) support
 optionsSYSVSHM # SYSV-style shared memory
 optionsSYSVMSG # SYSV-style message queues
 optionsSYSVSEM # SYSV-style semaphores
-optionsP1003_1B_SEMAPHORES # POSIX-style semaphores
 options_KPOSIX_PRIORITY_SCHEDULING # POSIX P1003_1B real-time 
extensions
 optionsAHC_REG_PRETTY_PRINT# Print register bitfields in debug
# output.  Adds ~128k to driver.
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r213181 - head/usr.sbin/watchdogd

2010-09-25 Thread Ed Maste
Author: emaste
Date: Sun Sep 26 01:45:33 2010
New Revision: 213181
URL: http://svn.freebsd.org/changeset/base/213181

Log:
  Protect the watchdog daemon against swap OOM killer.  This is similar to
  SVN r199804 which added protection to sshd, cron, syslogd, and inetd.

Modified:
  head/usr.sbin/watchdogd/watchdogd.c

Modified: head/usr.sbin/watchdogd/watchdogd.c
==
--- head/usr.sbin/watchdogd/watchdogd.c Sun Sep 26 01:41:53 2010
(r213180)
+++ head/usr.sbin/watchdogd/watchdogd.c Sun Sep 26 01:45:33 2010
(r213181)
@@ -31,6 +31,7 @@
 #include 
 __FBSDID("$FreeBSD$");
 
+#include 
 #include 
 #include 
 #include 
@@ -115,6 +116,8 @@ main(int argc, char *argv[])
signal(SIGTERM, sighandler);
 
pidfile_write(pfh);
+   if (madvise(0, 0, MADV_PROTECT) != 0)
+   warn("madvise failed");
 
watchdog_loop();
 
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r213182 - head/lib/libthr/thread

2010-09-25 Thread David Xu
Author: davidxu
Date: Sun Sep 26 06:45:24 2010
New Revision: 213182
URL: http://svn.freebsd.org/changeset/base/213182

Log:
  Report death event to debugger before moving to gc list, otherwise
  debugger may can not find it on thread list.

Modified:
  head/lib/libthr/thread/thr_exit.c

Modified: head/lib/libthr/thread/thr_exit.c
==
--- head/lib/libthr/thread/thr_exit.c   Sun Sep 26 01:45:33 2010
(r213181)
+++ head/lib/libthr/thread/thr_exit.c   Sun Sep 26 06:45:24 2010
(r213182)
@@ -286,6 +286,8 @@ exit_thread(void)
curthread->cycle++;
_thr_umtx_wake(&curthread->cycle, INT_MAX, 0);
}
+   if (!curthread->force_exit && SHOULD_REPORT_EVENT(curthread, TD_DEATH))
+   _thr_report_death(curthread);
/*
 * Thread was created with initial refcount 1, we drop the
 * reference count to allow it to be garbage collected.
@@ -293,9 +295,6 @@ exit_thread(void)
curthread->refcount--;
_thr_try_gc(curthread, curthread); /* thread lock released */
 
-   if (!curthread->force_exit && SHOULD_REPORT_EVENT(curthread, TD_DEATH))
-   _thr_report_death(curthread);
-
 #if defined(_PTHREADS_INVARIANTS)
if (THR_IN_CRITICAL(curthread))
PANIC("thread exits with resources held!");
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"