diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2008-04-08 21:26:31 -0400 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-04-08 21:26:31 -0400 |
| commit | 098107a01a2d427d0be9c19ae5bc9a410efed0c9 (patch) | |
| tree | b4354cb9e96ac38d5127c2a12da47e34c250eaa2 | |
| parent | f8e30e447c692aaa728c65930ebc0146f65e1e7b (diff) | |
| parent | ed13c27e546667fb0967ae30f5070cd7f6455f90 (diff) | |
Merge branch 'hotfixes' of git://git.linux-nfs.org/projects/trondmy/nfs-2.6
* '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
| -rw-r--r-- | fs/nfs/file.c | 4 | ||||
| -rw-r--r-- | fs/nfs/inode.c | 1 | ||||
| -rw-r--r-- | net/sunrpc/clnt.c | 4 | ||||
| -rw-r--r-- | net/sunrpc/xdr.c | 9 |
4 files changed, 11 insertions, 7 deletions
diff --git a/fs/nfs/file.c b/fs/nfs/file.c index ef57a5ae5904..5d2e9d9a4e28 100644 --- a/fs/nfs/file.c +++ b/fs/nfs/file.c | |||
| @@ -64,7 +64,11 @@ const struct file_operations nfs_file_operations = { | |||
| 64 | .write = do_sync_write, | 64 | .write = do_sync_write, |
| 65 | .aio_read = nfs_file_read, | 65 | .aio_read = nfs_file_read, |
| 66 | .aio_write = nfs_file_write, | 66 | .aio_write = nfs_file_write, |
| 67 | #ifdef CONFIG_MMU | ||
| 67 | .mmap = nfs_file_mmap, | 68 | .mmap = nfs_file_mmap, |
| 69 | #else | ||
| 70 | .mmap = generic_file_mmap, | ||
| 71 | #endif | ||
| 68 | .open = nfs_file_open, | 72 | .open = nfs_file_open, |
| 69 | .flush = nfs_file_flush, | 73 | .flush = nfs_file_flush, |
| 70 | .release = nfs_file_release, | 74 | .release = nfs_file_release, |
diff --git a/fs/nfs/inode.c b/fs/nfs/inode.c index a4c7cf2bff3a..6f88d7c77ac9 100644 --- a/fs/nfs/inode.c +++ b/fs/nfs/inode.c | |||
| @@ -506,6 +506,7 @@ static struct nfs_open_context *alloc_nfs_open_context(struct vfsmount *mnt, str | |||
| 506 | ctx->cred = get_rpccred(cred); | 506 | ctx->cred = get_rpccred(cred); |
| 507 | ctx->state = NULL; | 507 | ctx->state = NULL; |
| 508 | ctx->lockowner = current->files; | 508 | ctx->lockowner = current->files; |
| 509 | ctx->flags = 0; | ||
| 509 | ctx->error = 0; | 510 | ctx->error = 0; |
| 510 | ctx->dir_cookie = 0; | 511 | ctx->dir_cookie = 0; |
| 511 | atomic_set(&ctx->count, 1); | 512 | atomic_set(&ctx->count, 1); |
diff --git a/net/sunrpc/clnt.c b/net/sunrpc/clnt.c index 8c6a7f1a25e9..8834d68972cb 100644 --- a/net/sunrpc/clnt.c +++ b/net/sunrpc/clnt.c | |||
| @@ -261,10 +261,6 @@ struct rpc_clnt *rpc_create(struct rpc_create_args *args) | |||
| 261 | }; | 261 | }; |
| 262 | char servername[48]; | 262 | char servername[48]; |
| 263 | 263 | ||
| 264 | xprt = xprt_create_transport(&xprtargs); | ||
| 265 | if (IS_ERR(xprt)) | ||
| 266 | return (struct rpc_clnt *)xprt; | ||
| 267 | |||
| 268 | /* | 264 | /* |
| 269 | * If the caller chooses not to specify a hostname, whip | 265 | * If the caller chooses not to specify a hostname, whip |
| 270 | * up a string representation of the passed-in address. | 266 | * up a string representation of the passed-in address. |
diff --git a/net/sunrpc/xdr.c b/net/sunrpc/xdr.c index 995c3fdc16c2..79a55d56cc98 100644 --- a/net/sunrpc/xdr.c +++ b/net/sunrpc/xdr.c | |||
| @@ -244,7 +244,7 @@ _copy_to_pages(struct page **pages, size_t pgbase, const char *p, size_t len) | |||
| 244 | pgto = pages + (pgbase >> PAGE_CACHE_SHIFT); | 244 | pgto = pages + (pgbase >> PAGE_CACHE_SHIFT); |
| 245 | pgbase &= ~PAGE_CACHE_MASK; | 245 | pgbase &= ~PAGE_CACHE_MASK; |
| 246 | 246 | ||
| 247 | do { | 247 | for (;;) { |
| 248 | copy = PAGE_CACHE_SIZE - pgbase; | 248 | copy = PAGE_CACHE_SIZE - pgbase; |
| 249 | if (copy > len) | 249 | if (copy > len) |
| 250 | copy = len; | 250 | copy = len; |
| @@ -253,6 +253,10 @@ _copy_to_pages(struct page **pages, size_t pgbase, const char *p, size_t len) | |||
| 253 | memcpy(vto + pgbase, p, copy); | 253 | memcpy(vto + pgbase, p, copy); |
| 254 | kunmap_atomic(vto, KM_USER0); | 254 | kunmap_atomic(vto, KM_USER0); |
| 255 | 255 | ||
| 256 | len -= copy; | ||
| 257 | if (len == 0) | ||
| 258 | break; | ||
| 259 | |||
| 256 | pgbase += copy; | 260 | pgbase += copy; |
| 257 | if (pgbase == PAGE_CACHE_SIZE) { | 261 | if (pgbase == PAGE_CACHE_SIZE) { |
| 258 | flush_dcache_page(*pgto); | 262 | flush_dcache_page(*pgto); |
| @@ -260,8 +264,7 @@ _copy_to_pages(struct page **pages, size_t pgbase, const char *p, size_t len) | |||
| 260 | pgto++; | 264 | pgto++; |
| 261 | } | 265 | } |
| 262 | p += copy; | 266 | p += copy; |
| 263 | 267 | } | |
| 264 | } while ((len -= copy) != 0); | ||
| 265 | flush_dcache_page(*pgto); | 268 | flush_dcache_page(*pgto); |
| 266 | } | 269 | } |
| 267 | 270 | ||
