The Samba-Bugzilla – Attachment 11004 Details for
Bug 11243
kernel_flock and named streams
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch for 4.2 cherry-picker from master
v42_streams.patch (text/plain), 2.29 KB, created by
Ralph Böhme
on 2015-04-30 08:55:31 UTC
(
hide
)
Description:
Patch for 4.2 cherry-picker from master
Filename:
MIME Type:
Creator:
Ralph Böhme
Created:
2015-04-30 08:55:31 UTC
Size:
2.29 KB
patch
obsolete
>From 19e87e7464aaa8598b8ba6a3d26ed8f42ed780f2 Mon Sep 17 00:00:00 2001 >From: Ralph Boehme <slow@samba.org> >Date: Wed, 29 Apr 2015 16:53:04 +0200 >Subject: [PATCH] vfs: kernel_flock and named streams > >Streams implementing VFS modules may implement streams in a way that the >fsp will have the basefile open in the fsp fd, so lacking a distinct fd >for the stream, kernel_flock will apply on the basefile which is >wrong. The actual check is deffered to the VFS module implementing the >kernel_flock call. > >Bug: https://bugzilla.samba.org/show_bug.cgi?id=11243 > >Signed-off-by: Ralph Boehme <slow@samba.org> >Reviewed-by: Jeremy Allison <jra@samba.org> >(cherry picked from commit d748652e5b1c1c0238a2b86cdf14d7f6de7ce9b2) >--- > source3/modules/vfs_gpfs.c | 10 ++++++++++ > source3/smbd/open.c | 9 +++++++++ > 2 files changed, 19 insertions(+) > >diff --git a/source3/modules/vfs_gpfs.c b/source3/modules/vfs_gpfs.c >index 6ead65b..e1e29fa 100644 >--- a/source3/modules/vfs_gpfs.c >+++ b/source3/modules/vfs_gpfs.c >@@ -88,6 +88,16 @@ static int vfs_gpfs_kernel_flock(vfs_handle_struct *handle, files_struct *fsp, > return 0; > } > >+ /* >+ * A named stream fsp will have the basefile open in the fsp >+ * fd, so lacking a distinct fd for the stream we have to skip >+ * kernel_flock and set_gpfs_sharemode for stream. >+ */ >+ if (!is_ntfs_default_stream_smb_fname(fsp->fsp_name)) { >+ DEBUG(2,("%s: kernel_flock on stream\n", fsp_str_dbg(fsp))); >+ return 0; >+ } >+ > kernel_flock(fsp->fh->fd, share_mode, access_mask); > > if (!set_gpfs_sharemode(fsp, access_mask, fsp->share_access)) { >diff --git a/source3/smbd/open.c b/source3/smbd/open.c >index 773b146..86c1c31 100644 >--- a/source3/smbd/open.c >+++ b/source3/smbd/open.c >@@ -3064,6 +3064,15 @@ static NTSTATUS open_file_ntcreate(connection_struct *conn, > > if (fsp->fh->fd != -1 && lp_kernel_share_modes(SNUM(conn))) { > int ret_flock; >+ /* >+ * Beware: streams implementing VFS modules may >+ * implement streams in a way that fsp will have the >+ * basefile open in the fsp fd, so lacking a distinct >+ * fd for the stream kernel_flock will apply on the >+ * basefile which is wrong. The actual check is >+ * deffered to the VFS module implementing the >+ * kernel_flock call. >+ */ > ret_flock = SMB_VFS_KERNEL_FLOCK(fsp, share_access, access_mask); > if(ret_flock == -1 ){ > >-- >2.1.0 >
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 11243
:
11002
|
11003
| 11004 |
11579
|
11585