From 3458bceae09e40797ef04708a9e7122efeb432a5 Mon Sep 17 00:00:00 2001 From: Raghav Sharma Date: Sat, 4 Apr 2026 17:10:38 +0530 Subject: [PATCH] xfs: handle missing attribute fork in VerifyForkoff check For some files, devices, and directories with no xattrs xfs can set di_forkoff to 0, so make it a valid condition check in VerifyForkoff() method Change-Id: I930529ad661c8c5f640c18b2d50dfeddfde5b7d4 Reviewed-on: https://review.haiku-os.org/c/haiku/+/10655 Reviewed-by: Adrien Destugues Haiku-Format: Haiku-format Bot Tested-by: Commit checker robot --- src/add-ons/kernel/file_systems/xfs/Inode.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/add-ons/kernel/file_systems/xfs/Inode.cpp b/src/add-ons/kernel/file_systems/xfs/Inode.cpp index 90a1cb0d41..686e170ad7 100644 --- a/src/add-ons/kernel/file_systems/xfs/Inode.cpp +++ b/src/add-ons/kernel/file_systems/xfs/Inode.cpp @@ -154,6 +154,10 @@ Inode::VerifyFork(int whichFork) const bool Inode::VerifyForkoff() const { + // Valid case when there is no attribute fork present + if (!fNode->di_forkoff) + return true; + switch(Format()) { case XFS_DINODE_FMT_DEV: if (fNode->di_forkoff != (ROUNDUP(sizeof(uint32), 8) >> 3))