Konstantin Belousov b2c3df842b Handle errors from background write of the cylinder group blocks.
First, on the write error, bufdone() call from ffs_backgroundwrite()
panics because pbrelvp() cleared bp->b_bufobj, while brelse() would
try to re-dirty the copy of the cg buffer.  Handle this by setting
B_INVAL for the case of BIO_ERROR.

Second, we must re-dirty the real buffer containing the cylinder group
block data when background write failed.  Real cg buffer was already
marked clean in ffs_bufwrite(). After the BV_BKGRDINPROG flag is
cleared on the real cg buffer in ffs_backgroundwrite(), buffer scan
may reuse the buffer at any moment. The result is lost write, and if
the write error was only transient, we get corrupted bitmaps.

We cannot re-dirty the original cg buffer in the
ffs_backgroundwritedone(), since the context is not sleepable,
preventing us from sleeping for origbp' lock.  Add BV_BKGDERR flag
(protected by the buffer object lock), which is converted into delayed
write by brelse(), bqrelse() and buffer scan.

In collaboration with:	Conrad Meyer <cse.cem@gmail.com>
Reviewed by:	mckusick
Sponsored by:	The FreeBSD Foundation (kib),
	  EMC/Isilon storage division (Conrad)
MFC after:	2 weeks
2015-06-27 09:44:14 +00:00
..
2015-04-18 21:50:53 +00:00
2015-04-22 14:38:58 +00:00
2015-01-22 11:12:42 +00:00
2015-06-12 10:01:24 +00:00
2015-06-12 10:01:24 +00:00
2015-06-10 10:48:12 +00:00
2015-01-22 11:12:42 +00:00
2015-06-12 10:01:24 +00:00
2015-06-11 04:41:54 +00:00
2015-04-22 14:38:58 +00:00
2014-03-14 06:29:43 +00:00
2014-06-26 13:57:44 +00:00
2015-05-20 17:48:22 +00:00
2015-05-20 17:47:01 +00:00
2014-08-11 15:06:07 +00:00
2015-01-22 11:12:42 +00:00
2015-06-10 10:48:12 +00:00
2015-04-18 21:50:53 +00:00
2015-04-18 21:50:53 +00:00
2015-06-10 10:48:12 +00:00
2015-06-10 10:48:12 +00:00
2014-11-30 12:52:33 +00:00
2015-03-17 14:16:50 +00:00