Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7ca85ba7 authored by Steve French's avatar Steve French
Browse files

[CIFS] Fix readdir breakage when blocksize set too small



Do not treat filldir running out of space as an error that needs
to be returned.

Fixes Redhat bugzilla bug # 211070

Signed-off-by: default avatarSteve French <sfrench@us.ibm.com>
parent c1b707d2
Loading
Loading
Loading
Loading
+9 −0
Original line number Original line Diff line number Diff line
@@ -896,6 +896,10 @@ static int cifs_filldir(char *pfindEntry, struct file *file,
		     tmp_inode->i_ino,obj_type);
		     tmp_inode->i_ino,obj_type);
	if(rc) {
	if(rc) {
		cFYI(1,("filldir rc = %d",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);
	dput(tmp_dentry);
@@ -1074,6 +1078,11 @@ int cifs_readdir(struct file *file, void *direntry, filldir_t filldir)
			we want to check for that here? */
			we want to check for that here? */
			rc = cifs_filldir(current_entry, file,
			rc = cifs_filldir(current_entry, file,
					filldir, direntry, tmp_buf, max_len);
					filldir, direntry, tmp_buf, max_len);
			if(rc == -EOVERFLOW) {
				rc = 0;
				break;
			}

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