Received: by 10.213.65.68 with SMTP id h4csp491250imn; Fri, 16 Mar 2018 09:20:43 -0700 (PDT) X-Google-Smtp-Source: AG47ELsvzGE4zkXcTozEPk07RtPHIHf8aVRjrequ1ALr2xpgOqKsET6TTUowND15PtSo+j9/wx0N X-Received: by 10.101.70.8 with SMTP id v8mr1530520pgq.336.1521217243567; Fri, 16 Mar 2018 09:20:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521217243; cv=none; d=google.com; s=arc-20160816; b=yl0cohhICYgE3xWjkfyacfBC8zbEg5zQciDPtc9VMAq0Iia2X2nFs2vpRkI+Eucqc6 4Xx12jtXM5JJZvSeoGCOtOQBOqSfCg241aK7d1YUB1oQAvWizLaSxO+zjta4s+ICONrZ 2Dj9CGPjUcNErVa+xL0fb5hAF/K/iyNpHPd8l9zNPDWh1QE3hhL5j24HM7+jsQhayFx1 5A5ztScICkptT0Hs+alswZ5tKAMn7i21VVSvYpZWQSXkOMdpOUSieCUoUJtx7XElzhep mRYNBIDFGjmnW/9njnAbSZ+hUkdhD96jq0E4m11CkGmlM290dJOqwdBUrw2W6QfRbl/B gLaQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature :arc-authentication-results; bh=b7gMZSDWJ2ZNFljidkd8L0iMKm83bvHF0UxVJ3sL/iY=; b=Xt+YPuIN0PAMrBP+RGBhdysYA0aeNFFxcR7wxI6eECzD8sdEn89B57GlspfDSuWB/k tReX2/ZexYe473dICePcnC7zDiMB8t8QA/98Ndud8hqIVj8C4zexLOUsrbY5FbJIBuTq qpnchp7YuCDfetxUn5TNy8wdpHdx3Z3oH1AN9Kg8NhbuJ9DDULABRhz/QyEUM+H7STR7 zEP7tBNWB6QTjO4OyA1woveutYJXGAc/UxZJdX7WLStwslCirCE8FpueLIaW27p27Hf0 i+xw3MmtIa9L7BV2rhy1suwAqVKHbCPhsIBfhz1zHTfmkRh+v02VwO0VE0KiYxPIh64J L00w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2017-10-26 header.b=uUu7hcvl; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 62si5764248pfh.153.2018.03.16.09.20.28; Fri, 16 Mar 2018 09:20:43 -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; dkim=pass header.i=@oracle.com header.s=corp-2017-10-26 header.b=uUu7hcvl; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754831AbeCPQT2 (ORCPT + 99 others); Fri, 16 Mar 2018 12:19:28 -0400 Received: from aserp2120.oracle.com ([141.146.126.78]:38588 "EHLO aserp2120.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754520AbeCPQT0 (ORCPT ); Fri, 16 Mar 2018 12:19:26 -0400 Received: from pps.filterd (aserp2120.oracle.com [127.0.0.1]) by aserp2120.oracle.com (8.16.0.22/8.16.0.22) with SMTP id w2GGEemQ102217; Fri, 16 Mar 2018 16:19:18 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=subject : to : cc : references : from : message-id : date : mime-version : in-reply-to : content-type : content-transfer-encoding; s=corp-2017-10-26; bh=b7gMZSDWJ2ZNFljidkd8L0iMKm83bvHF0UxVJ3sL/iY=; b=uUu7hcvlVq9kYz/83UrmvVdHTRwaMwLTawUVig9PrG6xEGyI9xFGWZ+Y4urxSCiIPTjW rekYmtEWw5qOO8pBHs7cGyrhWzAzKqnpEPtd30Esu4dA5fOkjiW0WmRFQYXeb+cG7AR4 ZWEvoLtolmcEKiWkzo+/LZqFCOp+Wsy7Ddo/FhMP5OyYjiirP3BKcoJJfpRz1W0+N1vC kOaj7pKj8PNkbFjvgKA52Z43jMZgdJAJ3ZYxYmompByQsNg1SYqOkYxVdpLcd/KKR04t 0/hAlUgBcjG39BByb30bVpwGu3NmPlsc4BywBoj/n2dgOu3RoAz9RfgySNulkyBiX37v bg== Received: from aserv0021.oracle.com (aserv0021.oracle.com [141.146.126.233]) by aserp2120.oracle.com with ESMTP id 2grh97g0qp-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 16 Mar 2018 16:19:18 +0000 Received: from userv0122.oracle.com (userv0122.oracle.com [156.151.31.75]) by aserv0021.oracle.com (8.14.4/8.14.4) with ESMTP id w2GGJHVl012108 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 16 Mar 2018 16:19:17 GMT Received: from abhmp0018.oracle.com (abhmp0018.oracle.com [141.146.116.24]) by userv0122.oracle.com (8.14.4/8.14.4) with ESMTP id w2GGJGg5014138; Fri, 16 Mar 2018 16:19:17 GMT Received: from [192.168.8.5] (/202.156.140.248) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Fri, 16 Mar 2018 09:19:16 -0700 Subject: Re: [PATCH 4.14 024/110] btrfs: use proper endianness accessors for super_copy To: Christoph Biedl , Greg Kroah-Hartman Cc: linux-kernel@vger.kernel.org, stable@vger.kernel.org, Liu Bo , David Sterba References: <20180307191039.748351103@linuxfoundation.org> <20180307191042.810088712@linuxfoundation.org> <1521139304@msgid.manchmal.in-ulm.de> From: Anand Jain Message-ID: Date: Sat, 17 Mar 2018 00:21:04 +0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: <1521139304@msgid.manchmal.in-ulm.de> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=8833 signatures=668690 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1711220000 definitions=main-1803160153 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 03/16/2018 02:55 AM, Christoph Biedl wrote: > Greg Kroah-Hartman wrote... > >> 4.14-stable review patch. If anyone has any objections, please let me know. > >> commit 3c181c12c431fe33b669410d663beb9cceefcd1b upstream. > (...) > >> If the filesystem is always used on a same endian host, this will not >> be a problem. > > From my observations I cannot quite subscribe to that. > > On big-endian systems, this change intruduces severe corruption, > resulting in complete loss of the data on the used block device. Thanks for the report. That's really bad, my mistake. I am digging to know how it happened. Our on-disk root bytenr are little-endian compatible. So using the cpu_to_le for write on a big-endian arch is a correct thing to do. If it fails, certainly there is something which I have overlooked. I am digging to know. Thanks for the report again. Fsck won't be able to figure out the correct on-disk btyenr either. If there isn't any backup we could try to find out the correct pointers manually. However, restore from the backup approach is much better. -Anand > Steps to reproduce (tested on ppc/powerpc and parisc/hppa): > > # mkfs.btrfs $DEV > # mount $DEV /mnt/tmp/ > # umount /mnt/tmp/ > > This simple umount corrupts the file system: > > # mount $DEV /mnt/tmp/ > mount: /mnt/tmp: wrong fs type, bad option, bad superblock on $DEV, missing codepage or helper program, or other error. > > # dmesg: > BTRFS critical (device ): unable to find logical 4294967296 length 4096 > BTRFS critical (device ): unable to find logical 4294967296 length 4096 > BTRFS critical (device ): unable to find logical 18102363734671360 length 16384 > BTRFS error (device ): failed to read chunk root > BTRFS error (device ): open_ctree failed > > Also fsck is of no help: > > # btrfsck $DEV > Couldn't map the block 18102363734671360 > No mapping for 18102363734671360-18102363734687744 > Couldn't map the block 18102363734671360 > bytenr mismatch, want=18102363734671360, have=0 > ERROR: cannot read chunk root > ERROR: cannot open file system > > > Trying mount or fsck on a little-endian system does not help either. So > I consider the data on that device lost - luckily I use btrfs only for > files where a backup exists all the time. > > > Reverting that change restored the previous error-free behaviour. I > didn't check HEAD, i.e. v4.16-rc5, since the upstream commt was the last > that affected these files. Still I could give this a try if anybody > wishes so. > > Cheers, > > Christoph >