Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F160663592
D2900.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D2900.diff
View Options
Index: sys/ufs/ffs/ffs_vfsops.c
===================================================================
--- sys/ufs/ffs/ffs_vfsops.c
+++ sys/ufs/ffs/ffs_vfsops.c
@@ -48,6 +48,7 @@
#include <sys/bio.h>
#include <sys/buf.h>
#include <sys/conf.h>
+#include <sys/fail.h>
#include <sys/fcntl.h>
#include <sys/ioccom.h>
#include <sys/malloc.h>
@@ -1979,6 +1980,17 @@
if ((origbp = gbincore(bp->b_bufobj, bp->b_lblkno)) == NULL)
panic("backgroundwritedone: lost buffer");
BO_UNLOCK(bufobj);
+
+ KFAIL_POINT_CODE(DEBUG_FP, ffs_backgroundwritedone_error,
+ if ((int)bp->b_vp == RETURN_VALUE &&
+ (bp->b_ioflags & BIO_ERROR) == 0) {
+ printf("%s: Erroring IO bp=%p bo=%p\n", __func__, bp,
+ bufobj);
+ bp->b_ioflags |= BIO_ERROR;
+ bp->b_error = EIO;
+ }
+ );
+
/*
* Process dependencies then return any unfinished ones.
*/
@@ -1995,6 +2007,13 @@
*/
bp->b_flags |= B_NOCACHE;
bp->b_flags &= ~B_CACHE;
+ /*
+ * Prevent brelse() from re-dirtying bp on errors. It causes b_bufobj
+ * dereference in bdirty/reassignbuf, and bufobj was cleared in pbrelvp
+ * above.
+ */
+ if ((bp->b_ioflags & BIO_ERROR) != 0)
+ bp->b_flags |= B_INVAL;
bufdone(bp);
BO_LOCK(bufobj);
/*
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Jun 27, 2:33 PM (13 h, 50 s)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
34405667
Default Alt Text
D2900.diff (1 KB)
Attached To
Mode
D2900: ffs_backgroundwritedone: Set INVAL on errored IOs to avoid bdirty
Attached
Detach File
Event Timeline
Log In to Comment