Skip to content

Commit

Permalink
port the patch in new_fstatat to new_fxstatat to fix failed test on EL8.
Browse files Browse the repository at this point in the history
Features: pil4dfs

Required-githooks: true

Signed-off-by: Lei Huang <[email protected]>
  • Loading branch information
wiliamhuang committed Jan 10, 2024
1 parent b757c30 commit 87f0aa2
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion src/client/dfuse/pil4dfs/int_dfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -1840,7 +1840,7 @@ check_path_with_dirfd(int dirfd, char **full_path_out, const char *rel_path, int
free(*full_path_out);
*full_path_out = NULL;
}
DS_ERROR(errno, "readlink() failed");
D_DEBUG(DB_ANY, "readlink() failed: %d (%s)\n", errno, strerror(errno));
return (-1);
}

Expand Down Expand Up @@ -2573,6 +2573,17 @@ new_fxstatat(int ver, int dirfd, const char *path, struct stat *stat_buf, int fl
return new_xstat(1, path, stat_buf);
}

if (dirfd >= FD_FILE_BASE && dirfd < FD_DIR_BASE) {
if (path[0] == 0 && flags & AT_EMPTY_PATH)
/* same as fstat for a file. May need further work to handle flags */
return fstat(dirfd, stat_buf);
else if (path[0] == 0)
error = ENOENT;
else
error = ENOTDIR;
goto out_err;
}

idx_dfs = check_path_with_dirfd(dirfd, &full_path, path, &error);
if (error)
goto out_err;
Expand Down

0 comments on commit 87f0aa2

Please sign in to comment.