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
- Lines: 31
- Date:
Tue Oct 8 08:50:20 1996
- Orig file:
v2.1.1/linux/mm/filemap.c
- Orig date:
Sat Sep 28 23:20:18 1996
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