From 2b8aceb623ad5bd92b98504f9b60300871825ac3 Mon Sep 17 00:00:00 2001 From: liuh Date: Fri, 19 Apr 2024 09:46:41 +0800 Subject: [PATCH] glfs/open: dentry lists are not initialized (#4284) --- ...entry-lists-are-not-initialized-4284.patch | 52 +++++++++++++++++++ glusterfs.spec | 6 ++- 2 files changed, 57 insertions(+), 1 deletion(-) create mode 100644 0002-glfs-open-dentry-lists-are-not-initialized-4284.patch diff --git a/0002-glfs-open-dentry-lists-are-not-initialized-4284.patch b/0002-glfs-open-dentry-lists-are-not-initialized-4284.patch new file mode 100644 index 0000000..ddf13b3 --- /dev/null +++ b/0002-glfs-open-dentry-lists-are-not-initialized-4284.patch @@ -0,0 +1,52 @@ +From d53ce415fa902d18c827daf0b00e7de8c822f118 Mon Sep 17 00:00:00 2001 +From: Mohammed Rafi KC +Date: Fri, 19 Apr 2024 09:38:31 +0800 +Subject: [PATCH] glfs/open: dentry lists are not initialized (#4284) + +Now that we are using glfs_open to open directory fd, +we should initialize the dentry list. + +Change-Id: I6193eb83d80220ebef6ac4331bf984c8b4d6c49d + +Signed-off-by: Mohammed Rafi KC + +--- + api/src/glfs-fops.c | 2 +- + api/src/glfs.c | 1 + + 2 files changed, 2 insertions(+), 1 deletion(-) + +diff --git a/api/src/glfs-fops.c b/api/src/glfs-fops.c +index f60d1c7..c34ea73 100644 +--- a/api/src/glfs-fops.c ++++ b/api/src/glfs-fops.c +@@ -713,6 +713,7 @@ pub_glfs_close(struct glfs_fd *glfd) + DECLARE_OLD_THIS; + __GLFS_ENTRY_VALIDATE_FD(glfd, invalid_fs); + ++ gf_dirent_free(list_entry(&glfd->entries, gf_dirent_t, list)); + subvol = glfs_active_subvol(glfd->fs); + if (!subvol) { + ret = -1; +@@ -3590,7 +3591,6 @@ pub_glfs_opendir(struct glfs *fs, const char *path) + if (!glfd) + goto out; + +- INIT_LIST_HEAD(&glfd->entries); + retry: + ret = glfs_resolve(fs, subvol, path, &loc, &iatt, reval); + +diff --git a/api/src/glfs.c b/api/src/glfs.c +index d917036..1a4bfc1 100644 +--- a/api/src/glfs.c ++++ b/api/src/glfs.c +@@ -707,6 +707,7 @@ glfs_fd_new(struct glfs *fs) + glfd->fs = fs; + + INIT_LIST_HEAD(&glfd->openfds); ++ INIT_LIST_HEAD(&glfd->entries); + + GF_REF_INIT(glfd, glfs_fd_destroy); + +-- +2.27.0 + diff --git a/glusterfs.spec b/glusterfs.spec index 5386320..cf042d9 100644 --- a/glusterfs.spec +++ b/glusterfs.spec @@ -224,7 +224,7 @@ Summary: Distributed File System Name: glusterfs Version: 11.1 -Release: 2 +Release: 3 License: GPLv3 or GPLv2+ or LGPLv3+ URL: http://docs.gluster.org/ %if ( 0%{_for_fedora_koji_builds} ) @@ -238,6 +238,7 @@ Source0: https://download.gluster.org/pub/gluster/glusterfs/11/%{versio %endif Patch1: 0001-fuse-Resolve-asan-bug-in-during-receive-event-notifi.patch +Patch2: 0002-glfs-open-dentry-lists-are-not-initialized-4284.patch BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX) BuildRequires: rpcgen gperftools-devel libunwind-devel @@ -1500,6 +1501,9 @@ exit 0 %{_mandir}/man8/*gluster*.8* %changelog +* Fri Apr 19 2024 liuh - 11.1-3 +- sync patch from community + * Wed Mar 13 2024 wangxiaomeng - 11.1-2 - fix upgrade error that %{_mandir}/man8/*gluster*.8* belong to package glusterfs currently conflict with that belong to package help in the lower version. -- Gitee