The Samba-Bugzilla – Attachment 15866 Details for
Bug 14237
Repeated mtab loop in vfs_fileid causing slow performance
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch for 4.11 backported from master
bug14237-v411.patch (text/plain), 2.03 KB, created by
Ralph Böhme
on 2020-03-16 13:49:41 UTC
(
hide
)
Description:
Patch for 4.11 backported from master
Filename:
MIME Type:
Creator:
Ralph Böhme
Created:
2020-03-16 13:49:41 UTC
Size:
2.03 KB
patch
obsolete
>From 446cf8b5c2c74179f1e74a01f270cdf28263fff3 Mon Sep 17 00:00:00 2001 >From: Ralph Boehme <slow@samba.org> >Date: Fri, 17 Jan 2020 10:56:00 +0100 >Subject: [PATCH] smbd: avoid calling vfs_file_id_from_sbuf() if statinfo is > not valid > >When we're about to create a file, the stat info will be all zero, so >vfs_file_id_from_sbuf() would return a bogus file_id. This is normally not a >problem, as open_file() itself also calls vfs_file_id_from_sbuf() after having >created the file. > >This is however a problem when using the VFS module fileid, as that is doing >caching of /etc/mtab and failing to find smb_fname->st.st_ex_dev (all zero in >this case when creating a new file) in the mtab cache will trigger a mtab reload >which can be *very* expensive. > >Copying many small files to a Samba server in this situation will result in >abysimal performance. > >BUG: https://bugzilla.samba.org/show_bug.cgi?id=14237 > >Pair-Programmed-With: Jeremy Allison <jra@samba.org> >Signed-off-by: Ralph Boehme <slow@samba.org> > >Autobuild-User(master): Jeremy Allison <jra@samba.org> >Autobuild-Date(master): Fri Jan 17 22:38:14 UTC 2020 on sn-devel-184 > >(backported from commit 7606800b798a31d62e69f61d441201e5db2f0d8a) >--- > source3/smbd/open.c | 10 +++++++++- > 1 file changed, 9 insertions(+), 1 deletion(-) > >diff --git a/source3/smbd/open.c b/source3/smbd/open.c >index 871cc72053f..888e6ad3af7 100644 >--- a/source3/smbd/open.c >+++ b/source3/smbd/open.c >@@ -3245,7 +3245,15 @@ static NTSTATUS open_file_ntcreate(connection_struct *conn, > return NT_STATUS_ACCESS_DENIED; > } > >- fsp->file_id = vfs_file_id_from_sbuf(conn, &smb_fname->st); >+ if (VALID_STAT(smb_fname->st)) { >+ /* >+ * Only try and create a file id before open >+ * for an existing file. For a file being created >+ * this won't do anything useful until the file >+ * exists and has a valid stat struct. >+ */ >+ fsp->file_id = vfs_file_id_from_sbuf(conn, &smb_fname->st); >+ } > fsp->share_access = share_access; > fsp->fh->private_options = private_flags; > fsp->access_mask = open_access_mask; /* We change this to the >-- >2.24.1 >
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:
jra
:
review+
Actions:
View
Attachments on
bug 14237
: 15866