Received: by 10.213.65.68 with SMTP id h4csp487785imn; Fri, 16 Mar 2018 09:14:13 -0700 (PDT) X-Google-Smtp-Source: AG47ELukTTCrumwCBNdd/5RNQfT5TWM3tQFZbBMeW3V7Z/tS4lhlboG0KIPtYeezpeAx7eYd4pov X-Received: by 10.98.232.6 with SMTP id c6mr2021633pfi.242.1521216853736; Fri, 16 Mar 2018 09:14:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521216853; cv=none; d=google.com; s=arc-20160816; b=MjuQTlpSevpPV0Ojg9p7tStu3h2KckjZo+z+jItfPW6ZFahHirwogvGXosVghAkB44 GEIwyFn4sLzzA4spM12Sca6SRTo/e1JYNzuBZJjYbpPA75HGcOx8AM6hnGbgFKu3wIOx hAHG+ImtaLleM1Jk2+muzjKVrEYLlaPkMbyvsR2R5kMnka2FFddWuvkv3t9S/WmsIlfc N5z2KIVQoxun//cWyCgGkhYeH+9oabblAlFOnaTkA2z0nNzGXSJSYoEHNVnowBeDke0Z cvQ1ffVVNFIQW5bN9B0+v6MQVaoueryfC3acer7O5fO31ViKPIVHtV+KdBXSecfXI5zQ gO1g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=YgDF2nOBr0qQAv3cKPn0jzB7mLts8oL4JrfFRhTgdpM=; b=zXKCeqndKLHrIBlxcNfsb38DIgOaX8z20liHei4eoTkKDgj0UWscpY1dOOeVEpfz3u x45M8GvftA+xXvAoPvqoK0UXQo4hquXY2FysLEmBLF2a0W6GXT8NwQtDCheO2cXKDMef rk6o2e2zMoGC16X94ibWtLtz6D/PvYdgiRYBr5NTM9LBSSF/mmLIEPBUlPO4Twj9aKcn 76S1HuX9uMUosGlxgoH9+RovbOTx1FkW+n8mCYKLIEDvhRXCl5mFyMwwulascnSTZF6y wimHmUePvYhTfhVRVp1FoboZAo2oLVfUWXRCh+o0jZ6O2Vl7VUbCbL1fl6f1+vXRK165 8iQg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n69si5723008pfg.28.2018.03.16.09.13.59; Fri, 16 Mar 2018 09:14:13 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965022AbeCPPkR (ORCPT + 99 others); Fri, 16 Mar 2018 11:40:17 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:43474 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S964989AbeCPPkH (ORCPT ); Fri, 16 Mar 2018 11:40:07 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id E426CD4D; Fri, 16 Mar 2018 15:40:06 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Christoph Biedl , Anand Jain , Liu Bo , David Sterba Subject: [PATCH 4.15 025/128] [PATCH] Revert "btrfs: use proper endianness accessors for super_copy" Date: Fri, 16 Mar 2018 16:22:46 +0100 Message-Id: <20180316152337.761888084@linuxfoundation.org> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180316152336.199007505@linuxfoundation.org> References: <20180316152336.199007505@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.15-stable review patch. If anyone has any objections, please let me know. ------------------ This reverts commit 3c181c12c431fe33b669410d663beb9cceefcd1b as it causes breakage on big endian systems with btrfs images. Reported-by: Christoph Biedl Cc: Anand Jain Cc: Liu Bo Cc: David Sterba Signed-off-by: Greg Kroah-Hartman --- fs/btrfs/sysfs.c | 8 +++++--- fs/btrfs/transaction.c | 20 ++++++++------------ 2 files changed, 13 insertions(+), 15 deletions(-) --- a/fs/btrfs/sysfs.c +++ b/fs/btrfs/sysfs.c @@ -423,7 +423,7 @@ static ssize_t btrfs_nodesize_show(struc { struct btrfs_fs_info *fs_info = to_fs_info(kobj); - return snprintf(buf, PAGE_SIZE, "%u\n", fs_info->nodesize); + return snprintf(buf, PAGE_SIZE, "%u\n", fs_info->super_copy->nodesize); } BTRFS_ATTR(, nodesize, btrfs_nodesize_show); @@ -433,7 +433,8 @@ static ssize_t btrfs_sectorsize_show(str { struct btrfs_fs_info *fs_info = to_fs_info(kobj); - return snprintf(buf, PAGE_SIZE, "%u\n", fs_info->sectorsize); + return snprintf(buf, PAGE_SIZE, "%u\n", + fs_info->super_copy->sectorsize); } BTRFS_ATTR(, sectorsize, btrfs_sectorsize_show); @@ -443,7 +444,8 @@ static ssize_t btrfs_clone_alignment_sho { struct btrfs_fs_info *fs_info = to_fs_info(kobj); - return snprintf(buf, PAGE_SIZE, "%u\n", fs_info->sectorsize); + return snprintf(buf, PAGE_SIZE, "%u\n", + fs_info->super_copy->sectorsize); } BTRFS_ATTR(, clone_alignment, btrfs_clone_alignment_show); --- a/fs/btrfs/transaction.c +++ b/fs/btrfs/transaction.c @@ -1723,23 +1723,19 @@ static void update_super_roots(struct bt super = fs_info->super_copy; - /* update latest btrfs_super_block::chunk_root refs */ root_item = &fs_info->chunk_root->root_item; - btrfs_set_super_chunk_root(super, root_item->bytenr); - btrfs_set_super_chunk_root_generation(super, root_item->generation); - btrfs_set_super_chunk_root_level(super, root_item->level); + super->chunk_root = root_item->bytenr; + super->chunk_root_generation = root_item->generation; + super->chunk_root_level = root_item->level; - /* update latest btrfs_super_block::root refs */ root_item = &fs_info->tree_root->root_item; - btrfs_set_super_root(super, root_item->bytenr); - btrfs_set_super_generation(super, root_item->generation); - btrfs_set_super_root_level(super, root_item->level); - + super->root = root_item->bytenr; + super->generation = root_item->generation; + super->root_level = root_item->level; if (btrfs_test_opt(fs_info, SPACE_CACHE)) - btrfs_set_super_cache_generation(super, root_item->generation); + super->cache_generation = root_item->generation; if (test_bit(BTRFS_FS_UPDATE_UUID_TREE_GEN, &fs_info->flags)) - btrfs_set_super_uuid_tree_generation(super, - root_item->generation); + super->uuid_tree_generation = root_item->generation; } int btrfs_transaction_in_commit(struct btrfs_fs_info *info)