]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
xfs: translate fsdax media errors into file "data lost" errors when convenient
authorDarrick J. Wong <djwong@kernel.org>
Tue, 13 Jan 2026 00:32:12 +0000 (16:32 -0800)
committerChristian Brauner <brauner@kernel.org>
Tue, 13 Jan 2026 08:58:01 +0000 (09:58 +0100)
Translate fsdax persistent failure notifications into file data loss
events when it's convenient, aka when the inode is already incore.

Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Link: https://patch.msgid.link/176826402673.3490369.1672039530408369208.stgit@frogsfrogsfrogs
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Christian Brauner <brauner@kernel.org>
fs/xfs/xfs_notify_failure.c

index b1767288994206b35eb1276d3e0cfcd823c29c55..6d5002413c2cb4ace3405597126c2f7ee6262212 100644 (file)
@@ -26,6 +26,7 @@
 #include <linux/mm.h>
 #include <linux/dax.h>
 #include <linux/fs.h>
+#include <linux/fserror.h>
 
 struct xfs_failure_info {
        xfs_agblock_t           startblock;
@@ -116,6 +117,9 @@ xfs_dax_failure_fn(
                invalidate_inode_pages2_range(mapping, pgoff,
                                              pgoff + pgcnt - 1);
 
+       fserror_report_data_lost(VFS_I(ip), (u64)pgoff << PAGE_SHIFT,
+                       (u64)pgcnt << PAGE_SHIFT, GFP_NOFS);
+
        xfs_irele(ip);
        return error;
 }