On 8/5/19 12:31 PM, Hans van Kranenburg wrote:
On 8/5/19 12:20 PM, Holger Hoffstätte wrote:
On 8/2/19 6:10 PM, Josef Bacik wrote:
In testing block group removal it's sometimes handy to be able to create
block groups on demand. Add an ioctl to allow us to force allocation
from userspace.
Gave this a try and it works as advertised, though I noticed that the
redundancy level is ignored, e.g. adding a single metadata chunk will
add a new "single" chunk even when the metadata level is dup.
Doing a balance -mconvert dup,soft fixes that right up, but it's IMHO
unexpected. Can you put a cherry on top and create the new chunk according
to its dup level?
Looking at the code, you should get -EINVAL when you specify anything
else than single? (because of the != comparisons).
If this gets in, and is available without doing some special debug style
kernel build, then it will (tm) be (ab)used by users in the future for
things we didn't imagine today. So, in that case, it makes sense to be
able to specify any valid combination of flags (type+profile), like
indeed METADATA|DUP or whatever.
..and that's precisely why it (IMHO) should simply do The Right Thing
by default instead of giving people more footguns with unexpected
behaviour. Just observe the existing profile in the kernel ioctl and
act accordingly, no need for more user-supplied flags. Just don't.
Holger