Skip to content

Commit

Permalink
Fix report_mount_progress never calling set_progress_header
Browse files Browse the repository at this point in the history
That happens because of an off-by-one mistake.
share_mount_one_cb() calls report_mount_progress(current=sm_done) after
having incremented sm_done by one.  Then report_mount_progress()
increments the parameter again.  It appears that that logic became
obsolete after commit a10d50f, parallel zfs mount.

On FreeBSD I observe that zfs mount -a -v prints, for example,
    (null): (201/248)
That happens because set_progress_header() is never called.

With this change the output becomes correct:
    Mounting ZFS filesystems: (209/248)

Reviewed-by: Brian Behlendorf <[email protected]>
Signed-off-by: Andriy Gapon <[email protected]>
Closes #11607
  • Loading branch information
avg-I authored and behlendorf committed Mar 5, 2021
1 parent 62f9691 commit f6440fa
Showing 1 changed file with 0 additions and 3 deletions.
3 changes: 0 additions & 3 deletions cmd/zfs/zfs_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -6790,9 +6790,6 @@ report_mount_progress(int current, int total)
time_t now = time(NULL);
char info[32];

/* report 1..n instead of 0..n-1 */
++current;

/* display header if we're here for the first time */
if (current == 1) {
set_progress_header(gettext("Mounting ZFS filesystems"));
Expand Down

0 comments on commit f6440fa

Please sign in to comment.