From owner-freebsd-hackers Fri Oct 18 11:20:25 2002 Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 3ADBE37B401 for ; Fri, 18 Oct 2002 11:20:23 -0700 (PDT) Received: from baraca.united.net.ua (ns.united.net.ua [193.111.8.193]) by mx1.FreeBSD.org (Postfix) with ESMTP id B6A9043EAF for ; Fri, 18 Oct 2002 11:20:21 -0700 (PDT) (envelope-from sobomax@FreeBSD.org) Received: from vega.vega.com (xDSL-2-2.united.net.ua [193.111.9.226]) by baraca.united.net.ua (8.11.6/8.11.6) with ESMTP id g9IIKGd86817; Fri, 18 Oct 2002 21:20:16 +0300 (EEST) (envelope-from sobomax@FreeBSD.org) Received: from FreeBSD.org (big_brother.vega.com [192.168.1.1]) by vega.vega.com (8.12.6/8.12.5) with ESMTP id g9IIKCaJ011037; Fri, 18 Oct 2002 21:20:12 +0300 (EEST) (envelope-from sobomax@FreeBSD.org) Message-ID: <3DB0516F.9BE00F57@FreeBSD.org> Date: Fri, 18 Oct 2002 21:22:39 +0300 From: Maxim Sobolev Organization: Vega International Capital X-Mailer: Mozilla 4.8 [en] (Windows NT 5.0; U) X-Accept-Language: en,uk,ru MIME-Version: 1.0 To: Matthew Dillon Cc: hackers@FreeBSD.org Subject: Re: Patch to allow a driver to report unrecoverable write errors to the buf layer References: <3DB048B5.21097613@FreeBSD.org> <200210181807.g9II7cBY024485@apollo.backplane.com> Content-Type: text/plain; charset=koi8-r Content-Transfer-Encoding: 7bit Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Matthew Dillon wrote: > > :Hi folks, > : > :I noticed that FreeBSD buf/bio subsystem has one very annoying problem > :- once the write request is ejected into it, and write operation > :failed, there seemingly no way valid to tell the layer to drop the > :buffer. Instead, it retries the attempt over and over again, until > :reboot, even though originator of request (usually vfs layer) was > :already notified about failure and propagated error condition to the > :underlying user-lever program. > : > :There is a very easy way to trigger the problem: insert blank floppy > :... > > Your patch looks slightly incomplete to me, but the concept is reasonable. > The BIO_NORETRY test that sets B_INVAL should probably be done in > brelse(), not in bufwait(). It is the code in brelse() that actually > does the re-dirtying of the buffer in case of a write-error. Ah, actually I've initially put it into brelse() but then reconsidered a decision and moved it down into bufwait(). I'll move it back. ;) > This re-dirtying is necessary in most cases to prevent filesystem > corruption. Otherwise the buffer may be thrown away and a re-read > may return the original pre-modified data, causing massive filesystem > corruption elsewhere (consider what that would mean for a bitmap block). > > I think it's perfectly reasonable to do away with the buffer in the > case of a floppy error, though. Thanks! -Maxim > -Matt > > :... > : > :Also it would be very nice to devise some way to propagate such error > :condition into vfs layer, so that the fs driver could act upon it > :somehow (e.g. degrade fs into read-only mode). > : > :Thanks! > : > :-Maxim To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message