summaryrefslogtreecommitdiffstats
path: root/xlators/features/bit-rot
diff options
context:
space:
mode:
authorRaghavendra Bhat <raghavendra@redhat.com>2016-12-02 15:24:46 -0500
committerJeff Darcy <jdarcy@redhat.com>2017-01-30 15:17:51 -0500
commit2e0dceb6165d0a93581284fa2e0d74abe4ee615b (patch)
treeb8f00397445def0441a79e15259e2f58bc8bc2f8 /xlators/features/bit-rot
parentfaf43235e0b3308388d0146e65b3982c11661db0 (diff)
features/bit-rot-stub: use the correct spelling of quarantine for bad objects
container The directory for containing the list of bad objects was named "quanrantine" instead of "quarantine" Change-Id: I8c20381ac637201d9d1a224f5223e8dfbed53f1e BUG: 1401571 Signed-off-by: Raghavendra Bhat <raghavendra@redhat.com> Reviewed-on: https://review.gluster.org/16027 Smoke: Gluster Build System <jenkins@build.gluster.org> NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org> CentOS-regression: Gluster Build System <jenkins@build.gluster.org> Reviewed-by: Kotresh HR <khiremat@redhat.com>
Diffstat (limited to 'xlators/features/bit-rot')
-rw-r--r--xlators/features/bit-rot/src/stub/bit-rot-stub-helpers.c17
-rw-r--r--xlators/features/bit-rot/src/stub/bit-rot-stub.c2
-rw-r--r--xlators/features/bit-rot/src/stub/bit-rot-stub.h6
3 files changed, 20 insertions, 5 deletions
diff --git a/xlators/features/bit-rot/src/stub/bit-rot-stub-helpers.c b/xlators/features/bit-rot/src/stub/bit-rot-stub-helpers.c
index bf3e56a6c74..59588d04f5c 100644
--- a/xlators/features/bit-rot/src/stub/bit-rot-stub-helpers.c
+++ b/xlators/features/bit-rot/src/stub/bit-rot-stub-helpers.c
@@ -224,8 +224,15 @@ out:
static int
br_stub_check_stub_directory (xlator_t *this, char *fullpath)
{
- int ret = 0;
- struct stat st = {0,};
+ int ret = 0;
+ struct stat st = {0,};
+ char oldpath[PATH_MAX] = {0};
+ br_stub_private_t *priv = NULL;
+
+ priv = this->private;
+
+ (void) snprintf (oldpath, PATH_MAX,
+ "%s/%s", priv->export, OLD_BR_STUB_QUARANTINE_DIR);
ret = sys_stat (fullpath, &st);
if (!ret && !S_ISDIR (st.st_mode))
@@ -233,7 +240,11 @@ br_stub_check_stub_directory (xlator_t *this, char *fullpath)
if (ret) {
if (errno != ENOENT)
goto error_return;
- ret = mkdir_p (fullpath, 0600, _gf_true);
+ ret = sys_stat (oldpath, &st);
+ if (ret)
+ ret = mkdir_p (fullpath, 0600, _gf_true);
+ else
+ ret = sys_rename (oldpath, fullpath);
}
if (ret)
diff --git a/xlators/features/bit-rot/src/stub/bit-rot-stub.c b/xlators/features/bit-rot/src/stub/bit-rot-stub.c
index 4e01f5c86b1..ae99604957b 100644
--- a/xlators/features/bit-rot/src/stub/bit-rot-stub.c
+++ b/xlators/features/bit-rot/src/stub/bit-rot-stub.c
@@ -112,8 +112,6 @@ out:
return -1;
}
-#define BR_STUB_QUARANTINE_DIR GF_HIDDEN_PATH"/quanrantine"
-
int32_t
init (xlator_t *this)
{
diff --git a/xlators/features/bit-rot/src/stub/bit-rot-stub.h b/xlators/features/bit-rot/src/stub/bit-rot-stub.h
index 2d515417059..3facf2fe9c6 100644
--- a/xlators/features/bit-rot/src/stub/bit-rot-stub.h
+++ b/xlators/features/bit-rot/src/stub/bit-rot-stub.h
@@ -24,6 +24,12 @@
#define BAD_OBJECT_THREAD_STACK_SIZE ((size_t)(1024*1024))
+/*
+ * Oops. Spelling mistake. Correcting it
+ */
+#define OLD_BR_STUB_QUARANTINE_DIR GF_HIDDEN_PATH"/quanrantine"
+#define BR_STUB_QUARANTINE_DIR GF_HIDDEN_PATH"/quarantine"
+
typedef int (br_stub_version_cbk) (call_frame_t *, void *,
xlator_t *, int32_t, int32_t, dict_t *);