Skip to content

Commit 853d9ed

Browse files
authored
Merge pull request redpanda-data#13496 from travisdowns/td-13469-ext4-detection
Ext4 detection
2 parents 928833c + 051c63c commit 853d9ed

File tree

1 file changed

+35
-3
lines changed

1 file changed

+35
-3
lines changed

src/v/syschecks/syschecks.cc

Lines changed: 35 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,24 +20,56 @@
2020
#include <seastar/core/seastar.hh>
2121
#include <seastar/net/api.hh>
2222

23+
namespace {
24+
ss::sstring to_string(ss::fs_type fs) {
25+
switch (fs) {
26+
case ss::fs_type::other:
27+
return "other";
28+
case ss::fs_type::xfs:
29+
return "xfs";
30+
case ss::fs_type::ext2:
31+
return "ext2";
32+
case ss::fs_type::ext3:
33+
return "ext3";
34+
case ss::fs_type::ext4:
35+
return "ext4";
36+
case ss::fs_type::btrfs:
37+
return "btrfs";
38+
case ss::fs_type::hfs:
39+
return "hfs";
40+
case ss::fs_type::tmpfs:
41+
return "tmpfs";
42+
};
43+
return "bad_enum";
44+
}
45+
} // namespace
46+
2347
namespace syschecks {
2448
ss::logger checklog{"syschecks"};
2549

2650
ss::future<> disk(const ss::sstring& path) {
2751
return ss::check_direct_io_support(path).then([path] {
2852
return ss::file_system_at(path).then([path](auto fs) {
29-
if (fs == ss::fs_type::ext4) {
53+
checklog.info0("Detected file system type is {}", to_string(fs));
54+
// Currently, all of ext2, 3 and 4 are detected as ext2, so we just
55+
// assume an ext2 detection means ext4 for now, see:
56+
// https://github.com/redpanda-data/redpanda/issues/13469
57+
// We also still check for ext4, since if that is returned it means
58+
// that seastar has been fixed to be able to detect ext4.
59+
if (fs == ss::fs_type::ext2 || fs == ss::fs_type::ext4) {
3060
checklog.warn(
3161
"Path: `{}' is on ext4, not XFS. This will probably work, "
3262
"but Redpanda is only tested on XFS and XFS is recommended "
3363
"for best performance.",
3464
path);
3565
} else if (fs != ss::fs_type::xfs) {
3666
checklog.error(
37-
"Path: `{}' is not on XFS or ext4. This is a non-supported "
67+
"Path: `{}' uses {} filesystem which is not XFS or ext4. "
68+
"This is a unsupported "
3869
"configuration. You may experience poor performance or "
3970
"instability.",
40-
path);
71+
path,
72+
to_string(fs));
4173
}
4274
});
4375
});

0 commit comments

Comments
 (0)