Skip to content

Commit

Permalink
[CIFS] Fix readdir breakage when blocksize set too small
Browse files Browse the repository at this point in the history
Do not treat filldir running out of space as an error that needs
to be returned.

Fixes Redhat bugzilla bug # 211070

Signed-off-by: Steve French <sfrench@us.ibm.com>
  • Loading branch information
Steve French committed Oct 30, 2006
1 parent c1b707d commit 7ca85ba
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions fs/cifs/readdir.c
Original file line number Diff line number Diff line change
Expand Up @@ -896,6 +896,10 @@ static int cifs_filldir(char *pfindEntry, struct file *file,
tmp_inode->i_ino,obj_type);
if(rc) {
cFYI(1,("filldir rc = %d",rc));
/* we can not return filldir errors to the caller
since they are "normal" when the stat blocksize
is too small - we return remapped error instead */
rc = -EOVERFLOW;
}

dput(tmp_dentry);
Expand Down Expand Up @@ -1074,6 +1078,11 @@ int cifs_readdir(struct file *file, void *direntry, filldir_t filldir)
we want to check for that here? */
rc = cifs_filldir(current_entry, file,
filldir, direntry, tmp_buf, max_len);
if(rc == -EOVERFLOW) {
rc = 0;
break;
}

file->f_pos++;
if(file->f_pos ==
cifsFile->srch_inf.index_of_last_entry) {
Expand Down

0 comments on commit 7ca85ba

Please sign in to comment.