diff options
author | kib <kib@FreeBSD.org> | 2012-03-17 23:00:32 +0000 |
---|---|---|
committer | kib <kib@FreeBSD.org> | 2012-03-17 23:00:32 +0000 |
commit | 2963c3c979b3491c27ed851b7e3ea47c0ae4167c (patch) | |
tree | f682c3a5094240f4bd795d32ef82092b98ddaf50 /sys/vm/vm_pageout.c | |
parent | 7af7d69c50251e2fa1d112707e1ec06e1830e1b3 (diff) | |
download | FreeBSD-src-2963c3c979b3491c27ed851b7e3ea47c0ae4167c.zip FreeBSD-src-2963c3c979b3491c27ed851b7e3ea47c0ae4167c.tar.gz |
In vm_object_page_clean(), do not clean OBJ_MIGHTBEDIRTY object flag
if the filesystem performed short write and we are skipping the page
due to this.
Propogate write error from the pager back to the callers of
vm_pageout_flush(). Report the failure to write a page from the
requested range as the FALSE return value from vm_object_page_clean(),
and propagate it back to msync(2) to return EIO to usermode.
While there, convert the clearobjflags variable in the
vm_object_page_clean() and arguments of the helper functions to
boolean.
PR: kern/165927
Reviewed by: alc
MFC after: 2 weeks
Diffstat (limited to 'sys/vm/vm_pageout.c')
-rw-r--r-- | sys/vm/vm_pageout.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/sys/vm/vm_pageout.c b/sys/vm/vm_pageout.c index 7e63689..812fe4d 100644 --- a/sys/vm/vm_pageout.c +++ b/sys/vm/vm_pageout.c @@ -445,7 +445,8 @@ more: /* * we allow reads during pageouts... */ - return (vm_pageout_flush(&mc[page_base], pageout_count, 0, 0, NULL)); + return (vm_pageout_flush(&mc[page_base], pageout_count, 0, 0, NULL, + NULL)); } /* @@ -459,9 +460,12 @@ more: * * Returned runlen is the count of pages between mreq and first * page after mreq with status VM_PAGER_AGAIN. + * *eio is set to TRUE if pager returned VM_PAGER_ERROR or VM_PAGER_FAIL + * for any page in runlen set. */ int -vm_pageout_flush(vm_page_t *mc, int count, int flags, int mreq, int *prunlen) +vm_pageout_flush(vm_page_t *mc, int count, int flags, int mreq, int *prunlen, + boolean_t *eio) { vm_object_t object = mc[0]->object; int pageout_status[count]; @@ -493,6 +497,8 @@ vm_pageout_flush(vm_page_t *mc, int count, int flags, int mreq, int *prunlen) vm_pager_put_pages(object, mc, count, flags, pageout_status); runlen = count - mreq; + if (eio != NULL) + *eio = FALSE; for (i = 0; i < count; i++) { vm_page_t mt = mc[i]; @@ -522,6 +528,8 @@ vm_pageout_flush(vm_page_t *mc, int count, int flags, int mreq, int *prunlen) vm_page_lock(mt); vm_page_activate(mt); vm_page_unlock(mt); + if (eio != NULL && i >= mreq && i - mreq < runlen) + *eio = TRUE; break; case VM_PAGER_AGAIN: if (i >= mreq && i - mreq < runlen) |