Skip to contentSkip to conversation

Two small cifs patches

PATCH New Steve French 1 participant 1 message Aug 14, 2005

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Two small cifs patches

Based on testing at the cifs plugfest last week these were the two most important patches from among those pending in my tree. The rest can wait until after 2.6.12

[PATCH] [CIFS] Fix missing entries in search results when very long file names and more than 50 (or so) of such long search entries in the directory. FindNext could send corrupt last byte of resume name when resume key was a few hundred bytes long file name or longer.

Fixes Samba Bug # 2932

---

 fs/cifs/cifssmb.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

ef6724e32142c2d9ca252d423cacc435c142734e

fs/cifs/cifssmb.c +3 -0
@@ -2628,6 +2628,9 @@ int CIFSFindNext(const int xid, struct c
 	if(name_len < PATH_MAX) {
 		memcpy(pSMB->ResumeFileName, psrch_inf->presume_name, name_len);
 		byte_count += name_len;
+		/* 14 byte parm len above enough for 2 byte null terminator */
+		pSMB->ResumeFileName[name_len] = 0;
+		pSMB->ResumeFileName[name_len+1] = 0;
 	} else {
 		rc = -EINVAL;
 		goto FNext2_err_exit;

[PATCH] [CIFS] Fix path name conversion for long filenames when mapchars mount option was specified at mount time.

---

 fs/cifs/CHANGES |    6 ++++++
 fs/cifs/misc.c  |    1 +
 2 files changed, 7 insertions(+), 0 deletions(-)

f4cfd69cf349dd27e00d5cf804b57aee04e059c2

fs/cifs/CHANGES +6 -0
@@ -1,3 +1,9 @@
+Version 1.35
+------------
+Add writepage performance improvements.  Fix path name conversions
+for long filenames on mounts which were done with "mapchars" mount option
+specified.
+
 Version 1.34
 ------------
 Fix error mapping of the TOO_MANY_LINKS (hardlinks) case.
fs/cifs/misc.c +1 -0
@@ -611,6 +611,7 @@ cifsConvertToUCS(__le16 * target, const 
 		src_char = source[i];
 		switch (src_char) {
 			case 0:
+				target[j] = 0;
 				goto ctoUCS_out;
 			case ':':
 				target[j] = cpu_to_le16(UNI_COLON);