-
Notifications
You must be signed in to change notification settings - Fork 326
Deduplicate repo+sysroot syncfs logic #3509
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
This pull request refactors full_system_sync()
to use an existing repository file descriptor, which is a good simplification. It also adds a new validation in ensure_repo()
to confirm that the sysroot and repository are on the same device, enhancing robustness. My review includes a minor suggestion to improve the portability of an error message's format string.
0d6963b
to
a1fcddc
Compare
This is a followup to ostreedev@6e5a27a which I believe is correct as is. However, we already have a file descriptor open for the ostree repo, which *must* be on the same filesystem as `/sysroot/ostree` (the deployment code forces hardlinking today). It's hence cleaner to reuse that extant fd instead of opening a new one - we know we did writes to that fd. But going farther here, there already is logic to use syncfs for the repo when downloading objects (in a common case we actually syncfs twice). Since these are really the same operation, unify them: - Add journaling to the repo one syncfs case - Change the sysroot case to just call it - Since we log consistently to the journal for all syncfs/fsfreeze operations now, drop the SyncStats bits which was a way to add info about that to a later journal message Additionally, let's add an extra check when we're opening the repo that it's on the same device just on general principle. Signed-off-by: Colin Walters <walters@verbum.org>
a1fcddc
to
cb369f7
Compare
OK I rewrote this one again, it's now one commit and syncs up the syncfs logic |
|
||
if (self->disable_fsync) | ||
return TRUE; | ||
/* FIXME: Added OSTREE_SUPPRESS_SYNCFS since valgrind in el7 doesn't know |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
EL 7 is long dead, should we drop OSTREE_SUPPRESS_SYNCFS
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah I just kept it on the principle of not changing too many things at once.
This is a followup to 6e5a27a
which I believe is correct as is. However, we already have a file
descriptor open for the ostree repo, which must be on
the same filesystem as
/sysroot/ostree
(the deploymentcode forces hardlinking today).
It's hence cleaner to reuse that extant fd instead of opening
a new one - we know we did writes to that fd.
But going farther here, there already is logic to use syncfs
for the repo when downloading objects (in a common case
we actually syncfs twice).
Since these are really the same operation, unify them:
operations now, drop the SyncStats bits which was a way
to add info about that to a later journal message
Additionally, let's add an extra check when we're
opening the repo that it's on the same device just on general
principle.
Signed-off-by: Colin Walters walters@verbum.org