Size detection from output block device no longer working #91
Labels
No labels
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
ivarch/pv#91
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
The manual says
However,
pvhas lost this ability in version 1.8.10. It works properly in 1.8.9, but in 1.8.10 there's no ETA and no progress bar when, say, zeroing a drive, just the indicator moving back and forth.This seems to be a side effect of the changes made for adding the
-ooption.pv_calc_total_bytes()was modified to usestate->control.output_fdinstead ofSTDOUT_FILENO, but that field is not yet initialized when the function is called frommain().The simplest solution would seem to be to move the block that calls
pv_state_output_set()higher inmain(), right before the block that callspv_calc_total_size(). The only downside that I can see with this solution is that, if the output is a normal existing file, it will be truncated a bit more eagerly than before. I don't think this matters currently, as I don't see any early returns from main between the new and old positions of that block of code, but ifmain()is modified in the future to exit early for some reason, this has a higher chance of leaving the user with an error message and a truncated output file (instead of leaving the output file alone in case of a critical error).What do you think?
I've not looked at the code yet regarding this, but what you propose certainly sounds like the way to go. Thanks!
A fix has been committed which will be in the next release. Thanks again for reporting this, and your very helpful analysis.