From b0a434386dc2f77df89811bc3f56c4cc7fb7b16c Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Fri, 24 Oct 2014 13:57:04 -0700 Subject: s3:param: Add new option "strict rename". Control whether smbd can rename directories containing open files. Defaults to "no" (meaning we *can* do such renames). Signed-off-by: Jeremy Allison Reviewed-by: Stefan Metzmacher --- docs-xml/smbdotconf/tuning/strictrename.xml | 25 +++++++++++++++++++++++++ lib/param/param_table.c | 9 +++++++++ source3/param/loadparm.c | 1 + 3 files changed, 35 insertions(+) create mode 100644 docs-xml/smbdotconf/tuning/strictrename.xml diff --git a/docs-xml/smbdotconf/tuning/strictrename.xml b/docs-xml/smbdotconf/tuning/strictrename.xml new file mode 100644 index 0000000000..54788634d8 --- /dev/null +++ b/docs-xml/smbdotconf/tuning/strictrename.xml @@ -0,0 +1,25 @@ + + + By default a Windows SMB server prevents directory + renames when there are open file or directory handles below + it in the filesystem hierarchy. Historically Samba has always + allowed this as POSIX filesystem semantics require it. + + This boolean parameter allows Samba to match the Windows + behavior. Setting this to "yes" is a very expensive change, + as it forces Samba to travers the entire open file handle + database on every directory rename request. In a clustered + Samba system the cost is even greater than the non-clustered + case. + + For this reason the default is "no", and it is recommended + to be left that way unless a specific Windows application requires + it to be changed. + + + +no + diff --git a/lib/param/param_table.c b/lib/param/param_table.c index 15ffa8c3f6..7a13e6f84a 100644 --- a/lib/param/param_table.c +++ b/lib/param/param_table.c @@ -1883,6 +1883,15 @@ struct parm_struct parm_table[] = { .enum_list = NULL, .flags = FLAG_ADVANCED | FLAG_SHARE, }, + { + .label = "strict rename", + .type = P_BOOL, + .p_class = P_LOCAL, + .offset = LOCAL_VAR(strict_rename), + .special = NULL, + .enum_list = NULL, + .flags = FLAG_ADVANCED | FLAG_SHARE, + }, { .label = "strict sync", .type = P_BOOL, diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index f68c001f46..d6ba8fba10 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -206,6 +206,7 @@ static struct loadparm_service sDefault = .follow_symlinks = true, .sync_always = false, .strict_allocate = false, + .strict_rename = false, .strict_sync = false, .mangling_char = '~', .copymap = NULL, -- cgit