fix
authorMiklos Szeredi <miklos@szeredi.hu>
Fri, 8 Apr 2005 16:39:09 +0000 (16:39 +0000)
committerMiklos Szeredi <miklos@szeredi.hu>
Fri, 8 Apr 2005 16:39:09 +0000 (16:39 +0000)
ChangeLog
kernel/file.c

index 24d9da8114be5cfb454f92c01237bd45f4e3d354..4d83e658633ee05564ae793b9ae6a66dcb6bc7b2 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -2,6 +2,9 @@
 
        * Fix Oops in case of nfs export.  Spotted by David Shaw
 
+       * Fix another Oops in case of write over nfs with direct_io turned
+       on.  Again spotted by David Shaw
+
 2005-04-07  Miklos Szeredi <miklos@szeredi.hu>
 
        * Released 2.3-pre4
index a88654637668db69f1293cdd7ab105dfbb635a49..e7de38ae15fa1cdd99751817dce3f143290e631d 100644 (file)
@@ -508,6 +508,10 @@ static int fuse_get_user_pages(struct fuse_req *req, const char __user *buf,
        unsigned offset = user_addr & ~PAGE_MASK;
        int npages;
 
+       /* This doesn't work with nfsd */
+       if (!current->mm)
+               return -EPERM;
+
        nbytes = min(nbytes, (unsigned) FUSE_MAX_PAGES_PER_REQ << PAGE_SHIFT);
        npages = (nbytes + offset + PAGE_SIZE - 1) >> PAGE_SHIFT;
        npages = min(npages, FUSE_MAX_PAGES_PER_REQ);