GNOME Bugzilla – Bug 746360
Wrong output from fsck
Last modified: 2015-03-18 13:32:35 UTC
fsck prints the current object index starting at 0 and never reaches the total number of objects. $ ./ostree --repo=$REPO fsck Enumerating objects... Verifying content integrity of 1 commit objects... 0/13 objects 1/13 objects 2/13 objects 3/13 objects 4/13 objects 5/13 objects 6/13 objects 7/13 objects 8/13 objects 9/13 objects 10/13 objects 11/13 objects 12/13 objects
Created attachment 299626 [details] [review] fsck: Fix object count output The object count comes from g_hash_table_size(), so it's not 0 based index. Starting the index at 0 makes the output never reach the total number of objects.
Comment on attachment 299626 [details] [review] fsck: Fix object count output I suggest just changing the g_print() argument to i + 1 so as not to affect the (i % mod == 0) calculation.
Created attachment 299667 [details] [review] fsck: Fix object count output The object count comes from g_hash_table_size(), so it's not a 0 based index. In order to maintain the mod calculations correctly, just print out index + 1.
Good call. On my single commit repo where mod == 1, I hadn't noticed that would break.
Looks good, thanks for the patch! I'll give Colin a chance to comment, but it looks pretty straightforward to me.
(In reply to Matthew Barnes from comment #5) > Looks good, thanks for the patch! > > I'll give Colin a chance to comment, but it looks pretty straightforward to > me. I trust your review, please push, thanks!
Pushed to master: https://git.gnome.org/browse/ostree/commit/?id=553d7840d5d5ada906da8328fc84bc8b40c6d8b1