]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commitdiff
xfs: call xfs_iformat_fork from xfs_inode_from_disk
authorChristoph Hellwig <hch@lst.de>
Mon, 10 Aug 2020 20:32:05 +0000 (16:32 -0400)
committerEric Sandeen <sandeen@sandeen.net>
Mon, 10 Aug 2020 20:32:05 +0000 (16:32 -0400)
Source kernel commit: cb7d58594412fff106cde550dd9e0a7999cc2a0c

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@lst.de>
Reviewed-by: Brian Foster <bfoster@redhat.com>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
libxfs/xfs_inode_buf.c
libxfs/xfs_inode_buf.h

index 0a2d76e875bd4a6182da2fe43f9d523e5b27da5c..ed04883beee79ad5c8223d48a3427acee55307c1 100644 (file)
@@ -177,7 +177,7 @@ xfs_imap_to_bp(
        return 0;
 }
 
-void
+int
 xfs_inode_from_disk(
        struct xfs_inode        *ip,
        struct xfs_dinode       *from)
@@ -238,6 +238,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
@@ -638,8 +640,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",
index d9b4781ac9fd4ea0a86fb597f298ba49cc3ae223..0fbb99224ec73a09f4c79a0eca06a9bef226fe9f 100644 (file)
@@ -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);