Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F97317946
D34806.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
D34806.diff
View Options
diff --git a/sys/ufs/ffs/ffs_vfsops.c b/sys/ufs/ffs/ffs_vfsops.c
--- a/sys/ufs/ffs/ffs_vfsops.c
+++ b/sys/ufs/ffs/ffs_vfsops.c
@@ -1423,9 +1423,7 @@
if (susp)
vfs_write_resume(mp, VR_START_WRITE);
if (ump->um_trim_tq != NULL) {
- while (ump->um_trim_inflight != 0)
- pause("ufsutr", hz);
- taskqueue_drain_all(ump->um_trim_tq);
+ MPASS(ump->um_trim_inflight == 0);
taskqueue_free(ump->um_trim_tq);
free (ump->um_trimhash, M_TRIM);
}
@@ -1539,6 +1537,20 @@
if (qerror == 0 && (error = vflush(mp, 0, flags, td)) != 0)
return (error);
+ /*
+ * If this is a forcible unmount and there were any files that
+ * were unlinked but still open, then vflush() will have
+ * truncated and freed those files, which might have started
+ * some trim work. Wait here for any trims to complete
+ * and process the blkfrees which follow the trims.
+ * This may create more dirty devvp buffers and softdep deps.
+ */
+ if (ump->um_trim_tq != NULL) {
+ while (ump->um_trim_inflight != 0)
+ pause("ufsutr", hz);
+ taskqueue_drain_all(ump->um_trim_tq);
+ }
+
/*
* Flush filesystem metadata.
*/
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Sep 29, 3:29 PM (22 h, 7 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
13137942
Default Alt Text
D34806.diff (1 KB)
Attached To
Mode
D34806: ffs: wait for trims earlier during unmount to avoid panic
Attached
Detach File
Event Timeline
Log In to Comment