Bug 1746118

Summary: capture stat failure error while setting the gfid
Product: [Community] GlusterFS Reporter: Raghavendra Bhat <rabhat>
Component: posixAssignee: bugs <bugs>
Status: CLOSED NEXTRELEASE QA Contact:
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 6CC: bugs
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: 1736482 Environment:
Last Closed: 2019-09-23 07:09:27 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 1736481, 1736482    
Bug Blocks:    

Description Raghavendra Bhat 2019-08-27 17:28:17 UTC
+++ This bug was initially created as a clone of Bug #1736482 +++

+++ This bug was initially created as a clone of Bug #1736481 +++

Description of problem:

For create operation, after the entry is created, posix xlator tries to set the gfid for that entry. While doing that, there are several places where setting gfid can fail. While the failure is handled in all the cases, for one of the failure cases, the errno is not captured. Capturing this might help in debugging.

int
posix_gfid_set(xlator_t *this, const char *path, loc_t *loc, dict_t *xattr_req,
               pid_t pid, int *op_errno)
{
    uuid_t uuid_req;
    uuid_t uuid_curr;
    int ret = 0;
    ssize_t size = 0;
    struct stat stat = {
        0,
    };

    *op_errno = 0;

    if (!xattr_req) {
        if (pid != GF_SERVER_PID_TRASH) {
            gf_msg(this->name, GF_LOG_ERROR, EINVAL, P_MSG_INVALID_ARGUMENT,
                   "xattr_req is null");
            *op_errno = EINVAL;
            ret = -1;
        }
        goto out;
    }

   if (sys_lstat(path, &stat) != 0) {
        ret = -1;
        gf_msg(this->name, GF_LOG_ERROR, errno, P_MSG_LSTAT_FAILED,
               "lstat on %s failed", path);
        goto out;
    }

HERE, errno is not captured.

Version-Release number of selected component (if applicable):


How reproducible:


Steps to Reproduce:
1.
2.
3.

Actual results:


Expected results:


Additional info:

--- Additional comment from Worker Ant on 2019-08-01 19:47:09 UTC ---

REVIEW: https://review.gluster.org/23144 (storage/posix: set the op_errno to proper errno during gfid set) posted (#1) for review on master by Raghavendra Bhat

--- Additional comment from Worker Ant on 2019-08-04 07:09:48 UTC ---

REVIEW: https://review.gluster.org/23144 (storage/posix: set the op_errno to proper errno during gfid set) merged (#2) on master by Amar Tumballi

Comment 1 Worker Ant 2019-08-27 17:31:38 UTC
REVIEW: https://review.gluster.org/23311 (storage/posix: set the op_errno to proper errno during gfid set) posted (#1) for review on release-6 by Raghavendra Bhat

Comment 2 Worker Ant 2019-09-23 07:09:27 UTC
REVIEW: https://review.gluster.org/23311 (storage/posix: set the op_errno to proper errno during gfid set) merged (#2) on release-6 by hari gowtham