Browse Source

cifsd: update to git (2019-10-08)

Signed-off-by: Richard Yu <yurichard3839@gmail.com>
lilik-openwrt-22.03
Richard Yu 5 years ago
parent
commit
f6ee8cb4e2
No known key found for this signature in database GPG Key ID: D16286AFD4E1FFF3
5 changed files with 13 additions and 130 deletions
  1. +3
    -3
      kernel/cifsd/Makefile
  2. +0
    -33
      kernel/cifsd/patches/001-mips-vfree_vmalloc-fix.patch
  3. +0
    -89
      kernel/cifsd/patches/002-fix-xattr_list.patch
  4. +5
    -5
      net/cifsd-tools/Makefile
  5. +5
    -0
      net/cifsd-tools/files/smb.conf.help

+ 3
- 3
kernel/cifsd/Makefile View File

@ -5,9 +5,9 @@ PKG_RELEASE:=1
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://github.com/cifsd-team/cifsd.git
PKG_SOURCE_DATE:=2019-08-19
PKG_SOURCE_VERSION:=b919acf32027cd5d7616726336305b47e24f02ab
PKG_MIRROR_HASH:=fd64b2cb78b8847f11ff79cbe06c3416bb0e67ca7433215d20c810fbfff6ee8f
PKG_SOURCE_DATE:=2019-10-08
PKG_SOURCE_VERSION:=ef6e0d530907576bb886866bef53e2f44c054c7f
PKG_MIRROR_HASH:=bc06d3bdc36efc85e6eb5c6ba966e9720455dcbd074541cd9cf807a4bd5246f9
PKG_MAINTAINER:=Andy Walsh <andy.walsh44+github@gmail.com>
PKG_LICENSE:=GPL-2.0-or-later


+ 0
- 33
kernel/cifsd/patches/001-mips-vfree_vmalloc-fix.patch View File

@ -1,33 +0,0 @@
--- a/vfs_cache.c
+++ b/vfs_cache.c
@@ -232,7 +232,7 @@ int __init cifsd_inode_hash_init(void)
size = bucketsize << inode_hash_shift;
/* init master fp hash table */
- inode_hashtable = __vmalloc(size, GFP_ATOMIC, PAGE_KERNEL);
+ inode_hashtable = vmalloc(size);
if (!inode_hashtable)
return -ENOMEM;
--- b/vfs.c
+++ b/vfs.c
@@ -17,6 +17,8 @@
#include <linux/fsnotify.h>
#include <linux/dcache.h>
#include <linux/fiemap.h>
+#include <linux/slab.h>
+#include <linux/vmalloc.h>
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 11, 0)
#include <linux/sched/xacct.h>
--- b/vfs_cache.c
+++ b/vfs_cache.c
@@ -5,6 +5,8 @@
*/
#include <linux/fs.h>
+#include <linux/slab.h>
+#include <linux/vmalloc.h>
/* @FIXME */
#include "glob.h"

+ 0
- 89
kernel/cifsd/patches/002-fix-xattr_list.patch View File

@ -1,89 +0,0 @@
===
SMB1/SMB2 don't know exactly how vfs layer allocates xattr list,
via kmalloc() or vmalloc(). Introduce cifsd_vfs_xattr_free() and
keep both xattr allocation and de-allocation in one place.
Signed-off-by: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
---
smb1pdu.c | 4 ++--
smb2pdu.c | 6 ++----
vfs.c | 6 ++++++
vfs.h | 1 +
4 files changed, 11 insertions(+), 6 deletions(-)
diff --git a/smb1pdu.c b/smb1pdu.c
index 35599ef..8cb92cf 100644
--- a/smb1pdu.c
+++ b/smb1pdu.c
@@ -8,6 +8,7 @@
#include <linux/posix_acl_xattr.h>
#include <linux/namei.h>
#include <linux/statfs.h>
+#include <linux/vmalloc.h>
#include "glob.h"
#include "smb1pdu.h"
@@ -3844,8 +3845,7 @@ done:
rsp->ByteCount = cpu_to_le16(rsp_data_cnt + 5);
inc_rfc1001_len(&rsp->hdr, (10 * 2 + rsp->ByteCount));
out:
- if (xattr_list)
- vfree(xattr_list);
+ cifsd_vfs_xattr_free(xattr_list);
return rc;
}
diff --git a/smb2pdu.c b/smb2pdu.c
index 754258f..2727622 100644
--- a/smb2pdu.c
+++ b/smb2pdu.c
@@ -3867,8 +3867,7 @@ done:
rsp->OutputBufferLength = cpu_to_le32(rsp_data_cnt);
inc_rfc1001_len(rsp_org, rsp_data_cnt);
out:
- if (xattr_list)
- vfree(xattr_list);
+ cifsd_vfs_xattr_free(xattr_list);
return rc;
}
@@ -4151,8 +4150,7 @@ static void get_file_stream_info(struct cifsd_work *work,
/* last entry offset should be 0 */
file_info->NextEntryOffset = 0;
out:
- if (xattr_list)
- vfree(xattr_list);
+ cifsd_vfs_xattr_free(xattr_list);
rsp->OutputBufferLength = cpu_to_le32(nbytes);
inc_rfc1001_len(rsp_org, nbytes);
diff --git a/vfs.c b/vfs.c
index 556b1a5..6da6f8e 100644
--- a/vfs.c
+++ b/vfs.c
@@ -1550,6 +1550,12 @@ int cifsd_vfs_remove_xattr(struct dentry *dentry, char *attr_name)
return vfs_removexattr(dentry, attr_name);
}
+void cifsd_vfs_xattr_free(char *xattr)
+{
+ if (xattr)
+ vfree(xattr);
+}
+
int cifsd_vfs_unlink(struct dentry *dir, struct dentry *dentry)
{
int err = 0;
diff --git a/vfs.h b/vfs.h
index ee54daf..16b4f9e 100644
--- a/vfs.h
+++ b/vfs.h
@@ -186,6 +186,7 @@ int cifsd_vfs_xattr_stream_name(char *stream_name,
int cifsd_vfs_truncate_xattr(struct dentry *dentry, int wo_streams);
int cifsd_vfs_remove_xattr(struct dentry *dentry, char *attr_name);
+void cifsd_vfs_xattr_free(char *xattr);
int cifsd_vfs_kern_path(char *name, unsigned int flags, struct path *path,
bool caseless);

+ 5
- 5
net/cifsd-tools/Makefile View File

@ -5,9 +5,9 @@ PKG_RELEASE:=1
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://github.com/cifsd-team/cifsd-tools.git
PKG_SOURCE_DATE:=2019-08-19
PKG_SOURCE_VERSION:=bbeab27f0a1695f711fb84d9cd29a83f818ef90e
PKG_MIRROR_HASH:=f8bef545400aa8c0db6ba0fffdf0c0a2f201603503728f140df133aff3a39cbb
PKG_SOURCE_DATE:=2019-10-08
PKG_SOURCE_VERSION:=4bc2d762eb32577b30a14b6991cd10026d99eb05
PKG_MIRROR_HASH:=87edfb18bcf7c3c8558dc649b91a470aba0cee781e448b2f56ef7d774b6b40d3
PKG_MAINTAINER:=Andy Walsh <andy.walsh44+github@gmail.com>
PKG_LICENSE:=GPL-2.0-or-later
@ -31,7 +31,7 @@ define Package/cifsd-tools
endef
define Package/cifsd-tools/description
Userspace tools (cifsd, cifsadmin) for the CIFS/SMB kernel fileserver.
Userspace tools (cifsd, cifsuseradd, cifsshareadd) for the CIFS/SMB kernel fileserver.
The config file location is /etc/cifs/smb.conf
endef
@ -39,7 +39,7 @@ define Package/cifsd-tools/install
$(INSTALL_DIR) $(1)/usr/lib
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libcifsdtools.so* $(1)/usr/lib/
$(INSTALL_DIR) $(1)/usr/sbin
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/{cifsadmin,cifsd} $(1)/usr/sbin/
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/{cifsuseradd,cifsshareadd,cifsd} $(1)/usr/sbin/
$(INSTALL_DIR) $(1)/etc/config $(1)/etc/cifs $(1)/etc/init.d
$(INSTALL_CONF) ./files/cifsd.config $(1)/etc/config/cifsd
$(INSTALL_DATA) ./files/smb.conf.template $(1)/etc/cifs/


+ 5
- 0
net/cifsd-tools/files/smb.conf.help View File

@ -54,6 +54,11 @@
; the number of minutes of inactivity before a connection is
; considered dead, and it is disconnected. The deadtime only
; takes effect if the number of open files is zero.
; - root directory
; Sets up a root (base) directory for all shares. In some
; sense it's equal to chroot(). When this option set all shares'
; paths become relative to root directory, IOW the file name
; lookup resolves '/root directory/share path/file path' path.
;
; Supported [share] level parameters list:
; - comment


Loading…
Cancel
Save