aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaulo Alcantara <pcacjr@zytor.com>2012-07-20 21:08:55 -0300
committerPaulo Alcantara <pcacjr@zytor.com>2012-07-21 01:21:47 -0300
commitd6ffc9d1c04fa2a1cb63b7441d1747bb32bba2dd (patch)
treef5b4fb28f4819179c36bce31a39bf8518d884226
parent093b604f8e399e3d6a69f2d41ee326a6930df618 (diff)
downloadsyslinux-d6ffc9d1c04fa2a1cb63b7441d1747bb32bba2dd.tar.gz
syslinux-d6ffc9d1c04fa2a1cb63b7441d1747bb32bba2dd.tar.xz
syslinux-d6ffc9d1c04fa2a1cb63b7441d1747bb32bba2dd.zip
xfs: Only call fill_xfs_inode_pvt() if dinode was read
It does not make any sense to fill in private inode information when the requested dinode has not been read successfully. Signed-off-by: Paulo Alcantara <pcacjr@zytor.com>
-rw-r--r--core/fs/xfs/xfs.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/core/fs/xfs/xfs.c b/core/fs/xfs/xfs.c
index e9765f84..1bd41876 100644
--- a/core/fs/xfs/xfs.c
+++ b/core/fs/xfs/xfs.c
@@ -160,12 +160,13 @@ found:
xfs_debug("entry inode's number %lu", ino);
ncore = xfs_get_ino_core(fs, ino);
- fill_xfs_inode_pvt(inode, fs, ino);
if (!ncore) {
xfs_error("Failed to get dinode!");
goto out;
}
+ fill_xfs_inode_pvt(inode, fs, ino);
+
inode->ino = ino;
XFS_PVT(inode)->i_ino_blk = ino_to_bytes(fs, ino) >> BLOCK_SHIFT(fs);
inode->size = be64_to_cpu(ncore->di_size);
@@ -300,13 +301,14 @@ static struct inode *xfs_iget_root(struct fs_info *fs)
xfs_debug("Looking for the root inode...");
core = xfs_get_ino_core(fs, XFS_INFO(fs)->rootino);
- fill_xfs_inode_pvt(inode, fs, XFS_INFO(fs)->rootino);
if (!core) {
xfs_error("Inode core's magic number does not match!");
xfs_debug("magic number 0x%04x", be16_to_cpu(core->di_magic));
goto out;
}
+ fill_xfs_inode_pvt(inode, fs, XFS_INFO(fs)->rootino);
+
xfs_debug("Root inode has been found!");
if (!(be16_to_cpu(core->di_mode) & S_IFDIR)) {