Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F151332799
D13106.id.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
D13106.id.diff
View Options
Index: head/sys/cam/scsi/scsi_da.c
===================================================================
--- head/sys/cam/scsi/scsi_da.c
+++ head/sys/cam/scsi/scsi_da.c
@@ -3038,6 +3038,18 @@
}
case BIO_FLUSH:
/*
+ * If we don't support sync cache, or the disk
+ * isn't dirty, FLUSH is a no-op. Use the
+ * allocated * CCB for the next bio if one is
+ * available.
+ */
+ if ((softc->quirks & DA_Q_NO_SYNC_CACHE) != 0 ||
+ (softc->flags & DA_FLAG_DIRTY) == 0) {
+ biodone(bp);
+ goto skipstate;
+ }
+
+ /*
* BIO_FLUSH doesn't currently communicate
* range data, so we synchronize the cache
* over the whole disk. We also force
@@ -3052,6 +3064,15 @@
/*lb_count*/0,
SSD_FULL_SIZE,
da_default_timeout*1000);
+ /*
+ * Clear the dirty flag before sending the command.
+ * Either this sync cache will be successful, or it
+ * will fail after a retry. If it fails, it is
+ * unlikely to be successful if retried later, so
+ * we'll save ourselves time by just marking the
+ * device clean.
+ */
+ softc->flags &= ~DA_FLAG_DIRTY;
break;
case BIO_ZONE: {
int error, queue_ccb;
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Wed, Apr 8, 4:16 PM (8 h, 55 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
31107206
Default Alt Text
D13106.id.diff (1 KB)
Attached To
Mode
D13106: da(4): Short-circuit unnecessary BIO_FLUSH commands
Attached
Detach File
Event Timeline
Log In to Comment