There are 2 scenarios which would trigger infinite loop:
1. None log is recorded, then dumplog with "-n", for example:
debugfs -R "logdump -O -n 10" /dev/xxx
while /dev/xxx has no valid log recorded.
2. The log area is full and cycle write is triggered, then dumplog with
debugfs -R "logdump -aOS" /dev/xxx
This patch add a new flag "reverse_flag" to mark if logdump has reached
to tail of logarea, it is default false, and set in macro WRAP().
If reverse_flag is true, and we comes to first_transaction_blocknr
again, just break the logdump loop.
Signed-off-by: Wenchao Hao <haowenchao2@huawei.com>
(cherry picked from commit c45fdac18e07017351b6c102d16b71b253bf7007)