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=-5.0 required=3.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 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 37BD1C388F9 for ; Sat, 7 Nov 2020 13:38:13 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id F3761206ED for ; Sat, 7 Nov 2020 13:38:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728034AbgKGNiL (ORCPT ); Sat, 7 Nov 2020 08:38:11 -0500 Received: from mailfilter03-out30.webhostingserver.nl ([195.211.72.164]:42001 "EHLO mailfilter03-out30.webhostingserver.nl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727298AbgKGNiK (ORCPT ); Sat, 7 Nov 2020 08:38:10 -0500 X-Greylist: delayed 962 seconds by postgrey-1.27 at vger.kernel.org; Sat, 07 Nov 2020 08:38:08 EST X-Halon-ID: 38c1e3f7-20fc-11eb-8dbb-001a4a4cb9a5 Received: from s198.webhostingserver.nl (s198.webhostingserver.nl [141.138.168.154]) by mailfilter03.webhostingserver.nl (Halon) with ESMTPSA id 38c1e3f7-20fc-11eb-8dbb-001a4a4cb9a5; Sat, 07 Nov 2020 14:22:02 +0100 (CET) Received: from op35.xs4all.space ([83.160.74.106] helo=[192.168.178.48]) by s198.webhostingserver.nl with esmtpa (Exim 4.93.0.4) (envelope-from ) id 1kbOAL-008V4q-Tz; Sat, 07 Nov 2020 14:22:01 +0100 Subject: Re: Fwd: Read time tree block corruption detected To: Qu Wenruo , Qu Wenruo , Tyler Richmond Cc: Btrfs BTRFS References: <1f26ff53-f7c7-c497-b69f-8a3e5d8ce959@gmx.com> <0d6a0602-897a-b170-f1a2-007cff1f23fb@gmx.com> <134e61b5-ecf7-bc1a-e16b-c95b14876e6e@gmail.com> <5b757c2b-6dbf-cbec-6c66-e4b14897f53c@gmx.com> <838490cf-fc40-0008-88bb-eeede1e8d873@gmail.com> <50e0ef4d-061e-d02d-9dbf-61f83dfa7b3e@suse.com> <117797ff-c28b-c755-da17-fb7ce3169f0f@gmail.com> <51578ec7-f2e5-a09a-520e-f0577300d5ce@gmx.com> <0acac733-233c-0c71-b9bc-c4bee1c724ba@suse.com> <4dd24fde-6d7f-202f-5d2f-b4478d797a93@gmail.com> From: Ferry Toth Message-ID: Date: Sat, 7 Nov 2020 14:19:50 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.3.2 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US X-Antivirus-Scanner: Clean mail though you should still use an Antivirus Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org Hi Op 07-11-2020 om 12:35 schreef Qu Wenruo: > > On 2020/11/7 下午7:18, Ferry Toth wrote: >> Op 06-11-2020 om 11:32 schreef Qu Wenruo: >>> >>> On 2020/11/6 下午6:30, Ferry Toth wrote: >>>> Hi >>>> >>>> Op 06-11-2020 om 11:24 schreef Qu Wenruo: >>>>> On 2020/11/6 下午6:09, Ferry Toth wrote: >>>>>> Hi Qu >>>>>> >>>>>> Op 06-11-2020 om 00:40 schreef Qu Wenruo: >>>>>>> On 2020/11/6 上午7:37, Ferry Toth wrote: >>>>>>>> Hi >>>>>>>> >>>>>>>> Op 06-11-2020 om 00:32 schreef Qu Wenruo: >>>>>>>>> On 2020/11/6 上午7:12, Ferry Toth wrote: >>>>>>>>>> Hi, >>>>>>>>>> >>>>>>>>>> Op 06-11-2020 om 00:00 schreef Qu Wenruo: >>>>>>>>>>> On 2020/11/6 上午4:08, Ferry Toth wrote: >>>>>>>>>>>> I am in a similar spot, during updating my distro (Kubuntu), >>>>>>>>>>>> I am >>>>>>>>>>>> unable >>>>>>>>>>>> to update a certain package. I know which file it is: >>>>>>>>>>>> >>>>>>>>>>>> ~$ ls -l /usr/share/doc/libatk1.0-data >>>>>>>>>>>> ls: kan geen toegang krijgen tot >>>>>>>>>>>> '/usr/share/doc/libatk1.0-data': >>>>>>>>>>>> Invoer-/uitvoerfout >>>>>>>>>>>> >>>>>>>>>>>> This creates the following in journal: >>>>>>>>>>>> >>>>>>>>>>>> kernel: BTRFS critical (device sda2): corrupt leaf: root=294 >>>>>>>>>>>> block=1169152675840 slot=1 ino=915987, invalid inode >>>>>>>>>>>> generation: has >>>>>>>>>>>> 18446744073709551492 expect [0, 5851353] >>>>>>>>>>>> kernel: BTRFS error (device sda2): block=1169152675840 read time >>>>>>>>>>>> tree >>>>>>>>>>>> block corruption detected >>>>>>>>>>>> >>>>>>>>>>>> Now, the problem: this file is on my rootfs, which is >>>>>>>>>>>> mounted. apt >>>>>>>>>>>> (distribution updated) installed all packages but can't continue >>>>>>>>>>>> configuring, because libatk is a dependancy. I can't delete the >>>>>>>>>>>> file >>>>>>>>>>>> because of the I/O error. And btrfs check complains (I tried >>>>>>>>>>>> running RO) >>>>>>>>>>>> because the file system is mounted. >>>>>>>>>>>> >>>>>>>>>>>> But, on the sunny side, the file system is not RO. >>>>>>>>>>>> >>>>>>>>>>>> Is there any way to forcefully remove the file? Or do you have a >>>>>>>>>>>> recommendation how to proceed? >>>>>>>>>>> Newer kernel will reject to even read the item, thus will not be >>>>>>>>>>> able to >>>>>>>>>>> remove it. >>>>>>>>>> That's already the case. (input / output error) >>>>>>>>>>> I guess you have to use some distro ISO to fix the fs. >>>>>>>>>> And then? btrfs check --repair the disk offline? >>>>>>>>> Yep. >>>>>>>>> >>>>>>>>> You would want the latest btrfs-progs though. >>>>>>>> Groovy has 5.7. Would that be good enough? Otherwise will be >>>>>>>> difficult >>>>>>>> to build on/for live usb image. >>>>>>> For your particular case, the fix are already in btrfs-progs v5.4. >>>>>>> >>>>>>> Although newer is always better, just in case you have extent item >>>>>>> generation corruption, you may want v5.4.1. >>>>>>> >>>>>>> So your v5.7 should be good enough. >>>>>>> >>>>>>> Thanks, >>>>>>> Qu >>>>>> I made a live usb and performed: >>>>>> >>>>>> btrfs check --repair /dev/sda2 >>>>>> >>>>>> It found errors and fixed them. However, it did not fix the corrupt >>>>>> leaf. The file is actually a directory: >>>>>> >>>>>> ~$ stat /usr/share/doc/libatk1.0-data >>>>>> stat: cannot statx '/usr/share/doc/libatk1.0-data': >>>>>> Invoer-/uitvoerfout >>>>>> >>>>>> in journal: >>>>>> >>>>>> BTRFS critical (device sda2): corrupt leaf: root=294 >>>>>> block=1169152675840 >>>>>> slot=1 ino=915987, invalid inode generation: has 18446744073709551492 >>>>>> expect [0, 5852829] >>>>>> BTRFS error (device sda2): block=1169152675840 read time tree block >>>>>> corruption detected >>>>>> >>>>>> So how do I repair this? Am I doing something wrong? >>>>> Please provide the following dump: >>>>> btrfs ins dump-tree -b 1169152675840 /dev/sda2 >>>>> >>>>> Feel free to remove the filenames in the dump. >>>> sudo btrfs ins dump-tree -b 1169152675840 /dev/sda2 >>>> btrfs-progs v5.3-rc1 >>>> leaf 1169152675840 items 36 free space 966 generation 5431733 owner 294 >>>> leaf 1169152675840 flags 0x1(WRITTEN) backref revision 1 >>>> fs uuid 27155120-9ef8-47fb-b248-eaac2b7c8375 >>>> chunk uuid 5704f1ba-08fd-4f6b-9117-0e080b4e9ef0 >>>>          item 0 key (915986 DIR_INDEX 2) itemoff 3957 itemsize 38 >>>>                  location key (915987 INODE_ITEM 0) type FILE >>>>                  transid 7782235549259005952 data_len 0 name_len 8 >>>>                  name: smb.conf >>>>          item 1 key (915987 INODE_ITEM 0) itemoff 3797 itemsize 160 >>>>                  generation 1 transid 18446744073709551492 size 12464 >>>> nbytes 16384 >>> Yeah, corrupted transid. >>> >>> The v5.6 kernel doesn't get the fix backported... >>> >>> Now you have to use either the out-of-tree branch, or David's devel >>> branch to build a btrfs-progs which is able to repair the transid error. >>> >>> Thanks, >>> Qu >>> >> Just be to be clear, I tried to repair with the Kubuntu Groovy Live usb, >> which has linux 5.8 and btrfs-progs 5.7. >> >> I didn't fix the above transid, above was taken after booting normally >> again (linux 5.8), unfortunately with btrfs-progs v5.3-rc1 (that I built >> a year ago). See the other post for the result with btrfs-progs 5.7. >> >> > As I said already, you need either the devel branch to do the fix. > Current release btrfs-progs hasn't the repair ability merged. > Ah, I understood wrong. I thought 5.7 was enough. So, I need to build the latest and greatest and install on live usb. Or I need to wait for a future live usb with this incorporated.