On Sat, Apr 04, 2020 at 12:32:07PM +0200, Goffredo Baroncelli wrote: > the aim of this patch set is to issue a warning when a mixed profiles > filesystem is detected. This happens when the filesystems contains > (i.e.) raid1c3 and single chunk for data. > > BTRFS has the capability to support a filesystem with mixed profiles. > However this could lead to an unexpected behavior when a new chunk is > allocated (i.e. the chunk profile is not what is wanted). Moreover > if the user is not aware of this, he could assume a redundancy which > doesn't exist (for example because there is some 'single' chunk when > it is expected the filesystem to be full raid1). > A possible cause of a mixed profiles filesystem is an interrupted > balance operation or a not fully balance due to very specific filter. > > The check is added to the following btrfs commands: > - btrfs balance pause > - btrfs balance cancel > - btrfs device add > - btrfs device del > > The warning is shorter than the before one. Below an example and > it is printed after the normal output of the command. > > WARNING: Multiple profiles detected. See 'man btrfs(5)'. > WARNING: data -> [raid1c3, single], metadata -> [raid1, single] > > The command "btrfs fi us" doesn't show the warning above, instead > it was added a further line in the "Overall" section. The output now > is this: > > Multiple profile: YES Yeah the summary section seems suitable, I think this could be more specific, for which profile type it applies, eg. 'data, metadata', or just one of them. I'll add the patches to devel so we can see how it works in practice.
