From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 63AD9C433E0 for ; Wed, 24 Feb 2021 17:20:22 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 1D82364F0C for ; Wed, 24 Feb 2021 17:20:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230108AbhBXRUG (ORCPT ); Wed, 24 Feb 2021 12:20:06 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35802 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229534AbhBXRUE (ORCPT ); Wed, 24 Feb 2021 12:20:04 -0500 Received: from smtp.steev.me.uk (smtp.steev.me.uk [IPv6:2001:8b0:162c:10::25]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EE9F9C061574 for ; Wed, 24 Feb 2021 09:19:22 -0800 (PST) Received: from smtp.steev.me.uk ([2001:8b0:162c:10::25] helo=webmail.steev.me.uk) by smtp.steev.me.uk with esmtp (Exim 4.93.0.4) id 1lExof-004NGN-8h; Wed, 24 Feb 2021 17:19:13 +0000 MIME-Version: 1.0 Date: Wed, 24 Feb 2021 17:19:13 +0000 From: Steven Davies To: Anand Jain Cc: Johannes Thumshirn , dsterba@suse.cz, linux-btrfs Subject: Re: 5.11.0: open ctree failed: devide total_bytes should be at most X but found Y In-Reply-To: References: <34d881ab-7484-6074-7c0b-b5c8d9e46379@steev.me.uk> <20210223143020.GW1993@twin.jikos.cz> <457bf37240392e63a84c7e1546f7d47a@steev.me.uk> User-Agent: Roundcube Webmail/1.4.10 Message-ID: <42d37a6393db7ad5d83bc167459c8a5c@steev.me.uk> X-Sender: btrfs-list@steev.me.uk Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org On 2021-02-24 01:20, Anand Jain wrote: > On 24/02/2021 01:35, Johannes Thumshirn wrote: >> On 23/02/2021 18:20, Steven Davies wrote: >>> On 2021-02-23 14:30, David Sterba wrote: >>>> On Tue, Feb 23, 2021 at 09:43:04AM +0000, Johannes Thumshirn wrote: >>>>> On 23/02/2021 10:13, Johannes Thumshirn wrote: >>>>>> On 22/02/2021 21:07, Steven Davies wrote: >>>>>>> Booted my system with kernel 5.11.0 vanilla with the first time >>>>>>> and received this: >>>>>>> >>>>>>> BTRFS info (device nvme0n1p2): has skinny extents >>>>>>> BTRFS error (device nvme0n1p2): device total_bytes should be at >>>>>>> most 964757028864 but found >>>>>>> 964770336768 >>>>>>> BTRFS error (device nvme0n1p2): failed to read chunk tree: -22 >>>>>>> >>>>>>> Booting with 5.10.12 has no issues. >>>>> So the bdev inode's i_size must have changed between mkfs and >>>>> mount. >>> > > >>> That's likely, this is my development/testing machine and I've >>> changed >>> partitions (and btrfs RAID levels) around more than once since mkfs >>> time. I can't remember if or how I've modified the fs to take account >>> of >>> this. >>> > > What you say matches with the kernel logs. > >>>>> Steven, can you please run: >>>>> blockdev --getsize64 /dev/nvme0n1p2 >>> >>> # blockdev --getsize64 /dev/nvme0n1p2 >>> 964757028864 > > > Size at the time of mkfs is 964770336768. Now it is 964757028864. > > >>> Is there a simple way to fix this partition so that btrfs and the >>> partition table agree on its size? >>> >> >> Unless someone's yelling at me that this is a bad advice (David, >> Anand?), > > >> I'd go for: >> btrfs filesystem resize max / > > I was thinking about the same step when I was reading above. > >> I've personally never shrinked a device but looking at the code it >> will >> write the blockdevice's inode i_size to the device extents, and >> possibly >> relocate data. > > > Shrink works. I have tested it before. > I hope shrink helps here too. Please let us know. > > Thanks, Anand Yes, this worked - at least there's no panic on boot (albeit this single device fs is devid 3 now so I had to use 3:max). -- Steven Davies