From 3a29b5c442da55ff1a05025b769ba8e384429d2e Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Tue, 2 Feb 2010 15:28:19 -0800 Subject: [PATCH] filestore: (try to) warn if not btrfs or ext3 This can't distinguish between ext3 and ext4, still, and ext4 won't work (because fsync(whatever) doesn't flush the whole journal). Bleh. --- src/os/FileStore.cc | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/os/FileStore.cc b/src/os/FileStore.cc index 7f1298ce09218..d810913c53f91 100644 --- a/src/os/FileStore.cc +++ b/src/os/FileStore.cc @@ -506,6 +506,18 @@ int FileStore::mount() << " filestore journal writeahead = true\n" << TEXT_NORMAL; } + + // ext3? + struct statfs buf; + int r = ::statfs(basedir.c_str(), &buf); + if (r == 0 && buf.f_type != 0xEF53 /*EXT3_SUPER_MAGIC*/) { + dout(0) << "mount WARNING: not btrfs or ext3; data may be lost" << dendl; + cerr << TEXT_YELLOW + << " ** WARNING: not btrfs or ext3. We don't currently support file systems other\n" + << " than btrfs and ext3 (data=journal or data=ordered). Data may be\n" + << " lost in the event of a crash.\n" + << TEXT_NORMAL; + } } if (!journal && g_conf.filestore_max_sync_interval > 2.0) { -- 2.39.5