Merge branch 'hotfixes' of git://git.linux-nfs.org/projects/trondmy/nfs-2.6
authorLinus Torvalds <torvalds@linux-foundation.org>
Wed, 9 Apr 2008 01:26:31 +0000 (18:26 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Wed, 9 Apr 2008 01:26:31 +0000 (18:26 -0700)
* 'hotfixes' of git://git.linux-nfs.org/projects/trondmy/nfs-2.6:
  SUNRPC: Fix a memory leak in rpc_create()
  fix bug - executing FDPIC ELF on NFS mount triggers BUG() at mm/nommu.c:862:/do_mmap_private()
  NFS: initialize flags field in nfs_open_context
  SUNRPC: don't call flush_dcache_page() with an invalid pointer

fs/nfs/file.c
fs/nfs/inode.c
net/sunrpc/clnt.c
net/sunrpc/xdr.c

index ef57a5ae5904663d4ab20c974e920e711f921436..5d2e9d9a4e28a390c15fd10a0c856baf2fe89058 100644 (file)
@@ -64,7 +64,11 @@ const struct file_operations nfs_file_operations = {
        .write          = do_sync_write,
        .aio_read       = nfs_file_read,
        .aio_write      = nfs_file_write,
+#ifdef CONFIG_MMU
        .mmap           = nfs_file_mmap,
+#else
+       .mmap           = generic_file_mmap,
+#endif
        .open           = nfs_file_open,
        .flush          = nfs_file_flush,
        .release        = nfs_file_release,
index a4c7cf2bff3a61131d1de68dbb770833e3c8e124..6f88d7c77ac98e1b4bdb5a8f0b347227c271d5ac 100644 (file)
@@ -506,6 +506,7 @@ static struct nfs_open_context *alloc_nfs_open_context(struct vfsmount *mnt, str
                ctx->cred = get_rpccred(cred);
                ctx->state = NULL;
                ctx->lockowner = current->files;
+               ctx->flags = 0;
                ctx->error = 0;
                ctx->dir_cookie = 0;
                atomic_set(&ctx->count, 1);
index 8c6a7f1a25e9d148223c72e0c6685b5c3bfa045f..8834d68972cb539ba5fdb208c860ed3e9284ee4c 100644 (file)
@@ -261,10 +261,6 @@ struct rpc_clnt *rpc_create(struct rpc_create_args *args)
        };
        char servername[48];
 
-       xprt = xprt_create_transport(&xprtargs);
-       if (IS_ERR(xprt))
-               return (struct rpc_clnt *)xprt;
-
        /*
         * If the caller chooses not to specify a hostname, whip
         * up a string representation of the passed-in address.
index 995c3fdc16c27821d2e97887a6bdba002a086321..79a55d56cc980dbe63d1caa913046414e870e926 100644 (file)
@@ -244,7 +244,7 @@ _copy_to_pages(struct page **pages, size_t pgbase, const char *p, size_t len)
        pgto = pages + (pgbase >> PAGE_CACHE_SHIFT);
        pgbase &= ~PAGE_CACHE_MASK;
 
-       do {
+       for (;;) {
                copy = PAGE_CACHE_SIZE - pgbase;
                if (copy > len)
                        copy = len;
@@ -253,6 +253,10 @@ _copy_to_pages(struct page **pages, size_t pgbase, const char *p, size_t len)
                memcpy(vto + pgbase, p, copy);
                kunmap_atomic(vto, KM_USER0);
 
+               len -= copy;
+               if (len == 0)
+                       break;
+
                pgbase += copy;
                if (pgbase == PAGE_CACHE_SIZE) {
                        flush_dcache_page(*pgto);
@@ -260,8 +264,7 @@ _copy_to_pages(struct page **pages, size_t pgbase, const char *p, size_t len)
                        pgto++;
                }
                p += copy;
-
-       } while ((len -= copy) != 0);
+       }
        flush_dcache_page(*pgto);
 }