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