From 3d81aa100277c67dcd81f6de0ce9102d1009edd6 Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Tue, 2 Apr 2019 20:56:27 +0100 Subject: Zero out f_fsid of VFS See following comment in statfs(2) Nobody knows what f_fsid is supposed to contain (but see below). The general idea is that f_fsid contains some random stuff.... --- netfs/ice/typeConverter.cpp | 4 ++-- netfs/unittests/testCore.cpp | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/netfs/ice/typeConverter.cpp b/netfs/ice/typeConverter.cpp index 7619063..0e3ce7f 100644 --- a/netfs/ice/typeConverter.cpp +++ b/netfs/ice/typeConverter.cpp @@ -54,7 +54,7 @@ TypeConverter::convert(const NetFS::VFS & v) const vfs.f_files = v.files; vfs.f_ffree = v.freeFiles; vfs.f_favail = v.availFiles; - vfs.f_fsid = v.FSID; + vfs.f_fsid = 0; vfs.f_flag = v.flags; vfs.f_namemax = v.maxNameLen; return vfs; @@ -92,7 +92,7 @@ TypeConverter::convert(const struct statvfs & s) const t.files = s.f_files; t.freeFiles = s.f_ffree; t.availFiles = s.f_favail; - safeAssign(t.FSID, s.f_fsid); + t.FSID = 0; safeAssign(t.flags, s.f_flag); safeAssign(t.maxNameLen, s.f_namemax); return t; diff --git a/netfs/unittests/testCore.cpp b/netfs/unittests/testCore.cpp index 07b5ce6..9c83d8a 100644 --- a/netfs/unittests/testCore.cpp +++ b/netfs/unittests/testCore.cpp @@ -117,6 +117,7 @@ BOOST_AUTO_TEST_CASE ( clientInitialised ) { struct statvfs s; BOOST_REQUIRE_EQUAL(0, fuse->statfs("/", &s)); + BOOST_REQUIRE_EQUAL(s.f_fsid, 0); BOOST_REQUIRE_EQUAL(-ENOENT, fuse->statfs("/missing", &s)); } -- cgit v1.2.3