Skip to content

Commit a06250f

Browse files
authored
glfs/open: dentry lists are not initialized (#4284) (#4580)
Now that we are using glfs_open to open directory fd, we should initialize the dentry list. > cherry-picked from commit d53ce41 Change-Id: I6193eb83d80220ebef6ac4331bf984c8b4d6c49d Signed-off-by: Mohammed Rafi KC <[email protected]>
1 parent c5234e0 commit a06250f

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

api/src/glfs-fops.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -714,6 +714,7 @@ pub_glfs_close(struct glfs_fd *glfd)
714714
DECLARE_OLD_THIS;
715715
__GLFS_ENTRY_VALIDATE_FD(glfd, invalid_fs);
716716

717+
gf_dirent_free(list_entry(&glfd->entries, gf_dirent_t, list));
717718
subvol = glfs_active_subvol(glfd->fs);
718719
if (!subvol) {
719720
ret = -1;
@@ -3591,7 +3592,6 @@ pub_glfs_opendir(struct glfs *fs, const char *path)
35913592
if (!glfd)
35923593
goto out;
35933594

3594-
INIT_LIST_HEAD(&glfd->entries);
35953595
retry:
35963596
ret = glfs_resolve(fs, subvol, path, &loc, &iatt, reval);
35973597

api/src/glfs.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -707,6 +707,7 @@ glfs_fd_new(struct glfs *fs)
707707
glfd->fs = fs;
708708

709709
INIT_LIST_HEAD(&glfd->openfds);
710+
INIT_LIST_HEAD(&glfd->entries);
710711

711712
GF_REF_INIT(glfd, glfs_fd_destroy);
712713

0 commit comments

Comments
 (0)