]> git.baikalelectronics.ru Git - kernel.git/commit
xfs: on memory failure, only shut down fs after scanning all mappings
authorDarrick J. Wong <djwong@kernel.org>
Tue, 4 Oct 2022 05:40:01 +0000 (16:40 +1100)
committerDave Chinner <david@fromorbit.com>
Tue, 4 Oct 2022 05:40:01 +0000 (16:40 +1100)
commitb927072f846f088c7861979a9ab0d434cd7c2e56
tree138bf94d6210591be87f7ec987dc59c5a8c9a779
parent9423e966fd636b1b29317971a0204908bfab8f3d
xfs: on memory failure, only shut down fs after scanning all mappings

xfs_dax_failure_fn is used to scan the filesystem during a memory
failure event to look for memory mappings to revoke.  Unfortunately,
if it encounters an rmap record for filesystem metadata, it will
shut down the filesystem and the scan immediately.  This means that
we don't complete the mapping revocation scan and instead leave live
mappings to failed memory.  Fix the function to defer the shutdown
until after we've finished culling mappings.

While we're at it, add the usual "xfs_" prefix to struct
failure_info, and actually initialize mf_flags.

Fixes: 7f09e6d03fac ("xfs: implement ->notify_failure() for XFS")
Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
fs/xfs/xfs_notify_failure.c