From: "Darrick J. Wong" <djwong@kernel.org>
To: Christoph Hellwig <hch@lst.de>
Cc: zlang@kernel.org, fstests@vger.kernel.org, linux-xfs@vger.kernel.org
Subject: Re: [PATCH] shared/298: run xfs_db against the loop device instead of the image file
Date: Fri, 1 Mar 2024 09:47:56 -0800 [thread overview]
Message-ID: <20240301174756.GG1927156@frogsfrogsfrogs> (raw)
In-Reply-To: <20240301152820.1149483-1-hch@lst.de>
On Fri, Mar 01, 2024 at 08:28:20AM -0700, Christoph Hellwig wrote:
> xfs_db fails to properly detect the device sector size and thus segfaults
> when run again an image file with 4k sector size. While that's something
> we should fix in xfs_db it will require a fair amount of refactoring of
> the libxfs init code. For now just change shared/298 to run xfs_db
> against the loop device created on the image file that is used for I/O,
> which feels like the right thing to do anyway to avoid cache coherency
> issues.
>
> Signed-off-by: Christoph Hellwig <hch@lst.de>
> ---
> tests/shared/298 | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/tests/shared/298 b/tests/shared/298
> index 071c03dee..f657578c7 100755
> --- a/tests/shared/298
> +++ b/tests/shared/298
> @@ -69,7 +69,7 @@ get_free_sectors()
> agsize=`$XFS_INFO_PROG $loop_mnt | $SED_PROG -n 's/.*agsize=\(.*\) blks.*/\1/p'`
> # Convert free space (agno, block, length) to (start sector, end sector)
> _umount $loop_mnt
> - $XFS_DB_PROG -r -c "freesp -d" $img_file | $SED_PROG '/^.*from/,$d'| \
> + $XFS_DB_PROG -r -c "freesp -d" $loop_dev | $SED_PROG '/^.*from/,$d'| \
Might want to leave a comment here about why xfs uses $loop_dev unlike
the other clauses that use $img_file
# Use $loop_dev to work around sector size misdetection bugs in xfs_db
$XFS_DB_PROG...
With that changed,
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
--D
> $AWK_PROG -v spb=$sectors_per_block -v agsize=$agsize \
> '{ print spb * ($1 * agsize + $2), spb * ($1 * agsize + $2 + $3) - 1 }'
> ;;
> --
> 2.39.2
>
>
next prev parent reply other threads:[~2024-03-01 17:47 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-03-01 15:28 [PATCH] shared/298: run xfs_db against the loop device instead of the image file Christoph Hellwig
2024-03-01 17:47 ` Darrick J. Wong [this message]
2024-03-02 14:01 ` Christoph Hellwig
2024-03-02 19:51 ` Darrick J. Wong
2024-03-03 13:10 ` Zorro Lang
2024-03-03 14:15 ` Christoph Hellwig
2024-03-03 14:41 ` Zorro Lang
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240301174756.GG1927156@frogsfrogsfrogs \
--to=djwong@kernel.org \
--cc=fstests@vger.kernel.org \
--cc=hch@lst.de \
--cc=linux-xfs@vger.kernel.org \
--cc=zlang@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox