aboutsummaryrefslogtreecommitdiffstats
path: root/fs/cifs/readdir.c
diff options
context:
space:
mode:
authorJeff Layton <sfrench@us.ibm.com>2008-10-21 10:42:13 -0400
committerSteve French <sfrench@us.ibm.com>2008-10-21 10:42:13 -0400
commita364bc0b37f14ffd66c1f982af42990a9d77fa43 (patch)
tree1e1e039a630b49942ec0e997b084ae8fc2a60fa1 /fs/cifs/readdir.c
parent14121bdccc17b8c0e4368a9c0e4f82c3dd47f240 (diff)
[CIFS] fix saving of resume key before CIFSFindNext
We recently fixed the cifs readdir code so that it saves the resume key before calling CIFSFindNext. Unfortunately, this assumes that we have just done a CIFSFindFirst (or FindNext) and have resume info to save. This isn't necessarily the case. Fix the code to save resume info if we had to reinitiate the search, and after a FindNext. This fixes connectathon basic test6 against NetApp filers. Signed-off-by: Jeff Layton <jlayton@redhat.com> CC: Stable <stable@kernel.org> Signed-off-by: Steve French <sfrench@us.ibm.com>
Diffstat (limited to 'fs/cifs/readdir.c')
-rw-r--r--fs/cifs/readdir.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/cifs/readdir.c b/fs/cifs/readdir.c
index 765adf12d54f..58d57299f2a0 100644
--- a/fs/cifs/readdir.c
+++ b/fs/cifs/readdir.c
@@ -762,14 +762,15 @@ static int find_cifs_entry(const int xid, struct cifsTconInfo *pTcon,
762 rc)); 762 rc));
763 return rc; 763 return rc;
764 } 764 }
765 cifs_save_resume_key(cifsFile->srch_inf.last_entry, cifsFile);
765 } 766 }
766 767
767 while ((index_to_find >= cifsFile->srch_inf.index_of_last_entry) && 768 while ((index_to_find >= cifsFile->srch_inf.index_of_last_entry) &&
768 (rc == 0) && !cifsFile->srch_inf.endOfSearch) { 769 (rc == 0) && !cifsFile->srch_inf.endOfSearch) {
769 cFYI(1, ("calling findnext2")); 770 cFYI(1, ("calling findnext2"));
770 cifs_save_resume_key(cifsFile->srch_inf.last_entry, cifsFile);
771 rc = CIFSFindNext(xid, pTcon, cifsFile->netfid, 771 rc = CIFSFindNext(xid, pTcon, cifsFile->netfid,
772 &cifsFile->srch_inf); 772 &cifsFile->srch_inf);
773 cifs_save_resume_key(cifsFile->srch_inf.last_entry, cifsFile);
773 if (rc) 774 if (rc)
774 return -ENOENT; 775 return -ENOENT;
775 } 776 }