All of lore.kernel.org
 help / color / mirror / Atom feed
From: Byongho Lee <bhlee.kernel@gmail.com>
To: linux-btrfs@vger.kernel.org
Subject: [PATCH 5/6] btrfs-progs: fix endian bug in update_super()
Date: Mon,  4 Jan 2016 03:59:57 +0900	[thread overview]
Message-ID: <1451847598-30666-6-git-send-email-bhlee.kernel@gmail.com> (raw)
In-Reply-To: <1451847598-30666-1-git-send-email-bhlee.kernel@gmail.com>

In update_super() 'chunk->stripe.devid' and 'super->dev_item.devid' both
are little endian. So we should not use endian helper
btrfs_set_stack_stripe_devid().

Signed-off-by: Byongho Lee <bhlee.kernel@gmail.com>
---
 btrfs-image.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/btrfs-image.c b/btrfs-image.c
index 4a0a7c5414a7..bb1f63511647 100644
--- a/btrfs-image.c
+++ b/btrfs-image.c
@@ -1464,8 +1464,7 @@ static int update_super(struct mdrestore_struct *mdres, u8 *buffer)
 			btrfs_set_stack_chunk_sub_stripes(chunk, 0);
 			btrfs_set_stack_chunk_type(chunk,
 						   BTRFS_BLOCK_GROUP_SYSTEM);
-			btrfs_set_stack_stripe_devid(&chunk->stripe,
-						     super->dev_item.devid);
+			chunk->stripe.devid = super->dev_item.devid;
 			physical = logical_to_physical(mdres, key.offset,
 						       &size);
 			if (size != (u64)-1)
-- 
2.6.4


  parent reply	other threads:[~2016-01-03 19:00 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-03 18:59 [PATCH 0/6] fix endian bugs and clean-ups Byongho Lee
2016-01-03 18:59 ` [PATCH 1/6] btrfs-progs: get sparse checking working Byongho Lee
2016-01-03 18:59 ` [PATCH 2/6] btrfs-progs: use NULL instead of 0 Byongho Lee
2016-01-03 18:59 ` [PATCH 3/6] btrfs-progs: make private symbols to static Byongho Lee
2016-01-03 18:59 ` [PATCH 4/6] btrfs-progs: fix endian bugs in chunk rebuilding Byongho Lee
2016-01-03 18:59 ` Byongho Lee [this message]
2016-01-03 18:59 ` [PATCH 6/6] btrfs-progs: fix using on-disk structure to store in memory data Byongho Lee
2016-01-03 19:09 ` [PATCH 0/6] fix endian bugs and clean-ups Byongho Lee

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=1451847598-30666-6-git-send-email-bhlee.kernel@gmail.com \
    --to=bhlee.kernel@gmail.com \
    --cc=linux-btrfs@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.