Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F110665873
D25136.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
2 KB
Referenced Files
None
Subscribers
None
D25136.diff
View Options
Index: head/sys/kern/kern_sendfile.c
===================================================================
--- head/sys/kern/kern_sendfile.c
+++ head/sys/kern/kern_sendfile.c
@@ -292,36 +292,30 @@
struct socket *so;
int i;
- if (error != 0) {
+ if (error != 0)
sfio->error = error;
- /*
- * Restore of the pg[] elements is done by
- * sendfile_swapin().
- */
- } else {
- /*
- * Restore the valid page pointers. They are already
- * unbusied, but still wired. For error != 0 case,
- * sendfile_swapin() handles unbusy.
- *
- * XXXKIB since pages are only wired, and we do not
- * own the object lock, other users might have
- * invalidated them in meantime. Similarly, after we
- * unbusied the swapped-in pages, they can become
- * invalid under us.
- */
- MPASS(count == 0 || pa[0] != bogus_page);
- for (i = 0; i < count; i++) {
- if (pa[i] == bogus_page) {
- sfio->pa[(pa[0]->pindex - sfio->pindex0) + i] =
- pa[i] = vm_page_relookup(sfio->obj,
- pa[0]->pindex + i);
- KASSERT(pa[i] != NULL,
- ("%s: page %p[%d] disappeared",
- __func__, pa, i));
- } else {
- vm_page_xunbusy_unchecked(pa[i]);
- }
+
+ /*
+ * Restore the valid page pointers. They are already
+ * unbusied, but still wired.
+ *
+ * XXXKIB since pages are only wired, and we do not
+ * own the object lock, other users might have
+ * invalidated them in meantime. Similarly, after we
+ * unbusied the swapped-in pages, they can become
+ * invalid under us.
+ */
+ MPASS(count == 0 || pa[0] != bogus_page);
+ for (i = 0; i < count; i++) {
+ if (pa[i] == bogus_page) {
+ sfio->pa[(pa[0]->pindex - sfio->pindex0) + i] =
+ pa[i] = vm_page_relookup(sfio->obj,
+ pa[0]->pindex + i);
+ KASSERT(pa[i] != NULL,
+ ("%s: page %p[%d] disappeared",
+ __func__, pa, i));
+ } else {
+ vm_page_xunbusy_unchecked(pa[i]);
}
}
@@ -534,22 +528,12 @@
sendfile_iowait(sfio, "sferrio");
/*
- * Perform full pages recovery before returning EIO.
+ * Do remaining pages recovery before returning EIO.
* Pages from 0 to npages are wired.
- * Pages from (i + 1) to (i + count - 1) may be
- * substituted to bogus page, and not busied.
- * Pages from (i + count) to (i + count1 - 1) are
- * not busied.
- * Rest of the pages from i to npages are busied.
+ * Pages from (i + count1) to npages are busied.
*/
for (j = 0; j < npages; j++) {
- if (j >= i + count && j < i + count1)
- ;
- else if (j > i && j < i + count - 1 &&
- pa[j] == bogus_page)
- pa[j] = vm_page_relookup(obj,
- OFF_TO_IDX(vmoff(j, off)));
- else if (j >= i)
+ if (j >= i + count1)
vm_page_xunbusy(pa[j]);
KASSERT(pa[j] != NULL && pa[j] != bogus_page,
("%s: page %p[%d] I/O recovery failure",
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Feb 22, 4:08 PM (2 h, 44 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
16774590
Default Alt Text
D25136.diff (2 KB)
Attached To
Mode
D25136: Fix hang due to missing unbusy in sendfile when an async data I/O fails.
Attached
Detach File
Event Timeline
Log In to Comment