Bug 1455022
| Summary: | [GSS] Use of force with volume start, creates brick directory even it is not present | |||
|---|---|---|---|---|
| Product: | [Red Hat Storage] Red Hat Gluster Storage | Reporter: | Abhishek Kumar <abhishku> | |
| Component: | index | Assignee: | Ravishankar N <ravishankar> | |
| Status: | CLOSED ERRATA | QA Contact: | Bala Konda Reddy M <bmekala> | |
| Severity: | urgent | Docs Contact: | ||
| Priority: | urgent | |||
| Version: | rhgs-3.2 | CC: | amukherj, pdhange, ravishankar, rhs-bugs, storage-qa-internal, vbellur | |
| Target Milestone: | --- | Keywords: | Reopened | |
| Target Release: | RHGS 3.3.0 | |||
| Hardware: | All | |||
| OS: | Linux | |||
| Whiteboard: | ||||
| Fixed In Version: | glusterfs-3.8.4-29 | Doc Type: | If docs needed, set a value | |
| Doc Text: | Story Points: | --- | ||
| Clone Of: | ||||
| : | 1457202 (view as bug list) | Environment: | ||
| Last Closed: | 2017-09-21 04:45:37 UTC | Type: | Bug | |
| 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: | ||||
| Bug Blocks: | 1417151, 1457202, 1462636 | |||
|
Description
Abhishek Kumar
2017-05-24 05:01:37 UTC
While the expectation of creating the directory (even in root partition) with volume create force is valid, but we do have a bug in volume start force codepath where the brick is getting recreated. GlusterD actually doesn't create this brick path. We have an issue in the index xlator here.
index_dir_create ()
int
index_dir_create (xlator_t *this, const char *subdir)
{
int ret = 0;
struct stat st = {0};
char fullpath[PATH_MAX] = {0};
char path[PATH_MAX] = {0};
char *dir = NULL;
index_priv_t *priv = NULL;
size_t len = 0;
size_t pathlen = 0;
priv = this->private;
make_index_dir_path (priv->index_basepath, subdir, fullpath,
sizeof (fullpath));
ret = sys_stat (fullpath, &st);
if (!ret) {
if (!S_ISDIR (st.st_mode))
ret = -2;
goto out;
}
pathlen = strlen (fullpath);
if ((pathlen > 1) && fullpath[pathlen - 1] == '/')
fullpath[pathlen - 1] = '\0';
dir = strchr (fullpath, '/');
while (dir) {
dir = strchr (dir + 1, '/');
if (dir)
len = pathlen - strlen (dir);
else
len = pathlen;
strncpy (path, fullpath, len);
path[len] = '\0';
ret = sys_mkdir (path, 0600); ====> this is actually creating the brickpath.
if (ret && (errno != EEXIST))
goto out;
}
ret = 0;
out:
if (ret == -1) {
gf_msg (this->name, GF_LOG_ERROR, errno,
INDEX_MSG_INDEX_DIR_CREATE_FAILED, "%s/%s: Failed to "
"create", priv->index_basepath, subdir);
} else if (ret == -2) {
gf_msg (this->name, GF_LOG_ERROR, ENOTDIR,
INDEX_MSG_INDEX_DIR_CREATE_FAILED, "%s/%s: Failed to "
"create, path exists, not a directory ",
priv->index_basepath, subdir);
}
return ret;
}
Downstream patch: https://code.engineering.redhat.com/gerrit/#/c/109354/ BUILD : 3.8.4-32 Creating the volume with force is valid even when the directory is not present. Created a volume and removed the brick by doing "rm -rf /bricks/brick1/testvol_1." Then started the volume with force option. The directory associated the volume is not re-created as expected. Hence marking it as verified Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHBA-2017:2774 Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHBA-2017:2774 |