Wenchao Hao f920f49010 debugfs: Fix infinite loop when dump log
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)
2024-05-30 11:18:35 +08:00
2022-08-11 17:25:31 +08:00
2020-06-13 13:26:43 +08:00
Description
No description provided
23 MiB
Languages
C 100%