On Fri, May 01, 2020 at 10:14:14AM +0200, Christoph Hellwig wrote: > We always need to fill out the fork structures when reading the inode, > so call xfs_iformat_fork from the tail of xfs_inode_from_disk. > > Signed-off-by: Christoph Hellwig <hch@xxxxxx> > --- Reviewed-by: Brian Foster <bfoster@xxxxxxxxxx> > fs/xfs/libxfs/xfs_inode_buf.c | 7 ++++--- > fs/xfs/libxfs/xfs_inode_buf.h | 2 +- > fs/xfs/xfs_log_recover.c | 4 +--- > 3 files changed, 6 insertions(+), 7 deletions(-) > > diff --git a/fs/xfs/libxfs/xfs_inode_buf.c b/fs/xfs/libxfs/xfs_inode_buf.c > index 39c5a6e24915c..02f06dec0a5a6 100644 > --- a/fs/xfs/libxfs/xfs_inode_buf.c > +++ b/fs/xfs/libxfs/xfs_inode_buf.c > @@ -186,7 +186,7 @@ xfs_imap_to_bp( > return 0; > } > > -void > +int > xfs_inode_from_disk( > struct xfs_inode *ip, > struct xfs_dinode *from) > @@ -247,6 +247,8 @@ xfs_inode_from_disk( > to->di_flags2 = be64_to_cpu(from->di_flags2); > to->di_cowextsize = be32_to_cpu(from->di_cowextsize); > } > + > + return xfs_iformat_fork(ip, from); > } > > void > @@ -647,8 +649,7 @@ xfs_iread( > * Otherwise, just get the truly permanent information. > */ > if (dip->di_mode) { > - xfs_inode_from_disk(ip, dip); > - error = xfs_iformat_fork(ip, dip); > + error = xfs_inode_from_disk(ip, dip); > if (error) { > #ifdef DEBUG > xfs_alert(mp, "%s: xfs_iformat() returned error %d", > diff --git a/fs/xfs/libxfs/xfs_inode_buf.h b/fs/xfs/libxfs/xfs_inode_buf.h > index 9b373dcf9e34d..081230faf7bdc 100644 > --- a/fs/xfs/libxfs/xfs_inode_buf.h > +++ b/fs/xfs/libxfs/xfs_inode_buf.h > @@ -54,7 +54,7 @@ int xfs_iread(struct xfs_mount *, struct xfs_trans *, > void xfs_dinode_calc_crc(struct xfs_mount *, struct xfs_dinode *); > void xfs_inode_to_disk(struct xfs_inode *ip, struct xfs_dinode *to, > xfs_lsn_t lsn); > -void xfs_inode_from_disk(struct xfs_inode *ip, struct xfs_dinode *from); > +int xfs_inode_from_disk(struct xfs_inode *ip, struct xfs_dinode *from); > void xfs_log_dinode_to_disk(struct xfs_log_dinode *from, > struct xfs_dinode *to); > > diff --git a/fs/xfs/xfs_log_recover.c b/fs/xfs/xfs_log_recover.c > index 11c3502b07b13..464388125d20b 100644 > --- a/fs/xfs/xfs_log_recover.c > +++ b/fs/xfs/xfs_log_recover.c > @@ -2870,9 +2870,7 @@ xfs_recover_inode_owner_change( > > /* instantiate the inode */ > ASSERT(dip->di_version >= 3); > - xfs_inode_from_disk(ip, dip); > - > - error = xfs_iformat_fork(ip, dip); > + error = xfs_inode_from_disk(ip, dip); > if (error) > goto out_free_ip; > > -- > 2.26.2 >