The Samba-Bugzilla – Attachment 15436 Details for
Bug 14060
smbd fails to open kernel-oplocked files with smb1
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
vfs_glusterfs temp fix for master
0001-vfs_glusterfs-Return-fake-fd-from-pipe-during-open.patch (text/plain), 2.01 KB, created by
Anoop C S
on 2019-08-27 10:59:19 UTC
(
hide
)
Description:
vfs_glusterfs temp fix for master
Filename:
MIME Type:
Creator:
Anoop C S
Created:
2019-08-27 10:59:19 UTC
Size:
2.01 KB
patch
obsolete
>From 746d1aa42b3aade7082bef248bacf869bbeb7244 Mon Sep 17 00:00:00 2001 >From: Anoop C S <anoopcs@redhat.com> >Date: Wed, 14 Aug 2019 18:03:01 +0530 >Subject: [PATCH] vfs_glusterfs: Return fake fd from pipe() during open > >To workaround the problem of fcntl() acting upon fsp->fh->fd instead of >VFS based open fd we have to provide a valid fd from the system. Also >added a FIXME note for future reference when we have SMB_VFS_FCNTL in >place to get this fixed properly. > >Signed-off-by: Anoop C S <anoopcs@redhat.com> >--- > source3/modules/vfs_glusterfs.c | 22 ++++++++++++++++++++-- > 1 file changed, 20 insertions(+), 2 deletions(-) > >diff --git a/source3/modules/vfs_glusterfs.c b/source3/modules/vfs_glusterfs.c >index 38517b7af5a..a732059f817 100644 >--- a/source3/modules/vfs_glusterfs.c >+++ b/source3/modules/vfs_glusterfs.c >@@ -628,6 +628,7 @@ static int vfs_gluster_open(struct vfs_handle_struct *handle, > { > glfs_fd_t *glfd; > glfs_fd_t **p_tmp; >+ int fakefd[2]; > > START_PROFILE(syscall_open); > >@@ -657,8 +658,23 @@ static int vfs_gluster_open(struct vfs_handle_struct *handle, > *p_tmp = glfd; > > END_PROFILE(syscall_open); >- /* An arbitrary value for error reporting, so you know its us. */ >- return 13371337; >+ >+ // FIXME >+ /* Due to lack of SMB_VFS_FCNTL we return fake fd from pipe() to get >+ * past set_blocking() in open_file() code path. This is needed since >+ * O_NONBLOCK open flag is being added internally irrespective of >+ * 'kernel share modes' setting in smb.conf. vfs_glusterfs normally >+ * operates with 'kernel share modes' disabled. >+ * >+ * Refer https://bugzilla.samba.org/show_bug.cgi?id=14060 for details*/ >+ if (pipe(fakefd) == -1) { >+ DBG_ERR("pipe failed: %s\n", strerror(errno)); >+ return -1; >+ } >+ >+ close(fakefd[1]); >+ >+ return fakefd[0]; > } > > static int vfs_gluster_close(struct vfs_handle_struct *handle, >@@ -676,6 +692,8 @@ static int vfs_gluster_close(struct vfs_handle_struct *handle, > return -1; > } > >+ close(fsp->fh->fd); >+ > VFS_REMOVE_FSP_EXTENSION(handle, fsp); > > ret = glfs_close(glfd); >-- >2.21.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
Actions:
View
Attachments on
bug 14060
:
15367
|
15368
|
15369
| 15436