The Samba-Bugzilla – Attachment 15742 Details for
Bug 14241
"Invalid file handle" error on opening files using vfs_glusterfs
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
patch-for-v4-12
0001-vfs_glusterfs-Return-fake-fd-from-pipe-during-open.patch (text/plain), 1.56 KB, created by
Anoop C S
on 2020-01-17 11:24:20 UTC
(
hide
)
Description:
patch-for-v4-12
Filename:
MIME Type:
Creator:
Anoop C S
Created:
2020-01-17 11:24:20 UTC
Size:
1.56 KB
patch
obsolete
>From 8aacf4c1bb38b8c26953e2fbacd27797a1f4ba4f 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 > >GlusterFS currently doesn't have an API implementation to set flags on >open file descriptor. Thus we use pipe() to provide valid file descriptor >from the system. > >BUG: https://bugzilla.samba.org/show_bug.cgi?id=14241 > >Signed-off-by: Anoop C S <anoopcs@redhat.com> >--- > source3/modules/vfs_glusterfs.c | 14 ++++++++++++-- > 1 file changed, 12 insertions(+), 2 deletions(-) > >diff --git a/source3/modules/vfs_glusterfs.c b/source3/modules/vfs_glusterfs.c >index bce7ae5e84a..2520382c42f 100644 >--- a/source3/modules/vfs_glusterfs.c >+++ b/source3/modules/vfs_glusterfs.c >@@ -630,6 +630,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); > >@@ -659,8 +660,15 @@ 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; >+ >+ 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, >@@ -678,6 +686,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.24.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:
gd
:
review+
slow
:
review+
anoopcs
:
ci-passed+
Actions:
View
Attachments on
bug 14241
: 15742 |
15745