From 08e4779087f1086d7e2b1d4818ea48618abc63ec Mon Sep 17 00:00:00 2001 From: Vladimir 'phcoder' Serbinenko Date: Wed, 30 Jan 2013 09:22:43 +0100 Subject: [PATCH 144/364] * grub-core/fs/xfs.c (grub_xfs_read_block): Fix computation in presence of extended attributes. --- ChangeLog | 5 +++++ grub-core/fs/xfs.c | 4 +--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 74ef434..e5b71cf 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2013-01-30 Vladimir Serbinenko + + * grub-core/fs/xfs.c (grub_xfs_read_block): Fix computation in presence + of extended attributes. + 2013-01-27 Andrey Borzenkov * util/grub-install.in: change misleading comment about diff --git a/grub-core/fs/xfs.c b/grub-core/fs/xfs.c index 49d2a89..aee1582 100644 --- a/grub-core/fs/xfs.c +++ b/grub-core/fs/xfs.c @@ -295,9 +295,7 @@ grub_xfs_read_block (grub_fshelp_node_t node, grub_disk_addr_t fileblock) nrec = grub_be_to_cpu16 (node->inode.data.btree.numrecs); keys = &node->inode.data.btree.keys[0]; if (node->inode.fork_offset) - recoffset = (node->inode.fork_offset - - ((char *) &node->inode.data.btree.keys - (char *) &node->inode)) - / (2 * sizeof (grub_uint64_t)); + recoffset = (node->inode.fork_offset - 1) / 2; else recoffset = ((1 << node->data->sblock.log2_inode) - ((char *) &node->inode.data.btree.keys -- 1.8.1.4