Bug 1736481 - capture stat failure error while setting the gfid
Summary: capture stat failure error while setting the gfid
Keywords:
Status: CLOSED NEXTRELEASE
Alias: None
Product: GlusterFS
Classification: Community
Component: posix
Version: 7
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Raghavendra Bhat
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks: 1736482 1746118
TreeView+ depends on / blocked
 
Reported: 2019-08-01 18:06 UTC by Raghavendra Bhat
Modified: 2019-08-27 17:28 UTC (History)
2 users (show)

Fixed In Version:
Clone Of:
: 1736482 (view as bug list)
Environment:
Last Closed: 2019-08-22 05:59:50 UTC
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Gluster.org Gerrit 23214 0 None Merged storage/posix: set the op_errno to proper errno during gfid set 2019-08-22 05:59:49 UTC

Description Raghavendra Bhat 2019-08-01 18:06:30 UTC
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:

Comment 1 Worker Ant 2019-08-12 20:07:24 UTC
REVIEW: https://review.gluster.org/23214 (storage/posix: set the op_errno to proper errno during gfid set) posted (#1) for review on release-7 by Raghavendra Bhat

Comment 2 Worker Ant 2019-08-22 05:59:50 UTC
REVIEW: https://review.gluster.org/23214 (storage/posix: set the op_errno to proper errno during gfid set) merged (#3) on release-7 by Rinku Kothiya


Note You need to log in before you can comment on or make changes to this bug.