]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
vfs_gpfs: Remove pathref test
authorChristof Schmitt <cs@samba.org>
Tue, 4 Feb 2025 20:10:22 +0000 (13:10 -0700)
committerJule Anger <janger@samba.org>
Thu, 6 Feb 2025 11:24:41 +0000 (11:24 +0000)
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 <cs@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
source3/modules/vfs_gpfs.c

index b29ef338a51ce2878269fd4b89376b5564315a93..3b216950c15ef3e20939c10c1aa12d358df03117 100644 (file)
@@ -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);