public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
* xfs_db bug
@ 2025-01-02 22:14 Tom Samstag
  2025-01-02 23:20 ` Darrick J. Wong
  0 siblings, 1 reply; 3+ messages in thread
From: Tom Samstag @ 2025-01-02 22:14 UTC (permalink / raw)
  To: linux-xfs

Hi!

I'm encountering what I believe to be a bug in xfs_db with some code
that worked previously for me. I have some code that uses xfs_db to
copy some specific data out of an XFS disk image based on an inode
number. Basically, it does similar to:

inode [inodenum]
dblock 0
p
dblock 1
p
dblock 2
p
[etc]

This worked on older versions of xfs_db but is now resulting in
corrupted output. I believe I've traced the issue to the code
introduced in https://git.kernel.org/pub/scm/fs/xfs/xfsprogs-dev.git/commit/?id=b05a31722f5d4c5e071238cbedf491d5b109f278
to support realtime files.

Specifically, the use of a `dblock` command when the previous command
was not an `inode` command looks to lead to the data in
iocur_top->data to no longer contain inode data as expected in the
line
if (is_rtfile(iocur_top->data))

I don't know the code well enough to submit a fix, but some quick
experimentation suggested it may be sufficient to move the check for
an rtfile to inside the push/pop context above after the call to
set_cur_inode(iocur_top->ino).

Hopefully this describes the issue sufficiently but please let me know
if you need anything else from me.

-Tom Samstag
NetRise.io

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2025-01-06 17:33 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-01-02 22:14 xfs_db bug Tom Samstag
2025-01-02 23:20 ` Darrick J. Wong
2025-01-06 17:33   ` Tom Samstag

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox