From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from [195.159.176.226] ([195.159.176.226]:60263 "EHLO blaine.gmane.org" rhost-flags-FAIL-FAIL-OK-OK) by vger.kernel.org with ESMTP id S1750733AbdJMF1z (ORCPT ); Fri, 13 Oct 2017 01:27:55 -0400 Received: from list by blaine.gmane.org with local (Exim 4.84_2) (envelope-from ) id 1e2sVZ-0008CT-51 for linux-btrfs@vger.kernel.org; Fri, 13 Oct 2017 07:27:41 +0200 To: linux-btrfs@vger.kernel.org From: Duncan <1i5t5.duncan@cox.net> Subject: Re: [PATCH v2 3/3] btrfs-progs: device: add remove missing-all Date: Fri, 13 Oct 2017 05:27:34 +0000 (UTC) Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-btrfs-owner@vger.kernel.org List-ID: Misono, Tomohiro posted on Wed, 11 Oct 2017 11:18:50 +0900 as excerpted: > Add 'btrfs remove missing-all' to remove all the missing devices at once > for improving usability. > > Example: > sudo mkfs.btrfs -f -d raid1 /dev/sdb1 /dev/sdb2 /dev/sdb3 /dev/sdb4 > sudo wipefs -a /dev/sdb1 /dev/sdb3 > sudo mount -o degraded /dev/sdb2 /mnt > sudo btrfs filesystem show /mnt > sudo btrfs device remove missing-all /mnt > sudo btrfs filesystem show /mnt There's a reason remove missing-all hasn't yet been implemented. Note that the above would be very unlikely to work once a filesystem has been used in any significant way, because raid1 and raid10 are explicitly chunk pairs, *NOT* duplicated N times across N devices. So with two devices missing, chances are that both copies of some chunks will be missing as well, so the filesystem would no longer be mountable degraded- writable, only degraded-readonly, in which case device remove won't work at all because the filesystem is readonly. In fact, until the recent per-chunk check patches went in, it was impossible to mount-writable a raid1 missing two devices at all, because the safeguards simply assumed some chunks would be entirely missing. The only case in which more than a single device missing is likely to be mountable degraded-writable (so device remove will work at all) is raid6, tho with recent patches there's narrow cases in which it /might/ be doable with raid1 as well. Now you may still wish to implement remove missing-all for raid6 mode and for the unusual corner-case raid1/raid10 in which it might work, but the documentation should be pretty clear that save for raid6 it can't be expected to work in most cases. Given that, I think remove missing-all hasn't been implemented as it simply hasn't been considered to be worth the bother for the narrow use- cases in which it will actually work. -- Duncan - List replies preferred. No HTML msgs. "Every nonfree program has a lord, a master -- and if you use the program, he is your master." Richard Stallman