David Ribeiro Alves has posted comments on this change. Change subject: fs: ensure FS_IOC_FIEMAP can be used on LBM systems ......................................................................
Patch Set 1: (1 comment) http://gerrit.cloudera.org:8080/#/c/6584/1/src/kudu/fs/data_dirs.cc File src/kudu/fs/data_dirs.cc: PS1, Line 100: Status CheckFsFeatures(Env* env, const string& path) { : // Arbitrary constants. : static uint64_t kFileSize = 4096 * 4; : static uint64_t kHoleOffset = 4096; : static uint64_t kHoleSize = 8192; : static uint64_t kPunchedFileSize = kFileSize - kHoleSize; : : // Open the test file. : string filename = JoinPathSegments(path, "hole_punch_test_file"); : unique_ptr<RWFile> file; : RWFileOptions opts; : RETURN_NOT_OK(env->NewRWFile(opts, filename, &file)); : : // The file has been created; delete it on exit no matter what happens. : ScopedFileDeleter file_deleter(env, filename); : : // Preallocate it, making sure the file's size is what we'd expect. : uint64_t sz; : RETURN_NOT_OK_PREPEND(file->PreAllocate( : 0, kFileSize, RWFile::CHANGE_FILE_SIZE), "could not preallocate file"); : RETURN_NOT_OK(env->GetFileSizeOnDisk(filename, &sz)); : if (sz != kFileSize) { : return Status::IOError(Substitute( : "unexpected pre-punch file size for $0: expected $1 but got $2", : filename, kFileSize, sz)); : } : : // Punch the hole, testing the file's size again. : RETURN_NOT_OK_PREPEND(file->PunchHole(kHoleOffset, kHoleSize), : "could not punch hole in file"); : RETURN_NOT_OK(env->GetFileSizeOnDisk(filename, &sz)); : if (sz != kPunchedFileSize) { : return Status::IOError(Substitute( : "unexpected post-punch file size for $0: expected $1 but got $2", : filename, kPunchedFileSize, sz)); : } : : // Make sure we can get at the file's extents. : RWFile::ExtentMap extents; : RETURN_NOT_OK_PREPEND(file->GetExtentMap(&extents), : "could not get file's extent map"); : return Status::OK(); : } are there cases where people might have data already written to filesystems that don't support at least one of these things and which will become unreadable from now on? -- To view, visit http://gerrit.cloudera.org:8080/6584 To unsubscribe, visit http://gerrit.cloudera.org:8080/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ie027a264473ae5f905f8ad50aa45e810e046a135 Gerrit-PatchSet: 1 Gerrit-Project: kudu Gerrit-Branch: master Gerrit-Owner: Adar Dembo <[email protected]> Gerrit-Reviewer: David Ribeiro Alves <[email protected]> Gerrit-Reviewer: Kudu Jenkins Gerrit-Reviewer: Tidy Bot Gerrit-Reviewer: Todd Lipcon <[email protected]> Gerrit-HasComments: Yes
