On Thu, Apr 14, 2022 at 11:44:42AM -0600, Theo de Raadt wrote: > > If I understand correctly, the problem is that writing to memory > > of an mmap(2)ed file has no error handling. If the file system is > > full, userland cannot be informed. So someone invented this message > > in the kernel. > > If you cannot return an error to the program, deciding to print a message > to the console doesn't fix anything. The program doesn't see the problem. > The program cannot cope. The user sees an irrelevant message which doesn't > give them any action they can take. Not even root will know what to do.
ok to delete the message? bluhm Index: uvm/uvm_vnode.c =================================================================== RCS file: /data/mirror/openbsd/cvs/src/sys/uvm/uvm_vnode.c,v retrieving revision 1.121 diff -u -p -r1.121 uvm_vnode.c --- uvm/uvm_vnode.c 15 Dec 2021 12:53:53 -0000 1.121 +++ uvm/uvm_vnode.c 14 Apr 2022 17:34:01 -0000 @@ -744,7 +744,7 @@ ReTry: */ #ifdef DIAGNOSTIC if (flags & PGO_SYNCIO) - panic("uvn_flush: PGO_SYNCIO return 'try again' error (impossible)"); + panic("%s: PGO_SYNCIO return 'try again' error (impossible)", __func__); #endif flags |= PGO_SYNCIO; if (flags & PGO_FREE) @@ -807,17 +807,8 @@ ReTry: } } else if (flags & PGO_FREE && result != VM_PAGER_PEND) { - if (result != VM_PAGER_OK) { - printf("uvn_flush: obj=%p, " - "offset=0x%llx. error " - "during pageout.\n", - pp->uobject, - (long long)pp->offset); - printf("uvn_flush: WARNING: " - "changes to page may be " - "lost!\n"); + if (result != VM_PAGER_OK) retval = FALSE; - } pmap_page_protect(ptmp, PROT_NONE); uvm_pageclean(ptmp); TAILQ_INSERT_TAIL(&dead, ptmp, pageq);