Skip to content

chore: fallocate test#513

Open
kostasrim wants to merge 1 commit intoromange:masterfrom
kostasrim:kpr1
Open

chore: fallocate test#513
kostasrim wants to merge 1 commit intoromange:masterfrom
kostasrim:kpr1

Conversation

@kostasrim
Copy link
Collaborator

  • add small fallocate usage test

Plz read the comments in the code (see my review)

ec = StatX(path.c_str(), &stat, wf->fd());
ASSERT_FALSE(ec);
ASSERT_EQ(stat.stx_size, 0);
ASSERT_EQ(stat.stx_blocks, 0);
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This fires but I don't understand why 🤔

const int mode = FALLOC_FL_PUNCH_HOLE | FALLOC_FL_KEEP_SIZE;

Means that we will punch a hole on all the blocks so at least we should see a reduction yet it does not change at all 🤔

Based on my understanding, PUCH_HOLE is not hint meaning that we should see a reduction in block size

Copy link
Owner

Choose a reason for hiding this comment

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

I do not know but I would first use fallocate + stat shell commands and play with them. no need to write code to explore their behavior

@sonarqubecloud
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants