From: Byongho Lee <bhlee.kernel@gmail.com>
To: linux-btrfs@vger.kernel.org
Cc: Zach Brown <zab@redhat.com>
Subject: [PATCH 4/6] btrfs-progs: fix endian bugs in chunk rebuilding
Date: Mon, 4 Jan 2016 03:59:56 +0900 [thread overview]
Message-ID: <1451847598-30666-5-git-send-email-bhlee.kernel@gmail.com> (raw)
In-Reply-To: <1451847598-30666-1-git-send-email-bhlee.kernel@gmail.com>
This is a same patch as Zach Brown's but we lost so I resend it based on
current code.
- 'commit 2cd95f945a61 ("fix endian bugs in chunk rebuilding")'
Signed-off-by: Zach Brown <zab@redhat.com>
Signed-off-by: Byongho Lee <bhlee.kernel@gmail.com>
---
chunk-recover.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/chunk-recover.c b/chunk-recover.c
index 85dc1bca031a..b03330b4cda0 100644
--- a/chunk-recover.c
+++ b/chunk-recover.c
@@ -1159,9 +1159,9 @@ static int __rebuild_chunk_root(struct btrfs_trans_handle *trans,
if (min_devid > dev->devid)
min_devid = dev->devid;
}
- disk_key.objectid = BTRFS_DEV_ITEMS_OBJECTID;
- disk_key.type = BTRFS_DEV_ITEM_KEY;
- disk_key.offset = min_devid;
+ btrfs_set_disk_key_objectid(&disk_key, BTRFS_DEV_ITEMS_OBJECTID);
+ btrfs_set_disk_key_type(&disk_key, BTRFS_DEV_ITEM_KEY);
+ btrfs_set_disk_key_offset(&disk_key, min_devid);
cow = btrfs_alloc_free_block(trans, root, root->nodesize,
BTRFS_CHUNK_TREE_OBJECTID,
@@ -1234,7 +1234,7 @@ static int __insert_chunk_item(struct btrfs_trans_handle *trans,
key.offset = chunk_rec->offset;
ret = btrfs_insert_item(trans, chunk_root, &key, chunk,
- btrfs_chunk_item_size(chunk->num_stripes));
+ btrfs_chunk_item_size(chunk_rec->num_stripes));
free(chunk);
return ret;
}
--
2.6.4
next prev 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 ` Byongho Lee [this message]
2016-01-03 18:59 ` [PATCH 5/6] btrfs-progs: fix endian bug in update_super() Byongho Lee
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-5-git-send-email-bhlee.kernel@gmail.com \
--to=bhlee.kernel@gmail.com \
--cc=linux-btrfs@vger.kernel.org \
--cc=zab@redhat.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).