From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-qg0-f41.google.com ([209.85.192.41]:33244 "EHLO mail-qg0-f41.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751863AbbIVOyr (ORCPT ); Tue, 22 Sep 2015 10:54:47 -0400 Received: by qgev79 with SMTP id v79so118128648qge.0 for ; Tue, 22 Sep 2015 07:54:46 -0700 (PDT) Subject: Re: [PATCH] btrfs: Fix no space bug caused by removing bg To: Hugo Mills , dsterba@suse.cz, =?UTF-8?Q?Holger_Hoffst=c3=a4tte?= , linux-btrfs@vger.kernel.org References: <15fc8f8d002e4ffcdb46e769736f240ae7ace20b.1442839332.git.zhaolei@cn.fujitsu.com> <560150CD.6070301@suse.com> <5601596B.1020607@googlemail.com> <20150922134131.GH5918@carfax.org.uk> <20150922142333.GH12815@twin.jikos.cz> <20150922143602.GI5918@carfax.org.uk> From: Austin S Hemmelgarn Message-ID: <56016BB5.6060101@gmail.com> Date: Tue, 22 Sep 2015 10:54:45 -0400 MIME-Version: 1.0 In-Reply-To: <20150922143602.GI5918@carfax.org.uk> Content-Type: multipart/signed; protocol="application/pkcs7-signature"; micalg=sha-512; boundary="------------ms090307090205050409030503" Sender: linux-btrfs-owner@vger.kernel.org List-ID: This is a cryptographically signed message in MIME format. --------------ms090307090205050409030503 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: quoted-printable On 2015-09-22 10:36, Hugo Mills wrote: > On Tue, Sep 22, 2015 at 04:23:33PM +0200, David Sterba wrote: >> On Tue, Sep 22, 2015 at 01:41:31PM +0000, Hugo Mills wrote: >>> On Tue, Sep 22, 2015 at 03:36:43PM +0200, Holger Hoffst=E4tte wrote: >>>> On 09/22/15 14:59, Jeff Mahoney wrote: >>>> (snip) >>>>> So if they way we want to prevent the loss of raid type info is by >>>>> maintaining the last block group allocated with that raid type, fin= e, >>>>> but that's a separate discussion. Personally, I think keeping 1GB >>>> >>>> At this point I'm much more surprised to learn that the RAID type ca= n >>>> apparently get "lost" in the first place, and is not persisted >>>> separately. I mean..wat? >>> >>> It's always been like that, unfortunately. >>> >>> The code tries to use the RAID type that's already present to wor= k >>> out what the next allocation should be. If there aren't any chunks in= >>> the FS, the configuration is lost, because it's not stored anywhere >>> else. It's one of the things that tripped me up badly when I was >>> failing to rewrite the chunk allocator last year. >> >> Yeah, right now there's no persistent default for the allocator. I'm >> still hoping that the object properties will magically solve that. > > There's no obvious place that filesystem-wide properties can be > stored, though. There's a userspace tool to manipulate the few current > FS-wide properties, but that's all special-cased to use the > "historical" ioctls for those properties, with no generalisation of a > property store, or even (IIRC) any external API for them. > > We're nominally using xattrs in the btrfs: namespace on directories= > and files, and presumably on the top directory of a subvolume for > subvol-wide properties, but it's not clear where the FS-wide values > should go: in the top directory of subvolid=3D5 would be confusing, > because then you couldn't separate the properties for *that subvol* > from the ones for the whole FS (say, the default replication policy, > where you might want the top subvol to have different properties from > everything else). Possibly do special names for the defaults and store them there? In=20 general, I personally see little value in having some special 'default'=20 properties however. The way I would expect things to work is that a new subvolume inherits=20 it's properties from it's parent (if it's a snapshot), or from the next=20 higher subvolume it's nested in. This would obviate the need for some=20 special 'default' properties, and would be relatively intuitive behavior = for a significant majority of people. --------------ms090307090205050409030503 Content-Type: application/pkcs7-signature; name="smime.p7s" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="smime.p7s" Content-Description: S/MIME Cryptographic Signature MIAGCSqGSIb3DQEHAqCAMIACAQExDzANBglghkgBZQMEAgMFADCABgkqhkiG9w0BBwEAAKCC Brgwgga0MIIEnKADAgECAgMRLfgwDQYJKoZIhvcNAQENBQAweTEQMA4GA1UEChMHUm9vdCBD QTEeMBwGA1UECxMVaHR0cDovL3d3dy5jYWNlcnQub3JnMSIwIAYDVQQDExlDQSBDZXJ0IFNp Z25pbmcgQXV0aG9yaXR5MSEwHwYJKoZIhvcNAQkBFhJzdXBwb3J0QGNhY2VydC5vcmcwHhcN MTUwOTIxMTEzNTEzWhc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