Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

delete fallocate with punch_hole #2038

Closed
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions HISTORY.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@

### Bug Fixes
* Fix the bug that iterator may skip keys
* Remove calling fallocate with FALLOC_FL_KEEP_SIZE | FALLOC_FL_PUNCH_HOLE flag to circumvent a kernel bug that changes file size after this call on XFS

## 5.2.0 (02/08/2017)
### Public API Change
Expand Down
3 changes: 3 additions & 0 deletions util/io_posix.cc
Original file line number Diff line number Diff line change
Expand Up @@ -751,6 +751,9 @@ Status PosixWritableFile::Close() {
// but it will be nice to log these errors.
int dummy __attribute__((unused));
dummy = ftruncate(fd_, filesize_);
// NOTE(gzh): remove fallocate(FALLOC_FL_KEEP_SIZE | FALLOC_FL_PUNCH_HOLE)
// because a kernel bug on XFS make it change file size
// https://github.com/facebook/rocksdb/pull/2038
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMO, these new lines (754-756) are not really needed here, as we will be left wondering in the future why they are even here.

}

if (close(fd_) < 0) {
Expand Down