ZIL: flag crashed LWBs so we know not to process them

If the ZIL crashed, any outstanding LWBs are no longer interesting, so
if they return, we need to just clean them up and return, not try to do
any work on them. This is true even if they return success, as that may
be long after the pool suspended and resumed, depending on when/if the
kernel decides to return the IO to us. In particular, we must not try to
get the "next" LWB from zl_lwb_list, since they're no longer on that
list.

So, we put a flag on in-flight LWBs in zil_crash() when we move them
from zl_lwb_list to zl_lwb_crash_list, so we know what's going on when
they return.

Sponsored-by: Klara, Inc.
Sponsored-by: Wasabi Technology, Inc.
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Alexander Motin <alexander.motin@TrueNAS.com>
Signed-off-by: Rob Norris <rob.norris@klarasystems.com>
Closes #17622
This commit is contained in:
Rob Norris
2025-08-12 12:17:33 +10:00
committed by Brian Behlendorf
parent 508c546975
commit 92da3e18c8
2 changed files with 19 additions and 7 deletions
+3 -2
View File
@@ -101,8 +101,9 @@ typedef enum {
* "zl_lock" is used to protect the lwb against concurrent access.
*/
typedef enum {
LWB_FLAG_SLIM = (1<<0), /* log block has slim format */
LWB_FLAG_SLOG = (1<<1), /* lwb_blk is on SLOG device */
LWB_FLAG_SLIM = (1<<0), /* log block has slim format */
LWB_FLAG_SLOG = (1<<1), /* lwb_blk is on SLOG device */
LWB_FLAG_CRASHED = (1<<2), /* lwb is on the crash list */
} lwb_flag_t;
typedef struct lwb {