From patchwork Mon Jan 4 01:01:33 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Byongho Lee X-Patchwork-Id: 7944621 Return-Path: X-Original-To: patchwork-linux-btrfs@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 0CC97BEEE5 for ; Mon, 4 Jan 2016 01:02:51 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 48EA220384 for ; Mon, 4 Jan 2016 01:02:50 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 61A4D20389 for ; Mon, 4 Jan 2016 01:02:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752487AbcADBCp (ORCPT ); Sun, 3 Jan 2016 20:02:45 -0500 Received: from mail-pa0-f43.google.com ([209.85.220.43]:36727 "EHLO mail-pa0-f43.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752180AbcADBCM (ORCPT ); Sun, 3 Jan 2016 20:02:12 -0500 Received: by mail-pa0-f43.google.com with SMTP id yy13so95967221pab.3 for ; Sun, 03 Jan 2016 17:02:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:subject:date:message-id:in-reply-to:references; bh=FYGqd5dDFswovSfO0tsNVTQUyBwS1Fvlo+5uOHmSM1g=; b=0Wj5purKyve5bZaxMylkBkGt5R/bf7Us3q9CUjbGQ1RMKc1ogkqoxGebWGMG94USIe Xw5kOl3Z4eIc2cS5KRMtUtYmOFklIb3vs1fEe1I/EgUiJ7ij94wAy9jitGko1L5HwzDk afk/sneCPn4D0WWfgiag2FyJyolIPhX36r/KX5JEQ6XuKOrdqoUiXFl2pyog2ennBJmc ZxYV5cIfYrqglBqzFiSCEwANLULxnuea4h6FlQS3c1C2dJn2uDwB+4EjyppVlnHzSSm9 /eNE1GosGba0oDDfXMrgdDTdh/Xw+S05777g5So1pIR4xvcOM+Mt3r5lQciqWrfilLk3 PoZw== X-Received: by 10.67.24.33 with SMTP id if1mr46599979pad.137.1451869331998; Sun, 03 Jan 2016 17:02:11 -0800 (PST) Received: from arch-gct.localdomain ([175.114.213.172]) by smtp.gmail.com with ESMTPSA id 184sm45125786pfa.15.2016.01.03.17.02.10 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 03 Jan 2016 17:02:11 -0800 (PST) From: Byongho Lee To: linux-btrfs@vger.kernel.org Subject: [PATCH v2 5/6] btrfs-progs: fix endian bug in update_super() Date: Mon, 4 Jan 2016 10:01:33 +0900 Message-Id: <1451869294-4291-6-git-send-email-bhlee.kernel@gmail.com> X-Mailer: git-send-email 2.6.4 In-Reply-To: <1451869294-4291-1-git-send-email-bhlee.kernel@gmail.com> References: <1451869294-4291-1-git-send-email-bhlee.kernel@gmail.com> Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 --- 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)