The Samba-Bugzilla – Attachment 13916 Details for
Bug 13217
Unlink fails when file system sharemode denies DELETE
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch for Samba 4.8
patch-for-4.8 (text/plain), 1.64 KB, created by
Christof Schmitt
on 2018-01-17 20:29:38 UTC
(
hide
)
Description:
Patch for Samba 4.8
Filename:
MIME Type:
Creator:
Christof Schmitt
Created:
2018-01-17 20:29:38 UTC
Size:
1.64 KB
patch
obsolete
>From 302cda97d13ed3466acb902f28a77077ca099b64 Mon Sep 17 00:00:00 2001 >From: Christof Schmitt <cs@samba.org> >Date: Wed, 10 Jan 2018 15:56:08 -0700 >Subject: [PATCH] Remove file system sharemode before calling unlink > >GPFS implements the DENY_DELETE sharemode, which prevents unlink() from >deleting the file.. This causes the problem that deleting a file through >"delete on close" fails, as the code in close.c first calls unlink() and >only later removes the file system sharemode. > >Fix this by removing the file system sharemode before calling unlink(). > >BUG: https://bugzilla.samba.org/show_bug.cgi?id=13217 > >Signed-off-by: Christof Schmitt <cs@samba.org> >Reviewed-by: Jeremy Allison <jra@samba.org> > >Autobuild-User(master): Christof Schmitt <cs@samba.org> >Autobuild-Date(master): Wed Jan 17 01:31:53 CET 2018 on sn-devel-144 > >(cherry picked from commit e77f8e4628ba868f09cbcf2970caac6c69fe080c) >--- > source3/smbd/close.c | 16 ++++++++++++++++ > 1 file changed, 16 insertions(+) > >diff --git a/source3/smbd/close.c b/source3/smbd/close.c >index 095feec..2f6cc4f 100644 >--- a/source3/smbd/close.c >+++ b/source3/smbd/close.c >@@ -446,6 +446,22 @@ static NTSTATUS close_remove_share_mode(files_struct *fsp, > } > } > >+ if (fsp->kernel_share_modes_taken) { >+ int ret_flock; >+ >+ /* >+ * A file system sharemode could block the unlink; >+ * remove filesystem sharemodes first. >+ */ >+ ret_flock = SMB_VFS_KERNEL_FLOCK(fsp, 0, 0); >+ if (ret_flock == -1) { >+ DBG_INFO("removing kernel flock for %s failed: %s\n", >+ fsp_str_dbg(fsp), strerror(errno)); >+ } >+ >+ fsp->kernel_share_modes_taken = false; >+ } >+ > > if (SMB_VFS_UNLINK(conn, fsp->fsp_name) != 0) { > /* >-- >1.8.3.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 13217
: 13916