From 2a906f88008779d2fbf1e676c20d931ed50d299a Mon Sep 17 00:00:00 2001 From: RG72 Date: Tue, 8 Dec 2015 09:51:04 +0500 Subject: [PATCH 1/5] Update loadparm.c --- source3/param/loadparm.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 348298d..dc0f55c 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -902,6 +902,8 @@ static void init_globals(struct loadparm_context *lp_ctx, bool reinit_globals) Globals.web_port = 901; Globals.aio_max_threads = 100; + + Globals.disable_openfile_inode_check = false; /* Now put back the settings that were set with lp_set_cmdline() */ apply_lp_set_cmdline(); From 08a7e8562f5750cc2b8699b6d2b44f6cd9750762 Mon Sep 17 00:00:00 2001 From: RG72 Date: Tue, 8 Dec 2015 10:05:14 +0500 Subject: [PATCH 2/5] Create disable_openfile_inode_check.xml --- docs-xml/smbdotconf/tuning/disable_openfile_inode_check.xml | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 docs-xml/smbdotconf/tuning/disable_openfile_inode_check.xml diff --git a/docs-xml/smbdotconf/tuning/disable_openfile_inode_check.xml b/docs-xml/smbdotconf/tuning/disable_openfile_inode_check.xml new file mode 100644 index 0000000..0b387b4 --- /dev/null +++ b/docs-xml/smbdotconf/tuning/disable_openfile_inode_check.xml @@ -0,0 +1,10 @@ + + + If this parameter is yes then openfile does not check dev and inode of file. Use yes with overlayfs. + + + +no + From f1c1fcb4c3d4637ed0328593fc83c7f6b551ed48 Mon Sep 17 00:00:00 2001 From: RG72 Date: Tue, 8 Dec 2015 10:16:18 +0500 Subject: [PATCH 3/5] Update disable_openfile_inode_check.xml --- docs-xml/smbdotconf/tuning/disable_openfile_inode_check.xml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/docs-xml/smbdotconf/tuning/disable_openfile_inode_check.xml b/docs-xml/smbdotconf/tuning/disable_openfile_inode_check.xml index 0b387b4..8a9ecef 100644 --- a/docs-xml/smbdotconf/tuning/disable_openfile_inode_check.xml +++ b/docs-xml/smbdotconf/tuning/disable_openfile_inode_check.xml @@ -1,5 +1,6 @@ - If this parameter is yes then openfile does not check dev and inode of file. Use yes with overlayfs. From ffd62a48c11dd822a802549b6c8be6bda88e16f6 Mon Sep 17 00:00:00 2001 From: RG72 Date: Tue, 8 Dec 2015 10:16:32 +0500 Subject: [PATCH 4/5] Update loadparm.c --- source3/param/loadparm.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index dc0f55c..52d0614 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -244,6 +244,7 @@ static struct loadparm_service sDefault = .kernel_share_modes = true, .durable_handles = true, .param_opt = NULL, + .disable_openfile_inode_check = false, .dummy = "" }; @@ -903,8 +904,6 @@ static void init_globals(struct loadparm_context *lp_ctx, bool reinit_globals) Globals.aio_max_threads = 100; - Globals.disable_openfile_inode_check = false; - /* Now put back the settings that were set with lp_set_cmdline() */ apply_lp_set_cmdline(); } From 5675a2bf976be8770c8abc5dcb6facb0ea002462 Mon Sep 17 00:00:00 2001 From: RG72 Date: Tue, 8 Dec 2015 10:21:16 +0500 Subject: [PATCH 5/5] Update open.c Disable inode checking. I use samba on overlayfs. Some users can't open file for write, because of dev and inode changed to writable layer. --- source3/smbd/open.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source3/smbd/open.c b/source3/smbd/open.c index 9cd415b..d7967a2 100644 --- a/source3/smbd/open.c +++ b/source3/smbd/open.c @@ -2805,7 +2805,7 @@ static NTSTATUS open_file_ntcreate(connection_struct *conn, file_existed = false; } - if (file_existed && !check_same_dev_ino(&saved_stat, &smb_fname->st)) { + if (file_existed && !lp_disable_openfile_inode_check(SNUM(conn)) && !check_same_dev_ino(&saved_stat, &smb_fname->st)) { /* * The file did exist, but some other (local or NFS) * process either renamed/unlinked and re-created the