diff options
| -rw-r--r-- | fs/lockd/host.c | 11 | ||||
| -rw-r--r-- | fs/nfs/dir.c | 100 | ||||
| -rw-r--r-- | fs/nfs/nfs2xdr.c | 4 | ||||
| -rw-r--r-- | fs/nfs/nfs3xdr.c | 4 | ||||
| -rw-r--r-- | fs/nfs/nfs4proc.c | 4 | ||||
| -rw-r--r-- | fs/nfs/nfs4xdr.c | 2 | ||||
| -rw-r--r-- | fs/nfs/super.c | 8 | ||||
| -rw-r--r-- | include/linux/lockd/lockd.h | 1 | ||||
| -rw-r--r-- | include/linux/nfs_fs.h | 6 | ||||
| -rw-r--r-- | net/sunrpc/stats.c | 4 |
10 files changed, 86 insertions, 58 deletions
diff --git a/fs/lockd/host.c b/fs/lockd/host.c index 25e21e4023b2..ed0c59fe23ce 100644 --- a/fs/lockd/host.c +++ b/fs/lockd/host.c | |||
| @@ -124,7 +124,7 @@ static struct nlm_host *nlm_lookup_host(struct nlm_lookup_host_info *ni) | |||
| 124 | continue; | 124 | continue; |
| 125 | if (host->h_server != ni->server) | 125 | if (host->h_server != ni->server) |
| 126 | continue; | 126 | continue; |
| 127 | if (ni->server && | 127 | if (ni->server && ni->src_len != 0 && |
| 128 | !rpc_cmp_addr(nlm_srcaddr(host), ni->src_sap)) | 128 | !rpc_cmp_addr(nlm_srcaddr(host), ni->src_sap)) |
| 129 | continue; | 129 | continue; |
| 130 | 130 | ||
| @@ -167,6 +167,7 @@ static struct nlm_host *nlm_lookup_host(struct nlm_lookup_host_info *ni) | |||
| 167 | host->h_addrlen = ni->salen; | 167 | host->h_addrlen = ni->salen; |
| 168 | rpc_set_port(nlm_addr(host), 0); | 168 | rpc_set_port(nlm_addr(host), 0); |
| 169 | memcpy(nlm_srcaddr(host), ni->src_sap, ni->src_len); | 169 | memcpy(nlm_srcaddr(host), ni->src_sap, ni->src_len); |
| 170 | host->h_srcaddrlen = ni->src_len; | ||
| 170 | host->h_version = ni->version; | 171 | host->h_version = ni->version; |
| 171 | host->h_proto = ni->protocol; | 172 | host->h_proto = ni->protocol; |
| 172 | host->h_rpcclnt = NULL; | 173 | host->h_rpcclnt = NULL; |
| @@ -238,9 +239,6 @@ struct nlm_host *nlmclnt_lookup_host(const struct sockaddr *sap, | |||
| 238 | const char *hostname, | 239 | const char *hostname, |
| 239 | int noresvport) | 240 | int noresvport) |
| 240 | { | 241 | { |
| 241 | const struct sockaddr source = { | ||
| 242 | .sa_family = AF_UNSPEC, | ||
| 243 | }; | ||
| 244 | struct nlm_lookup_host_info ni = { | 242 | struct nlm_lookup_host_info ni = { |
| 245 | .server = 0, | 243 | .server = 0, |
| 246 | .sap = sap, | 244 | .sap = sap, |
| @@ -249,8 +247,6 @@ struct nlm_host *nlmclnt_lookup_host(const struct sockaddr *sap, | |||
| 249 | .version = version, | 247 | .version = version, |
| 250 | .hostname = hostname, | 248 | .hostname = hostname, |
| 251 | .hostname_len = strlen(hostname), | 249 | .hostname_len = strlen(hostname), |
| 252 | .src_sap = &source, | ||
| 253 | .src_len = sizeof(source), | ||
| 254 | .noresvport = noresvport, | 250 | .noresvport = noresvport, |
| 255 | }; | 251 | }; |
| 256 | 252 | ||
| @@ -357,7 +353,6 @@ nlm_bind_host(struct nlm_host *host) | |||
| 357 | .protocol = host->h_proto, | 353 | .protocol = host->h_proto, |
| 358 | .address = nlm_addr(host), | 354 | .address = nlm_addr(host), |
| 359 | .addrsize = host->h_addrlen, | 355 | .addrsize = host->h_addrlen, |
| 360 | .saddress = nlm_srcaddr(host), | ||
| 361 | .timeout = &timeparms, | 356 | .timeout = &timeparms, |
| 362 | .servername = host->h_name, | 357 | .servername = host->h_name, |
| 363 | .program = &nlm_program, | 358 | .program = &nlm_program, |
| @@ -376,6 +371,8 @@ nlm_bind_host(struct nlm_host *host) | |||
| 376 | args.flags |= RPC_CLNT_CREATE_HARDRTRY; | 371 | args.flags |= RPC_CLNT_CREATE_HARDRTRY; |
| 377 | if (host->h_noresvport) | 372 | if (host->h_noresvport) |
| 378 | args.flags |= RPC_CLNT_CREATE_NONPRIVPORT; | 373 | args.flags |= RPC_CLNT_CREATE_NONPRIVPORT; |
| 374 | if (host->h_srcaddrlen) | ||
| 375 | args.saddress = nlm_srcaddr(host); | ||
| 379 | 376 | ||
| 380 | clnt = rpc_create(&args); | 377 | clnt = rpc_create(&args); |
| 381 | if (!IS_ERR(clnt)) | 378 | if (!IS_ERR(clnt)) |
diff --git a/fs/nfs/dir.c b/fs/nfs/dir.c index 07ac3847e562..662df2a5fad5 100644 --- a/fs/nfs/dir.c +++ b/fs/nfs/dir.c | |||
| @@ -34,6 +34,7 @@ | |||
| 34 | #include <linux/mount.h> | 34 | #include <linux/mount.h> |
| 35 | #include <linux/sched.h> | 35 | #include <linux/sched.h> |
| 36 | #include <linux/vmalloc.h> | 36 | #include <linux/vmalloc.h> |
| 37 | #include <linux/kmemleak.h> | ||
| 37 | 38 | ||
| 38 | #include "delegation.h" | 39 | #include "delegation.h" |
| 39 | #include "iostat.h" | 40 | #include "iostat.h" |
| @@ -194,9 +195,13 @@ typedef struct { | |||
| 194 | static | 195 | static |
| 195 | struct nfs_cache_array *nfs_readdir_get_array(struct page *page) | 196 | struct nfs_cache_array *nfs_readdir_get_array(struct page *page) |
| 196 | { | 197 | { |
| 198 | void *ptr; | ||
| 197 | if (page == NULL) | 199 | if (page == NULL) |
| 198 | return ERR_PTR(-EIO); | 200 | return ERR_PTR(-EIO); |
| 199 | return (struct nfs_cache_array *)kmap(page); | 201 | ptr = kmap(page); |
| 202 | if (ptr == NULL) | ||
| 203 | return ERR_PTR(-ENOMEM); | ||
| 204 | return ptr; | ||
| 200 | } | 205 | } |
| 201 | 206 | ||
| 202 | static | 207 | static |
| @@ -213,6 +218,9 @@ int nfs_readdir_clear_array(struct page *page, gfp_t mask) | |||
| 213 | { | 218 | { |
| 214 | struct nfs_cache_array *array = nfs_readdir_get_array(page); | 219 | struct nfs_cache_array *array = nfs_readdir_get_array(page); |
| 215 | int i; | 220 | int i; |
| 221 | |||
| 222 | if (IS_ERR(array)) | ||
| 223 | return PTR_ERR(array); | ||
| 216 | for (i = 0; i < array->size; i++) | 224 | for (i = 0; i < array->size; i++) |
| 217 | kfree(array->array[i].string.name); | 225 | kfree(array->array[i].string.name); |
| 218 | nfs_readdir_release_array(page); | 226 | nfs_readdir_release_array(page); |
| @@ -231,6 +239,11 @@ int nfs_readdir_make_qstr(struct qstr *string, const char *name, unsigned int le | |||
| 231 | string->name = kmemdup(name, len, GFP_KERNEL); | 239 | string->name = kmemdup(name, len, GFP_KERNEL); |
| 232 | if (string->name == NULL) | 240 | if (string->name == NULL) |
| 233 | return -ENOMEM; | 241 | return -ENOMEM; |
| 242 | /* | ||
| 243 | * Avoid a kmemleak false positive. The pointer to the name is stored | ||
| 244 | * in a page cache page which kmemleak does not scan. | ||
| 245 | */ | ||
| 246 | kmemleak_not_leak(string->name); | ||
| 234 | string->hash = full_name_hash(name, len); | 247 | string->hash = full_name_hash(name, len); |
| 235 | return 0; | 248 | return 0; |
| 236 | } | 249 | } |
| @@ -244,7 +257,7 @@ int nfs_readdir_add_to_array(struct nfs_entry *entry, struct page *page) | |||
| 244 | 257 | ||
| 245 | if (IS_ERR(array)) | 258 | if (IS_ERR(array)) |
| 246 | return PTR_ERR(array); | 259 | return PTR_ERR(array); |
| 247 | ret = -EIO; | 260 | ret = -ENOSPC; |
| 248 | if (array->size >= MAX_READDIR_ARRAY) | 261 | if (array->size >= MAX_READDIR_ARRAY) |
| 249 | goto out; | 262 | goto out; |
| 250 | 263 | ||
| @@ -255,9 +268,9 @@ int nfs_readdir_add_to_array(struct nfs_entry *entry, struct page *page) | |||
| 255 | if (ret) | 268 | if (ret) |
| 256 | goto out; | 269 | goto out; |
| 257 | array->last_cookie = entry->cookie; | 270 | array->last_cookie = entry->cookie; |
| 271 | array->size++; | ||
| 258 | if (entry->eof == 1) | 272 | if (entry->eof == 1) |
| 259 | array->eof_index = array->size; | 273 | array->eof_index = array->size; |
| 260 | array->size++; | ||
| 261 | out: | 274 | out: |
| 262 | nfs_readdir_release_array(page); | 275 | nfs_readdir_release_array(page); |
| 263 | return ret; | 276 | return ret; |
| @@ -272,7 +285,7 @@ int nfs_readdir_search_for_pos(struct nfs_cache_array *array, nfs_readdir_descri | |||
| 272 | if (diff < 0) | 285 | if (diff < 0) |
| 273 | goto out_eof; | 286 | goto out_eof; |
| 274 | if (diff >= array->size) { | 287 | if (diff >= array->size) { |
| 275 | if (array->eof_index > 0) | 288 | if (array->eof_index >= 0) |
| 276 | goto out_eof; | 289 | goto out_eof; |
| 277 | desc->current_index += array->size; | 290 | desc->current_index += array->size; |
| 278 | return -EAGAIN; | 291 | return -EAGAIN; |
| @@ -281,8 +294,6 @@ int nfs_readdir_search_for_pos(struct nfs_cache_array *array, nfs_readdir_descri | |||
| 281 | index = (unsigned int)diff; | 294 | index = (unsigned int)diff; |
| 282 | *desc->dir_cookie = array->array[index].cookie; | 295 | *desc->dir_cookie = array->array[index].cookie; |
| 283 | desc->cache_entry_index = index; | 296 | desc->cache_entry_index = index; |
| 284 | if (index == array->eof_index) | ||
| 285 | desc->eof = 1; | ||
| 286 | return 0; | 297 | return 0; |
| 287 | out_eof: | 298 | out_eof: |
| 288 | desc->eof = 1; | 299 | desc->eof = 1; |
| @@ -296,17 +307,17 @@ int nfs_readdir_search_for_cookie(struct nfs_cache_array *array, nfs_readdir_des | |||
| 296 | int status = -EAGAIN; | 307 | int status = -EAGAIN; |
| 297 | 308 | ||
| 298 | for (i = 0; i < array->size; i++) { | 309 | for (i = 0; i < array->size; i++) { |
| 299 | if (i == array->eof_index) { | ||
| 300 | desc->eof = 1; | ||
| 301 | status = -EBADCOOKIE; | ||
| 302 | } | ||
| 303 | if (array->array[i].cookie == *desc->dir_cookie) { | 310 | if (array->array[i].cookie == *desc->dir_cookie) { |
| 304 | desc->cache_entry_index = i; | 311 | desc->cache_entry_index = i; |
| 305 | status = 0; | 312 | status = 0; |
| 306 | break; | 313 | goto out; |
| 307 | } | 314 | } |
| 308 | } | 315 | } |
| 309 | 316 | if (i == array->eof_index) { | |
| 317 | desc->eof = 1; | ||
| 318 | status = -EBADCOOKIE; | ||
| 319 | } | ||
| 320 | out: | ||
| 310 | return status; | 321 | return status; |
| 311 | } | 322 | } |
| 312 | 323 | ||
| @@ -449,7 +460,7 @@ out: | |||
| 449 | 460 | ||
| 450 | /* Perform conversion from xdr to cache array */ | 461 | /* Perform conversion from xdr to cache array */ |
| 451 | static | 462 | static |
| 452 | void nfs_readdir_page_filler(nfs_readdir_descriptor_t *desc, struct nfs_entry *entry, | 463 | int nfs_readdir_page_filler(nfs_readdir_descriptor_t *desc, struct nfs_entry *entry, |
| 453 | void *xdr_page, struct page *page, unsigned int buflen) | 464 | void *xdr_page, struct page *page, unsigned int buflen) |
| 454 | { | 465 | { |
| 455 | struct xdr_stream stream; | 466 | struct xdr_stream stream; |
| @@ -471,21 +482,29 @@ void nfs_readdir_page_filler(nfs_readdir_descriptor_t *desc, struct nfs_entry *e | |||
| 471 | 482 | ||
| 472 | do { | 483 | do { |
| 473 | status = xdr_decode(desc, entry, &stream); | 484 | status = xdr_decode(desc, entry, &stream); |
| 474 | if (status != 0) | 485 | if (status != 0) { |
| 486 | if (status == -EAGAIN) | ||
| 487 | status = 0; | ||
| 475 | break; | 488 | break; |
| 489 | } | ||
| 476 | 490 | ||
| 477 | if (nfs_readdir_add_to_array(entry, page) == -1) | ||
| 478 | break; | ||
| 479 | if (desc->plus == 1) | 491 | if (desc->plus == 1) |
| 480 | nfs_prime_dcache(desc->file->f_path.dentry, entry); | 492 | nfs_prime_dcache(desc->file->f_path.dentry, entry); |
| 493 | |||
| 494 | status = nfs_readdir_add_to_array(entry, page); | ||
| 495 | if (status != 0) | ||
| 496 | break; | ||
| 481 | } while (!entry->eof); | 497 | } while (!entry->eof); |
| 482 | 498 | ||
| 483 | if (status == -EBADCOOKIE && entry->eof) { | 499 | if (status == -EBADCOOKIE && entry->eof) { |
| 484 | array = nfs_readdir_get_array(page); | 500 | array = nfs_readdir_get_array(page); |
| 485 | array->eof_index = array->size - 1; | 501 | if (!IS_ERR(array)) { |
| 486 | status = 0; | 502 | array->eof_index = array->size; |
| 487 | nfs_readdir_release_array(page); | 503 | status = 0; |
| 504 | nfs_readdir_release_array(page); | ||
| 505 | } | ||
| 488 | } | 506 | } |
| 507 | return status; | ||
| 489 | } | 508 | } |
| 490 | 509 | ||
| 491 | static | 510 | static |
| @@ -537,7 +556,7 @@ int nfs_readdir_xdr_to_array(nfs_readdir_descriptor_t *desc, struct page *page, | |||
| 537 | struct nfs_entry entry; | 556 | struct nfs_entry entry; |
| 538 | struct file *file = desc->file; | 557 | struct file *file = desc->file; |
| 539 | struct nfs_cache_array *array; | 558 | struct nfs_cache_array *array; |
| 540 | int status = 0; | 559 | int status = -ENOMEM; |
| 541 | unsigned int array_size = ARRAY_SIZE(pages); | 560 | unsigned int array_size = ARRAY_SIZE(pages); |
| 542 | 561 | ||
| 543 | entry.prev_cookie = 0; | 562 | entry.prev_cookie = 0; |
| @@ -549,6 +568,10 @@ int nfs_readdir_xdr_to_array(nfs_readdir_descriptor_t *desc, struct page *page, | |||
| 549 | goto out; | 568 | goto out; |
| 550 | 569 | ||
| 551 | array = nfs_readdir_get_array(page); | 570 | array = nfs_readdir_get_array(page); |
| 571 | if (IS_ERR(array)) { | ||
| 572 | status = PTR_ERR(array); | ||
| 573 | goto out; | ||
| 574 | } | ||
| 552 | memset(array, 0, sizeof(struct nfs_cache_array)); | 575 | memset(array, 0, sizeof(struct nfs_cache_array)); |
| 553 | array->eof_index = -1; | 576 | array->eof_index = -1; |
| 554 | 577 | ||
| @@ -556,12 +579,19 @@ int nfs_readdir_xdr_to_array(nfs_readdir_descriptor_t *desc, struct page *page, | |||
| 556 | if (!pages_ptr) | 579 | if (!pages_ptr) |
| 557 | goto out_release_array; | 580 | goto out_release_array; |
| 558 | do { | 581 | do { |
| 582 | unsigned int pglen; | ||
| 559 | status = nfs_readdir_xdr_filler(pages, desc, &entry, file, inode); | 583 | status = nfs_readdir_xdr_filler(pages, desc, &entry, file, inode); |
| 560 | 584 | ||
| 561 | if (status < 0) | 585 | if (status < 0) |
| 562 | break; | 586 | break; |
| 563 | nfs_readdir_page_filler(desc, &entry, pages_ptr, page, array_size * PAGE_SIZE); | 587 | pglen = status; |
| 564 | } while (array->eof_index < 0 && array->size < MAX_READDIR_ARRAY); | 588 | status = nfs_readdir_page_filler(desc, &entry, pages_ptr, page, pglen); |
| 589 | if (status < 0) { | ||
| 590 | if (status == -ENOSPC) | ||
| 591 | status = 0; | ||
| 592 | break; | ||
| 593 | } | ||
| 594 | } while (array->eof_index < 0); | ||
| 565 | 595 | ||
| 566 | nfs_readdir_free_large_page(pages_ptr, pages, array_size); | 596 | nfs_readdir_free_large_page(pages_ptr, pages, array_size); |
| 567 | out_release_array: | 597 | out_release_array: |
| @@ -582,8 +612,10 @@ static | |||
| 582 | int nfs_readdir_filler(nfs_readdir_descriptor_t *desc, struct page* page) | 612 | int nfs_readdir_filler(nfs_readdir_descriptor_t *desc, struct page* page) |
| 583 | { | 613 | { |
| 584 | struct inode *inode = desc->file->f_path.dentry->d_inode; | 614 | struct inode *inode = desc->file->f_path.dentry->d_inode; |
| 615 | int ret; | ||
| 585 | 616 | ||
| 586 | if (nfs_readdir_xdr_to_array(desc, page, inode) < 0) | 617 | ret = nfs_readdir_xdr_to_array(desc, page, inode); |
| 618 | if (ret < 0) | ||
| 587 | goto error; | 619 | goto error; |
| 588 | SetPageUptodate(page); | 620 | SetPageUptodate(page); |
| 589 | 621 | ||
| @@ -595,7 +627,7 @@ int nfs_readdir_filler(nfs_readdir_descriptor_t *desc, struct page* page) | |||
| 595 | return 0; | 627 | return 0; |
| 596 | error: | 628 | error: |
| 597 | unlock_page(page); | 629 | unlock_page(page); |
| 598 | return -EIO; | 630 | return ret; |
| 599 | } | 631 | } |
| 600 | 632 | ||
| 601 | static | 633 | static |
| @@ -608,12 +640,8 @@ void cache_page_release(nfs_readdir_descriptor_t *desc) | |||
| 608 | static | 640 | static |
| 609 | struct page *get_cache_page(nfs_readdir_descriptor_t *desc) | 641 | struct page *get_cache_page(nfs_readdir_descriptor_t *desc) |
| 610 | { | 642 | { |
| 611 | struct page *page; | 643 | return read_cache_page(desc->file->f_path.dentry->d_inode->i_mapping, |
| 612 | page = read_cache_page(desc->file->f_path.dentry->d_inode->i_mapping, | ||
| 613 | desc->page_index, (filler_t *)nfs_readdir_filler, desc); | 644 | desc->page_index, (filler_t *)nfs_readdir_filler, desc); |
| 614 | if (IS_ERR(page)) | ||
| 615 | desc->eof = 1; | ||
| 616 | return page; | ||
| 617 | } | 645 | } |
| 618 | 646 | ||
| 619 | /* | 647 | /* |
| @@ -639,8 +667,10 @@ int find_cache_page(nfs_readdir_descriptor_t *desc) | |||
| 639 | static inline | 667 | static inline |
| 640 | int readdir_search_pagecache(nfs_readdir_descriptor_t *desc) | 668 | int readdir_search_pagecache(nfs_readdir_descriptor_t *desc) |
| 641 | { | 669 | { |
| 642 | int res = -EAGAIN; | 670 | int res; |
| 643 | 671 | ||
| 672 | if (desc->page_index == 0) | ||
| 673 | desc->current_index = 0; | ||
| 644 | while (1) { | 674 | while (1) { |
| 645 | res = find_cache_page(desc); | 675 | res = find_cache_page(desc); |
| 646 | if (res != -EAGAIN) | 676 | if (res != -EAGAIN) |
| @@ -670,6 +700,8 @@ int nfs_do_filldir(nfs_readdir_descriptor_t *desc, void *dirent, | |||
| 670 | struct dentry *dentry = NULL; | 700 | struct dentry *dentry = NULL; |
| 671 | 701 | ||
| 672 | array = nfs_readdir_get_array(desc->page); | 702 | array = nfs_readdir_get_array(desc->page); |
| 703 | if (IS_ERR(array)) | ||
| 704 | return PTR_ERR(array); | ||
| 673 | 705 | ||
| 674 | for (i = desc->cache_entry_index; i < array->size; i++) { | 706 | for (i = desc->cache_entry_index; i < array->size; i++) { |
| 675 | d_type = DT_UNKNOWN; | 707 | d_type = DT_UNKNOWN; |
| @@ -685,11 +717,9 @@ int nfs_do_filldir(nfs_readdir_descriptor_t *desc, void *dirent, | |||
| 685 | *desc->dir_cookie = array->array[i+1].cookie; | 717 | *desc->dir_cookie = array->array[i+1].cookie; |
| 686 | else | 718 | else |
| 687 | *desc->dir_cookie = array->last_cookie; | 719 | *desc->dir_cookie = array->last_cookie; |
| 688 | if (i == array->eof_index) { | ||
| 689 | desc->eof = 1; | ||
| 690 | break; | ||
| 691 | } | ||
| 692 | } | 720 | } |
| 721 | if (i == array->eof_index) | ||
| 722 | desc->eof = 1; | ||
| 693 | 723 | ||
| 694 | nfs_readdir_release_array(desc->page); | 724 | nfs_readdir_release_array(desc->page); |
| 695 | cache_page_release(desc); | 725 | cache_page_release(desc); |
| @@ -1345,12 +1375,12 @@ static struct dentry *nfs_atomic_lookup(struct inode *dir, struct dentry *dentry | |||
| 1345 | res = NULL; | 1375 | res = NULL; |
| 1346 | goto out; | 1376 | goto out; |
| 1347 | /* This turned out not to be a regular file */ | 1377 | /* This turned out not to be a regular file */ |
| 1348 | case -EISDIR: | ||
| 1349 | case -ENOTDIR: | 1378 | case -ENOTDIR: |
| 1350 | goto no_open; | 1379 | goto no_open; |
| 1351 | case -ELOOP: | 1380 | case -ELOOP: |
| 1352 | if (!(nd->intent.open.flags & O_NOFOLLOW)) | 1381 | if (!(nd->intent.open.flags & O_NOFOLLOW)) |
| 1353 | goto no_open; | 1382 | goto no_open; |
| 1383 | /* case -EISDIR: */ | ||
| 1354 | /* case -EINVAL: */ | 1384 | /* case -EINVAL: */ |
| 1355 | default: | 1385 | default: |
| 1356 | res = ERR_CAST(inode); | 1386 | res = ERR_CAST(inode); |
diff --git a/fs/nfs/nfs2xdr.c b/fs/nfs/nfs2xdr.c index e6bf45710cc7..2563f765c9b4 100644 --- a/fs/nfs/nfs2xdr.c +++ b/fs/nfs/nfs2xdr.c | |||
| @@ -423,7 +423,7 @@ nfs_xdr_readdirres(struct rpc_rqst *req, __be32 *p, void *dummy) | |||
| 423 | struct page **page; | 423 | struct page **page; |
| 424 | size_t hdrlen; | 424 | size_t hdrlen; |
| 425 | unsigned int pglen, recvd; | 425 | unsigned int pglen, recvd; |
| 426 | int status, nr = 0; | 426 | int status; |
| 427 | 427 | ||
| 428 | if ((status = ntohl(*p++))) | 428 | if ((status = ntohl(*p++))) |
| 429 | return nfs_stat_to_errno(status); | 429 | return nfs_stat_to_errno(status); |
| @@ -443,7 +443,7 @@ nfs_xdr_readdirres(struct rpc_rqst *req, __be32 *p, void *dummy) | |||
| 443 | if (pglen > recvd) | 443 | if (pglen > recvd) |
| 444 | pglen = recvd; | 444 | pglen = recvd; |
| 445 | page = rcvbuf->pages; | 445 | page = rcvbuf->pages; |
| 446 | return nr; | 446 | return pglen; |
| 447 | } | 447 | } |
| 448 | 448 | ||
| 449 | static void print_overflow_msg(const char *func, const struct xdr_stream *xdr) | 449 | static void print_overflow_msg(const char *func, const struct xdr_stream *xdr) |
diff --git a/fs/nfs/nfs3xdr.c b/fs/nfs/nfs3xdr.c index d9a5e832c257..748dc91a4a14 100644 --- a/fs/nfs/nfs3xdr.c +++ b/fs/nfs/nfs3xdr.c | |||
| @@ -555,7 +555,7 @@ nfs3_xdr_readdirres(struct rpc_rqst *req, __be32 *p, struct nfs3_readdirres *res | |||
| 555 | struct page **page; | 555 | struct page **page; |
| 556 | size_t hdrlen; | 556 | size_t hdrlen; |
| 557 | u32 recvd, pglen; | 557 | u32 recvd, pglen; |
| 558 | int status, nr = 0; | 558 | int status; |
| 559 | 559 | ||
| 560 | status = ntohl(*p++); | 560 | status = ntohl(*p++); |
| 561 | /* Decode post_op_attrs */ | 561 | /* Decode post_op_attrs */ |
| @@ -586,7 +586,7 @@ nfs3_xdr_readdirres(struct rpc_rqst *req, __be32 *p, struct nfs3_readdirres *res | |||
| 586 | pglen = recvd; | 586 | pglen = recvd; |
| 587 | page = rcvbuf->pages; | 587 | page = rcvbuf->pages; |
| 588 | 588 | ||
| 589 | return nr; | 589 | return pglen; |
| 590 | } | 590 | } |
| 591 | 591 | ||
| 592 | __be32 * | 592 | __be32 * |
diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c index 0f24cdf2cb13..6a653ffd8e4e 100644 --- a/fs/nfs/nfs4proc.c +++ b/fs/nfs/nfs4proc.c | |||
| @@ -2852,8 +2852,10 @@ static int _nfs4_proc_readdir(struct dentry *dentry, struct rpc_cred *cred, | |||
| 2852 | nfs4_setup_readdir(cookie, NFS_COOKIEVERF(dir), dentry, &args); | 2852 | nfs4_setup_readdir(cookie, NFS_COOKIEVERF(dir), dentry, &args); |
| 2853 | res.pgbase = args.pgbase; | 2853 | res.pgbase = args.pgbase; |
| 2854 | status = nfs4_call_sync(NFS_SERVER(dir), &msg, &args, &res, 0); | 2854 | status = nfs4_call_sync(NFS_SERVER(dir), &msg, &args, &res, 0); |
| 2855 | if (status == 0) | 2855 | if (status >= 0) { |
| 2856 | memcpy(NFS_COOKIEVERF(dir), res.verifier.data, NFS4_VERIFIER_SIZE); | 2856 | memcpy(NFS_COOKIEVERF(dir), res.verifier.data, NFS4_VERIFIER_SIZE); |
| 2857 | status += args.pgbase; | ||
| 2858 | } | ||
| 2857 | 2859 | ||
| 2858 | nfs_invalidate_atime(dir); | 2860 | nfs_invalidate_atime(dir); |
| 2859 | 2861 | ||
diff --git a/fs/nfs/nfs4xdr.c b/fs/nfs/nfs4xdr.c index f313c4cce7e4..b7a204ff6fe1 100644 --- a/fs/nfs/nfs4xdr.c +++ b/fs/nfs/nfs4xdr.c | |||
| @@ -4518,7 +4518,7 @@ static int decode_readdir(struct xdr_stream *xdr, struct rpc_rqst *req, struct n | |||
| 4518 | xdr_read_pages(xdr, pglen); | 4518 | xdr_read_pages(xdr, pglen); |
| 4519 | 4519 | ||
| 4520 | 4520 | ||
| 4521 | return 0; | 4521 | return pglen; |
| 4522 | } | 4522 | } |
| 4523 | 4523 | ||
| 4524 | static int decode_readlink(struct xdr_stream *xdr, struct rpc_rqst *req) | 4524 | static int decode_readlink(struct xdr_stream *xdr, struct rpc_rqst *req) |
diff --git a/fs/nfs/super.c b/fs/nfs/super.c index 0a42e8f4adcb..9587506d493c 100644 --- a/fs/nfs/super.c +++ b/fs/nfs/super.c | |||
| @@ -67,6 +67,12 @@ | |||
| 67 | 67 | ||
| 68 | #define NFSDBG_FACILITY NFSDBG_VFS | 68 | #define NFSDBG_FACILITY NFSDBG_VFS |
| 69 | 69 | ||
| 70 | #ifdef CONFIG_NFS_V3 | ||
| 71 | #define NFS_DEFAULT_VERSION 3 | ||
| 72 | #else | ||
| 73 | #define NFS_DEFAULT_VERSION 2 | ||
| 74 | #endif | ||
| 75 | |||
| 70 | enum { | 76 | enum { |
| 71 | /* Mount options that take no arguments */ | 77 | /* Mount options that take no arguments */ |
| 72 | Opt_soft, Opt_hard, | 78 | Opt_soft, Opt_hard, |
| @@ -2277,7 +2283,7 @@ static int nfs_get_sb(struct file_system_type *fs_type, | |||
| 2277 | }; | 2283 | }; |
| 2278 | int error = -ENOMEM; | 2284 | int error = -ENOMEM; |
| 2279 | 2285 | ||
| 2280 | data = nfs_alloc_parsed_mount_data(3); | 2286 | data = nfs_alloc_parsed_mount_data(NFS_DEFAULT_VERSION); |
| 2281 | mntfh = nfs_alloc_fhandle(); | 2287 | mntfh = nfs_alloc_fhandle(); |
| 2282 | if (data == NULL || mntfh == NULL) | 2288 | if (data == NULL || mntfh == NULL) |
| 2283 | goto out_free_fh; | 2289 | goto out_free_fh; |
diff --git a/include/linux/lockd/lockd.h b/include/linux/lockd/lockd.h index a34dea46b629..2dee05e5119a 100644 --- a/include/linux/lockd/lockd.h +++ b/include/linux/lockd/lockd.h | |||
| @@ -43,6 +43,7 @@ struct nlm_host { | |||
| 43 | struct sockaddr_storage h_addr; /* peer address */ | 43 | struct sockaddr_storage h_addr; /* peer address */ |
| 44 | size_t h_addrlen; | 44 | size_t h_addrlen; |
| 45 | struct sockaddr_storage h_srcaddr; /* our address (optional) */ | 45 | struct sockaddr_storage h_srcaddr; /* our address (optional) */ |
| 46 | size_t h_srcaddrlen; | ||
| 46 | struct rpc_clnt *h_rpcclnt; /* RPC client to talk to peer */ | 47 | struct rpc_clnt *h_rpcclnt; /* RPC client to talk to peer */ |
| 47 | char *h_name; /* remote hostname */ | 48 | char *h_name; /* remote hostname */ |
| 48 | u32 h_version; /* interface version */ | 49 | u32 h_version; /* interface version */ |
diff --git a/include/linux/nfs_fs.h b/include/linux/nfs_fs.h index bba26684acdc..c66fdb7d6998 100644 --- a/include/linux/nfs_fs.h +++ b/include/linux/nfs_fs.h | |||
| @@ -593,12 +593,6 @@ nfs_fileid_to_ino_t(u64 fileid) | |||
| 593 | return ino; | 593 | return ino; |
| 594 | } | 594 | } |
| 595 | 595 | ||
| 596 | #define nfs_wait_event(clnt, wq, condition) \ | ||
| 597 | ({ \ | ||
| 598 | int __retval = wait_event_killable(wq, condition); \ | ||
| 599 | __retval; \ | ||
| 600 | }) | ||
| 601 | |||
| 602 | #define NFS_JUKEBOX_RETRY_TIME (5 * HZ) | 596 | #define NFS_JUKEBOX_RETRY_TIME (5 * HZ) |
| 603 | 597 | ||
| 604 | #endif /* __KERNEL__ */ | 598 | #endif /* __KERNEL__ */ |
diff --git a/net/sunrpc/stats.c b/net/sunrpc/stats.c index f71a73107ae9..80df89d957ba 100644 --- a/net/sunrpc/stats.c +++ b/net/sunrpc/stats.c | |||
| @@ -115,9 +115,7 @@ EXPORT_SYMBOL_GPL(svc_seq_show); | |||
| 115 | */ | 115 | */ |
| 116 | struct rpc_iostats *rpc_alloc_iostats(struct rpc_clnt *clnt) | 116 | struct rpc_iostats *rpc_alloc_iostats(struct rpc_clnt *clnt) |
| 117 | { | 117 | { |
| 118 | struct rpc_iostats *new; | 118 | return kcalloc(clnt->cl_maxproc, sizeof(struct rpc_iostats), GFP_KERNEL); |
| 119 | new = kcalloc(clnt->cl_maxproc, sizeof(struct rpc_iostats), GFP_KERNEL); | ||
| 120 | return new; | ||
| 121 | } | 119 | } |
| 122 | EXPORT_SYMBOL_GPL(rpc_alloc_iostats); | 120 | EXPORT_SYMBOL_GPL(rpc_alloc_iostats); |
| 123 | 121 | ||
