Update to 3.12.0, which includes NFS4 ACLs and file locking improvements

Signed-off-by: Jonathan Dieter <jdieter@gmail.com>
This commit is contained in:
Jonathan Dieter 2017-12-26 20:48:37 +02:00
parent 77b493b513
commit 55a93c7bc2
8 changed files with 23802 additions and 239 deletions

1
.gitignore vendored
View File

@ -2,3 +2,4 @@
/lizardfs-3.11.0.tar.gz
/lizardfs-3.11.2.tar.gz
/lizardfs-3.11.3.tar.gz
/lizardfs-3.12.0.tar.gz

File diff suppressed because it is too large Load Diff

View File

@ -1,31 +0,0 @@
From 9d00681b24b02e0a143506c0f60c83d50136e87d Mon Sep 17 00:00:00 2001
From: Jonathan Dieter <jdieter@lesbg.com>
Date: Tue, 11 Apr 2017 11:20:32 +0300
Subject: [PATCH] [main] Remove supplementary groups when dropping privileges
When dropping privileges, remove supplementary groups which give
unnecessary access.
This will fail if we're not root, at which point the next statement will
also fail, so don't bother checking return value.
Signed-off-by: Jonathan Dieter <jdieter@lesbg.com>
---
src/main/main.cc | 1 +
1 file changed, 1 insertion(+)
diff --git a/src/main/main.cc b/src/main/main.cc
index 36cf9cb..a974881 100644
--- a/src/main/main.cc
+++ b/src/main/main.cc
@@ -374,6 +374,7 @@ void changeugid(RunMode runmode) {
free(wuser);
free(wgroup);
+ setgroups(0, NULL);
if (setgid(wrk_gid)<0) {
lzfs_pretty_errlog(LOG_ERR,"can't set gid to %d",(int)wrk_gid);
exit(LIZARDFS_EXIT_STATUS_ERROR);
--
2.9.3

View File

@ -1,119 +0,0 @@
From 0ff659db5d0847db2aa0d59be4955c16012d6fc2 Mon Sep 17 00:00:00 2001
From: Piotr Sarna <sarna@skytechnology.pl>
Date: Mon, 12 Jun 2017 12:41:56 +0200
Subject: [PATCH 1/3] master: Fix issues with reporting defective files
This commit fixes printing paths for trash/reserved files
in defective files report and adds missing counter increments
in fs_test_getdata loop.
Fixes #565
Change-Id: Ifb3932800b1d7998ff55cecb09fcc28a5dbc4717
---
src/master/filesystem_periodic.cc | 59 ++++++++++++++++++++-------------------
1 file changed, 31 insertions(+), 28 deletions(-)
diff --git a/src/master/filesystem_periodic.cc b/src/master/filesystem_periodic.cc
index d9fab6f9..8b7913fb 100644
--- a/src/master/filesystem_periodic.cc
+++ b/src/master/filesystem_periodic.cc
@@ -92,36 +92,11 @@ void fs_background_task_manager_work() {
}
}
-std::vector<DefectiveFileInfo> fs_get_defective_nodes_info(uint8_t requested_flags, uint64_t max_entries,
- uint64_t &entry_index) {
- FSNode *node;
- FSNodeDirectory *parent;
- std::string file_path;
- std::vector<DefectiveFileInfo> defective_nodes_info;
- ActiveLoopWatchdog watchdog;
- defective_nodes_info.reserve(max_entries);
- auto it = gDefectiveNodes.find_nth(entry_index);
- watchdog.start();
- for (uint64_t i = 0; i < max_entries && it != gDefectiveNodes.end(); ++it) {
- if (((*it).second & requested_flags) != 0) {
- node = fsnodes_id_to_node<FSNode>((*it).first);
- parent = fsnodes_get_first_parent(node);
- fsnodes_getpath(parent, node, file_path);
- file_path = "/" + file_path;
- defective_nodes_info.emplace_back(file_path, (*it).second);
- ++i;
- }
- ++entry_index;
- if (watchdog.expired()) {
- return defective_nodes_info;
- }
- }
- entry_index = 0;
- return defective_nodes_info;
-}
-
static std::string get_node_info(FSNode *node) {
std::string name;
+ if (node == nullptr) {
+ return name;
+ }
if (node->type == FSNode::kTrash) {
name = "file in trash " + std::to_string(node->id) + ": " +
(std::string)gMetadata->trash.at(TrashPathKey(node));
@@ -157,6 +132,30 @@ static std::string get_node_info(FSNode *node) {
return fsnodes_escape_name(name);
}
+std::vector<DefectiveFileInfo> fs_get_defective_nodes_info(uint8_t requested_flags, uint64_t max_entries,
+ uint64_t &entry_index) {
+ FSNode *node;
+ std::vector<DefectiveFileInfo> defective_nodes_info;
+ ActiveLoopWatchdog watchdog;
+ defective_nodes_info.reserve(max_entries);
+ auto it = gDefectiveNodes.find_nth(entry_index);
+ watchdog.start();
+ for (uint64_t i = 0; i < max_entries && it != gDefectiveNodes.end(); ++it) {
+ if (((*it).second & requested_flags) != 0) {
+ node = fsnodes_id_to_node<FSNode>((*it).first);
+ std::string info = get_node_info(node);
+ defective_nodes_info.emplace_back(std::move(info), (*it).second);
+ ++i;
+ }
+ ++entry_index;
+ if (watchdog.expired()) {
+ return defective_nodes_info;
+ }
+ }
+ entry_index = 0;
+ return defective_nodes_info;
+}
+
void fs_test_getdata(uint32_t &loopstart, uint32_t &loopend, uint32_t &files, uint32_t &ugfiles,
uint32_t &mfiles, uint32_t &chunks, uint32_t &ugchunks, uint32_t &mchunks,
std::string &result) {
@@ -170,6 +169,8 @@ void fs_test_getdata(uint32_t &loopstart, uint32_t &loopend, uint32_t &files, ui
FSNode *node = fsnodes_id_to_node<FSNode>(entry.first);
if (!node) {
+ report << "Structure error in defective list, entry " << std::to_string(entry.first) << "\n";
+ errors++;
continue;
}
@@ -213,6 +214,7 @@ void fs_test_getdata(uint32_t &loopstart, uint32_t &loopend, uint32_t &files, ui
report << "*";
}
report << " currently unavailable " << name << "\n";
+ errors++;
}
if (errors >= ERRORS_LOG_MAX) {
@@ -222,6 +224,7 @@ void fs_test_getdata(uint32_t &loopstart, uint32_t &loopend, uint32_t &files, ui
if (entry.second & kStructureError) {
std::string name = get_node_info(node);
report << "Structure error in " << name << "\n";
+ errors++;
}
if (errors >= ERRORS_LOG_MAX) {
--
2.13.0

View File

@ -1,30 +0,0 @@
From 48004d85280a8d8483c0b1a85e3fe2db28967750 Mon Sep 17 00:00:00 2001
From: Piotr Sarna <sarna@skytechnology.pl>
Date: Mon, 12 Jun 2017 17:24:34 +0200
Subject: [PATCH 2/3] mount: Fix request size in read cache for empty results
This commit makes empty cache results return correct '0' value
when checking its size.
Change-Id: I9d2fa823bff46133bc471aae32155b5c8b21e11c
---
src/mount/readdata_cache.h | 3 +++
1 file changed, 3 insertions(+)
diff --git a/src/mount/readdata_cache.h b/src/mount/readdata_cache.h
index 9043dc32..37f56e50 100644
--- a/src/mount/readdata_cache.h
+++ b/src/mount/readdata_cache.h
@@ -186,6 +186,9 @@ public:
}
Size requestSize(Offset real_offset, Size real_size) const {
+ if (entries.empty()) {
+ return 0;
+ }
assert(real_offset >= frontOffset());
assert(real_offset <= endOffset());
return std::min<Size>(endOffset() - real_offset, real_size);
--
2.13.0

View File

@ -1,45 +0,0 @@
From 0b970d4e0cad10a70c920cad0437bf8b278df00d Mon Sep 17 00:00:00 2001
From: Piotr Sarna <sarna@skytechnology.pl>
Date: Mon, 19 Jun 2017 14:38:05 +0200
Subject: [PATCH 3/3] mount: Fix read request size with disabled readahead
This commit makes read requests ask for proper size when readahead
feature is disabled (cacheexpirationtime set to 0).
Change-Id: Ia5d8cfb746d689b1f4750e79721419d02ae7db70
---
src/mount/readahead_adviser.h | 4 ++++
src/mount/readdata_cache.h | 2 +-
2 files changed, 5 insertions(+), 1 deletion(-)
diff --git a/src/mount/readahead_adviser.h b/src/mount/readahead_adviser.h
index 1dc89eae..832be05b 100644
--- a/src/mount/readahead_adviser.h
+++ b/src/mount/readahead_adviser.h
@@ -54,6 +54,10 @@ public:
* \param size size of read operation
*/
void feed(uint64_t offset, uint32_t size) {
+ if (timeout_ms_ == 0) {
+ window_ = 0;
+ return;
+ }
addToHistory(size);
if (offset == current_offset_) {
random_candidates_ = 0;
diff --git a/src/mount/readdata_cache.h b/src/mount/readdata_cache.h
index 37f56e50..717826b6 100644
--- a/src/mount/readdata_cache.h
+++ b/src/mount/readdata_cache.h
@@ -61,7 +61,7 @@ public:
}
bool expired(uint32_t expiration_time) const {
- return timer.elapsed_ms() > expiration_time;
+ return timer.elapsed_ms() >= expiration_time;
}
Offset endOffset() const {
--
2.13.0

View File

@ -1,6 +1,6 @@
Name: lizardfs
Summary: Distributed, fault tolerant file system
Version: 3.11.3
Version: 3.12.0
Release: 1%{?dist}
# LizardFS is under GPLv3 while crcutil is under ASL 2.0 and there's one header,
# src/common/coroutine.h, under the Boost license
@ -10,9 +10,8 @@ URL: http://www.lizardfs.org/
Source: https://github.com/lizardfs/%{name}/archive/v%{version}/%{name}-%{version}.tar.gz
Source1: pam-lizardfs
Source2: 95-lizardfs.conf
# Make sure we drop supplementary groups when running setgid
# Pull request at https://github.com/lizardfs/lizardfs/pull/533
Patch1: 0001-main-Remove-supplementary-groups-when-dropping-privi.patch
# Use spdlog system library if available
Patch0: 0001-Put-customized-spdlog-in-source-so-we-don-t-download.patch
BuildRequires: fuse-devel
BuildRequires: cmake
BuildRequires: pkgconfig
@ -27,6 +26,8 @@ BuildRequires: systemd
# libcrcutil is basically a copylib with a dead upstream
# https://code.google.com/archive/p/crcutil/
Provides: bundled(libcrcutil) = 1.0
# spdlog is a copylib that lizardfs changes, so we can't use the system version
Provides: bundled(spdlib) = 0.14.0
%global liz_project mfs
%global liz_group %{liz_project}
@ -196,7 +197,7 @@ exit 0
%autosetup -p1
# Remove /usr/bin/env from bash scripts
for i in src/tools/mfstools.sh src/mount/mfssnapshot src/master/mfsrestoremaster.in \
for i in src/tools/mfstools.sh src/master/mfsrestoremaster.in \
src/common/serialization_macros_generate.sh src/data/postinst.in \
utils/coverage.sh utils/cpp-interpreter.sh utils/wireshark/plugins/lizardfs/generate.sh; do
sed -i 's@#!/usr/bin/env bash@#!/bin/bash@' $i
@ -258,7 +259,7 @@ install -m644 %{SOURCE2} %{buildroot}%{_sysconfdir}/security/limits.d/95-lizardf
%files master
%doc NEWS README UPGRADE
%doc NEWS README.md UPGRADE
%license COPYING
%{_sbindir}/mfsmaster
%{_sbindir}/mfsrestoremaster
@ -291,7 +292,7 @@ install -m644 %{SOURCE2} %{buildroot}%{_sysconfdir}/security/limits.d/95-lizardf
%files metalogger
%doc NEWS README UPGRADE
%doc NEWS README.md UPGRADE
%license COPYING
%{_sbindir}/mfsmetalogger
%{_mandir}/man5/mfsmetalogger.cfg.5*
@ -303,7 +304,7 @@ install -m644 %{SOURCE2} %{buildroot}%{_sysconfdir}/security/limits.d/95-lizardf
%files chunkserver
%doc NEWS README UPGRADE
%doc NEWS README.md UPGRADE
%license COPYING
%{_sbindir}/mfschunkserver
%{_mandir}/man5/mfschunkserver.cfg.5*
@ -319,12 +320,11 @@ install -m644 %{SOURCE2} %{buildroot}%{_sysconfdir}/security/limits.d/95-lizardf
%files client
%doc NEWS README UPGRADE
%doc NEWS README.md UPGRADE
%license COPYING
%{_bindir}/lizardfs
%{_bindir}/mfstools.sh
%{_bindir}/mfsmount
%{_bindir}/mfssnapshot
%{_bindir}/mfsappendchunks
%{_bindir}/mfscheckfile
%{_bindir}/mfsdeleattr
@ -378,7 +378,7 @@ install -m644 %{SOURCE2} %{buildroot}%{_sysconfdir}/security/limits.d/95-lizardf
%files cgi
%doc NEWS README UPGRADE
%doc NEWS README.md UPGRADE
%license COPYING
%dir %{_datadir}/mfscgi
%{_datadir}/mfscgi/err.gif
@ -391,7 +391,7 @@ install -m644 %{SOURCE2} %{buildroot}%{_sysconfdir}/security/limits.d/95-lizardf
%files cgiserv
%doc NEWS README UPGRADE
%doc NEWS README.md UPGRADE
%license COPYING
%{_sbindir}/lizardfs-cgiserver
%{_sbindir}/mfscgiserv
@ -401,7 +401,7 @@ install -m644 %{SOURCE2} %{buildroot}%{_sysconfdir}/security/limits.d/95-lizardf
%files adm
%doc NEWS README UPGRADE
%doc NEWS README.md UPGRADE
%license COPYING
%{_bindir}/lizardfs-admin
%{_mandir}/man8/lizardfs-admin.8*
@ -410,6 +410,9 @@ install -m644 %{SOURCE2} %{buildroot}%{_sysconfdir}/security/limits.d/95-lizardf
%changelog
* Tue Dec 26 2017 Jonathan Dieter <jdieter@lesbg.com> - 3.12.0-1
- Update to 3.12.0
* Sat Aug 26 2017 Jonathan Dieter <jdieter@lesbg.com> - 3.11.3-1
- Update to 3.11.3, removing upstreamed patches

View File

@ -1 +1 @@
SHA512 (lizardfs-3.11.3.tar.gz) = daf90174a28ff9413cda57bb97e79c1f19a1af5ad2a673a5348e7f697ab8429824bc0153030b2fbd1045e96cf801c27504fceecaeb1dfa7bbf66896739dc9d86
SHA512 (lizardfs-3.12.0.tar.gz) = 0136114266dfadcf8e2205bfd19f50ee201566958fba1dc97d4a238ed63ca91dc2cd6352f25d911f4410b0fbd59846f54206da773789d5b959c8c02bde5adf20