Commit 6d3ab323 authored by Alexander Viro's avatar Alexander Viro Committed by Linus Torvalds

[PATCH] ncpfs (7/7): misc fixes and cleanups

* remaining endiannes cleanups
* don't mess with setting finfo.i.dataStreamSize when creating the root
  directory inode; that field is ignored when populating in-core directory
  inodes.
* missing cpu_to_le16() in ncp_search_for_fileset() (for big-endian clients
  server sees 0xff7f instead of intended 0x7fff).
Signed-off-by: default avatarAl Viro <viro@parcelfarce.linux.org.uk>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 67a385f2
...@@ -980,7 +980,8 @@ static int ncp_mkdir(struct inode *dir, struct dentry *dentry, int mode) ...@@ -980,7 +980,8 @@ static int ncp_mkdir(struct inode *dir, struct dentry *dentry, int mode)
error = -EACCES; error = -EACCES;
if (ncp_open_create_file_or_subdir(server, dir, __name, if (ncp_open_create_file_or_subdir(server, dir, __name,
OC_MODE_CREATE, aDIR, 0xffff, OC_MODE_CREATE, aDIR,
cpu_to_le16(0xffff),
&finfo) == 0) &finfo) == 0)
{ {
if (ncp_is_nfs_extras(server, finfo.volume)) { if (ncp_is_nfs_extras(server, finfo.volume)) {
......
...@@ -460,7 +460,7 @@ static int ncp_fill_super(struct super_block *sb, void *raw_data, int silent) ...@@ -460,7 +460,7 @@ static int ncp_fill_super(struct super_block *sb, void *raw_data, int silent)
break; break;
default: default:
error = -ECHRNG; error = -ECHRNG;
if (*(__u32*)raw_data == cpu_to_be32(0x76657273)) { if (memcmp(raw_data, "vers", 4) == 0) {
error = ncp_parse_options(&data, raw_data); error = ncp_parse_options(&data, raw_data);
} }
if (error) if (error)
...@@ -623,7 +623,7 @@ static int ncp_fill_super(struct super_block *sb, void *raw_data, int silent) ...@@ -623,7 +623,7 @@ static int ncp_fill_super(struct super_block *sb, void *raw_data, int silent)
memset(&finfo, 0, sizeof(finfo)); memset(&finfo, 0, sizeof(finfo));
finfo.i.attributes = aDIR; finfo.i.attributes = aDIR;
finfo.i.dataStreamSize = NCP_BLOCK_SIZE; finfo.i.dataStreamSize = 0; /* ignored */
finfo.i.dirEntNum = 0; finfo.i.dirEntNum = 0;
finfo.i.DosDirNum = 0; finfo.i.DosDirNum = 0;
#ifdef CONFIG_NCPFS_SMALLDOS #ifdef CONFIG_NCPFS_SMALLDOS
......
...@@ -902,7 +902,7 @@ int ncp_search_for_fileset(struct ncp_server *server, ...@@ -902,7 +902,7 @@ int ncp_search_for_fileset(struct ncp_server *server,
ncp_add_byte(server, 0); /* datastream */ ncp_add_byte(server, 0); /* datastream */
ncp_add_word(server, cpu_to_le16(0x8006)); ncp_add_word(server, cpu_to_le16(0x8006));
ncp_add_dword(server, RIM_ALL); ncp_add_dword(server, RIM_ALL);
ncp_add_word(server, 32767); /* max returned items */ ncp_add_word(server, cpu_to_le16(32767)); /* max returned items */
ncp_add_mem(server, seq, 9); ncp_add_mem(server, seq, 9);
#ifdef CONFIG_NCPFS_NFS_NS #ifdef CONFIG_NCPFS_NFS_NS
if (server->name_space[seq->volNumber] == NW_NS_NFS) { if (server->name_space[seq->volNumber] == NW_NS_NFS) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment