On Mon, May 14, 2018 at 12:46:31PM +0300, Nikolay Borisov wrote: > [Adding David to CC] > > On 14.05.2018 12:39, Roman Mamedov wrote: > > On Mon, 14 May 2018 11:36:26 +0300 > > Nikolay Borisov <nbori...@suse.com> wrote: > > > >> So what made you have these expectation, is it codified somewhere > >> (docs/man pages etc)? I'm fine with that semantics IF this is what > >> people expect. > > > > "Compression ...does not work for NOCOW files": > > https://btrfs.wiki.kernel.org/index.php/Compression > > > > The mount options man page does not say that the NOCOW attribute of files > > will > > be disregarded with compress-force. It only mentions interaction with the > > nodatacow and nodatasum mount options. So I'd expect the attribute to still > > work and prevent compression of NOCOW files. > > I wouldn't say this is very clear, it needs to be stated explicitly. > > > > >> Now the question is why people grew up to have this expectation and not the > >> other way round? IMO force_compress should really disregard everything else > > > > Both are knobs that the user needs to explicitly set, the difference is that > > the +C attribute is fine-grained and the mount option is global. If they are > > set by the user to conflicting values, it seems more useful to have the > > fine-grained control override the global one, not the other way round. > > This is valid reasoning but so is mine. So I'd like to have some rules > on that matter such that in the future things will have consistent > semantics. Obviously in this case the "local options trump global ones" > seems to be prevalent. I don't have problem with that but this should > codified somewhere. > > > David, what's your take on that. Where do you think will be the best > place to say that local, per-inode options take precedence over global ones?
The order of precedence is roughly like this, whenever the respective containing object exits: - inode - directory - subvolume - mount options - filesystem defaults There's some special cases for the compression, that are documented separately. -- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html