diff options
author | Jeff Layton <jlayton@tupile.poochiereds.net> | 2009-03-26 23:05:21 +0000 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2009-05-02 10:56:35 -0700 |
commit | d5496f8996e53b6a6841c9bf1889d04dbcfc55b3 (patch) | |
tree | 9c0d8155137cd1ca94401d1830fe05893b7789c0 /fs | |
parent | d5e252c5a10b951763b6fcfe3dac447e23222792 (diff) |
cifs: fix buffer format byte on NT Rename/hardlink
upstream commit: fcc7c09d94be7b75c9ea2beb22d0fae191c6b4b9
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.
Signed-off-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: Steve French <sfrench@us.ibm.com>
Signed-off-by: Chris Wright <chrisw@sous-sol.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/cifs/cifssmb.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/fs/cifs/cifssmb.c b/fs/cifs/cifssmb.c index 6d51696dc76..0979c6fcbb2 100644 --- a/fs/cifs/cifssmb.c +++ b/fs/cifs/cifssmb.c @@ -2350,8 +2350,10 @@ winCreateHardLinkRetry: PATH_MAX, nls_codepage, remap); name_len++; /* trailing null */ name_len *= 2; - pSMB->OldFileName[name_len] = 0; /* pad */ - pSMB->OldFileName[name_len + 1] = 0x04; + + /* protocol specifies ASCII buffer format (0x04) for unicode */ + pSMB->OldFileName[name_len] = 0x04; + pSMB->OldFileName[name_len + 1] = 0x00; /* pad */ name_len2 = cifsConvertToUCS((__le16 *)&pSMB->OldFileName[name_len + 2], toName, PATH_MAX, nls_codepage, remap); |