fix fallocate issue when filesystem doesn't support it
This commit is contained in:
@@ -2096,7 +2096,7 @@ typedef struct _FILE_ALLOCATED_RANGE_BUFFER {
|
|||||||
// way. If fallocate failed with some other error, it
|
// way. If fallocate failed with some other error, it
|
||||||
// probably means the user should know about it, error out
|
// probably means the user should know about it, error out
|
||||||
// and report it.
|
// and report it.
|
||||||
if (errno != ENOSYS && errno != EOPNOTSUPP)
|
if (errno != ENOSYS && errno != EOPNOTSUPP && errno != EINVAL)
|
||||||
{
|
{
|
||||||
ec.assign(errno, get_posix_category());
|
ec.assign(errno, get_posix_category());
|
||||||
return false;
|
return false;
|
||||||
|
@@ -678,17 +678,31 @@ void test_remove(std::string const& test_path, bool unbuffered)
|
|||||||
s->m_settings = &set;
|
s->m_settings = &set;
|
||||||
s->m_disk_pool = &dp;
|
s->m_disk_pool = &dp;
|
||||||
|
|
||||||
|
if (s->error())
|
||||||
|
{
|
||||||
|
TEST_ERROR(s->error().message().c_str());
|
||||||
|
fprintf(stderr, "default_storage::constructor %s: %s\n", s->error().message().c_str(), s->error_file().c_str());
|
||||||
|
}
|
||||||
|
|
||||||
// allocate the files and create the directories
|
// allocate the files and create the directories
|
||||||
s->initialize(true);
|
s->initialize(true);
|
||||||
TEST_CHECK(!s->error());
|
|
||||||
if (s->error())
|
if (s->error())
|
||||||
fprintf(stderr, "%s: %s\n", s->error().message().c_str(), s->error_file().c_str());
|
{
|
||||||
|
TEST_ERROR(s->error().message().c_str());
|
||||||
|
fprintf(stderr, "default_storage::initialize %s: %s\n", s->error().message().c_str(), s->error_file().c_str());
|
||||||
|
}
|
||||||
|
|
||||||
TEST_CHECK(exists(combine_path(test_path, combine_path("temp_storage", combine_path("_folder3", combine_path("subfolder", "test5.tmp"))))));
|
TEST_CHECK(exists(combine_path(test_path, combine_path("temp_storage", combine_path("_folder3", combine_path("subfolder", "test5.tmp"))))));
|
||||||
TEST_CHECK(exists(combine_path(test_path, combine_path("temp_storage", combine_path("folder2", "test3.tmp")))));
|
TEST_CHECK(exists(combine_path(test_path, combine_path("temp_storage", combine_path("folder2", "test3.tmp")))));
|
||||||
|
|
||||||
s->delete_files();
|
s->delete_files();
|
||||||
|
|
||||||
|
if (s->error())
|
||||||
|
{
|
||||||
|
TEST_ERROR(s->error().message().c_str());
|
||||||
|
fprintf(stderr, "default_storage::delete_files %s: %s\n", s->error().message().c_str(), s->error_file().c_str());
|
||||||
|
}
|
||||||
|
|
||||||
TEST_CHECK(!exists(combine_path(test_path, "temp_storage")));
|
TEST_CHECK(!exists(combine_path(test_path, "temp_storage")));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user