patch-2.3.29 linux/mm/filemap.c

Next file: linux/mm/highmem.c
Previous file: linux/mm/bootmem.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.3.28/linux/mm/filemap.c linux/mm/filemap.c
@@ -23,7 +23,7 @@
 #include <linux/init.h>
 #include <linux/mm.h>
 
-#include <asm/pgtable.h>
+#include <asm/pgalloc.h>
 #include <asm/uaccess.h>
 
 #include <linux/highmem.h>
@@ -1791,18 +1791,21 @@
 	struct dentry	*dentry = file->f_dentry; 
 	struct inode	*inode = dentry->d_inode; 
 	unsigned long	limit = current->rlim[RLIMIT_FSIZE].rlim_cur;
-	loff_t		pos = *ppos;
+	loff_t		pos;
 	struct page	*page, **hash, *cached_page;
 	unsigned long	written;
 	long		status;
 	int		err;
 
-	if (pos < 0)
-		return -EINVAL;
-
 	cached_page = NULL;
 
 	down(&inode->i_sem);
+
+	pos = *ppos;
+	err = -EINVAL;
+	if (pos < 0)
+		goto out;
+
 	err = file->f_error;
 	if (err) {
 		file->f_error = 0;

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)