re: xfs: cancel dfops on xfs_defer_finish() error

From: Colin Ian King
Date: Tue Aug 07 2018 - 10:14:11 EST


Hi,

Recent commit 82ff27bc52a88cb5cc400bfa64e210d3ec8dfebd ("xfs: automatic
dfops buffer relogging") removed the assignment of variable error:

- error = xfs_defer_bjoin(tp->t_dfops, bp);
if (error) {
xfs_trans_bhold_release(tp, bp);
xfs_trans_brelse(tp, bp);


.. the removal of the assignment leads to dead code on the following if
statement as error is always zero at this point. Not sure if that was
intended, but it tripped a static analysis warning from CoverityScan.


364 xfs_trans_bhold(tp, bp);

const: At condition error, the value of error must be equal to 0.
dead_error_condition: The condition error cannot be true.

365 if (error) {
CID 1472288 (#1 of 1): Logically dead code (DEADCODE)
dead_error_begin: Execution cannot reach this statement:
xfs_trans_bhold_release(tp,....


366 xfs_trans_bhold_release(tp, bp);
367 xfs_trans_brelse(tp, bp);
368 goto error1;
369 }

Colin