From: Christof Schmitt Date: Tue, 4 Feb 2025 20:10:22 +0000 (-0700) Subject: vfs_gpfs: Remove pathref test X-Git-Tag: tdb-1.4.13~9 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4787c737ec0421ac6286ff5cae9810e5d8587773;p=thirdparty%2Fsamba.git vfs_gpfs: Remove pathref test The gpfs_stat_x call O_PATH descriptors since GPFS 5.1.2.0 and will also be replaced with a simpler API call that also accepts O_PATH descriptors. Remove the pathref test that is no longer needed. Signed-off-by: Christof Schmitt Reviewed-by: Ralph Boehme --- diff --git a/source3/modules/vfs_gpfs.c b/source3/modules/vfs_gpfs.c index b29ef338a51..3b216950c15 100644 --- a/source3/modules/vfs_gpfs.c +++ b/source3/modules/vfs_gpfs.c @@ -56,9 +56,6 @@ struct gpfs_config_data { bool settimes; bool recalls; bool clamp_invalid_times; - struct { - bool gpfs_fstat_x; - } pathref_ok; }; struct gpfs_fsp_extension { @@ -1872,68 +1869,6 @@ static ssize_t vfs_gpfs_sendfile(vfs_handle_struct *handle, int tofd, return SMB_VFS_NEXT_SENDFILE(handle, tofd, fsp, hdr, offset, n); } -#ifdef O_PATH -static int vfs_gpfs_check_pathref_fstat_x(struct gpfs_config_data *config, - struct connection_struct *conn) -{ - struct gpfs_iattr64 iattr = {0}; - unsigned int litemask = 0; - int saved_errno; - int fd; - int ret; - - fd = open(conn->connectpath, O_PATH); - if (fd == -1) { - DBG_ERR("openat() of share with O_PATH failed: %s\n", - strerror(errno)); - return -1; - } - - ret = gpfswrap_fstat_x(fd, &litemask, &iattr, sizeof(iattr)); - if (ret == 0) { - close(fd); - config->pathref_ok.gpfs_fstat_x = true; - return 0; - } - - saved_errno = errno; - ret = close(fd); - if (ret != 0) { - DBG_ERR("close failed: %s\n", strerror(errno)); - return -1; - } - - if (saved_errno != EBADF) { - DBG_ERR("gpfswrap_fstat_x() of O_PATH handle failed: %s\n", - strerror(saved_errno)); - return -1; - } - - return 0; -} -#endif - -static int vfs_gpfs_check_pathref(struct gpfs_config_data *config, - struct connection_struct *conn) -{ -#ifndef O_PATH - /* - * This code path leaves all struct gpfs_config_data.pathref_ok members - * initialized to false. - */ - return 0; -#else - int ret; - - ret = vfs_gpfs_check_pathref_fstat_x(config, conn); - if (ret != 0) { - return -1; - } - - return 0; -#endif -} - static int vfs_gpfs_connect(struct vfs_handle_struct *handle, const char *service, const char *user) { @@ -2043,14 +1978,6 @@ static int vfs_gpfs_connect(struct vfs_handle_struct *handle, config->clamp_invalid_times = lp_parm_bool(SNUM(handle->conn), "gpfs", "clamp_invalid_times", false); - ret = vfs_gpfs_check_pathref(config, handle->conn); - if (ret != 0) { - DBG_ERR("vfs_gpfs_check_pathref() on [%s] failed\n", - handle->conn->connectpath); - TALLOC_FREE(config); - return -1; - } - SMB_VFS_HANDLE_SET_DATA(handle, config, NULL, struct gpfs_config_data, return -1);