NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: kern/50607: ext2 repeatable kernel panic when creating files

The following reply was made to PR kern/50607; it has been noted by GNATS.

From: Taylor R Campbell <>
Subject: Re: kern/50607: ext2 repeatable kernel panic when creating files
Date: Mon, 4 Jan 2016 17:54:01 +0000

 This is a multi-part message in MIME format.
 My fault.  Here's the message I sent pooka about how to fix it.
 Content-Type: message/rfc822
 Content-Disposition: inline
 Date: Sat, 2 Jan 2016 16:50:01 +0000
 From: Taylor R Campbell <>
 To: Antti Kantee <>
 Subject: Re: ext2 and "Disentangle buffer-cached I/O from page-cached I/O in UFS."
 MIME-Version: 1.0
 Content-Type: text/plain; charset=us-ascii
 Content-Transfer-Encoding: 7bit
    Date: Fri, 1 Jan 2016 13:17:36 +0000
    From: Antti Kantee <>
    There's a problem which seems to be a derivative of your work from some 
    months ago.  ext2fs_write() now at least KASSERTs that vp->v_type == 
    VREG, but ext2fs_direnter() uses VOP_WRITE() for the dvp, so that 
    invariant is false.
    Are those changes still in your cache?  Can you look at it ASAP?  I'll 
    probably dig in later today if not, but since there's a chance you can 
    fix it with a minute of effort, I guess it's worth a shot.
 Well, OOPS.  I don't have time to draft or test a fix right now until
 Monday or Tuesday, but that's a pretty embarrassing mistake on my
 part.  I'm not sure how it ever passed any tests!
 ufs uses buffercache I/O directly for directory operations, using
 VOP_BWRITE, and I must have assumed without checking that ext2fs does
 so too.  But ext2fs was based on ufs code before softdeps (circa
 1997), and ufs wasn't made to use VOP_BWRITE until 1999 when the
 softdep code was merged.
 There are two obvious resolutions:
 1. Fix it by adapting ext2fs_direnter to use buffercache(9) like
 ufs_direnter does.
 2. Provisionally work around it by putting a conditional in
 ext2fs_write for VDIR which dispatches to ext2fs_bufwr like
 ext2fs_read does to ext2fs_bufrd.
 If you don't have time to do one of these rihgt now, I can take a shot
 at it on Monday or Tuesday.
 (Happy new year!)

Home | Main Index | Thread Index | Old Index