diff options
Diffstat (limited to 'fs/nfs/dir.c')
-rw-r--r-- | fs/nfs/dir.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/fs/nfs/dir.c b/fs/nfs/dir.c index 1e51ecd61854..b2c8b31b2be7 100644 --- a/fs/nfs/dir.c +++ b/fs/nfs/dir.c | |||
@@ -543,6 +543,9 @@ int nfs_readdir_page_filler(nfs_readdir_descriptor_t *desc, struct nfs_entry *en | |||
543 | if (scratch == NULL) | 543 | if (scratch == NULL) |
544 | return -ENOMEM; | 544 | return -ENOMEM; |
545 | 545 | ||
546 | if (buflen == 0) | ||
547 | goto out_nopages; | ||
548 | |||
546 | xdr_init_decode_pages(&stream, &buf, xdr_pages, buflen); | 549 | xdr_init_decode_pages(&stream, &buf, xdr_pages, buflen); |
547 | xdr_set_scratch_buffer(&stream, page_address(scratch), PAGE_SIZE); | 550 | xdr_set_scratch_buffer(&stream, page_address(scratch), PAGE_SIZE); |
548 | 551 | ||
@@ -564,6 +567,7 @@ int nfs_readdir_page_filler(nfs_readdir_descriptor_t *desc, struct nfs_entry *en | |||
564 | break; | 567 | break; |
565 | } while (!entry->eof); | 568 | } while (!entry->eof); |
566 | 569 | ||
570 | out_nopages: | ||
567 | if (count == 0 || (status == -EBADCOOKIE && entry->eof != 0)) { | 571 | if (count == 0 || (status == -EBADCOOKIE && entry->eof != 0)) { |
568 | array = nfs_readdir_get_array(page); | 572 | array = nfs_readdir_get_array(page); |
569 | if (!IS_ERR(array)) { | 573 | if (!IS_ERR(array)) { |