Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 2 additions & 7 deletions auth_plugin/ProtoUtils.cc
Original file line number Diff line number Diff line change
Expand Up @@ -255,13 +255,8 @@ utils::GetXrdSfsPrep(const eos::auth::XrdSfsPrepProto& proto_obj)
//------------------------------------------------------------------------------
void utils::DeleteXrdSfsPrep(XrdSfsPrep*& obj)
{
if (obj->reqid) {
free(obj->reqid);
}

if (obj->notify != nullptr) {
free(obj->notify);
}
free(obj->reqid);
free(obj->notify);

XrdOucTList* currentPath = obj->paths;

Expand Down
2 changes: 1 addition & 1 deletion console/commands/com_proto_token.cc
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ void com_token_help()
<< " <origin> := <regexp:hostname>#<regex:username>#<regex:protocol>\n"
<< " - described by three regular extended expressions matching the \n"
<< " bearers hostname, possible authenticated name and protocol\n"
<< " - default is .#.#. (be careful with proper shell escaping)"
<< " - default is .*#.*#.* (be careful with proper shell escaping)"
<< "\n"
<< "Examples:\n"
<< " eos token --path /eos/ --permission rx --tree\n"
Expand Down
1 change: 1 addition & 0 deletions eos.spec.in
Original file line number Diff line number Diff line change
Expand Up @@ -326,6 +326,7 @@ The EOS server installation
%files -n eos-server
%defattr(-, root, root, -)
%{_bindir}/eos-ns-convert-to-locality-hashes
%{_bindir}/zstdtail
%{_sbindir}/eos-tty-broadcast
%{_sbindir}/eosfstregister
%{_sbindir}/eosfstinfo
Expand Down
6 changes: 2 additions & 4 deletions fst/http/s3/S3Handler.cc
Original file line number Diff line number Diff line change
Expand Up @@ -132,10 +132,8 @@ S3Handler::HandleRequest(eos::common::HttpRequest* request)

if (!mHttpResponse || request->GetBodySize() == 0) {
// clean-up left-over objects on error or end-of-put
if (mFile) {
delete mFile;
mFile = 0;
}
delete mFile;
mFile = 0;
}
}
}
Expand Down
9 changes: 2 additions & 7 deletions fst/xrdcl_plugins/RainFile.cc
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,8 @@ RainFile::~RainFile()
{
eos_debug("calling destructor");

if (pFile) {
delete pFile;
}

if (pRainFile) {
delete pRainFile;
}
delete pFile;
delete pRainFile;
}


Expand Down
98 changes: 50 additions & 48 deletions mgm/fsck/FsckEntry.cc
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ FsckEntry::RepairBestEffort()
std::string options = "&mgm.verify.compute.checksum=1"
"&mgm.verify.commit.checksum=1&mgm.verify.commit.size=1";

if (!gOFS->_verifystripe(mFid, lerr, root, ref_fsid, options)) {
if (gOFS->_verifystripe(mFid, lerr, root, ref_fsid, options)) {
eos_err("msg=\"failed verify stripe command\" fxid=%08llx fsid=%lu",
mFid, ref_fsid);
return false;
Expand Down Expand Up @@ -582,63 +582,65 @@ FsckEntry::RepairMgmXsSzDiff()
bool
FsckEntry::RepairFstXsSzDiff()
{
// Rain failures will be flagged and fixed by the stripe_errs
if (LayoutId::IsRain(mMgmFmd.layout_id())) {
return true;
}

std::set<eos::common::FileSystem::fsid_t> bad_fsids;
std::set<eos::common::FileSystem::fsid_t> good_fsids;

if (LayoutId::IsRain(mMgmFmd.layout_id())) {
bad_fsids.insert(*mFsidErr.begin());
} else { // for replica layouts
std::string mgm_xs_val =
StringConversion::BinData2HexString(mMgmFmd.checksum().c_str(),
SHA256_DIGEST_LENGTH,
LayoutId::GetChecksumLen(mMgmFmd.layout_id()));
// Make sure at least one disk xs and size match the MGM ones
uint64_t sz_val {0ull};
std::string xs_val;
// Replica layouts
std::string mgm_xs_val =
StringConversion::BinData2HexString(mMgmFmd.checksum().c_str(),
SHA256_DIGEST_LENGTH,
LayoutId::GetChecksumLen(mMgmFmd.layout_id()));
// Make sure at least one disk xs and size match the MGM ones
uint64_t sz_val {0ull};
std::string xs_val;

for (auto it = mFstFileInfo.cbegin(); it != mFstFileInfo.cend(); ++it) {
auto& finfo = it->second;
for (auto it = mFstFileInfo.cbegin(); it != mFstFileInfo.cend(); ++it) {
auto& finfo = it->second;

if (finfo->mFstErr != FstErr::None) {
eos_err("msg=\"unavailable replica info\" fxid=%08llx fsid=%lu",
mFid, it->first);
bad_fsids.insert(it->first);
continue;
}
if (finfo->mFstErr != FstErr::None) {
eos_err("msg=\"unavailable replica info\" fxid=%08llx fsid=%lu",
mFid, it->first);
bad_fsids.insert(it->first);
continue;
}

xs_val = finfo->mFstFmd.mProtoFmd.diskchecksum();
sz_val = finfo->mFstFmd.mProtoFmd.disksize();
eos_static_debug("mgm_sz=%llu mgm_xs=%s fst_sz_sz=%llu fst_sz_disk=%llu, "
"fst_xs=%s", mMgmFmd.size(), mgm_xs_val.c_str(),
finfo->mFstFmd.mProtoFmd.size(),
finfo->mFstFmd.mProtoFmd.disksize(),
finfo->mFstFmd.mProtoFmd.checksum().c_str());

// The disksize/xs must also match the original reference size/xs
if ((mgm_xs_val == xs_val) && (mMgmFmd.size() == sz_val) &&
(finfo->mFstFmd.mProtoFmd.size() == sz_val) &&
(finfo->mFstFmd.mProtoFmd.checksum() == xs_val)) {
good_fsids.insert(finfo->mFstFmd.mProtoFmd.fsid());
} else {
// It could be that the diskchecksum for the replica was not yet
// computed - this does not mean the replica is bad
if (!finfo->mFstFmd.mProtoFmd.diskchecksum().empty()) {
bad_fsids.insert(finfo->mFstFmd.mProtoFmd.fsid());
}
xs_val = finfo->mFstFmd.mProtoFmd.diskchecksum();
sz_val = finfo->mFstFmd.mProtoFmd.disksize();
eos_static_debug("mgm_sz=%llu mgm_xs=%s fst_sz_sz=%llu fst_sz_disk=%llu, "
"fst_xs=%s", mMgmFmd.size(), mgm_xs_val.c_str(),
finfo->mFstFmd.mProtoFmd.size(),
finfo->mFstFmd.mProtoFmd.disksize(),
finfo->mFstFmd.mProtoFmd.checksum().c_str());

// The disksize/xs must also match the original reference size/xs
if ((mgm_xs_val == xs_val) && (mMgmFmd.size() == sz_val) &&
(finfo->mFstFmd.mProtoFmd.size() == sz_val) &&
(finfo->mFstFmd.mProtoFmd.checksum() == xs_val)) {
good_fsids.insert(finfo->mFstFmd.mProtoFmd.fsid());
} else {
// It could be that the diskchecksum for the replica was not yet
// computed - this does not mean the replica is bad
if (!finfo->mFstFmd.mProtoFmd.diskchecksum().empty()) {
bad_fsids.insert(finfo->mFstFmd.mProtoFmd.fsid());
}
}
}

if (bad_fsids.empty()) {
eos_warning("msg=\"fst xs/size repair skip - no bad replicas\" fxid=%08llx",
mFid);
return true;
}
if (bad_fsids.empty()) {
eos_warning("msg=\"fst xs/size repair skip - no bad replicas\" fxid=%08llx",
mFid);
return true;
}

if (good_fsids.empty()) {
eos_err("msg=\"fst xs/size repair failed - no good replicas\" fxid=%08llx",
mFid);
return RepairBestEffort();
}
if (good_fsids.empty()) {
eos_err("msg=\"fst xs/size repair failed - no good replicas\" fxid=%08llx",
mFid);
return RepairBestEffort();
}

// Have more good stripes then layout requirements
Expand Down
2 changes: 1 addition & 1 deletion utils/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ add_executable(zstdtail zstdtail.cc)
target_link_libraries(zstdtail PRIVATE ZSTD::ZSTD)

install(TARGETS zstdtail
DESTINATION ${CMAKE_INSTALL_FULL_SBINDIR})
DESTINATION ${CMAKE_INSTALL_FULL_BINDIR})

install(
PROGRAMS eos-log-clean eos-mgm-clean eos-fst-clean eos-uninstall eos-ports-block eos-tty-broadcast filter-trace/eos-filter-stacktrace flamegraph/eos-util-flamegraph flamegraph/eos-util-stackcollapse flamegraph/eos-make-flamegraph
Expand Down