From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp-36.italiaonline.it ([212.48.25.164]:43701 "EHLO libero.it" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751234AbcGGRAz (ORCPT ); Thu, 7 Jul 2016 13:00:55 -0400 Reply-To: kreijack@inwind.it Subject: Re: 64-btrfs.rules and degraded boot References: <20160705212706.719397fc@jupiter.sol.kaishome.de> <44c18e92-69b4-1409-1bf3-b1d08f6f84db@gmail.com> <460a10bc-b793-35cb-7d31-73ce08204012@gmail.com> To: Chris Murphy , "Austin S. Hemmelgarn" Cc: Andrei Borzenkov , Kai Krakow , Btrfs BTRFS From: Goffredo Baroncelli Message-ID: Date: Thu, 7 Jul 2016 19:00:53 +0200 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Sender: linux-btrfs-owner@vger.kernel.org List-ID: On 2016-07-06 22:00, Chris Murphy wrote: > On Wed, Jul 6, 2016 at 1:17 PM, Austin S. Hemmelgarn > wrote: > >> In bash or most other POSIX compliant shells, you can run this: >> echo $? >> to get the return code of the previous command. >> >> In your case though, it may be reporting the FS ready because it had already >> seen all the devices, IIUC, the flag that checks is only set once, and never >> unset, which is not a good design in this case. > > Oh dear. > > [root@f24s ~]# lvs > LV VG Attr LSize Pool Origin Data% Meta% Move > Log Cpy%Sync Convert > 1 VG Vwi---tz-- 50.00g thintastic > 2 VG Vwi---tz-- 50.00g thintastic > 3 VG Vwi-a-tz-- 50.00g thintastic 2.54 > thintastic VG twi-aotz-- 90.00g 5.05 2.92 > [root@f24s ~]# btrfs dev scan > Scanning for Btrfs filesystems > [root@f24s ~]# echo $? > 0 > [root@f24s ~]# btrfs device ready /dev/mapper/VG-3 > [root@f24s ~]# echo $? > 0 > [root@f24s ~]# btrfs fi show > warning, device 2 is missing > Label: none uuid: 96240fd9-ea76-47e7-8cf4-05d3570ccfd7 > Total devices 3 FS bytes used 2.26GiB > devid 3 size 50.00GiB used 3.01GiB path /dev/mapper/VG-3 > *** Some devices missing > > > Cute, device 1 is also missing but that's not mentioned. In any case, > the device is still ready even after a dev scan. I guess this isn't > exactly testable all that easily unless I reboot. IIRC a device when "registered" by "btrfs dev scan", is never removed from the available devices. This means that if you remove a valid device after that it is already scanned, "btrfs dev ready" still return OK until a reboot happened. >>From your email, it is not clear if you rebooted (or rmmod-ded btrfs) after you removed the devices. Only my 2ยข... BR G.Baroncelli > > > -- gpg @keyserver.linux.it: Goffredo Baroncelli Key fingerprint BBF5 1610 0B64 DAC6 5F7D 17B2 0EDA 9B37 8B82 E0B5