Date: Fri, 18 Oct 2002 11:07:38 -0700 (PDT) From: Matthew Dillon <dillon@apollo.backplane.com> To: Maxim Sobolev <sobomax@FreeBSD.ORG> Cc: hackers@FreeBSD.ORG Subject: Re: Patch to allow a driver to report unrecoverable write errors to the buf layer Message-ID: <200210181807.g9II7cBY024485@apollo.backplane.com> References: <3DB048B5.21097613@FreeBSD.org>
next in thread | previous in thread | raw e-mail | index | archive | help
: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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200210181807.g9II7cBY024485>
