aboutsummaryrefslogtreecommitdiffstats
path: root/fs/cifs
diff options
context:
space:
mode:
authorJeff Layton <jlayton@tupile.poochiereds.net>2009-02-28 12:59:03 -0500
committerSteve French <sfrench@us.ibm.com>2009-03-11 21:36:21 -0400
commitfcc7c09d94be7b75c9ea2beb22d0fae191c6b4b9 (patch)
treecda830aadd2f9cccc5390290ac97b1ca48520bb6 /fs/cifs
parent0382457744969b0a3aa39ba997944903c5972cbc (diff)
cifs: fix buffer format byte on NT Rename/hardlink
Discovered at Connnectathon 2009... The buffer format byte and the pad are transposed in NT_RENAME calls (which are used to set hardlinks). Most servers seem to ignore this fact, but NetApp filers throw back an error due to this problem. This patch fixes it. CC: Stable <stable@kernel.org> Signed-off-by: Jeff Layton <jlayton@redhat.com> Signed-off-by: Steve French <sfrench@us.ibm.com>
Diffstat (limited to 'fs/cifs')
-rw-r--r--fs/cifs/cifssmb.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/fs/cifs/cifssmb.c b/fs/cifs/cifssmb.c
index 4c344fe7a152..bc09c998631f 100644
--- a/fs/cifs/cifssmb.c
+++ b/fs/cifs/cifssmb.c
@@ -2377,8 +2377,10 @@ winCreateHardLinkRetry:
2377 PATH_MAX, nls_codepage, remap); 2377 PATH_MAX, nls_codepage, remap);
2378 name_len++; /* trailing null */ 2378 name_len++; /* trailing null */
2379 name_len *= 2; 2379 name_len *= 2;
2380 pSMB->OldFileName[name_len] = 0; /* pad */ 2380
2381 pSMB->OldFileName[name_len + 1] = 0x04; 2381 /* protocol specifies ASCII buffer format (0x04) for unicode */
2382 pSMB->OldFileName[name_len] = 0x04;
2383 pSMB->OldFileName[name_len + 1] = 0x00; /* pad */
2382 name_len2 = 2384 name_len2 =
2383 cifsConvertToUCS((__le16 *)&pSMB->OldFileName[name_len + 2], 2385 cifsConvertToUCS((__le16 *)&pSMB->OldFileName[name_len + 2],
2384 toName, PATH_MAX, nls_codepage, remap); 2386 toName, PATH_MAX, nls_codepage, remap);