Skip to content

Commit e5827a0

Browse files
author
Darrick J. Wong
committed
xfs: shut up -Wuninitialized in xfsaild_push
-Wuninitialized complains about @target in xfsaild_push being uninitialized in the case where the waitqueue is active but there is no last item in the AIL to wait for. I /think/ it should never be the case that the subsequent xfs_trans_ail_cursor_first returns a log item and hence we'll never end up at XFS_LSN_CMP, but let's make this explicit. Signed-off-by: Darrick J. Wong <[email protected]> Reviewed-by: Gao Xiang <[email protected]> Reviewed-by: Dave Chinner <[email protected]>
1 parent fd5beaf commit e5827a0

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

fs/xfs/xfs_trans_ail.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -422,7 +422,7 @@ xfsaild_push(
422422
struct xfs_ail_cursor cur;
423423
struct xfs_log_item *lip;
424424
xfs_lsn_t lsn;
425-
xfs_lsn_t target;
425+
xfs_lsn_t target = NULLCOMMITLSN;
426426
long tout;
427427
int stuck = 0;
428428
int flushing = 0;
@@ -472,6 +472,8 @@ xfsaild_push(
472472

473473
XFS_STATS_INC(mp, xs_push_ail);
474474

475+
ASSERT(target != NULLCOMMITLSN);
476+
475477
lsn = lip->li_lsn;
476478
while ((XFS_LSN_CMP(lip->li_lsn, target) <= 0)) {
477479
int lock_result;

0 commit comments

Comments
 (0)