From: "Darrick J. Wong" <darrick.wong@oracle.com>
To: Eric Sandeen <sandeen@sandeen.net>
Cc: david@fromorbit.com, linux-xfs@vger.kernel.org
Subject: Re: [PATCH 2/6] libxfs: synchronize dinode_verify with userspace
Date: Fri, 4 Nov 2016 14:03:59 -0700 [thread overview]
Message-ID: <20161104210359.GG32036@birch.djwong.org> (raw)
In-Reply-To: <a090d3e9-9c73-c463-8177-834bfabefa9d@sandeen.net>
On Fri, Nov 04, 2016 at 02:07:27PM -0500, Eric Sandeen wrote:
> On 11/4/16 1:31 PM, Darrick J. Wong wrote:
> > The userspace version of _dinode_verify takes a raw inode number
> > instead of an inode itself. Since neither version actually needs
> > the inode, port the changes to the kernel. This will also reduce
> > the libxfs diff noise.
> >
> > Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
> > ---
> > fs/xfs/libxfs/xfs_inode_buf.c | 8 ++++----
> > 1 file changed, 4 insertions(+), 4 deletions(-)
> >
> >
> > diff --git a/fs/xfs/libxfs/xfs_inode_buf.c b/fs/xfs/libxfs/xfs_inode_buf.c
> > index 134424f..3a6694b 100644
> > --- a/fs/xfs/libxfs/xfs_inode_buf.c
> > +++ b/fs/xfs/libxfs/xfs_inode_buf.c
> > @@ -380,10 +380,10 @@ xfs_log_dinode_to_disk(
> > }
> > }
> >
> > -static bool
> > +bool
> > xfs_dinode_verify(
>
> I believe this can/should be static in both userspace & kernelspace.
>
> Otherwise looks fine to me; not sure why the ip-vs-ino difference
> exists, but it's 6 one way half a dozen the other I guess.
Hmmm, you're right.
--D
>
> -Eric
>
> > struct xfs_mount *mp,
> > - struct xfs_inode *ip,
> > + xfs_ino_t ino,
> > struct xfs_dinode *dip)
> > {
> > uint16_t flags;
> > @@ -401,7 +401,7 @@ xfs_dinode_verify(
> > if (!xfs_verify_cksum((char *)dip, mp->m_sb.sb_inodesize,
> > XFS_DINODE_CRC_OFF))
> > return false;
> > - if (be64_to_cpu(dip->di_ino) != ip->i_ino)
> > + if (be64_to_cpu(dip->di_ino) != ino)
> > return false;
> > if (!uuid_equal(&dip->di_uuid, &mp->m_sb.sb_meta_uuid))
> > return false;
> > @@ -493,7 +493,7 @@ xfs_iread(
> > return error;
> >
> > /* even unallocated inodes are verified */
> > - if (!xfs_dinode_verify(mp, ip, dip)) {
> > + if (!xfs_dinode_verify(mp, ip->i_ino, dip)) {
> > xfs_alert(mp, "%s: validation failed for inode %lld failed",
> > __func__, ip->i_ino);
> >
> >
> > --
> > To unsubscribe from this list: send the line "unsubscribe linux-xfs" in
> > the body of a message to majordomo@vger.kernel.org
> > More majordomo info at http://vger.kernel.org/majordomo-info.html
> >
> --
> To unsubscribe from this list: send the line "unsubscribe linux-xfs" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2016-11-04 21:04 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-11-04 18:31 [PATCH 0/6] xfs: miscellaneous libxfs cleanups Darrick J. Wong
2016-11-04 18:31 ` [PATCH 1/6] libxfs: convert ushort to unsigned short Darrick J. Wong
2016-11-04 19:09 ` Eric Sandeen
2016-11-04 20:31 ` Darrick J. Wong
2016-11-04 18:31 ` [PATCH 2/6] libxfs: synchronize dinode_verify with userspace Darrick J. Wong
2016-11-04 19:07 ` Eric Sandeen
2016-11-04 21:03 ` Darrick J. Wong [this message]
2016-11-04 18:31 ` [PATCH 3/6] libxfs: fix whitespace problems Darrick J. Wong
2016-11-04 19:03 ` Eric Sandeen
2016-11-04 18:32 ` [PATCH 4/6] libxfs: fix xfs_attr_shortform_bytesfit declaration Darrick J. Wong
2016-11-04 19:11 ` Eric Sandeen
2016-11-04 18:32 ` [PATCH 5/6] libxfs: clean up _dir2_data_freescan Darrick J. Wong
2016-11-04 22:58 ` Eric Sandeen
2016-11-04 23:09 ` Darrick J. Wong
2016-11-04 23:20 ` Eric Sandeen
2016-11-05 0:00 ` Darrick J. Wong
2016-11-04 18:32 ` [PATCH 6/6] xfs: don't call xfs_sb_quota_from_disk twice Eric Sandeen
2016-11-04 19:12 ` Eric Sandeen
2016-11-06 22:22 ` Dave Chinner
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=20161104210359.GG32036@birch.djwong.org \
--to=darrick.wong@oracle.com \
--cc=david@fromorbit.com \
--cc=linux-xfs@vger.kernel.org \
--cc=sandeen@sandeen.net \
/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;
as well as URLs for NNTP newsgroup(s).