remove smbfs
Subsystems (2)
PATCH 1/1 remove smbfs
I remember that there were some small things missing in CIFS for completely replacing the unmaintained smbfs when we discussed removing smbfs back in 2005 due to smbfs being unmaintained.
CIFS has improved since, smbfs is still unmaintained, and it's becoming time to finally remove smbfs.
---
Documentation/filesystems/00-INDEX | 2 Documentation/filesystems/cifs.txt | 4 Documentation/filesystems/smbfs.txt | 8 fs/Kconfig | 56 fs/Makefile | 1 fs/compat.c | 32 fs/compat_ioctl.c | 24 fs/smbfs/Makefile | 38 fs/smbfs/cache.c | 209 - fs/smbfs/dir.c | 702 ----- fs/smbfs/file.c | 445 --- fs/smbfs/getopt.c | 64 fs/smbfs/getopt.h | 14 fs/smbfs/inode.c | 828 ------ fs/smbfs/ioctl.c | 67 fs/smbfs/proc.c | 3508 ---------------------------- fs/smbfs/proto.h | 87 fs/smbfs/request.c | 818 ------ fs/smbfs/request.h | 70 fs/smbfs/smb_debug.h | 34 fs/smbfs/smbiod.c | 345 -- fs/smbfs/sock.c | 387 --- fs/smbfs/symlink.c | 68 include/linux/Kbuild | 4 include/linux/smb.h | 115 include/linux/smb_fs.h | 158 - include/linux/smb_fs_i.h | 39 include/linux/smb_fs_sb.h | 101 include/linux/smb_mount.h | 65 include/linux/smbno.h | 363 -- 30 files changed, 2 insertions(+), 8654 deletions(-)
f2ce9309065099de922ed4eb5a61b4c045d69856
Documentation/filesystems/00-INDEX +0 -2
@@ -80,8 +80,6 @@ relay.txt - info on relay, for efficient streaming from kernel to user space. romfs.txt - description of the ROMFS filesystem. -smbfs.txt - - info on using filesystems with the SMB protocol (Win 3.11 and NT). spufs.txt - info and mount options for the SPU filesystem used on Cell. sysfs-pci.txt
Documentation/filesystems/cifs.txt +1 -3
@@ -6,9 +6,7 @@ Windows XP) as well by Samba (which provides excellent CIFS server support for Linux and many other operating systems), so this network filesystem client can mount to a wide variety of - servers. The smbfs module should be used instead of this cifs module - for mounting to older SMB servers such as OS/2. The smbfs and cifs - modules can coexist and do not conflict. The CIFS VFS filesystem + servers. The CIFS VFS filesystem module is designed to work well with servers that implement the newer versions (dialects) of the SMB/CIFS protocol such as Samba, the program written by Andrew Tridgell that turns any Unix host
Documentation/filesystems/smbfs.txt deleted +0 -8
@@ -1,8 +0,0 @@ -Smbfs is a filesystem that implements the SMB protocol, which is the -protocol used by Windows for Workgroups, Windows 95 and Windows NT. -Smbfs was inspired by Samba, the program written by Andrew Tridgell -that turns any Unix host into a file server for DOS or Windows clients. - -Smbfs is a SMB client, but uses parts of samba for it's operation. For -more info on samba, including documentation, please go to -http://www.samba.org/ and then on to your nearest mirror.
fs/Kconfig +0 -56
62 lines not on this page · raw message
fs/Makefile +0 -1
@@ -91,7 +91,6 @@ obj-$(CONFIG_NFSD) += nfsd/ obj-$(CONFIG_LOCKD) += lockd/ obj-$(CONFIG_NLS) += nls/ obj-$(CONFIG_SYSV_FS) += sysv/ -obj-$(CONFIG_SMB_FS) += smbfs/ obj-$(CONFIG_CIFS) += cifs/ obj-$(CONFIG_NCP_FS) += ncpfs/ obj-$(CONFIG_HPFS_FS) += hpfs/
fs/compat.c +1 -31
@@ -27,8 +27,6 @@#include <linux/vfs.h> #include <linux/ioctl.h> #include <linux/init.h> -#include <linux/smb.h> -#include <linux/smb_mount.h> #include <linux/ncp_mount.h> #include <linux/nfs4_mount.h> #include <linux/smp_lock.h>
@@ -616,31 +614,6 @@ static void *do_ncp_super_data_conv(void *raw_data)return raw_data; } -struct compat_smb_mount_data { -compat_int_t version; -__compat_uid_t mounted_uid; -__compat_uid_t uid; -__compat_gid_t gid; -compat_mode_t file_mode; -compat_mode_t dir_mode; -}; - -static void *do_smb_super_data_conv (void *raw_data) -{ -struct smb_mount_data *s = raw_data; -struct compat_smb_mount_data *c_s = raw_data; - -if (c_s->version !=SMB_MOUNT_OLDVERSION ) - goto out; - s->dir_mode = c_s->dir_mode; - s->file_mode = c_s->file_mode; - s->gid = c_s->gid; - s->uid = c_s->uid; - s->mounted_uid = c_s->mounted_uid; - out: -return raw_data; -} -struct compat_nfs_string {compat_uint_t len;compat_uptr_t data;
@@ -709,7 +682,6 @@ static int do_nfs4_super_data_conv(void *raw_data)return 0 ; } -#define SMBFS_NAME "smbfs"#define NCPFS_NAME "ncpfs"#define NFS4_NAME "nfs4"
@@ -743,9 +715,7 @@ asmlinkage long compat_sys_mount(char __user * dev_name, char __user * dir_name, retval = -EINVAL ;if (type_page && data_page) { -if (!strcmp ((char *)type_page,SMBFS_NAME )) { -do_smb_super_data_conv ((void *)data_page); - }else if (!strcmp ((char *)type_page,NCPFS_NAME )) { +if (!strcmp ((char *)type_page,NCPFS_NAME )) {do_ncp_super_data_conv ((void *)data_page); }else if (!strcmp ((char *)type_page,NFS4_NAME )) {if (do_nfs4_super_data_conv ((void *) data_page))
fs/compat_ioctl.c +0 -24
@@ -46,7 +46,6 @@#include <linux/videodev.h> #include <linux/netdevice.h> #include <linux/raw.h> -#include <linux/smb_fs.h> #include <linux/blkdev.h> #include <linux/elevator.h> #include <linux/rtc.h>
@@ -1194,24 +1193,6 @@ static int do_unimap_ioctl(unsigned int fd, unsigned int cmd, unsigned long arg,#endif /* CONFIG_VT */ -static int do_smb_getmountuid (unsigned int fd,unsigned int cmd,unsigned long arg) -{ -mm_segment_t old_fs =get_fs (); -__kernel_uid_t kuid; -int err; - - cmd =SMB_IOC_GETMOUNTUID ; - -set_fs (KERNEL_DS ); - err =sys_ioctl (fd, cmd, (unsigned long )&kuid); -set_fs (old_fs); - -if (err >=0 ) - err =put_user (kuid, (compat_uid_t __user *)compat_ptr (arg)); - -return err; -} -struct atmif_sioc32 {compat_int_t number;compat_int_t length;
@@ -2390,8 +2371,6 @@ COMPATIBLE_IOCTL(AUTOFS_IOC_ASKUMOUNT)/* Raw devices */ COMPATIBLE_IOCTL(RAW_SETBIND) COMPATIBLE_IOCTL(RAW_GETBIND) -/* SMB ioctls which do not need any translations */ -COMPATIBLE_IOCTL(SMB_IOC_NEWCONN) /* Little a */ COMPATIBLE_IOCTL(ATMSIGD_CTRL) COMPATIBLE_IOCTL(ATMARPD_CTRL)
@@ -2729,9 +2708,6 @@ HANDLE_IOCTL(PIO_UNIMAP, do_unimap_ioctl) HANDLE_IOCTL(GIO_UNIMAP, do_unimap_ioctl) HANDLE_IOCTL(KDFONTOP, do_kdfontop_ioctl)#endif -/* One SMB ioctl needs translations. */ -#define SMB_IOC_GETMOUNTUID_32 _IOR('u', 1, compat_uid_t) -HANDLE_IOCTL(SMB_IOC_GETMOUNTUID_32, do_smb_getmountuid) HANDLE_IOCTL(ATM_GETLINKRATE32, do_atm_ioctl) HANDLE_IOCTL(ATM_GETNAMES32, do_atm_ioctl)HANDLE_IOCTL (ATM_GETTYPE32 , do_atm_ioctl)
fs/smbfs/Makefile deleted +0 -38
@@ -1,38 +0,0 @@ -# -# Makefile for the linux smb-filesystem routines. -# - -obj-$(CONFIG_SMB_FS) += smbfs.o - -smbfs-objs := proc.o dir.o cache.o sock.o inode.o file.o ioctl.o getopt.o \ - symlink.o smbiod.o request.o - -# If you want debugging output, you may add these flags to the EXTRA_CFLAGS -# SMBFS_PARANOIA should normally be enabled. - -EXTRA_CFLAGS += -DSMBFS_PARANOIA -#EXTRA_CFLAGS += -DSMBFS_DEBUG -#EXTRA_CFLAGS += -DSMBFS_DEBUG_VERBOSE -#EXTRA_CFLAGS += -DDEBUG_SMB_TIMESTAMP -#EXTRA_CFLAGS += -Werror - -# -# Maintainer rules -# - -# getopt.c not included. It is intentionally separate -SRC = proc.c dir.c cache.c sock.c inode.c file.c ioctl.c smbiod.c request.c \ - symlink.c - -proto: - -rm -f proto.h - @echo > proto2.h "/*" - @echo >> proto2.h " * Autogenerated with cproto on: " `date` - @echo >> proto2.h " */" - @echo >> proto2.h "" - @echo >> proto2.h "struct smb_request;" - @echo >> proto2.h "struct sock;" - @echo >> proto2.h "struct statfs;" - @echo >> proto2.h "" - cproto -E "gcc -E" -e -v -I $(TOPDIR)/include -DMAKING_PROTO -D__KERNEL__ $(SRC) >> proto2.h - mv proto2.h proto.h
fs/smbfs/cache.c deleted +0 -209
209 lines not on this page · raw message
fs/smbfs/dir.c deleted +0 -702
702 lines not on this page · raw message
fs/smbfs/file.c deleted +0 -445
445 lines not on this page · raw message
fs/smbfs/getopt.c deleted +0 -64
64 lines not on this page · raw message
fs/smbfs/getopt.h deleted +0 -14
@@ -1,14 +0,0 @@ -#ifndef _LINUX_GETOPT_H -#define _LINUX_GETOPT_H - -struct option { -const char *name; -unsigned long flag; -int val; -}; - -extern int smb_getopt (char *caller,char **options,struct option *opts, -char **optopt,char **optarg,unsigned long *flag, -unsigned long *value); - -#endif /* _LINUX_GETOPT_H */
fs/smbfs/inode.c deleted +0 -828
828 lines not on this page · raw message
fs/smbfs/ioctl.c deleted +0 -67
67 lines not on this page · raw message
fs/smbfs/proc.c deleted +0 -3508
434 lines not on this page · raw message
fs/smbfs/proto.h deleted +0 -87
87 lines not on this page · raw message
fs/smbfs/request.c deleted +0 -818
818 lines not on this page · raw message
fs/smbfs/request.h deleted +0 -70
70 lines not on this page · raw message
fs/smbfs/smbiod.c deleted +0 -345
345 lines not on this page · raw message
fs/smbfs/sock.c deleted +0 -387
387 lines not on this page · raw message
fs/smbfs/symlink.c deleted +0 -68
68 lines not on this page · raw message
include/linux/smb.h deleted +0 -115
115 lines not on this page · raw message
include/linux/smb_fs.h deleted +0 -158
158 lines not on this page · raw message
include/linux/smb_fs_sb.h deleted +0 -101
101 lines not on this page · raw message
include/linux/smb_mount.h deleted +0 -65
65 lines not on this page · raw message
include/linux/smbno.h deleted +0 -363
363 lines not on this page · raw message
The rest of this diff is not shown. View the raw message.
Part of the diff is not shown here. View the raw message.
That is fine with me since CIFS Kerberos support has made progress (although Simo and Jeff are still doing more testing on this before the EXPERIMENTAL config flag on this will go off).
Quoted 3,974 lines · Adrian Bunk
I remember that there were some small things missing in CIFS for completely replacing the unmaintained smbfs when we discussed removing smbfs back in 2005 due to smbfs being unmaintained.
CIFS has improved since, smbfs is still unmaintained, and it's becoming time to finally remove smbfs.
Signed-off-by Adrian Bunk <[email protected]>---
Documentation/filesystems/00-INDEX | 2 Documentation/filesystems/cifs.txt | 4 Documentation/filesystems/smbfs.txt | 8 fs/Kconfig | 56 fs/Makefile | 1 fs/compat.c | 32 fs/compat_ioctl.c | 24 fs/smbfs/Makefile | 38 fs/smbfs/cache.c | 209 - fs/smbfs/dir.c | 702 ----- fs/smbfs/file.c | 445 --- fs/smbfs/getopt.c | 64 fs/smbfs/getopt.h | 14 fs/smbfs/inode.c | 828 ------ fs/smbfs/ioctl.c | 67 fs/smbfs/proc.c | 3508 ---------------------------- fs/smbfs/proto.h | 87 fs/smbfs/request.c | 818 ------ fs/smbfs/request.h | 70 fs/smbfs/smb_debug.h | 34 fs/smbfs/smbiod.c | 345 -- fs/smbfs/sock.c | 387 --- fs/smbfs/symlink.c | 68 include/linux/Kbuild | 4 include/linux/smb.h | 115 include/linux/smb_fs.h | 158 - include/linux/smb_fs_i.h | 39 include/linux/smb_fs_sb.h | 101 include/linux/smb_mount.h | 65 include/linux/smbno.h | 363 -- 30 files changed, 2 insertions(+), 8654 deletions(-)
f2ce9309065099de922ed4eb5a61b4c045d69856Documentation/filesystems/00-INDEX +0
-2@@ -80,8 +80,6 @@ relay.txt - info on relay, for efficient streaming from kernel to user space. romfs.txt - description of the ROMFS filesystem. -smbfs.txt - - info on using filesystems with the SMB protocol (Win 3.11 and NT). spufs.txt - info and mount options for the SPU filesystem used on Cell. sysfs-pci.txtDocumentation/filesystems/cifs.txt +1
-3@@ -6,9 +6,7 @@ Windows XP) as well by Samba (which provides excellent CIFS server support for Linux and many other operating systems), so this network filesystem client can mount to a wide variety of - servers. The smbfs module should be used instead of this cifs module - for mounting to older SMB servers such as OS/2. The smbfs and cifs - modules can coexist and do not conflict. The CIFS VFS filesystem + servers. The CIFS VFS filesystem module is designed to work well with servers that implement the newer versions (dialects) of the SMB/CIFS protocol such as Samba, the program written by Andrew Tridgell that turns any Unix hostDocumentation/filesystems/smbfs.txt deleted +0
-8@@ -1,8 +0,0 @@ -Smbfs is a filesystem that implements the SMB protocol, which is the -protocol used by Windows for Workgroups, Windows 95 and Windows NT. -Smbfs was inspired by Samba, the program written by Andrew Tridgell -that turns any Unix host into a file server for DOS or Windows clients. - -Smbfs is a SMB client, but uses parts of samba for it's operation. For -more info on samba, including documentation, please go to -http://www.samba.org/ and then on to your nearest mirror.fs/Kconfig +0
-56@@ -1837,62 +1837,6 @@ config RPCSEC_GSS_SPKM3 If unsure, say N. -config SMB_FS - tristate "SMB file system support (to mount Windows shares etc.)" - depends on INET - select NLS - help - SMB (Server Message Block) is the protocol Windows for Workgroups - (WfW), Windows 95/98, Windows NT and OS/2 Lan Manager use to share - files and printers over local networks. Saying Y here allows you to - mount their file systems (often called "shares" in this context) and - access them just like any other Unix directory. Currently, this - works only if the Windows machines use TCP/IP as the underlying - transport protocol, and not NetBEUI. For details, read - <file:Documentation/filesystems/smbfs.txt> and the SMB-HOWTO, - available from <http://www.tldp.org/docs.html#howto>. - - Note: if you just want your box to act as an SMB *server* and make - files and printing services available to Windows clients (which need - to have a TCP/IP stack), you don't need to say Y here; you can use - the program SAMBA (available from <ftp://ftp.samba.org/pub/samba/>) - for that. - - General information about how to connect Linux, Windows machines and - Macs is on the WWW at <http://www.eats.com/linux_mac_win.html>. - - To compile the SMB support as a module, choose M here: the module will - be called smbfs. Most people say N, however. - -config SMB_NLS_DEFAULT - bool "Use a default NLS" - depends on SMB_FS - help - Enabling this will make smbfs use nls translations by default. You - need to specify the local charset (CONFIG_NLS_DEFAULT) in the nls - settings and you need to give the default nls for the SMB server as - CONFIG_SMB_NLS_REMOTE. - - The nls settings can be changed at mount time, if your smbmount - supports that, using the codepage and iocharset parameters. - - smbmount from samba 2.2.0 or later supports this. - -config SMB_NLS_REMOTE - string "Default Remote NLS Option" - depends on SMB_NLS_DEFAULT - default "cp437" - help - This setting allows you to specify a default value for which - codepage the server uses. If this field is left blank no - translations will be done by default. The local codepage/charset - default to CONFIG_NLS_DEFAULT. - - The nls settings can be changed at mount time, if your smbmount - supports that, using the codepage and iocharset parameters. - - smbmount from samba 2.2.0 or later supports this. - config CIFS tristate "CIFS support (advanced network filesystem for Samba, Window and other CIFS compliant servers)" depends on INETfs/Makefile +0
-1@@ -91,7 +91,6 @@ obj-$(CONFIG_NFSD) += nfsd/ obj-$(CONFIG_LOCKD) += lockd/ obj-$(CONFIG_NLS) += nls/ obj-$(CONFIG_SYSV_FS) += sysv/ -obj-$(CONFIG_SMB_FS) += smbfs/ obj-$(CONFIG_CIFS) += cifs/ obj-$(CONFIG_NCP_FS) += ncpfs/ obj-$(CONFIG_HPFS_FS) += hpfs/fs/compat.c +1
-31@@ -27,8 +27,6 @@#include <linux/vfs.h> #include <linux/ioctl.h> #include <linux/init.h> -#include <linux/smb.h> -#include <linux/smb_mount.h> #include <linux/ncp_mount.h> #include <linux/nfs4_mount.h> #include <linux/smp_lock.h> @@ -616,31 +614,6 @@ static void *do_ncp_super_data_conv(void *raw_data)return raw_data; } -struct compat_smb_mount_data { -compat_int_t version; -__compat_uid_t mounted_uid; -__compat_uid_t uid; -__compat_gid_t gid; -compat_mode_t file_mode; -compat_mode_t dir_mode; -}; - -static void *do_smb_super_data_conv (void *raw_data) -{ -struct smb_mount_data *s = raw_data; -struct compat_smb_mount_data *c_s = raw_data; - -if (c_s->version !=SMB_MOUNT_OLDVERSION ) - goto out; - s->dir_mode = c_s->dir_mode; - s->file_mode = c_s->file_mode; - s->gid = c_s->gid; - s->uid = c_s->uid; - s->mounted_uid = c_s->mounted_uid; - out: -return raw_data; -} -struct compat_nfs_string {compat_uint_t len;compat_uptr_t data;@@ -709,7 +682,6 @@ static int do_nfs4_super_data_conv(void *raw_data)return 0 ; } -#define SMBFS_NAME "smbfs"#define NCPFS_NAME "ncpfs"#define NFS4_NAME "nfs4"@@ -743,9 +715,7 @@ asmlinkage long compat_sys_mount(char __user * dev_name, char __user * dir_name, retval = -EINVAL ;if (type_page && data_page) { -if (!strcmp ((char *)type_page,SMBFS_NAME )) { -do_smb_super_data_conv ((void *)data_page); - }else if (!strcmp ((char *)type_page,NCPFS_NAME )) { +if (!strcmp ((char *)type_page,NCPFS_NAME )) {do_ncp_super_data_conv ((void *)data_page); }else if (!strcmp ((char *)type_page,NFS4_NAME )) {if (do_nfs4_super_data_conv ((void *) data_page))fs/compat_ioctl.c +0
-24@@ -46,7 +46,6 @@#include <linux/videodev.h> #include <linux/netdevice.h> #include <linux/raw.h> -#include <linux/smb_fs.h> #include <linux/blkdev.h> #include <linux/elevator.h> #include <linux/rtc.h> @@ -1194,24 +1193,6 @@ static int do_unimap_ioctl(unsigned int fd, unsigned int cmd, unsigned long arg,#endif /* CONFIG_VT */ -static int do_smb_getmountuid (unsigned int fd,unsigned int cmd,unsigned long arg) -{ -mm_segment_t old_fs =get_fs (); -__kernel_uid_t kuid; -int err; - - cmd =SMB_IOC_GETMOUNTUID ; - -set_fs (KERNEL_DS ); - err =sys_ioctl (fd, cmd, (unsigned long )&kuid); -set_fs (old_fs); - -if (err >=0 ) - err =put_user (kuid, (compat_uid_t __user *)compat_ptr (arg)); - -return err; -} -struct atmif_sioc32 {compat_int_t number;compat_int_t length;@@ -2390,8 +2371,6 @@ COMPATIBLE_IOCTL(AUTOFS_IOC_ASKUMOUNT)/* Raw devices */ COMPATIBLE_IOCTL(RAW_SETBIND) COMPATIBLE_IOCTL(RAW_GETBIND) -/* SMB ioctls which do not need any translations */ -COMPATIBLE_IOCTL(SMB_IOC_NEWCONN) /* Little a */ COMPATIBLE_IOCTL(ATMSIGD_CTRL) COMPATIBLE_IOCTL(ATMARPD_CTRL)@@ -2729,9 +2708,6 @@ HANDLE_IOCTL(PIO_UNIMAP, do_unimap_ioctl) HANDLE_IOCTL(GIO_UNIMAP, do_unimap_ioctl) HANDLE_IOCTL(KDFONTOP, do_kdfontop_ioctl)#endif -/* One SMB ioctl needs translations. */ -#define SMB_IOC_GETMOUNTUID_32 _IOR('u', 1, compat_uid_t) -HANDLE_IOCTL(SMB_IOC_GETMOUNTUID_32, do_smb_getmountuid) HANDLE_IOCTL(ATM_GETLINKRATE32, do_atm_ioctl) HANDLE_IOCTL(ATM_GETNAMES32, do_atm_ioctl)HANDLE_IOCTL (ATM_GETTYPE32 , do_atm_ioctl)fs/smbfs/Makefile deleted +0
-38@@ -1,38 +0,0 @@ -# -# Makefile for the linux smb-filesystem routines. -# - -obj-$(CONFIG_SMB_FS) += smbfs.o - -smbfs-objs := proc.o dir.o cache.o sock.o inode.o file.o ioctl.o getopt.o \ - symlink.o smbiod.o request.o - -# If you want debugging output, you may add these flags to the EXTRA_CFLAGS -# SMBFS_PARANOIA should normally be enabled. - -EXTRA_CFLAGS += -DSMBFS_PARANOIA -#EXTRA_CFLAGS += -DSMBFS_DEBUG -#EXTRA_CFLAGS += -DSMBFS_DEBUG_VERBOSE -#EXTRA_CFLAGS += -DDEBUG_SMB_TIMESTAMP -#EXTRA_CFLAGS += -Werror - -# -# Maintainer rules -# - -# getopt.c not included. It is intentionally separate -SRC = proc.c dir.c cache.c sock.c inode.c file.c ioctl.c smbiod.c request.c \ - symlink.c - -proto: - -rm -f proto.h - @echo > proto2.h "/*" - @echo >> proto2.h " * Autogenerated with cproto on: " `date` - @echo >> proto2.h " */" - @echo >> proto2.h "" - @echo >> proto2.h "struct smb_request;" - @echo >> proto2.h "struct sock;" - @echo >> proto2.h "struct statfs;" - @echo >> proto2.h "" - cproto -E "gcc -E" -e -v -I $(TOPDIR)/include -DMAKING_PROTO -D__KERNEL__ $(SRC) >> proto2.h - mv proto2.h proto.hfs/smbfs/cache.c deleted +0
-209@@ -1,209 +0,0 @@ -/* -* cache.c -* -* Copyright (C) 1997 by Bill Hawes -* -* Routines to support directory cacheing using the page cache. -* This cache code is almost directly taken from ncpfs. -* -* Please add a note about your changes to smbfs in the ChangeLog file. -*/ - -#include <linux/time.h> -#include <linux/errno.h> -#include <linux/kernel.h> -#include <linux/mm.h> -#include <linux/dirent.h> -#include <linux/smb_fs.h> -#include <linux/pagemap.h> -#include <linux/net.h> - -#include <asm/page.h> - -#include "smb_debug.h" -#include "proto.h" - -/* -* Force the next attempt to use the cache to be a timeout. -* If we can't find the page that's fine, it will cause a refresh. -*/ -void -smb_invalid_dir_cache (struct inode * dir) -{ -struct smb_sb_info *server =server_from_inode (dir); -union smb_dir_cache *cache =NULL ; -struct page *page =NULL ; - - page =grab_cache_page (&dir->i_data,0 ); -if (!page) - goto out; - -if (!PageUptodate (page)) - goto out_unlock; - - cache =kmap (page); - cache->head.time = jiffies -SMB_MAX_AGE (server); - -kunmap (page); -SetPageUptodate (page); -out_unlock: -unlock_page (page); -page_cache_release (page); -out: -return ; -} - -/* -* Mark all dentries for 'parent' as invalid, forcing them to be re-read -*/ -void -smb_invalidate_dircache_entries (struct dentry *parent) -{ -struct smb_sb_info *server =server_from_dentry (parent); -struct list_head *next; -struct dentry *dentry; - -spin_lock (&dcache_lock); - next = parent->d_subdirs.next; -while (next != &parent->d_subdirs) { - dentry = list_entry(next, struct dentry, d_u.d_child); - dentry->d_fsdata =NULL ; -smb_age_dentry (server, dentry); - next = next->next; - } -spin_unlock (&dcache_lock); -} - -/* -* dget, but require that fpos and parent matches what the dentry contains. -* dentry is not known to be a valid pointer at entry. -*/ -struct dentry * -smb_dget_fpos (struct dentry *dentry,struct dentry *parent,unsigned long fpos) -{ -struct dentry *dent = dentry; -struct list_head *next; - -if (d_validate (dent, parent)) { -if (dent->d_name.len <=SMB_MAXNAMELEN && - (unsigned long )dent->d_fsdata == fpos) { -if (!dent->d_inode) { -dput (dent); - dent =NULL ; - } -return dent; - } -dput (dent); - } - -/* If a pointer is invalid, we search the dentry. */ -spin_lock (&dcache_lock); - next = parent->d_subdirs.next; -while (next != &parent->d_subdirs) { - dent = list_entry(next, struct dentry, d_u.d_child); -if ((unsigned long )dent->d_fsdata == fpos) { -if (dent->d_inode) -dget_locked (dent); -else - dent =NULL ; - goto out_unlock; - } - next = next->next; - } - dent =NULL ; -out_unlock: -spin_unlock (&dcache_lock); -return dent; -} - - -/* -* Create dentry/inode for this file and add it to the dircache. -*/ -int -smb_fill_cache (struct file *filp,void *dirent,filldir_t filldir, -struct smb_cache_control *ctrl,struct qstr *qname, -struct smb_fattr *entry) -{ -struct dentry *newdent, *dentry = filp->f_path.dentry; -struct inode *newino, *inode = dentry->d_inode; -struct smb_cache_control ctl = *ctrl; -int valid =0 ; -int hashed =0 ; -ino_t ino =0 ; - - qname->hash =full_name_hash (qname->name, qname->len); - -if (dentry->d_op && dentry->d_op->d_hash) -if (dentry->d_op->d_hash (dentry, qname) !=0 ) - goto end_advance; - - newdent =d_lookup (dentry, qname); - -if (!newdent) { - newdent =d_alloc (dentry, qname); -if (!newdent) - goto end_advance; - }else { - hashed =1 ; -memcpy ((char *) newdent->d_name.name, qname->name, - newdent->d_name.len); - } - -if (!newdent->d_inode) { -smb_renew_times (newdent); - entry->f_ino =iunique (inode->i_sb,2 ); - newino =smb_iget (inode->i_sb, entry); -if (newino) { -smb_new_dentry (newdent); -d_instantiate (newdent, newino); -if (!hashed) -d_rehash (newdent); - } - }else -smb_set_inode_attr (newdent->d_inode, entry); - -if (newdent->d_inode) { - ino = newdent->d_inode->i_ino; - newdent->d_fsdata = (void *) ctl.fpos; -smb_new_dentry (newdent); - } - -if (ctl.idx >=SMB_DIRCACHE_SIZE ) { -if (ctl.page) { -kunmap (ctl.page); -SetPageUptodate (ctl.page); -unlock_page (ctl.page); -page_cache_release (ctl.page); - } - ctl.cache =NULL ; - ctl.idx -=SMB_DIRCACHE_SIZE ; - ctl.ofs +=1 ; - ctl.page =grab_cache_page (&inode->i_data, ctl.ofs); -if (ctl.page) - ctl.cache =kmap (ctl.page); - } -if (ctl.cache) { - ctl.cache->dentry[ctl.idx] = newdent; - valid =1 ; - } -dput (newdent); - -end_advance: -if (!valid) - ctl.valid =0 ; -if (!ctl.filled && (ctl.fpos == filp->f_pos)) { -if (!ino) - ino =find_inode_number (dentry, qname); -if (!ino) - ino =iunique (inode->i_sb,2 ); - ctl.filled =filldir (dirent, qname->name, qname->len, - filp->f_pos, ino,DT_UNKNOWN ); -if (!ctl.filled) - filp->f_pos +=1 ; - } - ctl.fpos +=1 ; - ctl.idx +=1 ; - *ctrl = ctl; -return (ctl.valid || !ctl.filled); -}fs/smbfs/dir.c deleted +0
-702@@ -1,702 +0,0 @@ -/* -* dir.c -* -* Copyright (C) 1995, 1996 by Paal-Kr. Engstad and Volker Lendecke -* Copyright (C) 1997 by Volker Lendecke -* -* Please add a note about your changes to smbfs in the ChangeLog file. -*/ - -#include <linux/time.h> -#include <linux/errno.h> -#include <linux/kernel.h> -#include <linux/smp_lock.h> -#include <linux/ctype.h> -#include <linux/net.h> -#include <linux/sched.h> - -#include <linux/smb_fs.h> -#include <linux/smb_mount.h> -#include <linux/smbno.h> - -#include "smb_debug.h" -#include "proto.h" - -static int smb_readdir (struct file *,void *,filldir_t ); -static int smb_dir_open (struct inode *,struct file *); - -static struct dentry *smb_lookup (struct inode *,struct dentry *,struct nameidata *); -static int smb_create (struct inode *,struct dentry *,int ,struct nameidata *); -static int smb_mkdir (struct inode *,struct dentry *,int ); -static int smb_rmdir (struct inode *,struct dentry *); -static int smb_unlink (struct inode *,struct dentry *); -static int smb_rename (struct inode *,struct dentry *, -struct inode *,struct dentry *); -static int smb_make_node (struct inode *,struct dentry *,int ,dev_t ); -static int smb_link (struct dentry *,struct inode *,struct dentry *); - -const struct file_operations smb_dir_operations = -{ - .read = generic_read_dir, - .readdir = smb_readdir, - .ioctl = smb_ioctl, - .open = smb_dir_open, -}; - -const struct inode_operations smb_dir_inode_operations = -{ - .create = smb_create, - .lookup = smb_lookup, - .unlink = smb_unlink, - .mkdir = smb_mkdir, - .rmdir = smb_rmdir, - .rename = smb_rename, - .getattr = smb_getattr, - .setattr = smb_notify_change, -}; - -const struct inode_operations smb_dir_inode_operations_unix = -{ - .create = smb_create, - .lookup = smb_lookup, - .unlink = smb_unlink, - .mkdir = smb_mkdir, - .rmdir = smb_rmdir, - .rename = smb_rename, - .getattr = smb_getattr, - .setattr = smb_notify_change, - .symlink = smb_symlink, - .mknod = smb_make_node, - .link = smb_link, -}; - -/* -* Read a directory, using filldir to fill the dirent memory. -* smb_proc_readdir does the actual reading from the smb server. -* -* The cache code is almost directly taken from ncpfs -*/ -static int -smb_readdir (struct file *filp,void *dirent,filldir_t filldir) -{ -struct dentry *dentry = filp->f_path.dentry; -struct inode *dir = dentry->d_inode; -struct smb_sb_info *server =server_from_dentry (dentry); -union smb_dir_cache *cache =NULL ; -struct smb_cache_control ctl; -struct page *page =NULL ; -int result; - - ctl.page =NULL ; - ctl.cache =NULL ; - -VERBOSE ("reading %s/%s, f_pos=%d\n" , -DENTRY_PATH (dentry), (int ) filp->f_pos); - - result =0 ; - -lock_kernel (); - -switch ((unsigned int ) filp->f_pos) { -case 0 : -if (filldir (dirent,"." ,1 ,0 , dir->i_ino,DT_DIR ) <0 ) - goto out; - filp->f_pos =1 ; -/* fallthrough */ -case 1 : -if (filldir (dirent,".." ,2 ,1 ,parent_ino (dentry),DT_DIR ) <0 ) - goto out; - filp->f_pos =2 ; - } - -/* -* Make sure our inode is up-to-date. -*/ - result =smb_revalidate_inode (dentry); -if (result) - goto out; - - - page =grab_cache_page (&dir->i_data,0 ); -if (!page) - goto read_really; - - ctl.cache = cache =kmap (page); - ctl.head = cache->head; - -if (!PageUptodate (page) || !ctl.head.eof) { -VERBOSE ("%s/%s, page uptodate=%d, eof=%d\n" , -DENTRY_PATH (dentry),PageUptodate (page),ctl.head.eof); - goto init_cache; - } - -if (filp->f_pos ==2 ) { -if (jiffies - ctl.head.time >=SMB_MAX_AGE (server)) - goto init_cache; - -/* -* N.B. ncpfs checks mtime of dentry too here, we don't. -* 1. common smb servers do not update mtime on dir changes -* 2. it requires an extra smb request -* (revalidate has the same timeout as ctl.head.time) -* -* Instead smbfs invalidates its own cache on local changes -* and remote changes are not seen until timeout. -*/ - } - -if (filp->f_pos > ctl.head.end) - goto finished; - - ctl.fpos = filp->f_pos + (SMB_DIRCACHE_START -2 ); - ctl.ofs = ctl.fpos /SMB_DIRCACHE_SIZE ; - ctl.idx = ctl.fpos %SMB_DIRCACHE_SIZE ; - -for (;;) { -if (ctl.ofs !=0 ) { - ctl.page =find_lock_page (&dir->i_data, ctl.ofs); -if (!ctl.page) - goto invalid_cache; - ctl.cache =kmap (ctl.page); -if (!PageUptodate (ctl.page)) - goto invalid_cache; - } -while (ctl.idx <SMB_DIRCACHE_SIZE ) { -struct dentry *dent; -int res; - - dent =smb_dget_fpos (ctl.cache->dentry[ctl.idx], - dentry, filp->f_pos); -if (!dent) - goto invalid_cache; - - res =filldir (dirent, dent->d_name.name, - dent->d_name.len, filp->f_pos, - dent->d_inode->i_ino,DT_UNKNOWN ); -dput (dent); -if (res) - goto finished; - filp->f_pos +=1 ; - ctl.idx +=1 ; -if (filp->f_pos > ctl.head.end) - goto finished; - } -if (ctl.page) { -kunmap (ctl.page); -SetPageUptodate (ctl.page); -unlock_page (ctl.page); -page_cache_release (ctl.page); - ctl.page =NULL ; - } - ctl.idx =0 ; - ctl.ofs +=1 ; - } -invalid_cache: -if (ctl.page) { -kunmap (ctl.page); -unlock_page (ctl.page); -page_cache_release (ctl.page); - ctl.page =NULL ; - } - ctl.cache = cache; -init_cache: -smb_invalidate_dircache_entries (dentry); - ctl.head.time = jiffies; - ctl.head.eof =0 ; - ctl.fpos =2 ; - ctl.ofs =0 ; - ctl.idx =SMB_DIRCACHE_START ; - ctl.filled =0 ; - ctl.valid =1 ; -read_really: - result = server->ops->readdir (filp, dirent, filldir, &ctl); -if (result == -ERESTARTSYS && page) -ClearPageUptodate (page); -if (ctl.idx ==-1 ) - goto invalid_cache;/* retry */ - ctl.head.end = ctl.fpos -1 ; - ctl.head.eof = ctl.valid; -finished: -if (page) { - cache->head = ctl.head; -kunmap (page); -if (result != -ERESTARTSYS ) -SetPageUptodate (page); -unlock_page (page); -page_cache_release (page); - } -if (ctl.page) { -kunmap (ctl.page); -SetPageUptodate (ctl.page); -unlock_page (ctl.page); -page_cache_release (ctl.page); - } -out: -unlock_kernel (); -return result; -} - -static int -smb_dir_open (struct inode *dir,struct file *file) -{ -struct dentry *dentry = file->f_path.dentry; -struct smb_sb_info *server; -int error =0 ; - -VERBOSE ("(%s/%s)\n" , dentry->d_parent->d_name.name, - file->f_path.dentry->d_name.name); - -/* -* Directory timestamps in the core protocol aren't updated -* when a file is added, so we give them a very short TTL. -*/ -lock_kernel (); - server =server_from_dentry (dentry); -if (server->opt.protocol <SMB_PROTOCOL_LANMAN2 ) { -unsigned long age = jiffies -SMB_I (dir)->oldmtime; -if (age >2 *HZ ) -smb_invalid_dir_cache (dir); - } - -/* -* Note: in order to allow the smbmount process to open the -* mount point, we only revalidate if the connection is valid or -* if the process is trying to access something other than the root. -*/ -if (server->state ==CONN_VALID || !IS_ROOT (dentry)) - error =smb_revalidate_inode (dentry); -unlock_kernel (); -return error; -} - -/* -* Dentry operations routines -*/ -static int smb_lookup_validate (struct dentry *,struct nameidata *); -static int smb_hash_dentry (struct dentry *,struct qstr *); -static int smb_compare_dentry (struct dentry *,struct qstr *,struct qstr *); -static int smb_delete_dentry (struct dentry *); - -static struct dentry_operations smbfs_dentry_operations = -{ - .d_revalidate = smb_lookup_validate, - .d_hash = smb_hash_dentry, - .d_compare = smb_compare_dentry, - .d_delete = smb_delete_dentry, -}; - -static struct dentry_operations smbfs_dentry_operations_case = -{ - .d_revalidate = smb_lookup_validate, - .d_delete = smb_delete_dentry, -}; - - -/* -* This is the callback when the dcache has a lookup hit. -*/ -static int -smb_lookup_validate (struct dentry * dentry,struct nameidata *nd) -{ -struct smb_sb_info *server =server_from_dentry (dentry); -struct inode * inode = dentry->d_inode; -unsigned long age = jiffies - dentry->d_time; -int valid; - -/* -* The default validation is based on dentry age: -* we believe in dentries for a few seconds. (But each -* successful server lookup renews the timestamp.) -*/ - valid = (age <=SMB_MAX_AGE (server)); -#ifdef SMBFS_DEBUG_VERBOSE -if (!valid) -VERBOSE ("%s/%s not valid, age=%lu\n" , -DENTRY_PATH (dentry), age); -#endif - -if (inode) { -lock_kernel (); -if (is_bad_inode (inode)) { -PARANOIA ("%s/%s has dud inode\n" ,DENTRY_PATH (dentry)); - valid =0 ; - }else if (!valid) - valid = (smb_revalidate_inode (dentry) ==0 ); -unlock_kernel (); - }else { -/* -* What should we do for negative dentries? -*/ - } -return valid; -} - -static int -smb_hash_dentry (struct dentry *dir,struct qstr *this) -{ -unsigned long hash; -int i; - - hash =init_name_hash (); -for (i=0 ; i < this->len ; i++) - hash =partial_name_hash (tolower (this->name[i]), hash); - this->hash =end_name_hash (hash); - -return 0 ; -} - -static int -smb_compare_dentry (struct dentry *dir,struct qstr *a,struct qstr *b) -{ -int i, result =1 ; - -if (a->len != b->len) - goto out; -for (i=0 ; i < a->len; i++) { -if (tolower (a->name[i]) !=tolower (b->name[i])) - goto out; - } - result =0 ; -out: -return result; -} - -/* -* This is the callback from dput() when d_count is going to 0. -* We use this to unhash dentries with bad inodes. -*/ -static int -smb_delete_dentry (struct dentry * dentry) -{ -if (dentry->d_inode) { -if (is_bad_inode (dentry->d_inode)) { -PARANOIA ("bad inode, unhashing %s/%s\n" , -DENTRY_PATH (dentry)); -return 1 ; - } - }else { -/* N.B. Unhash negative dentries? */ - } -return 0 ; -} - -/* -* Initialize a new dentry -*/ -void -smb_new_dentry (struct dentry *dentry) -{ -struct smb_sb_info *server =server_from_dentry (dentry); - -if (server->mnt->flags &SMB_MOUNT_CASE ) - dentry->d_op = &smbfs_dentry_operations_case; -else - dentry->d_op = &smbfs_dentry_operations; - dentry->d_time = jiffies; -} - - -/* -* Whenever a lookup succeeds, we know the parent directories -* are all valid, so we want to update the dentry timestamps. -* N.B. Move this to dcache? -*/ -void -smb_renew_times (struct dentry * dentry) -{ -dget (dentry); -spin_lock (&dentry->d_lock); -for (;;) { -struct dentry *parent; - - dentry->d_time = jiffies; -if (IS_ROOT (dentry)) -break ; - parent = dentry->d_parent; -dget (parent); -spin_unlock (&dentry->d_lock); -dput (dentry); - dentry = parent; -spin_lock (&dentry->d_lock); - } -spin_unlock (&dentry->d_lock); -dput (dentry); -} - -static struct dentry * -smb_lookup (struct inode *dir,struct dentry *dentry,struct nameidata *nd) -{ -struct smb_fattr finfo; -struct inode *inode; -int error; -struct smb_sb_info *server; - - error = -ENAMETOOLONG ; -if (dentry->d_name.len >SMB_MAXNAMELEN ) - goto out; - -/* Do not allow lookup of names with backslashes in */ - error = -EINVAL ; -if (memchr (dentry->d_name.name,'\\' , dentry->d_name.len)) - goto out; - -lock_kernel (); - error =smb_proc_getattr (dentry, &finfo); -#ifdef SMBFS_PARANOIA -if (error && error != -ENOENT ) -PARANOIA ("find %s/%s failed, error=%d\n" , -DENTRY_PATH (dentry), error); -#endif - - inode =NULL ; -if (error == -ENOENT ) - goto add_entry; -if (!error) { - error = -EACCES ; - finfo.f_ino =iunique (dentry->d_sb,2 ); - inode =smb_iget (dir->i_sb, &finfo); -if (inode) { - add_entry: - server =server_from_dentry (dentry); -if (server->mnt->flags &SMB_MOUNT_CASE ) - dentry->d_op = &smbfs_dentry_operations_case; -else - dentry->d_op = &smbfs_dentry_operations; - -d_add (dentry, inode); -smb_renew_times (dentry); - error =0 ; - } - } -unlock_kernel (); -out: -return ERR_PTR (error); -} - -/* -* This code is common to all routines creating a new inode. -*/ -static int -smb_instantiate (struct dentry *dentry,__u16 fileid,int have_id) -{ -struct smb_sb_info *server =server_from_dentry (dentry); -struct inode *inode; -int error; -struct smb_fattr fattr; - -VERBOSE ("file %s/%s, fileid=%u\n" ,DENTRY_PATH (dentry), fileid); - - error =smb_proc_getattr (dentry, &fattr); -if (error) - goto out_close; - -smb_renew_times (dentry); - fattr.f_ino =iunique (dentry->d_sb,2 ); - inode =smb_iget (dentry->d_sb, &fattr); -if (!inode) - goto out_no_inode; - -if (have_id) { -struct smb_inode_info *ei =SMB_I (inode); - ei->fileid = fileid; - ei->access =SMB_O_RDWR ; - ei->open = server->generation; - } -d_instantiate (dentry, inode); -out: -return error; - -out_no_inode: - error = -EACCES ; -out_close: -if (have_id) { -PARANOIA ("%s/%s failed, error=%d, closing %u\n" , -DENTRY_PATH (dentry), error, fileid); -smb_close_fileid (dentry, fileid); - } - goto out; -} - -/* N.B. How should the mode argument be used? */ -static int -smb_create (struct inode *dir,struct dentry *dentry,int mode, -struct nameidata *nd) -{ -struct smb_sb_info *server =server_from_dentry (dentry); -__u16 fileid; -int error; -struct iattr attr; - -VERBOSE ("creating %s/%s, mode=%d\n" ,DENTRY_PATH (dentry), mode); - -lock_kernel (); -smb_invalid_dir_cache (dir); - error =smb_proc_create (dentry,0 ,get_seconds (), &fileid); -if (!error) { -if (server->opt.capabilities &SMB_CAP_UNIX ) { -/* Set attributes for new file */ - attr.ia_valid =ATTR_MODE ; - attr.ia_mode = mode; - error =smb_proc_setattr_unix (dentry, &attr,0 ,0 ); - } - error =smb_instantiate (dentry, fileid,1 ); - }else { -PARANOIA ("%s/%s failed, error=%d\n" , -DENTRY_PATH (dentry), error); - } -unlock_kernel (); -return error; -} - -/* N.B. How should the mode argument be used? */ -static int -smb_mkdir (struct inode *dir,struct dentry *dentry,int mode) -{ -struct smb_sb_info *server =server_from_dentry (dentry); -int error; -struct iattr attr; - -lock_kernel (); -smb_invalid_dir_cache (dir); - error =smb_proc_mkdir (dentry); -if (!error) { -if (server->opt.capabilities &SMB_CAP_UNIX ) { -/* Set attributes for new directory */ - attr.ia_valid =ATTR_MODE ; - attr.ia_mode = mode; - error =smb_proc_setattr_unix (dentry, &attr,0 ,0 ); - } - error =smb_instantiate (dentry,0 ,0 ); - } -unlock_kernel (); -return error; -} - -static int -smb_rmdir (struct inode *dir,struct dentry *dentry) -{ -struct inode *inode = dentry->d_inode; -int error; - -/* -* Close the directory if it's open. -*/ -lock_kernel (); -smb_close (inode); - -/* -* Check that nobody else is using the directory.. -*/ - error = -EBUSY ; -if (!d_unhashed (dentry)) - goto out; - -smb_invalid_dir_cache (dir); - error =smb_proc_rmdir (dentry); - -out: -unlock_kernel (); -return error; -} - -static int -smb_unlink (struct inode *dir,struct dentry *dentry) -{ -int error; - -/* -* Close the file if it's open. -*/ -lock_kernel (); -smb_close (dentry->d_inode); - -smb_invalid_dir_cache (dir); - error =smb_proc_unlink (dentry); -if (!error) -smb_renew_times (dentry); -unlock_kernel (); -return error; -} - -static int -smb_rename (struct inode *old_dir,struct dentry *old_dentry, -struct inode *new_dir,struct dentry *new_dentry) -{ -int error; - -/* -* Close any open files, and check whether to delete the -* target before attempting the rename. -*/ -lock_kernel (); -if (old_dentry->d_inode) -smb_close (old_dentry->d_inode); -if (new_dentry->d_inode) { -smb_close (new_dentry->d_inode); - error =smb_proc_unlink (new_dentry); -if (error) { -VERBOSE ("unlink %s/%s, error=%d\n" , -DENTRY_PATH (new_dentry), error); - goto out; - } -/* FIXME */ -d_delete (new_dentry); - } - -smb_invalid_dir_cache (old_dir); -smb_invalid_dir_cache (new_dir); - error =smb_proc_mv (old_dentry, new_dentry); -if (!error) { -smb_renew_times (old_dentry); -smb_renew_times (new_dentry); - } -out: -unlock_kernel (); -return error; -} - -/* -* FIXME: samba servers won't let you create device nodes unless uid/gid -* matches the connection credentials (and we don't know which those are ...) -*/ -static int -smb_make_node (struct inode *dir,struct dentry *dentry,int mode,dev_t dev) -{ -int error; -struct iattr attr; - - attr.ia_valid =ATTR_MODE |ATTR_UID |ATTR_GID ; - attr.ia_mode = mode; - attr.ia_uid = current->euid; - attr.ia_gid = current->egid; - -if (!new_valid_dev (dev)) -return -EINVAL ; - -smb_invalid_dir_cache (dir); - error =smb_proc_setattr_unix (dentry, &attr,MAJOR (dev),MINOR (dev)); -if (!error) { - error =smb_instantiate (dentry,0 ,0 ); - } -return error; -} - -/* -* dentry = existing file -* new_dentry = new file -*/ -static int -smb_link (struct dentry *dentry,struct inode *dir,struct dentry *new_dentry) -{ -int error; - -DEBUG1 ("smb_link old=%s/%s new=%s/%s\n" , -DENTRY_PATH (dentry),DENTRY_PATH (new_dentry)); -smb_invalid_dir_cache (dir); - error =smb_proc_link (server_from_dentry (dentry), dentry, new_dentry); -if (!error) { -smb_renew_times (dentry); - error =smb_instantiate (new_dentry,0 ,0 ); - } -return error; -}fs/smbfs/file.c deleted +0
-445@@ -1,445 +0,0 @@ -/* -* file.c -* -* Copyright (C) 1995, 1996, 1997 by Paal-Kr. Engstad and Volker Lendecke -* Copyright (C) 1997 by Volker Lendecke -* -* Please add a note about your changes to smbfs in the ChangeLog file. -*/ - -#include <linux/time.h> -#include <linux/kernel.h> -#include <linux/errno.h> -#include <linux/fcntl.h> -#include <linux/stat.h> -#include <linux/mm.h> -#include <linux/slab.h> -#include <linux/pagemap.h> -#include <linux/smp_lock.h> -#include <linux/net.h> -#include <linux/aio.h> - -#include <asm/uaccess.h> -#include <asm/system.h> - -#include <linux/smbno.h> -#include <linux/smb_fs.h> - -#include "smb_debug.h" -#include "proto.h" - -static int -smb_fsync (struct file *file,struct dentry * dentry,int datasync) -{ -struct smb_sb_info *server =server_from_dentry (dentry); -int result; - -VERBOSE ("sync file %s/%s\n" ,DENTRY_PATH (dentry)); - -/* -* The VFS will writepage() all dirty pages for us, but we -* should send a SMBflush to the server, letting it know that -* we want things synchronized with actual storage. -* -* Note: this function requires all pages to have been written already -* (should be ok with writepage_sync) -*/ - result =smb_proc_flush (server,SMB_I (dentry->d_inode)->fileid); -return result; -} - -/* -* Read a page synchronously. -*/ -static int -smb_readpage_sync (struct dentry *dentry,struct page *page) -{ -char *buffer =kmap (page); -loff_t offset = (loff_t )page->index <<PAGE_CACHE_SHIFT ; -struct smb_sb_info *server =server_from_dentry (dentry); -unsigned int rsize =smb_get_rsize (server); -int count =PAGE_SIZE ; -int result; - -VERBOSE ("file %s/%s, count=%d@%Ld, rsize=%d\n" , -DENTRY_PATH (dentry), count, offset, rsize); - - result =smb_open (dentry,SMB_O_RDONLY ); -if (result <0 ) - goto io_error; - -do { -if (count < rsize) - rsize = count; - - result = server->ops->read (dentry->d_inode,offset,rsize,buffer); -if (result <0 ) - goto io_error; - - count -= result; - offset += result; - buffer += result; - dentry->d_inode->i_atime = -current_fs_time (dentry->d_inode->i_sb); -if (result < rsize) -break ; - }while (count); - -memset (buffer,0 , count); -flush_dcache_page (page); -SetPageUptodate (page); - result =0 ; - -io_error: -kunmap (page); -unlock_page (page); -return result; -} - -/* -* We are called with the page locked and we unlock it when done. -*/ -static int -smb_readpage (struct file *file,struct page *page) -{ -int error; -struct dentry *dentry = file->f_path.dentry; - -page_cache_get (page); - error =smb_readpage_sync (dentry, page); -page_cache_release (page); -return error; -} - -/* -* Write a page synchronously. -* Offset is the data offset within the page. -*/ -static int -smb_writepage_sync (struct inode *inode,struct page *page, -unsigned long pageoffset,unsigned int count) -{ -loff_t offset; -char *buffer =kmap (page) + pageoffset; -struct smb_sb_info *server =server_from_inode (inode); -unsigned int wsize =smb_get_wsize (server); -int ret =0 ; - - offset = ((loff_t )page->index <<PAGE_CACHE_SHIFT ) + pageoffset; -VERBOSE ("file ino=%ld, fileid=%d, count=%d@%Ld, wsize=%d\n" , - inode->i_ino,SMB_I (inode)->fileid, count, offset, wsize); - -do { -int write_ret; - -if (count < wsize) - wsize = count; - - write_ret = server->ops->write (inode, offset, wsize, buffer); -if (write_ret <0 ) { -PARANOIA ("failed write, wsize=%d, write_ret=%d\n" , - wsize, write_ret); - ret = write_ret; -break ; - } -/* N.B. what if result < wsize?? */ -#ifdef SMBFS_PARANOIA -if (write_ret < wsize) -PARANOIA ("short write, wsize=%d, write_ret=%d\n" , - wsize, write_ret); -#endif - buffer += wsize; - offset += wsize; - count -= wsize; -/* -* Update the inode now rather than waiting for a refresh. -*/ - inode->i_mtime = inode->i_atime =current_fs_time (inode->i_sb); -SMB_I (inode)->flags |=SMB_F_LOCALWRITE ; -if (offset > inode->i_size) - inode->i_size = offset; - }while (count); - -kunmap (page); -return ret; -} - -/* -* Write a page to the server. This will be used for NFS swapping only -* (for now), and we currently do this synchronously only. -* -* We are called with the page locked and we unlock it when done. -*/ -static int -smb_writepage (struct page *page,struct writeback_control *wbc) -{ -struct address_space *mapping = page->mapping; -struct inode *inode; -unsigned long end_index; -unsigned offset =PAGE_CACHE_SIZE ; -int err; - -BUG_ON (!mapping); - inode = mapping->host; -BUG_ON (!inode); - - end_index = inode->i_size >>PAGE_CACHE_SHIFT ; - -/* easy case */ -if (page->index < end_index) - goto do_it; -/* things got complicated... */ - offset = inode->i_size & (PAGE_CACHE_SIZE -1 ); -/* OK, are we completely out? */ -if (page->index >= end_index+1 || !offset) -return 0 ;/* truncated - don't care */ -do_it: -page_cache_get (page); - err =smb_writepage_sync (inode, page,0 , offset); -SetPageUptodate (page); -unlock_page (page); -page_cache_release (page); -return err; -} - -static int -smb_updatepage (struct file *file,struct page *page,unsigned long offset, -unsigned int count) -{ -struct dentry *dentry = file->f_path.dentry; - -DEBUG1 ("(%s/%s %d@%lld)\n" ,DENTRY_PATH (dentry), count, - ((unsigned long long )page->index <<PAGE_CACHE_SHIFT ) + offset); - -return smb_writepage_sync (dentry->d_inode, page, offset, count); -} - -static ssize_t -smb_file_aio_read (struct kiocb *iocb,const struct iovec *iov, -unsigned long nr_segs,loff_t pos) -{ -struct file * file = iocb->ki_filp; -struct dentry * dentry = file->f_path.dentry; -ssize_t status; - -VERBOSE ("file %s/%s, count=%lu@%lu\n" ,DENTRY_PATH (dentry), - (unsigned long ) iocb->ki_left, (unsigned long ) pos); - - status =smb_revalidate_inode (dentry); -if (status) { -PARANOIA ("%s/%s validation failed, error=%Zd\n" , -DENTRY_PATH (dentry), status); - goto out; - } - -VERBOSE ("before read, size=%ld, flags=%x, atime=%ld\n" , - (long )dentry->d_inode->i_size, - dentry->d_inode->i_flags, dentry->d_inode->i_atime.tv_sec); - - status =generic_file_aio_read (iocb, iov, nr_segs, pos); -out: -return status; -} - -static int -smb_file_mmap (struct file * file,struct vm_area_struct * vma) -{ -struct dentry * dentry = file->f_path.dentry; -int status; - -VERBOSE ("file %s/%s, address %lu - %lu\n" , -DENTRY_PATH (dentry), vma->vm_start, vma->vm_end); - - status =smb_revalidate_inode (dentry); -if (status) { -PARANOIA ("%s/%s validation failed, error=%d\n" , -DENTRY_PATH (dentry), status); - goto out; - } - status =generic_file_mmap (file, vma); -out: -return status; -} - -static ssize_t -smb_file_splice_read (struct file *file,loff_t *ppos, -struct pipe_inode_info *pipe,size_t count, -unsigned int flags) -{ -struct dentry *dentry = file->f_path.dentry; -ssize_t status; - -VERBOSE ("file %s/%s, pos=%Ld, count=%lu\n" , -DENTRY_PATH (dentry), *ppos, count); - - status =smb_revalidate_inode (dentry); -if (status) { -PARANOIA ("%s/%s validation failed, error=%Zd\n" , -DENTRY_PATH (dentry), status); - goto out; - } - status =generic_file_splice_read (file, ppos, pipe, count, flags); -out: -return status; -} - -/* -* This does the "real" work of the write. The generic routine has -* allocated the page, locked it, done all the page alignment stuff -* calculations etc. Now we should just copy the data from user -* space and write it back to the real medium.. -* -* If the writer ends up delaying the write, the writer needs to -* increment the page use counts until he is done with the page. -*/ -static int smb_write_begin (struct file *file,struct address_space *mapping, -loff_t pos,unsigned len,unsigned flags, -struct page **pagep,void **fsdata) -{ -pgoff_t index = pos >>PAGE_CACHE_SHIFT ; - *pagep =__grab_cache_page (mapping, index); -if (!*pagep) -return -ENOMEM ; -return 0 ; -} - -static int smb_write_end (struct file *file,struct address_space *mapping, -loff_t pos,unsigned len,unsigned copied, -struct page *page,void *fsdata) -{ -int status; -unsigned offset = pos & (PAGE_CACHE_SIZE -1 ); - -lock_kernel (); - status =smb_updatepage (file, page, offset, copied); -unlock_kernel (); - -if (!status) { -if (!PageUptodate (page) && copied ==PAGE_CACHE_SIZE ) -SetPageUptodate (page); - status = copied; - } - -unlock_page (page); -page_cache_release (page); - -return status; -} - -const struct address_space_operations smb_file_aops = { - .readpage = smb_readpage, - .writepage = smb_writepage, - .write_begin = smb_write_begin, - .write_end = smb_write_end, -}; - -/* -* Write to a file (through the page cache). -*/ -static ssize_t -smb_file_aio_write (struct kiocb *iocb,const struct iovec *iov, -unsigned long nr_segs,loff_t pos) -{ -struct file * file = iocb->ki_filp; -struct dentry * dentry = file->f_path.dentry; -ssize_t result; - -VERBOSE ("file %s/%s, count=%lu@%lu\n" , -DENTRY_PATH (dentry), - (unsigned long ) iocb->ki_left, (unsigned long ) pos); - - result =smb_revalidate_inode (dentry); -if (result) { -PARANOIA ("%s/%s validation failed, error=%Zd\n" , -DENTRY_PATH (dentry), result); - goto out; - } - - result =smb_open (dentry,SMB_O_WRONLY ); -if (result) - goto out; - -if (iocb->ki_left >0 ) { - result =generic_file_aio_write (iocb, iov, nr_segs, pos); -VERBOSE ("pos=%ld, size=%ld, mtime=%ld, atime=%ld\n" , - (long ) file->f_pos, (long ) dentry->d_inode->i_size, - dentry->d_inode->i_mtime.tv_sec, - dentry->d_inode->i_atime.tv_sec); - } -out: -return result; -} - -static int -smb_file_open (struct inode *inode,struct file * file) -{ -int result; -struct dentry *dentry = file->f_path.dentry; -int smb_mode = (file->f_mode &O_ACCMODE ) -1 ; - -lock_kernel (); - result =smb_open (dentry, smb_mode); -if (result) - goto out; -SMB_I (inode)->openers++; -out: -unlock_kernel (); -return result; -} - -static int -smb_file_release (struct inode *inode,struct file * file) -{ -lock_kernel (); -if (!--SMB_I (inode)->openers) { -/* We must flush any dirty pages now as we won't be able to -write anything after close. mmap can trigger this. -"openers" should perhaps include mmap'ers ... */ -filemap_write_and_wait (inode->i_mapping); -smb_close (inode); - } -unlock_kernel (); -return 0 ; -} - -/* -* Check whether the required access is compatible with -* an inode's permission. SMB doesn't recognize superuser -* privileges, so we need our own check for this. -*/ -static int -smb_file_permission (struct inode *inode,int mask,struct nameidata *nd) -{ -int mode = inode->i_mode; -int error =0 ; - -VERBOSE ("mode=%x, mask=%x\n" , mode, mask); - -/* Look at user permissions */ - mode >>=6 ; -if ((mode &7 & mask) != mask) - error = -EACCES ; -return error; -} - -const struct file_operations smb_file_operations = -{ - .llseek = remote_llseek, - .read = do_sync_read, - .aio_read = smb_file_aio_read, - .write = do_sync_write, - .aio_write = smb_file_aio_write, - .ioctl = smb_ioctl, - .mmap = smb_file_mmap, - .open = smb_file_open, - .release = smb_file_release, - .fsync = smb_fsync, - .splice_read = smb_file_splice_read, -}; - -const struct inode_operations smb_file_inode_operations = -{ - .permission = smb_file_permission, - .getattr = smb_getattr, - .setattr = smb_notify_change, -};fs/smbfs/getopt.c deleted +0
-64@@ -1,64 +0,0 @@ -/* -* getopt.c -*/ - -#include <linux/kernel.h> -#include <linux/string.h> -#include <linux/net.h> - -#include "getopt.h" - -/** -* smb_getopt - option parser -* @caller: name of the caller, for error messages -* @options: the options string -* @opts: an array of &struct option entries controlling parser operations -* @optopt: output; will contain the current option -* @optarg: output; will contain the value (if one exists) -* @flag: output; may be NULL; should point to a long for or'ing flags -* @value: output; may be NULL; will be overwritten with the integer value -* of the current argument. -* -* Helper to parse options on the format used by mount ("a=b,c=d,e,f"). -* Returns opts->val if a matching entry in the 'opts' array is found, -* 0 when no more tokens are found, -1 if an error is encountered. -*/ -int smb_getopt (char *caller,char **options,struct option *opts, -char **optopt,char **optarg,unsigned long *flag, -unsigned long *value) -{ -char *token; -char *val; -int i; - -do { -if ((token =strsep (options,"," )) ==NULL ) -return 0 ; - }while (*token =='\0' ); - *optopt = token; - - *optarg =NULL ; -if ((val =strchr (token,'=' )) !=NULL ) { - *val++ =0 ; -if (value) - *value =simple_strtoul (val,NULL ,0 ); - *optarg = val; - } - -for (i =0 ; opts[i].name !=NULL ; i++) { -if (!strcmp (opts[i].name, token)) { -if (!opts[i].flag && (!val || !*val)) { -printk ("%s: the %s option requires an argument\n" , - caller, token); -return -1 ; - } - -if (flag && opts[i].flag) - *flag |= opts[i].flag; - -return opts[i].val; - } - } -printk ("%s: Unrecognized mount option %s\n" , caller, token); -return -1 ; -}fs/smbfs/getopt.h deleted +0
-14@@ -1,14 +0,0 @@ -#ifndef _LINUX_GETOPT_H -#define _LINUX_GETOPT_H - -struct option { -const char *name; -unsigned long flag; -int val; -}; - -extern int smb_getopt (char *caller,char **options,struct option *opts, -char **optopt,char **optarg,unsigned long *flag, -unsigned long *value); - -#endif /* _LINUX_GETOPT_H */ fs/smbfs/inode.c deleted +0
-828@@ -1,828 +0,0 @@ -/* -* inode.c -* -* Copyright (C) 1995, 1996 by Paal-Kr. Engstad and Volker Lendecke -* Copyright (C) 1997 by Volker Lendecke -* -* Please add a note about your changes to smbfs in the ChangeLog file. -*/ - -#include <linux/module.h> -#include <linux/time.h> -#include <linux/kernel.h> -#include <linux/mm.h> -#include <linux/string.h> -#include <linux/stat.h> -#include <linux/errno.h> -#include <linux/slab.h> -#include <linux/init.h> -#include <linux/file.h> -#include <linux/dcache.h> -#include <linux/smp_lock.h> -#include <linux/nls.h> -#include <linux/seq_file.h> -#include <linux/mount.h> -#include <linux/net.h> -#include <linux/vfs.h> -#include <linux/highuid.h> -#include <linux/sched.h> -#include <linux/smb_fs.h> -#include <linux/smbno.h> -#include <linux/smb_mount.h> - -#include <asm/system.h> -#include <asm/uaccess.h> - -#include "smb_debug.h" -#include "getopt.h" -#include "proto.h" - -/* Always pick a default string */ -#ifdef CONFIG_SMB_NLS_REMOTE -#define SMB_NLS_REMOTE CONFIG_SMB_NLS_REMOTE -#else -#define SMB_NLS_REMOTE "" -#endif - -#define SMB_TTL_DEFAULT 1000 - -static void smb_delete_inode (struct inode *); -static void smb_put_super (struct super_block *); -static int smb_statfs (struct dentry *,struct kstatfs *); -static int smb_show_options (struct seq_file *,struct vfsmount *); - -static struct kmem_cache *smb_inode_cachep; - -static struct inode *smb_alloc_inode (struct super_block *sb) -{ -struct smb_inode_info *ei; - ei = (struct smb_inode_info *)kmem_cache_alloc (smb_inode_cachep,GFP_KERNEL ); -if (!ei) -return NULL ; -return &ei->vfs_inode; -} - -static void smb_destroy_inode (struct inode *inode) -{ -kmem_cache_free (smb_inode_cachep,SMB_I (inode)); -} - -static void init_once (struct kmem_cache *cachep,void *foo) -{ -struct smb_inode_info *ei = (struct smb_inode_info *) foo; - -inode_init_once (&ei->vfs_inode); -} - -static int init_inodecache (void ) -{ - smb_inode_cachep =kmem_cache_create ("smb_inode_cache" , -sizeof (struct smb_inode_info ), -0 , (SLAB_RECLAIM_ACCOUNT | -SLAB_MEM_SPREAD ), - init_once); -if (smb_inode_cachep ==NULL ) -return -ENOMEM ; -return 0 ; -} - -static void destroy_inodecache (void ) -{ -kmem_cache_destroy (smb_inode_cachep); -} - -static int smb_remount (struct super_block *sb,int *flags,char *data) -{ - *flags |=MS_NODIRATIME ; -return 0 ; -} - -static const struct super_operations smb_sops = -{ - .alloc_inode = smb_alloc_inode, - .destroy_inode = smb_destroy_inode, - .drop_inode = generic_delete_inode, - .delete_inode = smb_delete_inode, - .put_super = smb_put_super, - .statfs = smb_statfs, - .show_options = smb_show_options, - .remount_fs = smb_remount, -}; - - -/* We are always generating a new inode here */ -struct inode * -smb_iget (struct super_block *sb,struct smb_fattr *fattr) -{ -struct smb_sb_info *server =SMB_SB (sb); -struct inode *result; - -DEBUG1 ("smb_iget: %p\n" , fattr); - - result =new_inode (sb); -if (!result) -return result; - result->i_ino = fattr->f_ino; -SMB_I (result)->open =0 ; -SMB_I (result)->fileid =0 ; -SMB_I (result)->access =0 ; -SMB_I (result)->flags =0 ; -SMB_I (result)->closed =0 ; -SMB_I (result)->openers =0 ; -smb_set_inode_attr (result, fattr); -if (S_ISREG (result->i_mode)) { - result->i_op = &smb_file_inode_operations; - result->i_fop = &smb_file_operations; - result->i_data.a_ops = &smb_file_aops; - }else if (S_ISDIR (result->i_mode)) { -if (server->opt.capabilities &SMB_CAP_UNIX ) - result->i_op = &smb_dir_inode_operations_unix; -else - result->i_op = &smb_dir_inode_operations; - result->i_fop = &smb_dir_operations; - }else if (S_ISLNK (result->i_mode)) { - result->i_op = &smb_link_inode_operations; - }else { -init_special_inode (result, result->i_mode, fattr->f_rdev); - } -insert_inode_hash (result); -return result; -} - -/* -* Copy the inode data to a smb_fattr structure. -*/ -void -smb_get_inode_attr (struct inode *inode,struct smb_fattr *fattr) -{ -memset (fattr,0 ,sizeof (struct smb_fattr )); - fattr->f_mode = inode->i_mode; - fattr->f_nlink = inode->i_nlink; - fattr->f_ino = inode->i_ino; - fattr->f_uid = inode->i_uid; - fattr->f_gid = inode->i_gid; - fattr->f_size = inode->i_size; - fattr->f_mtime = inode->i_mtime; - fattr->f_ctime = inode->i_ctime; - fattr->f_atime = inode->i_atime; - fattr->f_blocks = inode->i_blocks; - - fattr->attr =SMB_I (inode)->attr; -/* -* Keep the attributes in sync with the inode permissions. -*/ -if (fattr->f_mode &S_IWUSR ) - fattr->attr &= ~aRONLY; -else - fattr->attr |= aRONLY; -} - -/* -* Update the inode, possibly causing it to invalidate its pages if mtime/size -* is different from last time. -*/ -void -smb_set_inode_attr (struct inode *inode,struct smb_fattr *fattr) -{ -struct smb_inode_info *ei =SMB_I (inode); - -/* -* A size change should have a different mtime, or same mtime -* but different size. -*/ -time_t last_time = inode->i_mtime.tv_sec; -loff_t last_sz = inode->i_size; - - inode->i_mode = fattr->f_mode; - inode->i_nlink = fattr->f_nlink; - inode->i_uid = fattr->f_uid; - inode->i_gid = fattr->f_gid; - inode->i_ctime = fattr->f_ctime; - inode->i_blocks = fattr->f_blocks; - inode->i_size = fattr->f_size; - inode->i_mtime = fattr->f_mtime; - inode->i_atime = fattr->f_atime; - ei->attr = fattr->attr; - -/* -* Update the "last time refreshed" field for revalidation. -*/ - ei->oldmtime = jiffies; - -if (inode->i_mtime.tv_sec != last_time || inode->i_size != last_sz) { -VERBOSE ("%ld changed, old=%ld, new=%ld, oz=%ld, nz=%ld\n" , - inode->i_ino, - (long ) last_time, (long ) inode->i_mtime.tv_sec, - (long ) last_sz, (long ) inode->i_size); - -if (!S_ISDIR (inode->i_mode)) -invalidate_remote_inode (inode); - } -} - -/* -* This is called if the connection has gone bad ... -* try to kill off all the current inodes. -*/ -void -smb_invalidate_inodes (struct smb_sb_info *server) -{ -VERBOSE ("\n" ); -shrink_dcache_sb (SB_of (server)); -invalidate_inodes (SB_of (server)); -} - -/* -* This is called to update the inode attributes after -* we've made changes to a file or directory. -*/ -static int -smb_refresh_inode (struct dentry *dentry) -{ -struct inode *inode = dentry->d_inode; -int error; -struct smb_fattr fattr; - - error =smb_proc_getattr (dentry, &fattr); -if (!error) { -smb_renew_times (dentry); -/* -* Check whether the type part of the mode changed, -* and don't update the attributes if it did. -* -* And don't dick with the root inode -*/ -if (inode->i_ino ==2 ) -return error; -if (S_ISLNK (inode->i_mode)) -return error;/* VFS will deal with it */ - -if ((inode->i_mode &S_IFMT ) == (fattr.f_mode &S_IFMT )) { -smb_set_inode_attr (inode, &fattr); - }else { -/* -* Big trouble! The inode has become a new object, -* so any operations attempted on it are invalid. -* -* To limit damage, mark the inode as bad so that -* subsequent lookup validations will fail. -*/ -PARANOIA ("%s/%s changed mode, %07o to %07o\n" , -DENTRY_PATH (dentry), - inode->i_mode, fattr.f_mode); - - fattr.f_mode = inode->i_mode;/* save mode */ -make_bad_inode (inode); - inode->i_mode = fattr.f_mode;/* restore mode */ -/* -* No need to worry about unhashing the dentry: the -* lookup validation will see that the inode is bad. -* But we do want to invalidate the caches ... -*/ -if (!S_ISDIR (inode->i_mode)) -invalidate_remote_inode (inode); -else -smb_invalid_dir_cache (inode); - error = -EIO ; - } - } -return error; -} - -/* -* This is called when we want to check whether the inode -* has changed on the server. If it has changed, we must -* invalidate our local caches. -*/ -int -smb_revalidate_inode (struct dentry *dentry) -{ -struct smb_sb_info *s =server_from_dentry (dentry); -struct inode *inode = dentry->d_inode; -int error =0 ; - -DEBUG1 ("smb_revalidate_inode\n" ); -lock_kernel (); - -/* -* Check whether we've recently refreshed the inode. -*/ -if (time_before (jiffies,SMB_I (inode)->oldmtime +SMB_MAX_AGE (s))) { -VERBOSE ("up-to-date, ino=%ld, jiffies=%lu, oldtime=%lu\n" , - inode->i_ino, jiffies,SMB_I (inode)->oldmtime); - goto out; - } - - error =smb_refresh_inode (dentry); -out: -unlock_kernel (); -return error; -} - -/* -* This routine is called when i_nlink == 0 and i_count goes to 0. -* All blocking cleanup operations need to go here to avoid races. -*/ -static void -smb_delete_inode (struct inode *ino) -{ -DEBUG1 ("ino=%ld\n" , ino->i_ino); -truncate_inode_pages (&ino->i_data,0 ); -lock_kernel (); -if (smb_close (ino)) -PARANOIA ("could not close inode %ld\n" , ino->i_ino); -unlock_kernel (); -clear_inode (ino); -} - -static struct option opts[] = { - {"version" ,0 ,'v' }, - {"win95" ,SMB_MOUNT_WIN95 ,1 }, - {"oldattr" ,SMB_MOUNT_OLDATTR ,1 }, - {"dirattr" ,SMB_MOUNT_DIRATTR ,1 }, - {"case" ,SMB_MOUNT_CASE ,1 }, - {"uid" ,0 ,'u' }, - {"gid" ,0 ,'g' }, - {"file_mode" ,0 ,'f' }, - {"dir_mode" ,0 ,'d' }, - {"iocharset" ,0 ,'i' }, - {"codepage" ,0 ,'c' }, - {"ttl" ,0 ,'t' }, - {NULL ,0 ,0 } -}; - -static int -parse_options (struct smb_mount_data_kernel *mnt,char *options) -{ -int c; -unsigned long flags; -unsigned long value; -char *optarg; -char *optopt; - - flags =0 ; -while ( (c =smb_getopt ("smbfs" , &options, opts, - &optopt, &optarg, &flags, &value)) >0 ) { - -VERBOSE ("'%s' -> '%s'\n" , optopt, optarg ? optarg :"<none>" ); -switch (c) { -case 1 : -/* got a "flag" option */ -break ; -case 'v' : -if (value !=SMB_MOUNT_VERSION ) { -printk ("smbfs: Bad mount version %ld, expected %d\n" , - value,SMB_MOUNT_VERSION ); -return 0 ; - } - mnt->version = value; -break ; -case 'u' : - mnt->uid = value; - flags |=SMB_MOUNT_UID ; -break ; -case 'g' : - mnt->gid = value; - flags |=SMB_MOUNT_GID ; -break ; -case 'f' : - mnt->file_mode = (value &S_IRWXUGO ) |S_IFREG ; - flags |=SMB_MOUNT_FMODE ; -break ; -case 'd' : - mnt->dir_mode = (value &S_IRWXUGO ) |S_IFDIR ; - flags |=SMB_MOUNT_DMODE ; -break ; -case 'i' : -strlcpy (mnt->codepage.local_name, optarg, -SMB_NLS_MAXNAMELEN ); -break ; -case 'c' : -strlcpy (mnt->codepage.remote_name, optarg, -SMB_NLS_MAXNAMELEN ); -break ; -case 't' : - mnt->ttl = value; -break ; -default : -printk ("smbfs: Unrecognized mount option %s\n" , - optopt); -return -1 ; - } - } - mnt->flags = flags; -return c; -} - -/* -* smb_show_options() is for displaying mount options in /proc/mounts. -* It tries to avoid showing settings that were not changed from their -* defaults. -*/ -static int -smb_show_options (struct seq_file *s,struct vfsmount *m) -{ -struct smb_mount_data_kernel *mnt =SMB_SB (m->mnt_sb)->mnt; -int i; - -for (i =0 ; opts[i].name !=NULL ; i++) -if (mnt->flags & opts[i].flag) -seq_printf (s,",%s" , opts[i].name); - -if (mnt->flags &SMB_MOUNT_UID ) -seq_printf (s,",uid=%d" , mnt->uid); -if (mnt->flags &SMB_MOUNT_GID ) -seq_printf (s,",gid=%d" , mnt->gid); -if (mnt->mounted_uid !=0 ) -seq_printf (s,",mounted_uid=%d" , mnt->mounted_uid); - -/* -* Defaults for file_mode and dir_mode are unknown to us; they -* depend on the current umask of the user doing the mount. -*/ -if (mnt->flags &SMB_MOUNT_FMODE ) -seq_printf (s,",file_mode=%04o" , mnt->file_mode &S_IRWXUGO ); -if (mnt->flags &SMB_MOUNT_DMODE ) -seq_printf (s,",dir_mode=%04o" , mnt->dir_mode &S_IRWXUGO ); - -if (strcmp (mnt->codepage.local_name,CONFIG_NLS_DEFAULT )) -seq_printf (s,",iocharset=%s" , mnt->codepage.local_name); -if (strcmp (mnt->codepage.remote_name,SMB_NLS_REMOTE )) -seq_printf (s,",codepage=%s" , mnt->codepage.remote_name); - -if (mnt->ttl !=SMB_TTL_DEFAULT ) -seq_printf (s,",ttl=%d" , mnt->ttl); - -return 0 ; -} - -static void -smb_unload_nls (struct smb_sb_info *server) -{ -if (server->remote_nls) { -unload_nls (server->remote_nls); - server->remote_nls =NULL ; - } -if (server->local_nls) { -unload_nls (server->local_nls); - server->local_nls =NULL ; - } -} - -static void -smb_put_super (struct super_block *sb) -{ -struct smb_sb_info *server =SMB_SB (sb); - -smb_lock_server (server); - server->state =CONN_INVALID ; -smbiod_unregister_server (server); - -smb_close_socket (server); - -if (server->conn_pid) -kill_pid (server->conn_pid,SIGTERM ,1 ); - -kfree (server->ops); -smb_unload_nls (server); - sb->s_fs_info =NULL ; -smb_unlock_server (server); -put_pid (server->conn_pid); -kfree (server); -} - -static int smb_fill_super (struct super_block *sb,void *raw_data,int silent) -{ -struct smb_sb_info *server; -struct smb_mount_data_kernel *mnt; -struct smb_mount_data *oldmnt; -struct inode *root_inode; -struct smb_fattr root; -int ver; -void *mem; - -if (!raw_data) - goto out_no_data; - - oldmnt = (struct smb_mount_data *) raw_data; - ver = oldmnt->version; -if (ver !=SMB_MOUNT_OLDVERSION &&cpu_to_be32 (ver) !=SMB_MOUNT_ASCII ) - goto out_wrong_data; - - sb->s_flags |=MS_NODIRATIME ; - sb->s_blocksize =1024 ;/* Eh... Is this correct? */ - sb->s_blocksize_bits =10 ; - sb->s_magic =SMB_SUPER_MAGIC ; - sb->s_op = &smb_sops; - sb->s_time_gran =100 ; - - server =kzalloc (sizeof (struct smb_sb_info ),GFP_KERNEL ); -if (!server) - goto out_no_server; - sb->s_fs_info = server; - - server->super_block = sb; - server->mnt =NULL ; - server->sock_file =NULL ; -init_waitqueue_head (&server->conn_wq); -init_MUTEX (&server->sem); -INIT_LIST_HEAD (&server->entry); -INIT_LIST_HEAD (&server->xmitq); -INIT_LIST_HEAD (&server->recvq); - server->conn_error =0 ; - server->conn_pid =NULL ; - server->state =CONN_INVALID ;/* no connection yet */ - server->generation =0 ; - -/* Allocate the global temp buffer and some superblock helper structs */ -/* FIXME: move these to the smb_sb_info struct */ -VERBOSE ("alloc chunk = %lu\n" ,sizeof (struct smb_ops ) + -sizeof (struct smb_mount_data_kernel )); - mem =kmalloc (sizeof (struct smb_ops ) + -sizeof (struct smb_mount_data_kernel ),GFP_KERNEL ); -if (!mem) - goto out_no_mem; - - server->ops = mem; -smb_install_null_ops (server->ops); - server->mnt = mem +sizeof (struct smb_ops ); - -/* Setup NLS stuff */ - server->remote_nls =NULL ; - server->local_nls =NULL ; - - mnt = server->mnt; - -memset (mnt,0 ,sizeof (struct smb_mount_data_kernel )); -strlcpy (mnt->codepage.local_name,CONFIG_NLS_DEFAULT , -SMB_NLS_MAXNAMELEN ); -strlcpy (mnt->codepage.remote_name,SMB_NLS_REMOTE , -SMB_NLS_MAXNAMELEN ); - - mnt->ttl =SMB_TTL_DEFAULT ; -if (ver ==SMB_MOUNT_OLDVERSION ) { - mnt->version = oldmnt->version; - -SET_UID (mnt->uid, oldmnt->uid); -SET_GID (mnt->gid, oldmnt->gid); - - mnt->file_mode = (oldmnt->file_mode &S_IRWXUGO ) |S_IFREG ; - mnt->dir_mode = (oldmnt->dir_mode &S_IRWXUGO ) |S_IFDIR ; - - mnt->flags = (oldmnt->file_mode >>9 ) |SMB_MOUNT_UID | -SMB_MOUNT_GID |SMB_MOUNT_FMODE |SMB_MOUNT_DMODE ; - }else { - mnt->file_mode =S_IRWXU |S_IRGRP |S_IXGRP | -S_IROTH |S_IXOTH |S_IFREG ; - mnt->dir_mode =S_IRWXU |S_IRGRP |S_IXGRP | -S_IROTH |S_IXOTH |S_IFDIR ; -if (parse_options (mnt, raw_data)) - goto out_bad_option; - } - mnt->mounted_uid = current->uid; -smb_setcodepage (server, &mnt->codepage); - -/* -* Display the enabled options -* Note: smb_proc_getattr uses these in 2.4 (but was changed in 2.2) -*/ -if (mnt->flags &SMB_MOUNT_OLDATTR ) -printk ("SMBFS: Using core getattr (Win 95 speedup)\n" ); -else if (mnt->flags &SMB_MOUNT_DIRATTR ) -printk ("SMBFS: Using dir ff getattr\n" ); - -if (smbiod_register_server (server) <0 ) { -printk (KERN_ERR "smbfs: failed to start smbiod\n" ); - goto out_no_smbiod; - } - -/* -* Keep the super block locked while we get the root inode. -*/ -smb_init_root_dirent (server, &root, sb); - root_inode =smb_iget (sb, &root); -if (!root_inode) - goto out_no_root; - - sb->s_root =d_alloc_root (root_inode); -if (!sb->s_root) - goto out_no_root; - -smb_new_dentry (sb->s_root); - -return 0 ; - -out_no_root: -iput (root_inode); -out_no_smbiod: -smb_unload_nls (server); -out_bad_option: -kfree (mem); -out_no_mem: -if (!server->mnt) -printk (KERN_ERR "smb_fill_super: allocation failure\n" ); - sb->s_fs_info =NULL ; -kfree (server); - goto out_fail; -out_wrong_data: -printk (KERN_ERR "smbfs: mount_data version %d is not supported\n" , ver); - goto out_fail; -out_no_data: -printk (KERN_ERR "smb_fill_super: missing data argument\n" ); -out_fail: -return -EINVAL ; -out_no_server: -printk (KERN_ERR "smb_fill_super: cannot allocate struct smb_sb_info\n" ); -return -ENOMEM ; -} - -static int -smb_statfs (struct dentry *dentry,struct kstatfs *buf) -{ -int result; - -lock_kernel (); - - result =smb_proc_dskattr (dentry, buf); - -unlock_kernel (); - - buf->f_type =SMB_SUPER_MAGIC ; - buf->f_namelen =SMB_MAXPATHLEN ; -return result; -} - -int smb_getattr (struct vfsmount *mnt,struct dentry *dentry,struct kstat *stat) -{ -int err =smb_revalidate_inode (dentry); -if (!err) -generic_fillattr (dentry->d_inode, stat); -return err; -} - -int -smb_notify_change (struct dentry *dentry,struct iattr *attr) -{ -struct inode *inode = dentry->d_inode; -struct smb_sb_info *server =server_from_dentry (dentry); -unsigned int mask = (S_IFREG |S_IFDIR |S_IRWXUGO ); -int error, changed, refresh =0 ; -struct smb_fattr fattr; - -lock_kernel (); - - error =smb_revalidate_inode (dentry); -if (error) - goto out; - -if ((error =inode_change_ok (inode, attr)) <0 ) - goto out; - - error = -EPERM ; -if ((attr->ia_valid &ATTR_UID ) && (attr->ia_uid != server->mnt->uid)) - goto out; - -if ((attr->ia_valid &ATTR_GID ) && (attr->ia_uid != server->mnt->gid)) - goto out; - -if ((attr->ia_valid &ATTR_MODE ) && (attr->ia_mode & ~mask)) - goto out; - -if ((attr->ia_valid &ATTR_SIZE ) !=0 ) { -VERBOSE ("changing %s/%s, old size=%ld, new size=%ld\n" , -DENTRY_PATH (dentry), - (long ) inode->i_size, (long ) attr->ia_size); - -filemap_write_and_wait (inode->i_mapping); - - error =smb_open (dentry,O_WRONLY ); -if (error) - goto out; - error = server->ops->truncate (inode, attr->ia_size); -if (error) - goto out; - error =vmtruncate (inode, attr->ia_size); -if (error) - goto out; - refresh =1 ; - } - -if (server->opt.capabilities &SMB_CAP_UNIX ) { -/* For now we don't want to set the size with setattr_unix */ - attr->ia_valid &= ~ATTR_SIZE ; -/* FIXME: only call if we actually want to set something? */ - error =smb_proc_setattr_unix (dentry, attr,0 ,0 ); -if (!error) - refresh =1 ; - - goto out; - } - -/* -* Initialize the fattr and check for changed fields. -* Note: CTIME under SMB is creation time rather than -* change time, so we don't attempt to change it. -*/ -smb_get_inode_attr (inode, &fattr); - - changed =0 ; -if ((attr->ia_valid &ATTR_MTIME ) !=0 ) { - fattr.f_mtime = attr->ia_mtime; - changed =1 ; - } -if ((attr->ia_valid &ATTR_ATIME ) !=0 ) { - fattr.f_atime = attr->ia_atime; -/* Earlier protocols don't have an access time */ -if (server->opt.protocol >=SMB_PROTOCOL_LANMAN2 ) - changed =1 ; - } -if (changed) { - error =smb_proc_settime (dentry, &fattr); -if (error) - goto out; - refresh =1 ; - } - -/* -* Check for mode changes ... we're extremely limited in -* what can be set for SMB servers: just the read-only bit. -*/ -if ((attr->ia_valid &ATTR_MODE ) !=0 ) { -VERBOSE ("%s/%s mode change, old=%x, new=%x\n" , -DENTRY_PATH (dentry), fattr.f_mode, attr->ia_mode); - changed =0 ; -if (attr->ia_mode &S_IWUSR ) { -if (fattr.attr & aRONLY) { - fattr.attr &= ~aRONLY; - changed =1 ; - } - }else { -if (!(fattr.attr & aRONLY)) { - fattr.attr |= aRONLY; - changed =1 ; - } - } -if (changed) { - error =smb_proc_setattr (dentry, &fattr); -if (error) - goto out; - refresh =1 ; - } - } - error =0 ; - -out: -if (refresh) -smb_refresh_inode (dentry); -unlock_kernel (); -return error; -} - -static int smb_get_sb (struct file_system_type *fs_type, -int flags,const char *dev_name,void *data,struct vfsmount *mnt) -{ -return get_sb_nodev (fs_type, flags, data, smb_fill_super, mnt); -} - -static struct file_system_type smb_fs_type = { - .owner =THIS_MODULE , - .name ="smbfs" , - .get_sb = smb_get_sb, - .kill_sb = kill_anon_super, - .fs_flags =FS_BINARY_MOUNTDATA , -}; - -static int __init init_smb_fs (void ) -{ -int err; -DEBUG1 ("registering ...\n" ); - - err =init_inodecache (); -if (err) - goto out_inode; - err =smb_init_request_cache (); -if (err) - goto out_request; - err =register_filesystem (&smb_fs_type); -if (err) - goto out; -return 0 ; -out: -smb_destroy_request_cache (); -out_request: -destroy_inodecache (); -out_inode: -return err; -} - -static void __exit exit_smb_fs(void) -{ -DEBUG1 ("unregistering ...\n" ); -unregister_filesystem (&smb_fs_type); -smb_destroy_request_cache (); -destroy_inodecache (); -} - -module_init(init_smb_fs) -module_exit(exit_smb_fs) -MODULE_LICENSE("GPL");fs/smbfs/ioctl.c deleted +0
-67@@ -1,67 +0,0 @@ -/* -* ioctl.c -* -* Copyright (C) 1995, 1996 by Volker Lendecke -* Copyright (C) 1997 by Volker Lendecke -* -* Please add a note about your changes to smbfs in the ChangeLog file. -*/ - -#include <linux/errno.h> -#include <linux/fs.h> -#include <linux/ioctl.h> -#include <linux/time.h> -#include <linux/mm.h> -#include <linux/highuid.h> -#include <linux/net.h> - -#include <linux/smb_fs.h> -#include <linux/smb_mount.h> - -#include <asm/uaccess.h> - -#include "proto.h" - -int -smb_ioctl (struct inode *inode,struct file *filp, -unsigned int cmd,unsigned long arg) -{ -struct smb_sb_info *server =server_from_inode (inode); -struct smb_conn_opt opt; -int result = -EINVAL ; - -switch (cmd) { -uid16_t uid16; -uid_t uid32; -case SMB_IOC_GETMOUNTUID : -SET_UID (uid16, server->mnt->mounted_uid); - result =put_user (uid16, (uid16_t __user *) arg); -break ; -case SMB_IOC_GETMOUNTUID32 : -SET_UID (uid32, server->mnt->mounted_uid); - result =put_user (uid32, (uid_t __user *) arg); -break ; - -case SMB_IOC_NEWCONN : -/* arg is smb_conn_opt, or NULL if no connection was made */ -if (!arg) { - result =0 ; -smb_lock_server (server); - server->state =CONN_RETRIED ; -printk (KERN_ERR "Connection attempt failed! [%d]\n" , - server->conn_error); -smbiod_flush (server); -smb_unlock_server (server); -break ; - } - - result = -EFAULT ; -if (!copy_from_user (&opt, (void __user *)arg,sizeof (opt))) - result =smb_newconn (server, &opt); -break ; -default : -break ; - } - -return result; -}fs/smbfs/proc.c deleted +0
-1266@@ -1,3508 +0,0 @@ -/* -* proc.c -* -* Copyright (C) 1995, 1996 by Paal-Kr. Engstad and Volker Lendecke -* Copyright (C) 1997 by Volker Lendecke -* -* Please add a note about your changes to smbfs in the ChangeLog file. -*/ - -#include <linux/types.h> -#include <linux/capability.h> -#include <linux/errno.h> -#include <linux/slab.h> -#include <linux/fs.h> -#include <linux/file.h> -#include <linux/stat.h> -#include <linux/fcntl.h> -#include <linux/dcache.h> -#include <linux/dirent.h> -#include <linux/nls.h> -#include <linux/smp_lock.h> -#include <linux/net.h> -#include <linux/vfs.h> -#include <linux/smb_fs.h> -#include <linux/smbno.h> -#include <linux/smb_mount.h> - -#include <net/sock.h> - -#include <asm/string.h> -#include <asm/div64.h> - -#include "smb_debug.h" -#include "proto.h" -#include "request.h" - - -/* Features. Undefine if they cause problems, this should perhaps be a -config option. */ -#define SMBFS_POSIX_UNLINK 1 - -/* Allow smb_retry to be interrupted. */ -#define SMB_RETRY_INTR - -#define SMB_VWV (packet) ((packet) + SMB_HEADER_LEN) -#define SMB_CMD (packet) (*(packet+8)) -#define SMB_WCT (packet) (*(packet+SMB_HEADER_LEN - 1)) - -#define SMB_DIRINFO_SIZE 43 -#define SMB_STATUS_SIZE 21 - -#define SMB_ST_BLKSIZE (PAGE_SIZE) -#define SMB_ST_BLKSHIFT (PAGE_SHIFT) - -static struct smb_ops smb_ops_core; -static struct smb_ops smb_ops_os2; -static struct smb_ops smb_ops_win95; -static struct smb_ops smb_ops_winNT; -static struct smb_ops smb_ops_unix; -static struct smb_ops smb_ops_null; - -static void -smb_init_dirent (struct smb_sb_info *server,struct smb_fattr *fattr); -static void -smb_finish_dirent (struct smb_sb_info *server,struct smb_fattr *fattr); -static int -smb_proc_getattr_core (struct smb_sb_info *server,struct dentry *dir, -struct smb_fattr *fattr); -static int -smb_proc_getattr_ff (struct smb_sb_info *server,struct dentry *dentry, -struct smb_fattr *fattr); -static int -smb_proc_setattr_core (struct smb_sb_info *server,struct dentry *dentry, -u16 attr); -static int -smb_proc_setattr_ext (struct smb_sb_info *server, -struct inode *inode,struct smb_fattr *fattr); -static int -smb_proc_query_cifsunix (struct smb_sb_info *server); -static void -install_ops (struct smb_ops *dst,struct smb_ops *src); - - -static void -str_upper (char *name,int len) -{ -while (len--) - { -if (*name >='a' && *name <='z' ) - *name -= ('a' -'A' ); - name++; - } -} - -#if 0 -static void -str_lower (char *name,int len) -{ -while (len--) - { -if (*name >='A' && *name <='Z' ) - *name += ('a' -'A' ); - name++; - } -} -#endif - -/* reverse a string inline. This is used by the dircache walking routines */ -static void reverse_string (char *buf,int len) -{ -char c; -char *end = buf+len-1 ; - -while (buf < end) { - c = *buf; - *(buf++) = *end; - *(end--) = c; - } -} - -/* no conversion, just a wrapper for memcpy. */ -static int convert_memcpy (unsigned char *output,int olen, -const unsigned char *input,int ilen, -struct nls_table *nls_from, -struct nls_table *nls_to) -{ -if (olen < ilen) -return -ENAMETOOLONG ; -memcpy (output, input, ilen); -return ilen; -} - -static inline int write_char (unsigned char ch,char *output,int olen) -{ -if (olen <4 ) -return -ENAMETOOLONG ; -sprintf (output,":x%02x" , ch); -return 4 ; -} - -static inline int write_unichar (wchar_t ch,char *output,int olen) -{ -if (olen <5 ) -return -ENAMETOOLONG ; -sprintf (output,":%04x" , ch); -return 5 ; -} - -/* convert from one "codepage" to another (possibly being utf8). */ -static int convert_cp (unsigned char *output,int olen, -const unsigned char *input,int ilen, -struct nls_table *nls_from, -struct nls_table *nls_to) -{ -int len =0 ; -int n; -wchar_t ch; - -while (ilen >0 ) { -/* convert by changing to unicode and back to the new cp */ - n = nls_from->char2uni (input, ilen, &ch); -if (n == -EINVAL ) { - ilen--; - n =write_char (*input++, output, olen); -if (n <0 ) - goto fail; - output += n; - olen -= n; - len += n; -continue ; - }else if (n <0 ) - goto fail; - input += n; - ilen -= n; - - n = nls_to->uni2char (ch, output, olen); -if (n == -EINVAL ) - n =write_unichar (ch, output, olen); -if (n <0 ) - goto fail; - output += n; - olen -= n; - - len += n; - } -return len; -fail: -return n; -} - -/* ----------------------------------------------------------- */ - -/* -* nls_unicode -* -* This encodes/decodes little endian unicode format -*/ - -static int uni2char (wchar_t uni,unsigned char *out,int boundlen) -{ -if (boundlen <2 ) -return -EINVAL ; - *out++ = uni &0xff ; - *out++ = uni >>8 ; -return 2 ; -} - -static int char2uni (const unsigned char *rawstring,int boundlen,wchar_t *uni) -{ -if (boundlen <2 ) -return -EINVAL ; - *uni = (rawstring[1 ] <<8 ) | rawstring[0 ]; -return 2 ; -} - -static struct nls_table unicode_table = { - .charset ="unicode" , - .uni2char = uni2char, - .char2uni = char2uni, -}; - -/* ----------------------------------------------------------- */ - -static int setcodepage (struct nls_table **p,char *name) -{ -struct nls_table *nls; - -if (!name || !*name) { - nls =NULL ; - }else if ( (nls =load_nls (name)) ==NULL ) { -printk (KERN_ERR "smbfs: failed to load nls '%s'\n" , name); -return -EINVAL ; - } - -/* if already set, unload the previous one. */ -if (*p && *p != &unicode_table) -unload_nls (*p); - *p = nls; - -return 0 ; -} - -/* Handles all changes to codepage settings. */ -int smb_setcodepage (struct smb_sb_info *server,struct smb_nls_codepage *cp) -{ -int n =0 ; - -smb_lock_server (server); - -/* Don't load any nls_* at all, if no remote is requested */ -if (!*cp->remote_name) - goto out; - -/* local */ - n =setcodepage (&server->local_nls, cp->local_name); -if (n !=0 ) - goto out; - -/* remote */ -if (!strcmp (cp->remote_name,"unicode" )) { - server->remote_nls = &unicode_table; - }else { - n =setcodepage (&server->remote_nls, cp->remote_name); -if (n !=0 ) -setcodepage (&server->local_nls,NULL ); - } - -out: -if (server->local_nls !=NULL && server->remote_nls !=NULL ) - server->ops->convert = convert_cp; -else - server->ops->convert = convert_memcpy; - -smb_unlock_server (server); -return n; -} - - -/*****************************************************************************/ -/* */ -/* Encoding/Decoding section */ -/* */ -/*****************************************************************************/ - -static __u8 * -smb_encode_smb_length (__u8 * p,__u32 len) -{ - *p =0 ; - *(p+1 ) =0 ; - *(p+2 ) = (len &0xFF00 ) >>8 ; - *(p+3 ) = (len &0xFF ); -if (len >0xFFFF ) - { - *(p+1 ) =1 ; - } -return p +4 ; -} - -/* -* smb_build_path: build the path to entry and name storing it in buf. -* The path returned will have the trailing '\0'. -*/ -static int smb_build_path (struct smb_sb_info *server,unsigned char *buf, -int maxlen, -struct dentry *entry,struct qstr *name) -{ -unsigned char *path = buf; -int len; -int unicode = (server->mnt->flags &SMB_MOUNT_UNICODE ) !=0 ; - -if (maxlen < (2 <<unicode)) -return -ENAMETOOLONG ; - -if (maxlen >SMB_MAXPATHLEN +1 ) - maxlen =SMB_MAXPATHLEN +1 ; - -if (entry ==NULL ) - goto test_name_and_out; - -/* -* If IS_ROOT, we have to do no walking at all. -*/ -if (IS_ROOT (entry) && !name) { - *path++ ='\\' ; -if (unicode) *path++ ='\0' ; - *path++ ='\0' ; -if (unicode) *path++ ='\0' ; -return path-buf; - } - -/* -* Build the path string walking the tree backward from end to ROOT -* and store it in reversed order [see reverse_string()] -*/ -dget (entry); -spin_lock (&entry->d_lock); -while (!IS_ROOT (entry)) { -struct dentry *parent; - -if (maxlen < (3 <<unicode)) { -spin_unlock (&entry->d_lock); -dput (entry); -return -ENAMETOOLONG ; - } - - len = server->ops->convert (path, maxlen-2 , - entry->d_name.name, entry->d_name.len, - server->local_nls, server->remote_nls); -if (len <0 ) { -spin_unlock (&entry->d_lock); -dput (entry); -return len; - } -reverse_string (path, len); - path += len; -if (unicode) { -/* Note: reverse order */ - *path++ ='\0' ; - maxlen--; - } - *path++ ='\\' ; - maxlen -= len+1 ; - - parent = entry->d_parent; -dget (parent); -spin_unlock (&entry->d_lock); -dput (entry); - entry = parent; -spin_lock (&entry->d_lock); - } -spin_unlock (&entry->d_lock); -dput (entry); -reverse_string (buf, path-buf); - -/* maxlen has space for at least one char */ -test_name_and_out: -if (name) { -if (maxlen < (3 <<unicode)) -return -ENAMETOOLONG ; - *path++ ='\\' ; -if (unicode) { - *path++ ='\0' ; - maxlen--; - } - len = server->ops->convert (path, maxlen-2 , - name->name, name->len, - server->local_nls, server->remote_nls); -if (len <0 ) -return len; - path += len; - maxlen -= len+1 ; - } -/* maxlen has space for at least one char */ - *path++ ='\0' ; -if (unicode) *path++ ='\0' ; -return path-buf; -} - -static int smb_encode_path (struct smb_sb_info *server,char *buf,int maxlen, -struct dentry *dir,struct qstr *name) -{ -int result; - - result =smb_build_path (server, buf, maxlen, dir, name); -if (result <0 ) - goto out; -if (server->opt.protocol <=SMB_PROTOCOL_COREPLUS ) -str_upper (buf, result); -out: -return result; -} - -/* encode_path for non-trans2 request SMBs */ -static int smb_simple_encode_path (struct smb_request *req,char **p, -struct dentry * entry,struct qstr * name) -{ -struct smb_sb_info *server = req->rq_server; -char *s = *p; -int res; -int maxlen = ((char *)req->rq_buffer + req->rq_bufsize) - s; -int unicode = (server->mnt->flags &SMB_MOUNT_UNICODE ); - -if (!maxlen) -return -ENAMETOOLONG ; - *s++ =4 ;/* ASCII data format */ - -/* -* SMB Unicode strings must be 16bit aligned relative the start of the -* packet. If they are not they must be padded with 0. -*/ -if (unicode) { -int align = s - (char *)req->rq_buffer; -if (!(align &1 )) { - *s++ ='\0' ;Lines of this file are not shown. View the raw message.
The rest of this diff is not shown. View the raw message.
[Message clipped]
Signature · 3 lines
Thanks, Steve
Part of the diff is not shown here. View the raw message.
Quoted 7 lines · Adrian Bunk
I remember that there were some small things missing in CIFS for completely replacing the unmaintained smbfs when we discussed removing smbfs back in 2005 due to smbfs being unmaintained.
CIFS has improved since, smbfs is still unmaintained, and it's becoming time to finally remove smbfs.
Negative. CIFS as of 2.6.24-rc7 still does not support Windows 98, or at least, the mount command I tried was not the right one:
mount -t cifs //WIN98/c /mnt -o guest,sec=none
(It is a test share with a null password open for anyone.) I am running out of options..
CIFS VFS: cifs_mount failed w/return code = -2
I have mounted to Windows98 a few months ago with no problems (other than a few restrictions like you can't set the file times via utimes).
For mounts to Windows98 note that you have to specify the server
netbios name on the mount (since it is not the same as the DNS name). In your example your would need to specify "servernetbiosname=WIN98" in the mount options (until mount.cifs autoretries with servernetbiosname assumed to be the beginning of the UNC name - note that later servers have a dummy netbios name that is used so this mount option is only needed for OS/2 and Win9x).
I will try mounts to Windows98 again.
Quoted 20 lines · Jan Engelhardt
Quoted 7 lines · Adrian Bunk
I remember that there were some small things missing in CIFS for completely replacing the unmaintained smbfs when we discussed removing smbfs back in 2005 due to smbfs being unmaintained.
CIFS has improved since, smbfs is still unmaintained, and it's becoming time to finally remove smbfs.
Negative. CIFS as of 2.6.24-rc7 still does not support Windows 98, or at least, the mount command I tried was not the right one:
mount -t cifs //WIN98/c /mnt -o guest,sec=none
(It is a test share with a null password open for anyone.) I am running out of options..
CIFS VFS:
cifs_mountfailed w/return code = -2
Signature · 3 lines
Thanks, Steve
Quoted 9 lines · Steve French
I have mounted to Windows98 a few months ago with no problems (other than a few restrictions like you can't set the file times via utimes). For mounts to Windows98 note that you have to specify the server netbios name on the mount (since it is not the same as the DNS name). In your example your would need to specify "servernetbiosname=WIN98" in the mount options (until mount.cifs autoretries with servernetbiosname assumed to be the beginning of the UNC name - note that later servers have a dummy netbios name that is used so this mount option is only needed for OS/2 and Win9x).
Ok that works. I had tried "netbiosname" but not "servernetbiosname" (only fuzzy memories from the last win98 encounter and the suggestion to use netbiossomething).
I think servernetbiosname should implicitly be assumed to be the same as the //hostpart/ when it's not explicitly specified, no?
Quoted 12 lines · Jan Engelhardt
Quoted 9 lines · Steve French
I have mounted to Windows98 a few months ago with no problems (other than a few restrictions like you can't set the file times via utimes). For mounts to Windows98 note that you have to specify the server netbios name on the mount (since it is not the same as the DNS name). In your example your would need to specify "servernetbiosname=WIN98" in the mount options (until mount.cifs autoretries with servernetbiosname assumed to be the beginning of the UNC name - note that later servers have a dummy netbios name that is used so this mount option is only needed for OS/2 and Win9x).
Quoted 6 lines
Ok that works. I had tried "netbiosname" but not "servernetbiosname" (only fuzzy memories from the last win98 encounter and the suggestion to use netbiossomething).
I think servernetbiosname should implicitly be assumed to be the same as the //hostpart/ when it's not explicitly specified, no?
Unfortunately, it is not quite that easy since there is a default "dummy" netbiosname that you are supposed to specify.
The default netbios name is supposed to be "*SMBSERVER" in the RFC1001 session init request (this allows you to connect to the default netbiosname on the target ip address), but for servers older than about 1997, and Windows9x, that name is not supported by default and that field in the session initialize request must contain the actual
netbiosname. Although using the host name of the server is a good
first guess - the netbiosname does not have to match the tcp host name (and often differs in more than simply being uppercase and limited to 15 bytes).
There is retry which can be tried. When the server does not listen on port 445 and mount fails to *SMBSERVER on port 139 (and retry using the uppercased tcp name as the netbios name fails) - we can try to do an "adapter status" rfc1001 call to the ip address of the target and pick the first netbiosname (or at least the first one that ends with the server suffix - ie a byte of 0x20 for byte 16 of the netbios
name). This complicates the mount.cifs helpers retry logic and
adding rfc1001 adapter status code into the kernel also would be a few hundred lines of kernel code for little benefit if any for current
servers, but it could be done. Simply adding the one retry (for
failed mounts using servernetbiosname=<target-host-name> would probably take care of most cases.
Signature · 3 lines
Thanks, Steve
Quoted 18 lines · Steve French
Quoted 11 lines · Steve French
Quoted 9 lines
I have mounted to Windows98 a few months ago with no problems (other than a few restrictions like you can't set the file times via utimes). For mounts to Windows98 note that you have to specify the server netbios name on the mount (since it is not the same as the DNS name). In your example your would need to specify "servernetbiosname=WIN98" in the mount options (until mount.cifs autoretries with servernetbiosname assumed to be the beginning of the UNC name - note that later servers have a dummy netbios name that is used so this mount option is only needed for OS/2 and Win9x).
Quoted 6 lines
Ok that works. I had tried "netbiosname" but not "servernetbiosname" (only fuzzy memories from the last win98 encounter and the suggestion to use netbiossomething).
I think servernetbiosname should implicitly be assumed to be the same as the //hostpart/ when it's not explicitly specified, no?
Quoted 16 lines
Unfortunately, it is not quite that easy since there is a default "dummy" netbiosname that you are supposed to specify.
[...]
There is retry which can be tried. When the server does not listen on port 445 and mount fails to *SMBSERVER on port 139 (and retry using the uppercased tcp name as the netbios name fails) - we can try to do an "adapter status" rfc1001 call to the ip address of the target and pick the first netbiosname (or at least the first one that ends with the server suffix - ie a byte of0x20for byte 16 of the netbios
name). This complicates the mount.cifs helpers retry logic and
adding rfc1001 adapter status code into the kernel also would be a few hundred lines of kernel code for little benefit if any for current
servers, but it could be done. Simply adding the one retry (for
failed mounts using servernetbiosname=<target-host-name> would probably take care of most cases.
Yes, that is what I'd like, the simple retry with the servernetbiosname taken from //foo/. Querying adapter and all that seems unnecessary since if I say //foo/, I really mean servernetbiosname=foo,ip=<resolve foo> not servernetbiosname=bar,ip=<resolve foo>.
Quoted 13 lines · Jan Engelhardt
Quoted 10 lines · Steve French
I have mounted to Windows98 a few months ago with no problems (other than a few restrictions like you can't set the file times via utimes). For mounts to Windows98 note that you have to specify the server netbios name on the mount (since it is not the same as the DNS name). In your example your would need to specify "servernetbiosname=WIN98" in the mount options (until mount.cifs autoretries with servernetbiosname assumed to be the beginning of the UNC name - note that later servers have a dummy netbios name that is used so this mount option is only needed for OS/2 and Win9x).
Quoted 4 lines
Ok that works. I had tried "netbiosname" but not "servernetbiosname" (only fuzzy memories from the last win98 encounter and the suggestion to use netbiossomething).
Apparently CIFS lacks an adequate man page (otherwise Jan would have discovered servernetbiosname for himself.) That's sufficient reason to keep smbfs, and just to be radical, why not remove cifs until it's properly documented? Man pages are essential.
(Listens for howls.)
Quoted 13 lines · David Newall
Quoted 12 lines · Jan Engelhardt
Quoted 9 lines · Steve French
I have mounted to Windows98 a few months ago with no problems (other than a few restrictions like you can't set the file times via utimes). For mounts to Windows98 note that you have to specify the server netbios name on the mount (since it is not the same as the DNS name). In your example your would need to specify "servernetbiosname=WIN98" in the mount options (until mount.cifs autoretries with servernetbiosname assumed to be the beginning of the UNC name - note that later servers have a dummy netbios name that is used so this mount option is only needed for OS/2 and Win9x).
Quoted 8 lines
Quoted 3 lines
Ok that works. I had tried "netbiosname" but not "servernetbiosname" (only fuzzy memories from the last win98 encounter and the suggestion to use netbiossomething).
Apparently CIFS lacks an adequate man page (otherwise Jan would have discovered servernetbiosname for himself.) That's sufficient reason to keep smbfs, and just to be radical, why not remove cifs until it's properly documented? Man pages are essential.
smbfs does not seem to do NT/XP mounts, so that's kinda problematic too, as fun as it sounds :)
Quoted 16 lines · Jan Engelhardt
Quoted 13 lines · David Newall
Quoted 12 lines · Jan Engelhardt
Quoted 9 lines · Steve French
I have mounted to Windows98 a few months ago with no problems (other than a few restrictions like you can't set the file times via utimes). For mounts to Windows98 note that you have to specify the server netbios name on the mount (since it is not the same as the DNS name). In your example your would need to specify "servernetbiosname=WIN98" in the mount options (until mount.cifs autoretries with servernetbiosname assumed to be the beginning of the UNC name - note that later servers have a dummy netbios name that is used so this mount option is only needed for OS/2 and Win9x).
Quoted 8 lines
Quoted 8 lines
Quoted 3 lines
Ok that works. I had tried "netbiosname" but not "servernetbiosname" (only fuzzy memories from the last win98 encounter and the suggestion to use netbiossomething).
Apparently CIFS lacks an adequate man page (otherwise Jan would have discovered servernetbiosname for himself.) That's sufficient reason to keep smbfs, and just to be radical, why not remove cifs until it's properly documented? Man pages are essential.
The cifs user guide (note that smbfs did not have a user's guide) does list the required mount options pretty clearly in the section on mount
syntax on page 4. Excerpt follows:
mounting to older servers (those prior to1997) may require specifying two additional fields beyond
those which smbfs required:
a) The server's netbios (RFC1001) name AND the server's tcp (or ip ) address. CIFS does not
assume, as smbfs did, that the tcp name and the netbios name of the server are the same. The netbios name of the server is specified by passing the mount option "servern=SERVERNAME" and is not assumed to be necessarily the same as the tcp name of the server (also note that the netbios name is usually capitalized). Both tcp/ip name and netbios name have to be specified for mounts for most old lanman servers. For example:
mount -t cifs //tcp-name-of-server/sharename
Current versions of "mount.cifs -h" also list all mount options, and the README information on the syntax is also current and contains
information which needs to be added to the mount.cifs man page. I
will make this fix for the mount.cifs man page, it lags behind the mount.cifs help and the README but any additional updates to the man page text to clarify it would be welcome.
Quoted 2 lines
smbfs does not seem to do NT/XP mounts, so that's kinda problematic too, as fun as it sounds :)
Signature · 3 lines
Thanks, Steve
Am Mittwoch, 30. Januar 2008 schrieb Steve French:
Quoted 10 lines
I have mounted to Windows98 a few months ago with no problems (other than a few restrictions like you can't set the file times via utimes).
For mounts to Windows98 note that you have to specify the server
netbios name on the mount (since it is not the same as the DNS name). In your example your would need to specify "servernetbiosname=WIN98" in the mount options (until mount.cifs autoretries with servernetbiosname assumed to be the beginning of the UNC name - note that later servers have a dummy netbios name that is used so this mount option is only needed for OS/2 and Win9x).
Quoted 2 lines
I will try mounts to Windows98 again.
being not able to set the file times via utimes is a _major_ missing feature in cifs, so
cp -p /client/file /server
does not work regarding servers like win9x/me and os/2. The source time stamps are not transfered to the server! The current local time on the server is set instead for all time stamps.
The reason is a missing implementation of legacy versions of
setfileinfo
setpathinfo
I had that already working months ago, but it never made it upstream ...
Possibly we could give it a 2nd try?
Cheers, Günter
Am Montag, 28. Januar 2008 schrieb Adrian Bunk:
Quoted 9 lines
I remember that there were some small things missing in CIFS for completely replacing the unmaintained smbfs when we discussed removing smbfs back in 2005 due to smbfs being unmaintained.
CIFS has improved since, smbfs is still unmaintained, and it's becoming time to finally remove smbfs.
Signed-off-by Adrian Bunk <[email protected]>
"... unmaintained smbfs ..." is not quite right, see
http://lkml.org/lkml/2007/11/6/94
Before removing it now completely, drop
Jeff Layton <[email protected]>
a note.
Afaik, Redhat still has customers which rely on smbfs.
In addition, cifs cannot completely replace smbfs atm. Even todays sold NAS-boxes (often running anchient samba-2.x.x) work only with smbfs on the client side. Cheers, Günter
Quoted 11 lines · On Wed, 30 Jan 2008 22:16:13 +0100 Guenter Kukkukk <[email protected]> wrote:
Am Montag, 28. Januar 2008 schrieb Adrian Bunk:
Quoted 9 lines
I remember that there were some small things missing in CIFS for completely replacing the unmaintained smbfs when we discussed removing smbfs back in 2005 due to smbfs being unmaintained.
CIFS has improved since, smbfs is still unmaintained, and it's becoming time to finally remove smbfs.
Signed-off-by Adrian Bunk <[email protected]>
Quoted 7 lines
"... unmaintained smbfs ..." is not quite right, see
http://lkml.org/lkml/2007/11/6/94
Before removing it now completely, drop
Jeff Layton <[email protected]>
a note.
Afaik, Redhat still has customers which rely on smbfs.
Some of our older products use smbfs, but our newer stuff (RHEL5 and up) have smbfs disabled. Fedora has had smbfs disabled for quite some time as well. I've heard very few complaints (though maybe they're just not getting to me).
I have no problem with targeting smbfs for removal, but I thought Andrew had an unofficial policy that we should first mark things to be deprecated, and then remove them 2 releases later. That seems like a sensible policy to me. If we mark it deprecated in 2.6.25 then we can remove it after 2.6.26 is released.
It might not even hurt to have a nice loud printk when the smbfs module is plugged in to warn users that it's slated to be removed, and that they should move to CIFS as soon as possible.
Quoted 3 lines
In addition, cifs cannot completely replace smbfs atm. Even todays sold NAS-boxes (often running anchient samba-2.x.x) work only with smbfs on the client side.
It would be ideal if someone were to report these problems as bugs. I remember some of those in the past, but haven't heard of any cases of that sort of thing for some time. When I have, Steve has generally been very good about tracking down the cause and fixing it.
Cheers,
Signature · 1 line
Jeff Layton <[email protected]>
Quoted 33 lines · Jeff Layton
Quoted 11 lines · On Wed, 30 Jan 2008 22:16:13 +0100 Guenter Kukkukk <[email protected]> wrote:
Am Montag, 28. Januar 2008 schrieb Adrian Bunk:
Quoted 9 lines
I remember that there were some small things missing in CIFS for completely replacing the unmaintained smbfs when we discussed removing smbfs back in 2005 due to smbfs being unmaintained.
CIFS has improved since, smbfs is still unmaintained, and it's becoming time to finally remove smbfs.
Signed-off-by Adrian Bunk <[email protected]>Quoted 7 lines
"... unmaintained smbfs ..." is not quite right, see
http://lkml.org/lkml/2007/11/6/94
Before removing it now completely, drop
Jeff Layton <[email protected]>
a note.
Afaik, Redhat still has customers which rely on smbfs.Some of our older products use smbfs, but our newer stuff (RHEL5 and up) have smbfs disabled. Fedora has had smbfs disabled for quite some time as well. I've heard very few complaints (though maybe they're just not getting to me).
I have no problem with targeting smbfs for removal, but I thought Andrew had an unofficial policy that we should first mark things to be deprecated, and then remove them 2 releases later. That seems like a sensible policy to me. If we mark it deprecated in 2.6.25 then we can remove it after 2.6.26 is released.
Quoted 3 lines
It might not even hurt to have a nice loud printk when the smbfs module is plugged in to warn users that it's slated to be removed, and that they should move to CIFS as soon as possible.
Andrew has this with a target date of December 2006 (sic) for the removal buried in -mm...
Quoted 8 lines
Quoted 3 lines
In addition, cifs cannot completely replace smbfs atm. Even todays sold NAS-boxes (often running anchient samba-2.x.x) work only with smbfs on the client side.
It would be ideal if someone were to report these problems as bugs. I remember some of those in the past, but haven't heard of any cases of that sort of thing for some time. When I have, Steve has generally been very good about tracking down the cause and fixing it.
More exactly, one of the main advantages of removing redundant code like smbfs is that people are finally forced to report their bugs.
Quoted 1 line
Cheers,
cu
Adrian
Signature · 4 lines
"Is there not promise of rain?" Ling Tan asked suddenly out
of the darkness. There had been need of rain for many days.
"Only a promise," Lao Er said.
Pearl S. Buck - Dragon SeedQuoted 35 lines · On Thu, 31 Jan 2008 00:58:10 +0200 Adrian Bunk <[email protected]> wrote:
Quoted 34 lines · Jeff Layton
Quoted 12 lines · On Wed, 30 Jan 2008 22:16:13 +0100 Guenter Kukkukk <[email protected]> wrote:
Am Montag, 28. Januar 2008 schrieb Adrian Bunk:
Quoted 10 lines
I remember that there were some small things missing in CIFS for completely replacing the unmaintained smbfs when we discussed removing smbfs back in 2005 due to smbfs being unmaintained.
CIFS has improved since, smbfs is still unmaintained, and it's becoming time to finally remove smbfs.
Signed-off-by Adrian Bunk <[email protected]>Quoted 7 lines
"... unmaintained smbfs ..." is not quite right, see
http://lkml.org/lkml/2007/11/6/94
Before removing it now completely, drop
Jeff Layton <[email protected]>
a note.
Afaik, Redhat still has customers which rely on smbfs.Some of our older products use smbfs, but our newer stuff (RHEL5 and up) have smbfs disabled. Fedora has had smbfs disabled for quite some time as well. I've heard very few complaints (though maybe they're just not getting to me).
I have no problem with targeting smbfs for removal, but I thought Andrew had an unofficial policy that we should first mark things to be deprecated, and then remove them 2 releases later. That seems like a sensible policy to me. If we mark it deprecated in 2.6.25 then we can remove it after 2.6.26 is released.
Quoted 7 lines
Quoted 3 lines
It might not even hurt to have a nice loud printk when the smbfs module is plugged in to warn users that it's slated to be removed, and that they should move to CIFS as soon as possible.
Andrew has this with a target date of December 2006 (sic) for the removal buried in -mm...
True, but most users don't run -mm. I think we should have this marked as deprecated in mainline kernels before removing it. I rather like the idea of a runtime warning too...
smbfs has the unfortunate quality of momentum. A lot of users aren't aware of CIFS at all since smbfs basically does what they need it to do. Some extra warning for those users would be nice.
Quoted 4 lines
Quoted 4 lines
Quoted 3 lines
In addition, cifs cannot completely replace smbfs atm. Even todays sold NAS-boxes (often running anchient samba-2.x.x) work only with smbfs on the client side.
Quoted 9 lines
Quoted 5 lines
It would be ideal if someone were to report these problems as bugs. I remember some of those in the past, but haven't heard of any cases of that sort of thing for some time. When I have, Steve has generally been very good about tracking down the cause and fixing it.
More exactly, one of the main advantages of removing redundant code like smbfs is that people are finally forced to report their bugs.
Indeed. I'm all for removing it, but I think we should try to have a clear transition path to avoid some of the "WTF happened to smbfs?" emails we're bound to get. Marking it deprecated in mainline and stating that it'll be removed in version 2.6.26 (or whenever) seems like a reasonable thing to do.
Just my $.02...
Signature · 1 line
Jeff Layton <[email protected]>
Quoted 42 lines · Jeff Layton
Quoted 39 lines · On Thu, 31 Jan 2008 00:58:10 +0200 Adrian Bunk <[email protected]> wrote:
Quoted 37 lines · Jeff Layton
Quoted 12 lines · On Wed, 30 Jan 2008 22:16:13 +0100 Guenter Kukkukk <[email protected]> wrote:
Am Montag, 28. Januar 2008 schrieb Adrian Bunk:
Quoted 10 lines
I remember that there were some small things missing in CIFS for completely replacing the unmaintained smbfs when we discussed removing smbfs back in 2005 due to smbfs being unmaintained.
CIFS has improved since, smbfs is still unmaintained, and it's becoming time to finally remove smbfs.
Signed-off-by Adrian Bunk <[email protected]>Quoted 7 lines
"... unmaintained smbfs ..." is not quite right, see
http://lkml.org/lkml/2007/11/6/94
Before removing it now completely, drop
Jeff Layton <[email protected]>
a note.
Afaik, Redhat still has customers which rely on smbfs.Some of our older products use smbfs, but our newer stuff (RHEL5 and up) have smbfs disabled. Fedora has had smbfs disabled for quite some time as well. I've heard very few complaints (though maybe they're just not getting to me).
I have no problem with targeting smbfs for removal, but I thought Andrew had an unofficial policy that we should first mark things to be deprecated, and then remove them 2 releases later. That seems like a sensible policy to me. If we mark it deprecated in 2.6.25 then we can remove it after 2.6.26 is released.
It might not even hurt to have a nice loud printk when the smbfs module is plugged in to warn users that it's slated to be removed, and that they should move to CIFS as soon as possible.
Quoted 7 lines
Quoted 3 lines
Andrew has this with a target date of December 2006 (sic) for the removal buried in -mm...
True, but most users don't run -mm. I think we should have this marked as deprecated in mainline kernels before removing it. I rather like the idea of a runtime warning too...
drivers/pcmcia/pcmcia_ioctl.c was scheduled for removal in November 2005 and has such a printk since 2005.
Without any good reason why it's still in the kernel.
Quoted 3 lines
smbfs has the unfortunate quality of momentum. A lot of users aren't aware of CIFS at all since smbfs basically does what they need it to do. Some extra warning for those users would be nice.
And many users will start whining loudly that the not deprecated driver (in this case cifs) has this or that bug not before the patch to finally remove the deprecated feature got applied or at least posted.
And will demand that it therefore does not get removed.
Quoted 14 lines
Quoted 4 lines
Quoted 4 lines
Quoted 3 lines
In addition, cifs cannot completely replace smbfs atm. Even todays sold NAS-boxes (often running anchient samba-2.x.x) work only with smbfs on the client side.
Quoted 9 lines
Quoted 5 lines
It would be ideal if someone were to report these problems as bugs. I remember some of those in the past, but haven't heard of any cases of that sort of thing for some time. When I have, Steve has generally been very good about tracking down the cause and fixing it.
More exactly, one of the main advantages of removing redundant code like smbfs is that people are finally forced to report their bugs.
Quoted 5 lines
Indeed. I'm all for removing it, but I think we should try to have a clear transition path to avoid some of the "WTF happened to smbfs?" emails we're bound to get. Marking it deprecated in mainline and stating that it'll be removed in version 2.6.26 (or whenever) seems like a reasonable thing to do.
How many "WTF happened to smbfs?" emails did you get at RedHat?
Quoted 1 line
Just my $.02...
cu
Adrian
Signature · 4 lines
"Is there not promise of rain?" Ling Tan asked suddenly out
of the darkness. There had been need of rain for many days.
"Only a promise," Lao Er said.
Pearl S. Buck - Dragon SeedQuoted 61 lines · On Thu, 31 Jan 2008 02:47:17 +0200 Adrian Bunk <[email protected]> wrote:
Quoted 43 lines · Jeff Layton
Quoted 40 lines · On Thu, 31 Jan 2008 00:58:10 +0200 Adrian Bunk <[email protected]> wrote:
Quoted 38 lines · Jeff Layton
Quoted 12 lines · On Wed, 30 Jan 2008 22:16:13 +0100 Guenter Kukkukk <[email protected]> wrote:
Am Montag, 28. Januar 2008 schrieb Adrian Bunk:
Quoted 10 lines
I remember that there were some small things missing in CIFS for completely replacing the unmaintained smbfs when we discussed removing smbfs back in 2005 due to smbfs being unmaintained.
CIFS has improved since, smbfs is still unmaintained, and it's becoming time to finally remove smbfs.
Signed-off-by Adrian Bunk <[email protected]>Quoted 7 lines
"... unmaintained smbfs ..." is not quite right, see
http://lkml.org/lkml/2007/11/6/94
Before removing it now completely, drop
Jeff Layton <[email protected]>
a note.
Afaik, Redhat still has customers which rely on smbfs.Some of our older products use smbfs, but our newer stuff (RHEL5 and up) have smbfs disabled. Fedora has had smbfs disabled for quite some time as well. I've heard very few complaints (though maybe they're just not getting to me).
I have no problem with targeting smbfs for removal, but I thought Andrew had an unofficial policy that we should first mark things to be deprecated, and then remove them 2 releases later. That seems like a sensible policy to me. If we mark it deprecated in 2.6.25 then we can remove it after 2.6.26 is released.
It might not even hurt to have a nice loud printk when the smbfs module is plugged in to warn users that it's slated to be removed, and that they should move to CIFS as soon as possible.
Quoted 7 lines
Quoted 3 lines
Andrew has this with a target date of December 2006 (sic) for the removal buried in -mm...
True, but most users don't run -mm. I think we should have this marked as deprecated in mainline kernels before removing it. I rather like the idea of a runtime warning too...
drivers/pcmcia/pcmcia_ioctl.cwas scheduled for removal in November 2005 and has such a printk since 2005.Without any good reason why it's still in the kernel.
Quoted 3 lines
smbfs has the unfortunate quality of momentum. A lot of users aren't aware of CIFS at all since smbfs basically does what they need it to do. Some extra warning for those users would be nice.
Quoted 7 lines
And many users will start whining loudly that the not deprecated driver (in this case cifs) has this or that bug not before the patch to finally remove the deprecated feature got applied or at least posted.
And will demand that it therefore does not get removed.
Sucks for them then. They're always welcome to take the old code and maintain it out of tree if they wish.
Quoted 15 lines
Quoted 15 lines
Quoted 14 lines
Quoted 9 lines
Quoted 3 lines
In addition, cifs cannot completely replace smbfs atm. Even todays sold NAS-boxes (often running anchient samba-2.x.x) work only with smbfs on the client side.
It would be ideal if someone were to report these problems as bugs. I remember some of those in the past, but haven't heard of any cases of that sort of thing for some time. When I have, Steve has generally been very good about tracking down the cause and fixing it.
More exactly, one of the main advantages of removing redundant code like smbfs is that people are finally forced to report their bugs.
Quoted 8 lines
Quoted 5 lines
Indeed. I'm all for removing it, but I think we should try to have a clear transition path to avoid some of the "WTF happened to smbfs?" emails we're bound to get. Marking it deprecated in mainline and stating that it'll be removed in version 2.6.26 (or whenever) seems like a reasonable thing to do.
How many "WTF happened to smbfs?" emails did you get at RedHat?
Not too many, though we did have customers who demanded that we fix smbfs and refused to move to cifs. We did that for some of the older releases but they're out of luck on the new ones.
I don't feel strongly about this either way, really. In general, I think offering some warning is the better approach, but if you think that removing smbfs immediately is the right one then go for it...
Signature · 1 line
Jeff Layton <[email protected]>
Quoted 4 lines · Jeff Layton
On Thu, 31 Jan 2008 02:47:17 +0200
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
In addition, cifs cannot completely replace smbfs atm. Even todays sold NAS-boxes (often running anchient samba-2.x.x) work only with smbfs on the client side.
I am not convinced that this (mounting to older servers) would be a problem with the proper mount options but it is more intuitive for
smbfs for some of the lanman servers. I do want to make sure that we
don't make it too easy to mount with insecure lanman (ie due to downgrade attacks) without the user at least doing that (specify weak lanman security explicitly). Today the user has to explicitly specify sec=lanman which is confusing but at least makes explicit the weaker security.
There are four common issues with mounting to these very old servers:
1) remembering to mount specifying lanman security (sec=lanman)
2) remembering to specify the netbios name of the server on mount (which is often not be the same as its tcp name) - we can make this easier in mount.cifs though
3) some missing function (mostly relating to converting unix time to DOS time for set time functions, although the other way around works)
4) working around various server bugs (a surprising number of these)
Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
Quoted 5 lines
It would be ideal if someone were to report these problems as bugs. I remember some of those in the past, but haven't heard of any cases of that sort of thing for some time. When I have, Steve has generally been very good about tracking down the cause and fixing it.
More exactly, one of the main advantages of removing redundant code like smbfs is that people are finally forced to report their bugs.
Signature · 3 lines
Thanks, Steve
Quoted 14 lines · On Wed, 30 Jan 2008 19:30:55 -0600 "Steve French" <[email protected]> wrote:
Quoted 4 lines · Jeff Layton
On Thu, 31 Jan 2008 02:47:17 +0200
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
In addition, cifs cannot completely replace smbfs atm. Even todays sold NAS-boxes (often running anchient samba-2.x.x) work only with smbfs on the client side.
I am not convinced that this (mounting to older servers) would be a problem with the proper mount options but it is more intuitive for
smbfs for some of the lanman servers. I do want to make sure that we
don't make it too easy to mount with insecure lanman (ie due to downgrade attacks) without the user at least doing that (specify weak lanman security explicitly). Today the user has to explicitly specify sec=lanman which is confusing but at least makes explicit the weaker security.
Quoted 2 lines
There are four common issues with mounting to these very old servers:
1) remembering to mount specifying lanman security (sec=lanman)
I think it'd be nice to add an alias called oldsmb or similar for that option in mount.cifs. It should only be needed for old win9x servers.
Quoted 9 lines · Steve French
There are four common issues with mounting to these very old servers:
1) remembering to mount specifying lanman security (sec=lanman)
2) remembering to specify the netbios name of the server on mount (which is often not be the same as its tcp name) - we can make this easier in mount.cifs though
3) some missing function (mostly relating to converting unix time to DOS time for set time functions, although the other way around works)
4) working around various server bugs (a surprising number of these)
Could you perhaps just emulate it transparently in user space mount?
When smbfs is specifies use cifs with the correct legacy options.
-Andi
Quoted 9 lines · Adrian Bunk
Quoted 3 lines
smbfs has the unfortunate quality of momentum. A lot of users aren't aware of CIFS at all since smbfs basically does what they need it to do. Some extra warning for those users would be nice.
And many users will start whining loudly that the not deprecated driver (in this case cifs) has this or that bug not before the patch to finally remove the deprecated feature got applied or at least posted.
And will demand that it therefore does not get removed.
We've had about 3 of these in Debian since deciding to cut it from the upcoming release. (The kicker for us was the samba security update that wasn't tested with smbfs as a client.) The key regressions of interest relative to smbfs seem to be:
- lack of DFS support
- lack of netbios name resolution for UNC share names
The former seems to be a kernel issue whose resolution is in progress, and I think the latter would have to be addressed in the userspace mount tools?
Signature · 4 lines
Steve Langasek Give me a lever long enough and a Free OS Debian Developer to set it on, and I can move the world. Ubuntu Developer http://www.debian.org/ [email protected] [email protected]
Quoted 16 lines · Steve Langasek
Quoted 9 lines · Adrian Bunk
Quoted 3 lines
smbfs has the unfortunate quality of momentum. A lot of users aren't aware of CIFS at all since smbfs basically does what they need it to do. Some extra warning for those users would be nice.
And many users will start whining loudly that the not deprecated driver (in this case cifs) has this or that bug not before the patch to finally remove the deprecated feature got applied or at least posted.
And will demand that it therefore does not get removed.
We've had about 3 of these in Debian since deciding to cut it from the upcoming release. (The kicker for us was the samba security update that wasn't tested with smbfs as a client.) The key regressions of interest relative to smbfs seem to be:
Quoted 5 lines
- lack of DFS support
- lack of netbios name resolution for UNC share namesThe former seems to be a kernel issue whose resolution is in progress, and I think the latter would have to be addressed in the userspace mount tools?
DFS support has never been in any smb client except Windows and the user space smbclient (but only for about a year) - it has been in
Samba server for a while. The final piece necessary for DFS support
has not been merged but is expected in the next few weeks - Christoph and others noticed some problems during the review of the patch series that I would like to address including rewriting CIFSDFSGetReferral.
lack of automatic netbios name resolution for the server name portion of the UNC name was discussed in earlier posts - but can be done in mount.cifs. More intricate techniques (probing via astat for netbios name discovery - would require more kernel code)
Signature · 3 lines
Thanks, Steve
Quoted 11 lines · Jeff Layton
Some of our older products use smbfs, but our newer stuff (RHEL5 and up) have smbfs disabled. Fedora has had smbfs disabled for quite some time as well. I've heard very few complaints (though maybe they're just not getting to me).
I have no problem with targeting smbfs for removal, but I thought Andrew had an unofficial policy that we should first mark things to be deprecated, and then remove them 2 releases later. That seems like a sensible policy to me. If we mark it deprecated in 2.6.25 then we can remove it after 2.6.26 is released.
Quoted 8 lines
It might not even hurt to have a nice loud printk when the smbfs module is plugged in to warn users that it's slated to be removed, and that they should move to CIFS as soon as possible.
It would be ideal if someone were to report these problems as bugs. I remember some of those in the past, but haven't heard of any cases of that sort of thing for some time. When I have, Steve has generally been very good about tracking down the cause and fixing it.
But if smbfs works when cifs doesn't, most people figure it's supposed to be that way and smbfs works so what's to complain about?
I too have had cifs not work for some devices, and I actually thought that was intentional. I will try to keep a note of what device that was.
--
Len Sorensen
Andrew Morton
Acked-by Steven FrenchQuoted 9 lines · On Wed, 30 Jan 2008 17:41:03 -0500 Jeff Layton <[email protected]> wrote:
I have no problem with targeting smbfs for removal, but I thought Andrew had an unofficial policy that we should first mark things to be deprecated, and then remove them 2 releases later. That seems like a sensible policy to me. If we mark it deprecated in 2.6.25 then we can remove it after 2.6.26 is released.
It might not even hurt to have a nice loud printk when the smbfs module is plugged in to warn users that it's slated to be removed, and that they should move to CIFS as soon as possible.
I've patiently had this:
From: Andrew Morton <[email protected]>
smbfs is a bit buggy and has no maintainer. Change it to shout at the user on the first five mount attempts - tell them to switch to CIFS.
Come December we'll mark it BROKEN and see what happens.
---
fs/Kconfig | 28 ++++++++++++++-------------- fs/smbfs/inode.c | 7 +++++++ 2 files changed, 21 insertions(+), 14 deletions(-)
fs/Kconfig renamed from fs/Kconfig~deprecate-smbfs-in-favour-of-cifs +14 -14
@@ -1181,7 +1181,7 @@ config BEFS_DEBUG depends on BEFS_FS help If you say Y here, you can use the 'debug' mount option to enable - debugging output from the driver. + debugging output from the driver. config BFS_FS tristate "BFS file system support (EXPERIMENTAL)"
@@ -1292,7 +1292,7 @@ config JFFS2_FS_XATTR Extended attributes are name:value pairs associated with inodes by the kernel or by users (see the attr(5) manual page, or visit <http://acl.bestbits.at/> for details). - + If unsure, say N. config JFFS2_FS_POSIX_ACL
@@ -1303,10 +1303,10 @@ config JFFS2_FS_POSIX_ACL help Posix Access Control Lists (ACLs) support permissions for users and groups beyond the owner/group/world scheme. - + To learn more about Access Control Lists, visit the Posix ACLs for Linux website <http://acl.bestbits.at/>. - + If you don't know what Access Control Lists are, say N config JFFS2_FS_SECURITY
@@ -1318,7 +1318,7 @@ config JFFS2_FS_SECURITY implemented by security modules like SELinux. This option enables an extended attribute handler for file security labels in the jffs2 filesystem. - + If you are not using a security module that requires using extended attributes for file security labels, say N.
@@ -1862,7 +1862,7 @@ config RPCSEC_GSS_SPKM3 If unsure, say N. config SMB_FS - tristate "SMB file system support (to mount Windows shares etc.)" + tristate "SMB file system support (OBSOLETE, please use CIFS)" depends on INET select NLS help
@@ -1885,8 +1885,8 @@ config SMB_FS General information about how to connect Linux, Windows machines and Macs is on the WWW at <http://www.eats.com/linux_mac_win.html>. - To compile the SMB support as a module, choose M here: the module will - be called smbfs. Most people say N, however. + To compile the SMB support as a module, choose M here: + the module will be called smbfs. Most people say N, however. config SMB_NLS_DEFAULT bool "Use a default NLS"
@@ -1918,7 +1918,7 @@ config SMB_NLS_REMOTE smbmount from samba 2.2.0 or later supports this. config CIFS - tristate "CIFS support (advanced network filesystem for Samba, Window and other CIFS compliant servers)" + tristate "CIFS support (advanced network filesystem, SMBFS successor)" depends on INET select NLS help
@@ -1976,16 +1976,16 @@ config CIFS_WEAK_PW_HASH LANMAN based servers such as OS/2 and Windows 95, but such mounts may be less secure than mounts using NTLM or more recent security mechanisms if you are on a public network. Unless you - have a need to access old SMB servers (and are on a private + have a need to access old SMB servers (and are on a private network) you probably want to say N. Even if this support is enabled in the kernel build, LANMAN authentication will not be used automatically. At runtime LANMAN mounts are disabled but can be set to required (or optional) either in /proc/fs/cifs (see fs/cifs/README for more detail) or via an - option on the mount command. This support is disabled by + option on the mount command. This support is disabled by default in order to reduce the possibility of a downgrade attack. - + If unsure, say N. config CIFS_XATTR
@@ -2026,7 +2026,7 @@ config CIFS_DEBUG2 messages in some error paths, slowing performance. This option can be turned off unless you are debugging cifs problems. If unsure, say N. - + config CIFS_EXPERIMENTAL bool "CIFS Experimental Features (EXPERIMENTAL)" depends on CIFS && EXPERIMENTAL
@@ -2117,7 +2117,7 @@ config CODA_FS_OLD_API However this new API is not backward compatible with older clients. If you really need to run the old Coda userspace cache manager then say Y. - + For most cases you probably want to say N. config AFS_FS
fs/smbfs/inode.c renamed from fs/smbfs/inode.c~deprecate-smbfs-in-favour-of-cifs +7 -0
@@ -500,6 +500,13 @@ static int smb_fill_super(struct super_bstruct smb_fattr root;int ver;void *mem; +static int warn_count; + +if (warn_count <5 ) { + warn_count++; +printk (KERN_EMERG "smbfs is deprecated and will be removed in" +" December, 2006. Please migrate to cifs\n" ); + }if (!raw_data) goto out_no_data;
_
queued for over 1.5 years waiting for the go-ahead from Steve.
It looks like it's time? If so, what should I set the date to?
Quoted 166 lines · On Tue, 5 Feb 2008 00:18:05 -0800 Andrew Morton <[email protected]>…
Quoted 9 lines · On Wed, 30 Jan 2008 17:41:03 -0500 Jeff Layton <[email protected]> wrote:
I have no problem with targeting smbfs for removal, but I thought Andrew had an unofficial policy that we should first mark things to be deprecated, and then remove them 2 releases later. That seems like a sensible policy to me. If we mark it deprecated in 2.6.25 then we can remove it after 2.6.26 is released.
It might not even hurt to have a nice loud printk when the smbfs module is plugged in to warn users that it's slated to be removed, and that they should move to CIFS as soon as possible.
I've patiently had this:
From: Andrew Morton <[email protected]>
smbfs is a bit buggy and has no maintainer. Change it to shout at the user on the first five mount attempts - tell them to switch to CIFS.
Come December we'll mark it BROKEN and see what happens.
[[email protected]: documentation update]Cc Urban Widmark <[email protected]>Acked-by Steven French <[email protected]>Signed-off-by Oleg Verych <[email protected]>Cc <[email protected].Signed-off-by Andrew Morton <[email protected]>---
fs/Kconfig | 28 ++++++++++++++-------------- fs/smbfs/inode.c | 7 +++++++ 2 files changed, 21 insertions(+), 14 deletions(-)diff -puN
fs/Kconfig~deprecate-smbfs-in-favour-of-cifsfs/Kconfigfs/Kconfig renamed from fs/Kconfig~deprecate-smbfs-in-favour-of-cifs +14
-14@@ -1181,7 +1181,7 @@ config BEFS_DEBUG depends on BEFS_FS help If you say Y here, you can use the 'debug' mount option to enable - debugging output from the driver. + debugging output from the driver. config BFS_FS tristate "BFS file system support (EXPERIMENTAL)"@@ -1292,7 +1292,7 @@ config JFFS2_FS_XATTR Extended attributes are name:value pairs associated with inodes by the kernel or by users (see the attr(5) manual page, or visit <http://acl.bestbits.at/> for details). - + If unsure, say N. config JFFS2_FS_POSIX_ACL@@ -1303,10 +1303,10 @@ config JFFS2_FS_POSIX_ACL help Posix Access Control Lists (ACLs) support permissions for users and groups beyond the owner/group/world scheme. - + To learn more about Access Control Lists, visit the Posix ACLs for Linux website <http://acl.bestbits.at/>. - + If you don't know what Access Control Lists are, say N config JFFS2_FS_SECURITY@@ -1318,7 +1318,7 @@ config JFFS2_FS_SECURITY implemented by security modules like SELinux. This option enables an extended attribute handler for file security labels in the jffs2 filesystem. - + If you are not using a security module that requires using extended attributes for file security labels, say N.@@ -1862,7 +1862,7 @@ config RPCSEC_GSS_SPKM3 If unsure, say N. config SMB_FS - tristate "SMB file system support (to mount Windows shares etc.)" + tristate "SMB file system support (OBSOLETE, please use CIFS)" depends on INET select NLS help@@ -1885,8 +1885,8 @@ config SMB_FS General information about how to connect Linux, Windows machines and Macs is on the WWW at <http://www.eats.com/linux_mac_win.html>. - To compile the SMB support as a module, choose M here: the module will - be called smbfs. Most people say N, however. + To compile the SMB support as a module, choose M here: + the module will be called smbfs. Most people say N, however. config SMB_NLS_DEFAULT bool "Use a default NLS"@@ -1918,7 +1918,7 @@ config SMB_NLS_REMOTE smbmount from samba 2.2.0 or later supports this. config CIFS - tristate "CIFS support (advanced network filesystem for Samba, Window and other CIFS compliant servers)" + tristate "CIFS support (advanced network filesystem, SMBFS successor)" depends on INET select NLS help@@ -1976,16 +1976,16 @@ config CIFS_WEAK_PW_HASH LANMAN based servers such as OS/2 and Windows 95, but such mounts may be less secure than mounts using NTLM or more recent security mechanisms if you are on a public network. Unless you - have a need to access old SMB servers (and are on a private + have a need to access old SMB servers (and are on a private network) you probably want to say N. Even if this support is enabled in the kernel build, LANMAN authentication will not be used automatically. At runtime LANMAN mounts are disabled but can be set to required (or optional) either in /proc/fs/cifs (see fs/cifs/README for more detail) or via an - option on the mount command. This support is disabled by + option on the mount command. This support is disabled by default in order to reduce the possibility of a downgrade attack. - + If unsure, say N. config CIFS_XATTR@@ -2026,7 +2026,7 @@ config CIFS_DEBUG2 messages in some error paths, slowing performance. This option can be turned off unless you are debugging cifs problems. If unsure, say N. - + config CIFS_EXPERIMENTAL bool "CIFS Experimental Features (EXPERIMENTAL)" depends on CIFS && EXPERIMENTAL@@ -2117,7 +2117,7 @@ config CODA_FS_OLD_API However this new API is not backward compatible with older clients. If you really need to run the old Coda userspace cache manager then say Y. - + For most cases you probably want to say N. config AFS_FSdiff -puN
fs/smbfs/inode.c~deprecate-smbfs-in-favour-of-cifsfs/smbfs/inode.cfs/smbfs/inode.c renamed from fs/smbfs/inode.c~deprecate-smbfs-in-favour-of-cifs +7
-0@@ -500,6 +500,13 @@ static int smb_fill_super(struct super_bstruct smb_fattr root;int ver;void *mem; +static int warn_count; + +if (warn_count <5 ) { + warn_count++; +printk (KERN_EMERG "smbfs is deprecated and will be removed in" +" December, 2006. Please migrate to cifs\n" ); + }if (!raw_data) goto out_no_data;_
Quoted 3 lines
queued for over 1.5 years waiting for the go-ahead from Steve.
It looks like it's time? If so, what should I set the date to?
Looks good to me. I'd suggest that we change the printk's to refer to a release version and state that it will be removed in for 2.6.26 (or 2.6.27 if that's not enough notice). Then, once the previous version is released, remove it from the tree as soon as possible.
Signature · 1 line
Jeff Layton <[email protected]>
Quoted 6 lines · On Tue, 5 Feb 2008 06:31:14 -0500 Jeff Layton <[email protected]> wrote:
Quoted 1 line
It looks like it's time? If so, what should I set the date to?
Looks good to me. I'd suggest that we change the printk's to refer to a release version and state that it will be removed in for 2.6.26 (or 2.6.27 if that's not enough notice). Then, once the previous version is released, remove it from the tree as soon as possible.
OK. smbfs is not exactly hurting us being there so I made it "will be removed from the 2.6.27 kernel". That gives the public the full 2.6.25->2.6.26 time period in which to discover what we're proposing and to make any objections.
fs/smbfs/inode.c static int smb_fill_super(struct super_b · line 508
Quoted 9 lines · El Tue, 5 Feb 2008 00:18:05 -0800 Andrew Morton <[email protected]>…
fs/smbfs/inode.c renamed from fs/smbfs/inode.c~deprecate-smbfs-in-favour-of-cifs +6
-0struct smb_fattr root;int ver;void *mem; +static int warn_count; + +if (warn_count <5 ) { + warn_count++; +printk (KERN_EMERG "smbfs is deprecated and will be removed in" +" December, 2006. Please migrate to cifs\n" );
Surely you mean ^^^^ ??? ¿2008?
Quoted 15 lines
fs/smbfs/inode.c renamed from fs/smbfs/inode.c~deprecate-smbfs-in-favour-of-cifs +1
-0+ }if (!raw_data) goto out_no_data;_
queued for over 1.5 years waiting for the go-ahead from Steve.
It looks like it's time? If so, what should I set the date to? --
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Quoted 31 lines · Andrew Morton
Quoted 9 lines · On Wed, 30 Jan 2008 17:41:03 -0500 Jeff Layton <[email protected]> wrote:
I have no problem with targeting smbfs for removal, but I thought Andrew had an unofficial policy that we should first mark things to be deprecated, and then remove them 2 releases later. That seems like a sensible policy to me. If we mark it deprecated in 2.6.25 then we can remove it after 2.6.26 is released.
It might not even hurt to have a nice loud printk when the smbfs module is plugged in to warn users that it's slated to be removed, and that they should move to CIFS as soon as possible.
From: Andrew Morton <[email protected]>
smbfs is a bit buggy and has no maintainer. Change it to shout at the user on the first five mount attempts - tell them to switch to CIFS.
Come December we'll mark it BROKEN and see what happens.
fs/smbfs/inode.c renamed from fs/smbfs/inode.c~deprecate-smbfs-in-favour-of-cifs +5
-0+if (warn_count <5 ) { + warn_count++; +printk (KERN_EMERG "smbfs is deprecated and will be removed in" +" December, 2006. Please migrate to cifs\n" ); + }if (!raw_data) goto out_no_data;_
Quoted 3 lines
queued for over 1.5 years waiting for the go-ahead from Steve.
It looks like it's time? If so, what should I set the date to?
If the 2.6.26 cycle would starts in April, then saying April 2008 is fine with me.
Signature · 3 lines
Thanks, Steve