From owner-freebsd-hackers Fri Oct 18 11: 7:40 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 7EB3F37B401; Fri, 18 Oct 2002 11:07:39 -0700 (PDT) Received: from apollo.backplane.com (apollo.backplane.com [216.240.41.2]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2E6E643E7B; Fri, 18 Oct 2002 11:07:39 -0700 (PDT) (envelope-from dillon@apollo.backplane.com) Received: from apollo.backplane.com (localhost [127.0.0.1]) by apollo.backplane.com (8.12.5/8.12.4) with ESMTP id g9II7dPQ024517; Fri, 18 Oct 2002 11:07:39 -0700 (PDT) (envelope-from dillon@apollo.backplane.com) Received: (from dillon@localhost) by apollo.backplane.com (8.12.5/8.12.4/Submit) id g9II7cBY024485; Fri, 18 Oct 2002 11:07:38 -0700 (PDT) (envelope-from dillon) Date: Fri, 18 Oct 2002 11:07:38 -0700 (PDT) From: Matthew Dillon Message-Id: <200210181807.g9II7cBY024485@apollo.backplane.com> To: Maxim Sobolev 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> 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 :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. 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. -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