diff mbox series

[2/3] xfs/242: fix _filter_bmap for xfs_io bmap that does rt file properly

Message ID 168005149606.4147931.15638466274918510566.stgit@frogsfrogsfrogs (mailing list archive)
State New, archived
Headers show
Series fstests: random fixes for v2023.03.26 | expand

Commit Message

Darrick J. Wong March 29, 2023, 12:58 a.m. UTC
From: Darrick J. Wong <djwong@kernel.org>

xfsprogs commit b1faed5f787 ("xfs_io: fix bmap command not detecting
realtime files with xattrs") fixed the xfs_io bmap output to display
realtime file columns for realtime files with xattrs.  As a result, the
data and unwritten flags are in column 5 and not column 7.

Signed-off-by: Darrick J. Wong <djwong@kernel.org>
---
 common/punch |    8 ++++++++
 1 file changed, 8 insertions(+)

Comments

David Disseldorp March 29, 2023, 11:02 a.m. UTC | #1
On Tue, 28 Mar 2023 17:58:16 -0700, Darrick J. Wong wrote:

> From: Darrick J. Wong <djwong@kernel.org>
> 
> xfsprogs commit b1faed5f787 ("xfs_io: fix bmap command not detecting
> realtime files with xattrs") fixed the xfs_io bmap output to display
> realtime file columns for realtime files with xattrs.  As a result, the
> data and unwritten flags are in column 5 and not column 7.

Reviewed-by: David Disseldorp <ddiss@suse.de>
diff mbox series

Patch

diff --git a/common/punch b/common/punch
index 3b8be21a2a..9e730404e2 100644
--- a/common/punch
+++ b/common/punch
@@ -188,6 +188,7 @@  _filter_hole_fiemap()
 	_coalesce_extents
 }
 
+# Column 7 for datadev files and column 5 for rtdev files
 #     10000 Unwritten preallocated extent
 #     01000 Doesn't begin on stripe unit
 #     00100 Doesn't end   on stripe unit
@@ -200,6 +201,13 @@  _filter_bmap()
 			print $1, $2, $3;
 			next;
 		}
+		$5 ~ /1[01][01][01][01]/ {
+			print $1, $2, "unwritten";
+			next;
+		}
+		$5 ~ /0[01][01][01][01]/ {
+			print $1, $2, "data"
+		}
 		$7 ~ /1[01][01][01][01]/ {
 			print $1, $2, "unwritten";
 			next;