patch-2.1.2 linux/mm/filemap.c

Next file: linux/mm/memory.c
Previous file: linux/kernel/ksyms.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.1.1/linux/mm/filemap.c linux/mm/filemap.c
@@ -657,14 +657,17 @@
 		 */
 	{
 		unsigned long offset, nr;
+
+		if (exception())
+			goto page_read_exception;
 		offset = pos & ~PAGE_MASK;
 		nr = PAGE_SIZE - offset;
 		if (nr > count)
 			nr = count;
-
 		if (nr > inode->i_size - pos)
 			nr = inode->i_size - pos;
 		memcpy_tofs(buf, (void *) (page_address(page) + offset), nr);
+		end_exception();
 		release_page(page);
 		buf += nr;
 		pos += nr;
@@ -736,6 +739,11 @@
 				goto success;
 			error = -EIO; /* Some unspecified error occurred.. */
 		}
+		release_page(page);
+		break;
+
+page_read_exception:
+		error = -EFAULT;
 		release_page(page);
 		break;
 	}

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov