[PATCH] Change "strict sync" paramter from "no" to "yes" by default for 4.7.0.
Christof Schmitt
cs at samba.org
Thu Mar 23 16:17:00 UTC 2017
On Thu, Mar 23, 2017 at 09:08:55AM -0700, Jeremy Allison via samba-technical wrote:
> On Thu, Mar 23, 2017 at 08:10:31AM -0700, Jeremy Allison via samba-technical wrote:
> > On Thu, Mar 23, 2017 at 03:34:22PM +0100, Christian Ambach via samba-technical wrote:
> > > > Thanks, I won't post a new version of the patch for
> > > > this but will fix if when I push if the consensus
> > > > is for accepting the change.
> > >
> > > I consent to the change. Don't we need a patch for WHATSNEW as well?
> >
> > Oh good point. Updated patch to follow.
>
> Here it is with added WHATSNEW change.
>
> Please review !
>
> Jeremy.
Thank you.
Reviewed-by: Christof Schmitt <cs at samba.org>
> From 3192fa01c264c8a86633cbcff4250aec9c2075c4 Mon Sep 17 00:00:00 2001
> From: Jeremy Allison <jra at samba.org>
> Date: Wed, 22 Mar 2017 19:22:31 -0700
> Subject: [PATCH 1/2] s3: smbd: Change "strict sync" paramter from "no" to
> "yes" for 4.7.0.
>
> Document change and modify in loadparm.c.
> Safer default for new installs and vendors.
>
> Signed-off-by: Jeremy Allison <jra at samba.org>
> ---
> docs-xml/smbdotconf/tuning/strictsync.xml | 48 +++++++++++++++++++------------
> source3/param/loadparm.c | 2 +-
> 2 files changed, 31 insertions(+), 19 deletions(-)
>
> diff --git a/docs-xml/smbdotconf/tuning/strictsync.xml b/docs-xml/smbdotconf/tuning/strictsync.xml
> index 5cfd388..f2e3788 100644
> --- a/docs-xml/smbdotconf/tuning/strictsync.xml
> +++ b/docs-xml/smbdotconf/tuning/strictsync.xml
> @@ -3,26 +3,38 @@
> type="boolean"
> xmlns:samba="http://www.samba.org/samba/DTD/samba-doc">
> <description>
> - <para>Many Windows applications (including the Windows 98 explorer
> - shell) seem to confuse flushing buffer contents to disk with doing
> - a sync to disk. Under UNIX, a sync call forces the thread to be
> - suspended until the kernel has ensured that all outstanding data in
> - kernel disk buffers has been safely stored onto stable storage.
> - This is very slow and should only be done rarely. Setting this
> - parameter to <constant>no</constant> (the default) means that
> - <citerefentry><refentrytitle>smbd</refentrytitle>
> - <manvolnum>8</manvolnum></citerefentry> ignores the Windows
> - applications requests for a sync call. There is only a possibility
> - of losing data if the operating system itself that Samba is running
> - on crashes, so there is little danger in this default setting. In
> - addition, this fixes many performance problems that people have
> - reported with the new Windows98 explorer shell file copies.</para>
> + <para>This parameter controls whether Samba honors a request
> + from an SMB client to ensure any outstanding operating system
> + buffer contents held in memory are safely written onto stable
> + storage on disk. If set to <constant>yes</constant>, which is
> + the default, then Windows applications can force the smbd server
> + to synchronize unwritten data onto the disk. If set to
> + <constant>no</constant> then smbd will ignore client
> + requests to synchronize unwritten data onto stable storage on
> + disk.</para>
> +
> + <para>In Samba 4.7.0, the default for this parameter changed from
> + <constant>no</constant> to <constant>yes</constant> to better
> + match the expectations of SMB2/3 clients and improve application
> + safety when running against smbd.</para>
> +
> <para>The flush request from SMB2/3 clients is handled
> - asynchronously, so for these clients setting the parameter
> - to <constant>yes</constant> does not block the processing of other
> - requests in the smbd process.</para>
> + asynchronously inside smbd, so leaving the parameter as the default
> + value of <constant>yes</constant> does not block the processing of
> + other requests to the smbd process.</para>
> +
> + <para>Legacy Windows applications (such as the Windows 98 explorer
> + shell) seemed to confuse writing buffer contents to the operating
> + system with synchronously writing outstanding data onto stable storage
> + on disk. Changing this parameter to <constant>no</constant> means that
> + <citerefentry><refentrytitle>smbd</refentrytitle>
> + <manvolnum>8</manvolnum></citerefentry> will ignore the Windows
> + applications request to synchronize unwritten data onto disk. Only
> + consider changing this if smbd is serving obsolete SMB1 Windows clients
> + prior to Windows XP (Windows 98 and below). There should be no need to
> + change this setting for normal operations.</para>
> </description>
>
> <related>sync always</related>
> -<value type="default">no</value>
> +<value type="default">yes</value>
> </samba:parameter>
> diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c
> index c65e613..57220a6 100644
> --- a/source3/param/loadparm.c
> +++ b/source3/param/loadparm.c
> @@ -207,7 +207,7 @@ static struct loadparm_service sDefault =
> .sync_always = false,
> .strict_allocate = false,
> .strict_rename = false,
> - .strict_sync = false,
> + .strict_sync = true,
> .mangling_char = '~',
> .copymap = NULL,
> .delete_readonly = false,
> --
> 2.7.4
>
>
> From 63a6313a87fca7df587a258110843eda04850d9b Mon Sep 17 00:00:00 2001
> From: Jeremy Allison <jra at samba.org>
> Date: Thu, 23 Mar 2017 09:06:27 -0700
> Subject: [PATCH 2/2] WHATSNEW: Document "strict sync" default change.
>
> Signed-off-by: Jeremy Allison <jra at samba.org>
> ---
> WHATSNEW.txt | 6 ++++++
> 1 file changed, 6 insertions(+)
>
> diff --git a/WHATSNEW.txt b/WHATSNEW.txt
> index dd60cd2..cda61ef 100644
> --- a/WHATSNEW.txt
> +++ b/WHATSNEW.txt
> @@ -16,12 +16,18 @@ UPGRADING
> NEW FEATURES/CHANGES
> ====================
>
> +The "strict sync" global parameter has been changed from
> +a default of "no" to "yes". This means smbd will by default
> +obey client requests to synchronize unwritten data in operating
> +system buffers safely onto disk. This is a safer default setting
> +for modern SMB1/2/3 clients.
>
> smb.conf changes
> ================
>
> Parameter Name Description Default
> -------------- ----------- -------
> + strict sync Default changed yes
>
>
> KNOWN ISSUES
> --
> 2.7.4
>
More information about the samba-technical
mailing list