Received: by 10.213.65.68 with SMTP id h4csp501663imn; Fri, 16 Mar 2018 09:40:55 -0700 (PDT) X-Google-Smtp-Source: AG47ELs09hKV8uIOKrunOFjhbq0yhGoT32XHKXrTXLRO/SJL6QqlwQiKWzNXoRgn7CQ2cbeiTap+ X-Received: by 10.99.121.140 with SMTP id u134mr1927725pgc.89.1521218455625; Fri, 16 Mar 2018 09:40:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521218455; cv=none; d=google.com; s=arc-20160816; b=bEiOaXcki+eNvalIz4f18NajiLJ4uHF0K+SN/0URRhUxlKAj8+vwX/naoVuwAIUASH tBZ78wmOclSZAdUKsslIuPM8JN6R/747GiwDx8ZpK/0eAO5t2dHSZlED6E6FBvFPAuGD tRfp0oHCk7jdNI6M4JgpOd+ojzV5iiOBIOFBpcV+qvF+bw8iRxaH1jtz/TsKGbZwl4gD MsFYmzd37wC3PuWJeszV6/Pyp8+Bu6e0/oWp5qV7nhX4FMZqglqM9GavndKnJ46WIRIR pqZ8YI/QPemlJa1Dt8Qj4xB5Wz4WaM+c5IkGBmJ7z9OriIACXpsTIb9MGxc5bxattxeC /dCw== 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=ZDVXQlt8nhcn1dg62DITg0IWn/i1CJKggHzO9O1GpW0=; b=KZTWFew/DxEPzUHzLmKXRE3Yo6hjHImzpx7+6rt3xNQ9h94IS6ZGaDlxwcxFEOcukE SsXjZzzALoxuhnbdUskcrxssKjpigtoBkE2vaNfUBy9xK5r2szzBNzH1mHIHRWLU1Fqy S1fFKDiaXvDE0PBYxNi8NIqCZ6frJKygz3XDy2FP5yJQS+p2+WiPJyjuRB/YFQqnub+K iv1JlIUY/OIFKAEJNv3PCH7svQ451jb6qArbQu9Dl2SnjQ0nyY5Htwd8Pty1MR3fT4C1 YDs4qFdLMr0QIuHl16umrwbZR6cUlDQ8d4Vt0y7pCmU7m47QisuEpqVBm4nQbtniVxkz xfHA== 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 p66si4864781pfk.100.2018.03.16.09.40.41; Fri, 16 Mar 2018 09:40:55 -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 S1753296AbeCPQja (ORCPT + 99 others); Fri, 16 Mar 2018 12:39:30 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:40516 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934037AbeCPPg7 (ORCPT ); Fri, 16 Mar 2018 11:36:59 -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 409781221; Fri, 16 Mar 2018 15:36:59 +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.14 026/109] [PATCH] Revert "btrfs: use proper endianness accessors for super_copy" Date: Fri, 16 Mar 2018 16:22:55 +0100 Message-Id: <20180316152331.374866372@linuxfoundation.org> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180316152329.844663293@linuxfoundation.org> References: <20180316152329.844663293@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.14-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 @@ -422,7 +422,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); @@ -432,7 +432,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); @@ -442,7 +443,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 @@ -1722,23 +1722,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)