From 2963c3c979b3491c27ed851b7e3ea47c0ae4167c Mon Sep 17 00:00:00 2001 From: kib Date: Sat, 17 Mar 2012 23:00:32 +0000 Subject: 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 --- sys/vm/vm_map.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'sys/vm/vm_map.c') diff --git a/sys/vm/vm_map.c b/sys/vm/vm_map.c index 6484a9f..a180601 100644 --- a/sys/vm/vm_map.c +++ b/sys/vm/vm_map.c @@ -2591,6 +2591,7 @@ vm_map_sync( vm_object_t object; vm_ooffset_t offset; unsigned int last_timestamp; + boolean_t failed; vm_map_lock_read(map); VM_MAP_RANGE_CHECK(map, start, end); @@ -2620,6 +2621,7 @@ vm_map_sync( if (invalidate) pmap_remove(map->pmap, start, end); + failed = FALSE; /* * Make a second pass, cleaning/uncaching pages from the indicated @@ -2648,7 +2650,8 @@ vm_map_sync( vm_object_reference(object); last_timestamp = map->timestamp; vm_map_unlock_read(map); - vm_object_sync(object, offset, size, syncio, invalidate); + if (!vm_object_sync(object, offset, size, syncio, invalidate)) + failed = TRUE; start += size; vm_object_deallocate(object); vm_map_lock_read(map); @@ -2658,7 +2661,7 @@ vm_map_sync( } vm_map_unlock_read(map); - return (KERN_SUCCESS); + return (failed ? KERN_FAILURE : KERN_SUCCESS); } /* -- cgit v1.1