Skip to content

Commit f0d0070

Browse files
committed
CONSOLE/MGM: Move fsck commands to on/off semantics rather than toggle. Fixes EOS-6275
1 parent abec8eb commit f0d0070

6 files changed

Lines changed: 200 additions & 120 deletions

File tree

common/Mapping.cc

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -842,13 +842,15 @@ Mapping::IdMap(const XrdSecEntity* client, const char* env, const char* tident,
842842
eos_static_err("failed to decode token tident='%s' token='%s' errno=%d", tident,
843843
authz.c_str(), -rc);
844844
} else {
845-
bool validated = true;
846-
if (path.length() && path.substr(0,6) != "/proc/") {
847-
if (vid.token->ValidatePath(path)) {
848-
eos_static_err("token:validatepath msg=\"path validation failed for '%s'\"", path.c_str());
849-
validated = false;
850-
}
851-
}
845+
bool validated = true;
846+
847+
if (path.length() && path.substr(0, 6) != "/proc/") {
848+
if (vid.token->ValidatePath(path)) {
849+
eos_static_err("token:validatepath msg=\"path validation failed for '%s'\"",
850+
path.c_str());
851+
validated = false;
852+
}
853+
}
852854

853855
// if the path is screened we change owner/group
854856
if (validated && !vid.token->Owner().empty()) {
@@ -864,7 +866,8 @@ Mapping::IdMap(const XrdSecEntity* client, const char* env, const char* tident,
864866
if (EOS_LOGS_INFO) {
865867
std::string dump;
866868
vid.token->Dump(dump, true, true);
867-
eos_static_info("%s {tokensudo:%d (%d)}", dump.c_str(), token_sudo, gTokenSudo.load());
869+
eos_static_info("%s {tokensudo:%d (%d)}", dump.c_str(), token_sudo,
870+
gTokenSudo.load());
868871
}
869872
}
870873
} else {
@@ -1137,7 +1140,6 @@ Mapping::HandleVOMS(const XrdSecEntity* client, VirtualIdentity& vid)
11371140
}
11381141
}
11391142

1140-
11411143
//------------------------------------------------------------------------------
11421144
// Handle HTTPS authz keys mapping
11431145
//------------------------------------------------------------------------------

common/Mapping.hh

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -386,7 +386,7 @@ public:
386386
static void HandleUidGidMapping(const char* name, VirtualIdentity& vid,
387387
const std::string& uid_key_name,
388388
const std::string& gid_key_name,
389-
bool force=false);
389+
bool force = false);
390390

391391
static void cacheUserIds(uid_t uid, const std::string& username);
392392
static void cacheGroupIds(gid_t gid, const std::string& groupname);
@@ -415,7 +415,6 @@ public:
415415
static void addSecondaryGroups(VirtualIdentity& vid, const std::string& name,
416416
gid_t gid);
417417

418-
419418
//----------------------------------------------------------------------------
420419
//! Handle HTTPS authz key mapping
421420
//!

console/commands/com_proto_fsck.cc

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -61,20 +61,20 @@ void com_fsck_help()
6161
<< " print summary of consistency checks\n"
6262
<< " -m : print in monitoring format\n"
6363
<< std::endl
64-
<< " fsck config <key> [<value>]\n"
64+
<< " fsck config <key> <value>\n"
6565
<< " configure the fsck with the following possible options:\n"
66-
<< " toggle-collect : enable/disable error collection thread, <value> represents\n"
67-
<< " the collection interval in minutes [default 30]\n"
68-
<< " toggle-repair : enable/disable repair thread, no <value> required\n"
69-
<< " toggle-best-effort : enable/disable best-effort repair mode, no <value> required\n"
66+
<< " collect-interval-min : collection interval in minutes [default 30]\n"
67+
<< " collect : control error collection thread - on/off\n"
68+
<< " repair : control error repair thread - on/off\n"
69+
<< " best-effort : control best-effort repair mode - on/off\n"
7070
<< " repair-category : specify error types that the repair thread will handle\n"
7171
<< " e.g all, m_cx_diff, m_mem_sz_diff, d_cx_diff, d_mem_sz_diff,\n"
72-
<< " unreg_n, rep_diff_n, rep_missing_n, blockxs_err\n"
73-
<< " show-dark-files : yes/no [default no]\n"
74-
<< " show-offline : yes/no [default no]\n"
75-
<< " show-no-replica : yes/no [default no]\n"
72+
<< " unreg_n, rep_diff_n, rep_missing_n, blockxs_err\n"
7673
<< " max-queued-jobs : maximum number of queued jobs\n"
7774
<< " max-thread-pool-size : maximum number of threads in the fsck pool\n"
75+
<< " show-dark-files : on/off [default off] - might affect instance performance\n"
76+
<< " show-offline : on/off [default off] - might affect instance performance\n"
77+
<< " show-no-replica : on/off [default off] - might affect instance performance\n"
7878
<< std::endl
7979
<< " fsck report [-a] [-h] [-i] [-l] [-j|--json] [--error <tag1> <tag2> ...]\n"
8080
<< " report consistency check results, with the following options\n"

0 commit comments

Comments
 (0)