From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from felloff.net ([94.135.152.80]) by ttr; Fri Mar 21 13:37:11 EDT 2014 Message-ID: <27c060f21b9d7ac0f85a08db9def1a98@felloff.net> List-ID: <9front.9front.org> X-Glyph: ➈ X-Bullshit: extensible basic metadata storage configuration-aware component-aware optimizer Date: Fri, 21 Mar 2014 18:37:07 +0100 From: cinap_lenrek@felloff.net To: 9front@9front.org Subject: Re: [9front] prep divide by zero and kernel panic in devfs In-Reply-To: <20140321065058.GB3145@iota.offblast.org> MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit the kernel crash is a off by one bug in error handling codepath when it tries to clean up state before erroring out: --- a/sys/src/9/port/devfs.c Fri Mar 21 16:55:16 2014 +0100 +++ b/sys/src/9/port/devfs.c Fri Mar 21 18:10:55 2014 +0100 @@ -646,7 +646,7 @@ Fail: for(i = 1; i < cb->nf; i++) if(idev != nil && idev[i-1] != nil) - cclose(idev[i]); + cclose(idev[i-1]); if(mp != nil) mdeldev(mp); free(idev); this has nothing todo with sparsefiles. a sparsefile is a optimization of the filesystem. it just avoids allocating blocks containing all zeros, thats all. you want to use partfs. see the test.disk target in /sys/src/boot/pc/mkfile devfs is bad because then you need to be hostowner on the machine and you are manipulating global state to solve a local problem. -- cinap