Skip to content

Commit a364bc0

Browse files
author
Jeff Layton
committed
[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 <[email protected]> CC: Stable <[email protected]> Signed-off-by: Steve French <[email protected]>
1 parent 14121bd commit a364bc0

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

fs/cifs/readdir.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -762,14 +762,15 @@ static int find_cifs_entry(const int xid, struct cifsTconInfo *pTcon,
762762
rc));
763763
return rc;
764764
}
765+
cifs_save_resume_key(cifsFile->srch_inf.last_entry, cifsFile);
765766
}
766767

767768
while ((index_to_find >= cifsFile->srch_inf.index_of_last_entry) &&
768769
(rc == 0) && !cifsFile->srch_inf.endOfSearch) {
769770
cFYI(1, ("calling findnext2"));
770-
cifs_save_resume_key(cifsFile->srch_inf.last_entry, cifsFile);
771771
rc = CIFSFindNext(xid, pTcon, cifsFile->netfid,
772772
&cifsFile->srch_inf);
773+
cifs_save_resume_key(cifsFile->srch_inf.last_entry, cifsFile);
773774
if (rc)
774775
return -ENOENT;
775776
}

0 commit comments

Comments
 (0)