From: "Darrick J. Wong" <djwong@kernel.org>
To: Zorro Lang <zlang@redhat.com>
Cc: linux-xfs@vger.kernel.org, fstests@vger.kernel.org
Subject: Re: [PATCH 2/4] xfs: refactor filesystem directory block size extraction logic
Date: Thu, 27 Oct 2022 10:03:05 -0700 [thread overview]
Message-ID: <Y1q5yYiIjWole+lj@magnolia> (raw)
In-Reply-To: <20221027165916.4ttwfx7g66pznsrt@zlang-mailbox>
On Fri, Oct 28, 2022 at 12:59:16AM +0800, Zorro Lang wrote:
> On Wed, Oct 26, 2022 at 12:03:25PM -0700, Darrick J. Wong wrote:
> > From: Darrick J. Wong <djwong@kernel.org>
> >
> > There are a lot of places where we open-code determining the directory
> > block size for a specific filesystem. Refactor this into a single
> > helper to clean up existing tests.
> >
> > Signed-off-by: Darrick J. Wong <djwong@kernel.org>
> > ---
>
> Hmm... sorry I failed to merge this patchset:
>
> $ git am ./20221026_djwong_fstests_refactor_xfs_geometry_computation.mbx
> Applying: xfs: refactor filesystem feature detection logic
> Applying: xfs: refactor filesystem directory block size extraction logic
> error: sha1 information is lacking or useless (common/xfs).
> error: could not build fake ancestor
> Patch failed at 0002 xfs: refactor filesystem directory block size extraction logic
> hint: Use 'git am --show-current-patch=diff' to see the failed patch
> When you have resolved this problem, run "git am --continue".
> If you prefer to skip this patch, run "git am --skip" instead.
> To restore the original branch and stop patching, run "git am --abort".
I don't know what exactly failed, but if you're ok with pushing your
working branch to kernel.org, I can rebase my changes atop that and
send you a pull request.
--D
> > common/populate | 4 ++--
> > common/xfs | 9 +++++++++
> > tests/xfs/099 | 2 +-
> > tests/xfs/100 | 2 +-
> > tests/xfs/101 | 2 +-
> > tests/xfs/102 | 2 +-
> > tests/xfs/105 | 2 +-
> > tests/xfs/112 | 2 +-
> > tests/xfs/113 | 2 +-
> > 9 files changed, 18 insertions(+), 9 deletions(-)
> >
> >
> > diff --git a/common/populate b/common/populate
> > index 9fa1a06798..23b2fecf69 100644
> > --- a/common/populate
> > +++ b/common/populate
> > @@ -175,7 +175,7 @@ _scratch_xfs_populate() {
> > _xfs_force_bdev data $SCRATCH_MNT
> >
> > blksz="$(stat -f -c '%s' "${SCRATCH_MNT}")"
> > - dblksz="$($XFS_INFO_PROG "${SCRATCH_MNT}" | grep naming.*bsize | sed -e 's/^.*bsize=//g' -e 's/\([0-9]*\).*$/\1/g')"
> > + dblksz="$(_xfs_get_dir_blocksize "$SCRATCH_MNT")"
> > crc="$(_xfs_has_feature "$SCRATCH_MNT" crc -v)"
> > if [ $crc -eq 1 ]; then
> > leaf_hdr_size=64
> > @@ -602,7 +602,7 @@ _scratch_xfs_populate_check() {
> > is_reflink=$(_xfs_has_feature "$SCRATCH_MNT" reflink -v)
> >
> > blksz="$(stat -f -c '%s' "${SCRATCH_MNT}")"
> > - dblksz="$($XFS_INFO_PROG "${SCRATCH_MNT}" | grep naming.*bsize | sed -e 's/^.*bsize=//g' -e 's/\([0-9]*\).*$/\1/g')"
> > + dblksz="$(_xfs_get_dir_blocksize "$SCRATCH_MNT")"
> > leaf_lblk="$((32 * 1073741824 / blksz))"
> > node_lblk="$((64 * 1073741824 / blksz))"
> > umount "${SCRATCH_MNT}"
> > diff --git a/common/xfs b/common/xfs
> > index c7496bce3f..6445bfd9db 100644
> > --- a/common/xfs
> > +++ b/common/xfs
> > @@ -203,6 +203,15 @@ _xfs_is_realtime_file()
> > $XFS_IO_PROG -c 'stat -v' "$1" | grep -q -w realtime
> > }
> >
> > +# Get the directory block size of a mounted filesystem.
> > +_xfs_get_dir_blocksize()
> > +{
> > + local fs="$1"
> > +
> > + $XFS_INFO_PROG "$fs" | grep 'naming.*bsize' | \
> > + sed -e 's/^.*bsize=//g' -e 's/\([0-9]*\).*$/\1/g'
> > +}
> > +
> > # Set or clear the realtime status of every supplied path. The first argument
> > # is either 'data' or 'realtime'. All other arguments should be paths to
> > # existing directories or empty regular files.
> > diff --git a/tests/xfs/099 b/tests/xfs/099
> > index a7eaff6e0c..82bef8ad26 100755
> > --- a/tests/xfs/099
> > +++ b/tests/xfs/099
> > @@ -37,7 +37,7 @@ _scratch_mkfs_xfs > /dev/null
> >
> > echo "+ mount fs image"
> > _scratch_mount
> > -dblksz="$($XFS_INFO_PROG "${SCRATCH_MNT}" | grep naming.*bsize | sed -e 's/^.*bsize=//g' -e 's/\([0-9]*\).*$/\1/g')"
> > +dblksz=$(_xfs_get_dir_blocksize "$SCRATCH_MNT")
> > nr="$((dblksz / 40))"
> > blksz="$(stat -f -c '%s' "${SCRATCH_MNT}")"
> > leaf_lblk="$((32 * 1073741824 / blksz))"
> > diff --git a/tests/xfs/100 b/tests/xfs/100
> > index 79da8cb02c..e638b4ba17 100755
> > --- a/tests/xfs/100
> > +++ b/tests/xfs/100
> > @@ -37,7 +37,7 @@ _scratch_mkfs_xfs > /dev/null
> >
> > echo "+ mount fs image"
> > _scratch_mount
> > -dblksz="$($XFS_INFO_PROG "${SCRATCH_MNT}" | grep naming.*bsize | sed -e 's/^.*bsize=//g' -e 's/\([0-9]*\).*$/\1/g')"
> > +dblksz=$(_xfs_get_dir_blocksize "$SCRATCH_MNT")
> > nr="$((dblksz / 12))"
> > blksz="$(stat -f -c '%s' "${SCRATCH_MNT}")"
> > leaf_lblk="$((32 * 1073741824 / blksz))"
> > diff --git a/tests/xfs/101 b/tests/xfs/101
> > index 64f4705aca..11ed329110 100755
> > --- a/tests/xfs/101
> > +++ b/tests/xfs/101
> > @@ -37,7 +37,7 @@ _scratch_mkfs_xfs > /dev/null
> >
> > echo "+ mount fs image"
> > _scratch_mount
> > -dblksz="$($XFS_INFO_PROG "${SCRATCH_MNT}" | grep naming.*bsize | sed -e 's/^.*bsize=//g' -e 's/\([0-9]*\).*$/\1/g')"
> > +dblksz=$(_xfs_get_dir_blocksize "$SCRATCH_MNT")
> > nr="$((dblksz / 12))"
> > blksz="$(stat -f -c '%s' "${SCRATCH_MNT}")"
> > leaf_lblk="$((32 * 1073741824 / blksz))"
> > diff --git a/tests/xfs/102 b/tests/xfs/102
> > index 24dce43058..43f4539181 100755
> > --- a/tests/xfs/102
> > +++ b/tests/xfs/102
> > @@ -37,7 +37,7 @@ _scratch_mkfs_xfs > /dev/null
> >
> > echo "+ mount fs image"
> > _scratch_mount
> > -dblksz="$($XFS_INFO_PROG "${SCRATCH_MNT}" | grep naming.*bsize | sed -e 's/^.*bsize=//g' -e 's/\([0-9]*\).*$/\1/g')"
> > +dblksz=$(_xfs_get_dir_blocksize "$SCRATCH_MNT")
> > nr="$((16 * dblksz / 40))"
> > blksz="$(stat -f -c '%s' "${SCRATCH_MNT}")"
> > leaf_lblk="$((32 * 1073741824 / blksz))"
> > diff --git a/tests/xfs/105 b/tests/xfs/105
> > index 22a8bf9fb0..002a712883 100755
> > --- a/tests/xfs/105
> > +++ b/tests/xfs/105
> > @@ -37,7 +37,7 @@ _scratch_mkfs_xfs > /dev/null
> >
> > echo "+ mount fs image"
> > _scratch_mount
> > -dblksz="$($XFS_INFO_PROG "${SCRATCH_MNT}" | grep naming.*bsize | sed -e 's/^.*bsize=//g' -e 's/\([0-9]*\).*$/\1/g')"
> > +dblksz=$(_xfs_get_dir_blocksize "$SCRATCH_MNT")
> > nr="$((16 * dblksz / 40))"
> > blksz="$(stat -f -c '%s' "${SCRATCH_MNT}")"
> > leaf_lblk="$((32 * 1073741824 / blksz))"
> > diff --git a/tests/xfs/112 b/tests/xfs/112
> > index bc1ab62895..e2d5932da6 100755
> > --- a/tests/xfs/112
> > +++ b/tests/xfs/112
> > @@ -37,7 +37,7 @@ _scratch_mkfs_xfs > /dev/null
> >
> > echo "+ mount fs image"
> > _scratch_mount
> > -dblksz="$($XFS_INFO_PROG "${SCRATCH_MNT}" | grep naming.*bsize | sed -e 's/^.*bsize=//g' -e 's/\([0-9]*\).*$/\1/g')"
> > +dblksz=$(_xfs_get_dir_blocksize "$SCRATCH_MNT")
> > nr="$((16 * dblksz / 40))"
> > blksz="$(stat -f -c '%s' "${SCRATCH_MNT}")"
> > leaf_lblk="$((32 * 1073741824 / blksz))"
> > diff --git a/tests/xfs/113 b/tests/xfs/113
> > index e820ed96da..9bb2cd304b 100755
> > --- a/tests/xfs/113
> > +++ b/tests/xfs/113
> > @@ -37,7 +37,7 @@ _scratch_mkfs_xfs > /dev/null
> >
> > echo "+ mount fs image"
> > _scratch_mount
> > -dblksz="$($XFS_INFO_PROG "${SCRATCH_MNT}" | grep naming.*bsize | sed -e 's/^.*bsize=//g' -e 's/\([0-9]*\).*$/\1/g')"
> > +dblksz=$(_xfs_get_dir_blocksize "$SCRATCH_MNT")
> > nr="$((128 * dblksz / 40))"
> > blksz="$(stat -f -c '%s' "${SCRATCH_MNT}")"
> > leaf_lblk="$((32 * 1073741824 / blksz))"
> >
>
next prev parent reply other threads:[~2022-10-27 17:03 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-10-26 19:03 [PATCHSET v23.2 0/4] fstests: refactor xfs geometry computation Darrick J. Wong
2022-10-26 19:03 ` [PATCH 1/4] xfs: refactor filesystem feature detection logic Darrick J. Wong
2022-10-26 19:03 ` [PATCH 2/4] xfs: refactor filesystem directory block size extraction logic Darrick J. Wong
2022-10-27 16:59 ` Zorro Lang
2022-10-27 17:03 ` Darrick J. Wong [this message]
2022-10-28 6:08 ` Zorro Lang
2022-10-28 16:21 ` Darrick J. Wong
2022-10-28 16:55 ` Zorro Lang
2022-10-26 19:03 ` [PATCH 3/4] xfs: refactor filesystem realtime geometry detection logic Darrick J. Wong
2022-10-26 19:03 ` [PATCH 4/4] common: simplify grep pipe sed interactions Darrick J. Wong
-- strict thread matches above, loose matches on Subject: below --
2022-10-28 17:41 [PATCHSET v23.3 0/4] fstests: refactor xfs geometry computation Darrick J. Wong
2022-10-28 17:41 ` [PATCH 2/4] xfs: refactor filesystem directory block size extraction logic Darrick J. Wong
2022-10-30 3:29 ` 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=Y1q5yYiIjWole+lj@magnolia \
--to=djwong@kernel.org \
--cc=fstests@vger.kernel.org \
--cc=linux-xfs@vger.kernel.org \
--cc=zlang@redhat.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.