Skip to content

Commit

Permalink
Prevent gcc -Werror=maybe-uninitialized warnings in spa_wait_common()
Browse files Browse the repository at this point in the history
This commit fixes the following build failure detected on Debian9
(GCC 6.3.0):

     CC [M]  module/zfs/spa.o
   module/zfs/spa.c: In function ‘spa_wait_common.part.31’:
   module/zfs/spa.c:9468:6: error: ‘in_progress’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
      if (!in_progress || spa->spa_waiters_cancel || error)
         ^
   cc1: all warnings being treated as errors

Reviewed-by: Chris Dunlop <[email protected]>
Reviewed-by: Brian Behlendorf <[email protected]>
Reviewed-by: John Gallagher <[email protected]>
Signed-off-by: loli10K <[email protected]>
Closes #9326
  • Loading branch information
loli10K authored and behlendorf committed Sep 16, 2019
1 parent 7e15647 commit b24771a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion module/zfs/spa.c
Original file line number Diff line number Diff line change
Expand Up @@ -9465,7 +9465,7 @@ spa_wait_common(const char *pool, zpool_wait_activity_t activity,
error = spa_activity_in_progress(spa, activity, use_tag, tag,
&in_progress);

if (!in_progress || spa->spa_waiters_cancel || error)
if (error || !in_progress || spa->spa_waiters_cancel)
break;

*waited = B_TRUE;
Expand Down

0 comments on commit b24771a

Please sign in to comment.