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>
This commit is contained in:
Raghavendra Bhat 2016-12-02 15:24:46 -05:00 committed by Jeff Darcy
parent faf43235e0
commit 2e0dceb616
6 changed files with 29 additions and 14 deletions

View File

@ -56,10 +56,10 @@ echo "Corrupted data" >> $B1/FILE2
#Manually set bad-file xattr since we can't wait for an hour for scrubber.
TEST setfattr -n trusted.bit-rot.bad-file -v 0x3100 $B1/FILE1
TEST setfattr -n trusted.bit-rot.bad-file -v 0x3100 $B1/FILE2
TEST touch "$B1/.glusterfs/quanrantine/$gfid1"
TEST chmod 000 "$B1/.glusterfs/quanrantine/$gfid1"
TEST touch "$B1/.glusterfs/quanrantine/$gfid2"
TEST chmod 000 "$B1/.glusterfs/quanrantine/$gfid2"
TEST touch "$B1/.glusterfs/quarantine/$gfid1"
TEST chmod 000 "$B1/.glusterfs/quarantine/$gfid1"
TEST touch "$B1/.glusterfs/quarantine/$gfid2"
TEST chmod 000 "$B1/.glusterfs/quarantine/$gfid2"
EXPECT "4" get_quarantine_count "$B1";
TEST $CLI_1 volume stop $V0
@ -80,7 +80,7 @@ EXPECT "$uuid2" get_node_uuid;
#BUG 1308961
#Remove bad files from mount, it should be removed from quarantine directory.
TEST rm -f $M0/FILE1
TEST ! stat "$B1/.glusterfs/quanrantine/$gfid1"
TEST ! stat "$B1/.glusterfs/quarantine/$gfid1"
#BUG 1308961
#Set network.inode-lru-limit to 5 and exceed the limit by creating 10 other files.
@ -90,6 +90,6 @@ for i in {1..10}
do
echo "1234" > $M0/file_$i
done
TEST stat "$B1/.glusterfs/quanrantine/$gfid2"
TEST stat "$B1/.glusterfs/quarantine/$gfid2"
cleanup;

View File

@ -37,8 +37,8 @@ gfid1=$(getfattr -n glusterfs.gfid.string --only-values $M0/FILE1)
#Manually set bad-file xattr
TEST setfattr -n trusted.bit-rot.bad-file -v 0x3100 $B0/${V0}5/FILE1
TEST touch "$B0/${V0}5/.glusterfs/quanrantine/$gfid1"
TEST chmod 000 "$B0/${V0}5/.glusterfs/quanrantine/$gfid1"
TEST touch "$B0/${V0}5/.glusterfs/quarantine/$gfid1"
TEST chmod 000 "$B0/${V0}5/.glusterfs/quarantine/$gfid1"
EXPECT "3" get_quarantine_count "$B0/${V0}5";
TEST $CLI volume stop $V0

View File

@ -618,7 +618,7 @@ function get_scrubd_count {
}
function get_quarantine_count {
ls -l "$1/.glusterfs/quanrantine" | wc -l
ls -l "$1/.glusterfs/quarantine" | wc -l
}
function get_quotad_count {

View File

@ -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)

View File

@ -112,8 +112,6 @@ out:
return -1;
}
#define BR_STUB_QUARANTINE_DIR GF_HIDDEN_PATH"/quanrantine"
int32_t
init (xlator_t *this)
{

View File

@ -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 *);