Re: NFSv3 and linux-2.4.10-ac3 => oops

From: Trond Myklebust (trond.myklebust@fys.uio.no)
Date: Tue Oct 02 2001 - 09:03:57 EST


>>>>> " " == Alan Cox <alan@lxorguk.ukuu.org.uk> writes:

>> what I can see, Alan merged that particular patch into
>> 2.4.9-ac11 (but without merging in the related changes to
>> linux/mm/filemap.c).

> Ok its probably better I merge the related mm/filemap.c changes
> if someone has the relevant bits handy. That helps to keep the
> differences down

The following ought to be sufficient.

Cheers,
   Trond

--- linux-2.4.10-ac/mm/filemap.c Tue Oct 2 15:53:04 2001
+++ linux-2.4.10-new/mm/filemap.c Tue Oct 2 15:56:29 2001
@@ -2673,10 +2673,10 @@
                         PAGE_BUG(page);
                 }
 
+ kaddr = kmap(page);
                 status = mapping->a_ops->prepare_write(file, page, offset, offset+bytes);
                 if (status)
                         goto sync_failure;
- kaddr = page_address(page);
                 status = __copy_from_user(kaddr+offset, buf, bytes);
                 flush_dcache_page(page);
                 if (status) {
@@ -2695,6 +2695,7 @@
                         buf += status;
                 }
 unlock:
+ kunmap(page);
                 /* Mark it unlocked again and drop the page.. */
                 UnlockPage(page);
                 if (deactivate)
@@ -2728,9 +2729,9 @@
 fail_write:
         status = -EFAULT;
         ClearPageUptodate(page);
- kunmap(page);
         goto unlock;
 sync_failure:
+ kunmap(page);
         UnlockPage(page);
         deactivate_page(page);
         page_cache_release(page);
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Sun Oct 07 2001 - 21:00:22 EST