The Samba-Bugzilla – Attachment 17544 Details for
Bug 15192
Remove special case for O_CREAT in SMB_VFS_OPENAT from vfs_glusterfs
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
patch for v4-17
0001-vfs_glusterfs-Remove-special-handling-of-O_CREAT-fla.patch (text/plain), 3.67 KB, created by
Anoop C S
on 2022-10-06 15:47:46 UTC
(
hide
)
Description:
patch for v4-17
Filename:
MIME Type:
Creator:
Anoop C S
Created:
2022-10-06 15:47:46 UTC
Size:
3.67 KB
patch
obsolete
>From 88ddfddc5e9832a12ede5c05e2eaa73b0f59ab6a Mon Sep 17 00:00:00 2001 >From: Anoop C S <anoopcs@samba.org> >Date: Mon, 3 Oct 2022 15:36:13 +0530 >Subject: [PATCH] vfs_glusterfs: Remove special handling of O_CREAT flag >MIME-Version: 1.0 >Content-Type: text/plain; charset=UTF-8 >Content-Transfer-Encoding: 8bit > >Special handling of O_CREAT flag in SMB_VFS_OPENAT code path was the >only option to ensure correctness due to a bug in libgfapi as detailed >in issue #3838[1] from GlusterFS upstream. This has been fixed recently >so that O_CREAT is handled correctly within glfs_openat() enbaling us to >remove the corresponding special case from vfs_gluster_openat(). > >[1] https://github.com/gluster/glusterfs/issues/3838 > >Signed-off-by: Anoop C S <anoopcs@samba.org> >Reviewed-by: Ralph Boehme <slow@samba.org> > >Autobuild-User(master): Ralph Böhme <slow@samba.org> >Autobuild-Date(master): Thu Oct 6 08:34:56 UTC 2022 on sn-devel-184 > >(cherry picked from commit 9a8bc67f4a5e4afecd648523f43a8e97584fcfd0) >--- > source3/modules/vfs_glusterfs.c | 78 +++++++++++++-------------------- > 1 file changed, 30 insertions(+), 48 deletions(-) > >diff --git a/source3/modules/vfs_glusterfs.c b/source3/modules/vfs_glusterfs.c >index e2f9fbd8bd4..8fef8c8bf9c 100644 >--- a/source3/modules/vfs_glusterfs.c >+++ b/source3/modules/vfs_glusterfs.c >@@ -824,61 +824,43 @@ static int vfs_gluster_openat(struct vfs_handle_struct *handle, > became_root = true; > } > >- /* >- * O_CREAT flag in open is handled differently in a way which is *NOT* >- * safe against symlink race situations. We use glfs_creat() instead >- * for correctness as glfs_openat() is broken with O_CREAT present >- * in open flags. >- */ >- if (flags & O_CREAT) { >- if (fsp_get_pathref_fd(dirfsp) != AT_FDCWD) { >- /* >- * Replace smb_fname with full_path constructed above. >- */ >- smb_fname = full_fname; >+ if (fsp_get_pathref_fd(dirfsp) != AT_FDCWD) { >+#ifdef HAVE_GFAPI_VER_7_11 >+ /* >+ * Fetch Gluster fd for parent directory using dirfsp >+ * before calling glfs_openat(); >+ */ >+ pglfd = vfs_gluster_fetch_glfd(handle, dirfsp); >+ if (pglfd == NULL) { >+ END_PROFILE(syscall_openat); >+ DBG_ERR("Failed to fetch gluster fd\n"); >+ return -1; > } > >+ glfd = glfs_openat(pglfd, >+ smb_fname->base_name, >+ flags, >+ how->mode); >+#else >+ /* >+ * Replace smb_fname with full_path constructed above. >+ */ >+ smb_fname = full_fname; >+#endif >+ } >+ >+ if (pglfd == NULL) { > /* > * smb_fname can either be a full_path or the same one > * as received from the caller. In the latter case we > * are operating at current working directory. > */ >- glfd = glfs_creat(handle->data, >- smb_fname->base_name, >- flags, >- how->mode); >- } else { >- if (fsp_get_pathref_fd(dirfsp) != AT_FDCWD) { >-#ifdef HAVE_GFAPI_VER_7_11 >- /* >- * Fetch Gluster fd for parent directory using dirfsp >- * before calling glfs_openat(); >- */ >- pglfd = vfs_gluster_fetch_glfd(handle, dirfsp); >- if (pglfd == NULL) { >- END_PROFILE(syscall_openat); >- DBG_ERR("Failed to fetch gluster fd\n"); >- return -1; >- } >- >- glfd = glfs_openat(pglfd, >- smb_fname->base_name, >- flags, >- how->mode); >-#else >- /* >- * Replace smb_fname with full_path constructed above. >- */ >- smb_fname = full_fname; >-#endif >- } >- >- if (pglfd == NULL) { >- /* >- * smb_fname can either be a full_path or the same one >- * as received from the caller. In the latter case we >- * are operating at current working directory. >- */ >+ if (flags & O_CREAT) { >+ glfd = glfs_creat(handle->data, >+ smb_fname->base_name, >+ flags, >+ how->mode); >+ } else { > glfd = glfs_open(handle->data, > smb_fname->base_name, > flags); >-- >2.37.3 >
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:
slow
:
review+
gd
:
review+
Actions:
View
Attachments on
bug 15192
: 17544