The Samba-Bugzilla – Attachment 14098 Details for
Bug 13363
Don't use the directory cache for SMB2/3
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
git-am fix for 4.8.next, 4.7.next.
0001-s3-smbd-don-t-use-the-directory-cache-for-SMB2-3.patch (text/plain), 3.30 KB, created by
Jeremy Allison
on 2018-03-30 21:00:14 UTC
(
hide
)
Description:
git-am fix for 4.8.next, 4.7.next.
Filename:
MIME Type:
Creator:
Jeremy Allison
Created:
2018-03-30 21:00:14 UTC
Size:
3.30 KB
patch
obsolete
>From 969647a3d9922908d96387289fe72ba4b8ecdf5f Mon Sep 17 00:00:00 2001 >From: Ralph Boehme <slow@samba.org> >Date: Thu, 29 Mar 2018 20:06:47 +0200 >Subject: [PATCH] s3:smbd: don't use the directory cache for SMB2/3 > >Bug: https://bugzilla.samba.org/show_bug.cgi?id=13363 > >Signed-off-by: Ralph Boehme <slow@samba.org> >Reviewed-by: Jeremy Allison <jra@samba.org> > >Autobuild-User(master): Jeremy Allison <jra@samba.org> >Autobuild-Date(master): Fri Mar 30 03:51:48 CEST 2018 on sn-devel-144 > >(cherry picked from commit 66052fdccd28922cf1caa2bc750e39051a6414cf) >--- > .../misc/directorynamecachesize.xml | 5 +-- > source3/smbd/dir.c | 32 +++++++++++++++++-- > 2 files changed, 32 insertions(+), 5 deletions(-) > >diff --git a/docs-xml/smbdotconf/misc/directorynamecachesize.xml b/docs-xml/smbdotconf/misc/directorynamecachesize.xml >index 7a89bf2ed64..22999a6964e 100644 >--- a/docs-xml/smbdotconf/misc/directorynamecachesize.xml >+++ b/docs-xml/smbdotconf/misc/directorynamecachesize.xml >@@ -4,8 +4,9 @@ > xmlns:samba="http://www.samba.org/samba/DTD/samba-doc"> > <description> > <para> >- This parameter specifies the size of the directory name cache. >- It will be needed to turn this off for *BSD systems. >+ This parameter specifies the size of the directory name cache for SMB1 >+ connections. It is not used for SMB2. It will be needed to turn this off >+ for *BSD systems. > </para> > > </description> >diff --git a/source3/smbd/dir.c b/source3/smbd/dir.c >index 6621b4ee387..801daa5caa7 100644 >--- a/source3/smbd/dir.c >+++ b/source3/smbd/dir.c >@@ -1219,7 +1219,15 @@ bool smbd_dirptr_get_entry(TALLOC_CTX *ctx, > mask, smb_fname_str_dbg(&smb_fname), > dname, fname)); > >- DirCacheAdd(dirptr->dir_hnd, dname, cur_offset); >+ if (!conn->sconn->using_smb2) { >+ /* >+ * The dircache is only needed for SMB1 because SMB1 >+ * uses a name for the resume wheras SMB2 always >+ * continues from the next position (unless it's told to >+ * restart or close-and-reopen the listing). >+ */ >+ DirCacheAdd(dirptr->dir_hnd, dname, cur_offset); >+ } > > TALLOC_FREE(dname); > >@@ -1646,7 +1654,16 @@ static struct smb_Dir *OpenDir_internal(TALLOC_CTX *mem_ctx, > } > > dirp->conn = conn; >- dirp->name_cache_size = lp_directory_name_cache_size(SNUM(conn)); >+ >+ if (!conn->sconn->using_smb2) { >+ /* >+ * The dircache is only needed for SMB1 because SMB1 uses a name >+ * for the resume wheras SMB2 always continues from the next >+ * position (unless it's told to restart or close-and-reopen the >+ * listing). >+ */ >+ dirp->name_cache_size = lp_directory_name_cache_size(SNUM(conn)); >+ } > > if (sconn && !sconn->using_smb2) { > sconn->searches.dirhandles_open++; >@@ -1768,7 +1785,16 @@ static struct smb_Dir *OpenDir_fsp(TALLOC_CTX *mem_ctx, connection_struct *conn, > } > > dirp->conn = conn; >- dirp->name_cache_size = lp_directory_name_cache_size(SNUM(conn)); >+ >+ if (!conn->sconn->using_smb2) { >+ /* >+ * The dircache is only needed for SMB1 because SMB1 uses a name >+ * for the resume wheras SMB2 always continues from the next >+ * position (unless it's told to restart or close-and-reopen the >+ * listing). >+ */ >+ dirp->name_cache_size = lp_directory_name_cache_size(SNUM(conn)); >+ } > > dirp->dir_smb_fname = cp_smb_filename(dirp, fsp->fsp_name); > if (!dirp->dir_smb_fname) { >-- >2.17.0.rc1.321.gba9d0f2565-goog >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Flags:
slow
:
review+
Actions:
View
Attachments on
bug 13363
: 14098