From: Andrei Borzenkov <arvidjaar@gmail.com>
To: Michael Chang <mchang@suse.com>
Cc: grub-devel@gnu.org
Subject: Re: [PATCH] Fix missing byte order conversion in get_btrfs_fs_prefix function
Date: Fri, 26 Jun 2015 09:56:33 +0300 [thread overview]
Message-ID: <20150626095633.1c598609@opensuse.site> (raw)
In-Reply-To: <1434962727-16154-1-git-send-email-mchang@suse.com>
В Mon, 22 Jun 2015 16:45:27 +0800
Michael Chang <mchang@suse.com> пишет:
> Since btrfs on-disk format uses little-endian, the searched item types
> (ROOT_REF, INODE_REF) need converting the byte order in order to
> function properly on big-endian systems.
Applied. Thanks!
> ---
> grub-core/osdep/linux/getroot.c | 6 +++---
> 1 files changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/grub-core/osdep/linux/getroot.c b/grub-core/osdep/linux/getroot.c
> index a2e360f..3978c71 100644
> --- a/grub-core/osdep/linux/getroot.c
> +++ b/grub-core/osdep/linux/getroot.c
> @@ -316,9 +316,9 @@ get_btrfs_fs_prefix (const char *mount_path)
>
> tree_id = sargs.buf[2];
> br = (struct grub_btrfs_root_backref *) (sargs.buf + 4);
> - inode_id = br->inode_id;
> + inode_id = grub_le_to_cpu64 (br->inode_id);
> name = br->name;
> - namelen = br->n;
> + namelen = grub_le_to_cpu16 (br->n);
> }
> else
> {
> @@ -345,7 +345,7 @@ get_btrfs_fs_prefix (const char *mount_path)
>
> ir = (struct grub_btrfs_inode_ref *) (sargs.buf + 4);
> name = ir->name;
> - namelen = ir->n;
> + namelen = grub_le_to_cpu16 (ir->n);
> }
> old = ret;
> ret = xmalloc (namelen + (old ? strlen (old) : 0) + 2);
prev parent reply other threads:[~2015-06-26 6:56 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-06-22 8:45 [PATCH] Fix missing byte order conversion in get_btrfs_fs_prefix function Michael Chang
2015-06-26 6:56 ` Andrei Borzenkov [this message]
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=20150626095633.1c598609@opensuse.site \
--to=arvidjaar@gmail.com \
--cc=grub-devel@gnu.org \
--cc=mchang@suse.com \
/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).