From 4deab46f5e6c5f209f85e66cfb62b95143033c41 Mon Sep 17 00:00:00 2001
From: Thomas Bushnell <thomas@gnu.org>
Date: Sat, 4 Sep 1999 13:00:39 +0000
Subject: 1999-09-04  Thomas Bushnell, BSG  <tb@mit.edu>

	* pager.c (find_address): If !ISREAD, then don't return errors for
	access past NP->allocsize, and clear *ADDR and *DISKSIZE.  These
	can happen through harmless races against truncate.
	(pager_write_page): Don't print annoying messages for writes to
	unallocated disk.  These can happen through harmless races against
	truncate, and so we should not pester the console with them.
---
 ufs/pager.c | 17 +++++++++--------
 1 file changed, 9 insertions(+), 8 deletions(-)

(limited to 'ufs/pager.c')

diff --git a/ufs/pager.c b/ufs/pager.c
index e703bfd2..3038932d 100644
--- a/ufs/pager.c
+++ b/ufs/pager.c
@@ -121,7 +121,14 @@ find_address (struct user_pager_info *upi,
 	{
 	  if (*nplock)
 	    rwlock_reader_unlock (*nplock);
-	  return EIO;
+	  if (isread)
+	    return EIO;
+	  else
+	    {
+	      *addr = 0;
+	      *disksize = 0;
+	      return 0;
+	    }
 	}
 
       if (offset + __vm_page_size > np->allocsize)
@@ -216,13 +223,7 @@ pager_write_page (struct user_pager_info *pager,
 	err = EIO;
     }
   else
-    {
-      printf ("Attempt to write unallocated disk\n.");
-      printf ("Object %p\tOffset %#x\n", pager, page);
-      fflush (stdout);
-      err = 0;			/* unallocated disk;
-				   error would be pointless */
-    }
+    err = 0;
 
   if (nplock)
     rwlock_reader_unlock (nplock);
-- 
cgit v1.2.3