patch for 2.1.118 smbfs

Bill Hawes (whawes@transmeta.com)
Wed, 26 Aug 1998 18:16:39 -0700


This is a multi-part message in MIME format.
--------------37E2AA32BE820A356CD3B04E
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

I found a w95 machine on the network here and confirmed the problem with
w95 directory listings, and have attached a patch to fix things up.

The fix is very simple: just use the old-style getattr, as the trans2
getattr doesn't seem to work with w95. This can be turned on via the
SMB_FIX_OLDATTR runtime flag, but the patch makes this automatic when
the w95 bugfixes are enabled. So compiling with the W95 config option or
using the -f 1xxx runtime flag will enable the workaround.

Other changes in the patch:
-- remove an unnecessary #include <linux/dirent.h> in smb_fs.h

-- change uid_t, etc to the kernel uid_t in smb_mount.h, as has been
suggested several times on the kernel list.

With the above changes I've built the smbmount and smbmnt programs in
Samba 18p7 ( using libc), and
they work OK for me. But I'd appreciate some further testing, especially
from those of the glibc persuasion.

(The smbumount program doesn't build, but I've never needed it anyway --
regular umount works fine. Does anyone know a reason why it shouldn't
just be removed from the package?)

Regards,
Bill

--------------37E2AA32BE820A356CD3B04E
Content-Type: text/plain; charset=us-ascii; name="smbfs_118-patch"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline; filename="smbfs_118-patch"

--- linux-2.1.118/include/linux/smb_fs.h.old Wed Aug 26 13:51:43 1998
+++ linux-2.1.118/include/linux/smb_fs.h Wed Aug 26 15:23:16 1998
@@ -9,7 +9,6 @@
#ifndef _LINUX_SMB_FS_H
#define _LINUX_SMB_FS_H

-#include <linux/dirent.h>
#include <linux/smb.h>

/*
--- linux-2.1.118/include/linux/smb_mount.h.old Wed Aug 26 13:35:52 1998
+++ linux-2.1.118/include/linux/smb_mount.h Wed Aug 26 17:47:05 1998
@@ -15,12 +15,11 @@

struct smb_mount_data {
int version;
- uid_t mounted_uid; /* Who may umount() this filesystem? */
-
- uid_t uid;
- gid_t gid;
- mode_t file_mode;
- mode_t dir_mode;
+ __kernel_uid_t mounted_uid; /* Who may umount() this filesystem? */
+ __kernel_uid_t uid;
+ __kernel_gid_t gid;
+ __kernel_mode_t file_mode;
+ __kernel_mode_t dir_mode;
};

#endif
--- linux-2.1.118/fs/smbfs/proc.c.old Wed Aug 19 21:22:42 1998
+++ linux-2.1.118/fs/smbfs/proc.c Wed Aug 26 17:12:37 1998
@@ -1961,11 +1961,13 @@
smb_init_dirent(server, fattr);

/*
- * Win 95 is painfully slow at returning trans2 getattr info,
- * so we provide the SMB_FIX_OLDATTR option switch.
+ * Select whether to use core or trans2 getattr.
*/
if (server->opt.protocol >= SMB_PROTOCOL_LANMAN2) {
- if (server->mnt->version & SMB_FIX_OLDATTR)
+ /*
+ * Win 95 appears to break with the trans2 getattr.
+ */
+ if (server->mnt->version & (SMB_FIX_OLDATTR|SMB_FIX_WIN95))
goto core_attr;
if (server->mnt->version & SMB_FIX_DIRATTR)
result = smb_proc_getattr_ff(server, dir, fattr);

--------------37E2AA32BE820A356CD3B04E--

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.altern.org/andrebalsa/doc/lkml-faq.html