Merge tag 'mars0.1stable46' into mars0.1a.y

This commit is contained in:
Thomas Schoebel-Theuer 2017-09-11 11:48:41 +02:00
commit 2787be89de
4 changed files with 21 additions and 19 deletions

View File

@ -200,6 +200,12 @@ mars0.1balpha0
-----------------------------------
Changelog for series 0.1:
mars0.1stable46
* Major fix: bugfix from 0.1stable44 (state "Detached" was
reported too early) was incorrect, now fixed.
* Minor fix: display of host lists in special case of
create-resource was misleading.
mars0.1stable45
* Major fix: on secondaries, orphane files and symlinks were
sometimes created in /mars and could accumulate over a long time.

View File

@ -620,6 +620,7 @@ struct mars_rotate {
int avoid_count;
bool has_symlinks;
bool peer_activated;
bool is_attached;
bool res_shutdown;
bool has_error;
bool has_double_logfile;
@ -4167,7 +4168,6 @@ int make_bio(void *buf, struct mars_dent *dent)
struct mars_brick *brick;
const char *tmp;
bool switch_on;
bool is_attached;
int status = 0;
if (!global || !dent->d_parent) {
@ -4179,10 +4179,10 @@ int make_bio(void *buf, struct mars_dent *dent)
/* for detach, both the logger and the bio must be gone */
if (rot->trans_brick)
is_attached = true;
rot->is_attached = true;
else if (!rot->bio_brick)
is_attached = false;
_show_actual(rot->parent_path, "is-attached", is_attached);
rot->is_attached = false;
_show_actual(rot->parent_path, "is-attached", rot->is_attached);
rot->has_symlinks = true;
activate_peer(rot, dent->d_rest);
@ -5620,6 +5620,8 @@ static const struct main_class main_classes[] = {
};
/* Helper routine to pre-determine the relevance of a name from the filesystem.
* Caution: this is called as a callback from iterate_dir() and friends.
* Don't deadlock by producing any filesystem output within this!
*/
int main_checker(struct mars_dent *parent, const char *_name, int namlen, unsigned int d_type, int *prefix, int *serial, bool *use_channel)
{
@ -5633,7 +5635,6 @@ int main_checker(struct mars_dent *parent, const char *_name, int namlen, unsign
const char *name = _name;
#endif
//MARS_DBG("trying '%s' '%s'\n", path, name);
for (class = CL_ROOT + 1; ; class++) {
const struct main_class *test = &main_classes[class];
int len = test->cl_len;
@ -5641,9 +5642,11 @@ int main_checker(struct mars_dent *parent, const char *_name, int namlen, unsign
break;
}
//MARS_DBG(" testing class '%s'\n", test->cl_name);
#ifdef MARS_DEBUGGING
/* This can only happen when the table stucture is misformed.
* Exceptionally produce an error output.
* The whole system will not work anyway in such a stupid case.
*/
if (len != strlen(test->cl_name)) {
MARS_ERR("internal table '%s' mismatch: %d != %d\n", test->cl_name, len, (int)strlen(test->cl_name));
len = strlen(test->cl_name);
@ -5660,18 +5663,14 @@ int main_checker(struct mars_dent *parent, const char *_name, int namlen, unsign
continue;
}
//MARS_DBG("path '%s/%s' matches class %d '%s'\n", path, name, class, test->cl_name);
// check special contexts
if (test->cl_serial) {
int plus = 0;
int count;
count = sscanf(name+len, "%d%n", serial, &plus);
if (count < 1) {
//MARS_DBG("'%s' serial number mismatch at '%s'\n", name, name+len);
continue;
}
//MARS_DBG("'%s' serial number = %d\n", name, *serial);
len += plus;
if (name[len] == '-')
len++;
@ -5680,7 +5679,6 @@ int main_checker(struct mars_dent *parent, const char *_name, int namlen, unsign
*prefix = len;
if (test->cl_hostcontext) {
if (memcmp(name+len, my_id(), namlen-len)) {
//MARS_DBG("context mismatch '%s' at '%s'\n", name, name+len);
continue;
}
}

View File

@ -1133,6 +1133,9 @@ struct mars_dir_context {
#endif
// end_remove_this
/* Caution: this is called as a callback from iterate_dir() and friends.
* Don't deadlock by producing any filesystem output within this!
*/
#ifdef __HAS_NEW_FILLDIR_T
int mars_filler(struct dir_context *__buf, const char *name, int namlen, loff_t offset,
u64 ino, unsigned int d_type)
@ -1164,9 +1167,6 @@ int mars_filler(void *__buf, const char *name, int namlen, loff_t offset,
int serial = 0;
bool use_channel = false;
MARS_IO("ino = %llu len = %d offset = %lld type = %u\n", ino, namlen, offset, d_type);
cookie->hit = true;
if (name[0] == '.') {
@ -1187,8 +1187,6 @@ int mars_filler(void *__buf, const char *name, int namlen, loff_t offset,
pathlen += namlen;
newpath[pathlen] = '\0';
MARS_IO("path = '%s'\n", newpath);
dent = brick_zmem_alloc(cookie->allocsize);
if (unlikely(!dent))
goto err_mem1;

View File

@ -1878,7 +1878,7 @@ sub create_res {
lwarn "resource directory '$res' already exists\n";
my @host_list = glob("$resdir/replay-*");
if (@host_list) {
my $h_list = join(',', map({ $_ =~ s:.*/replay-::;} (@host_list)));
my $h_list = join(',', map({ $_ =~ s:.*/replay-::; $_; } (@host_list)));
lwarn "DANGER: hosts '$h_list' are already member of resource '$res'.\n";
ldie "REFUSING to trash your resource!\n" unless $force;
}
@ -2072,7 +2072,7 @@ sub create_res {
set_link($size, "$resdir/syncstatus-$host");
my $startnr = get_link("$resdir/maxnr", 2);
if (defined($startnr) && $startnr ne "" && $startnr > 0) {
$startnr += 1000;
$startnr += 100000;
} else {
$startnr = 1;
}