Skip to contentSkip to conversation

overlay tests: generalize _check_overlay_feature for param-less mount options

RFC Prabhakar Pujeri 2 participants 2 messages Sep 2

lore
Share & tools
lore
#0 lore raw

Hi all,

During the overlay/081 _require_scratch review, Zorro asked whether the uuid=null/auto/on mount options (kernel v6.6+) warrant a _require_* helper. Amir replied that a dedicated helper is not the way; instead he suggested teaching _require_scratch_overlay_features / _check_overlay_feature about mount options that have no module parameter of the same name (uuid, xino, verity, fsync) -- a missing /sys/module/ overlay/parameters/<name> then means "defaults off" rather than "unsupported" -- and pointed out the xino tests (overlay/041, 043, 044, 067, 070, 071) practically open-code that pattern already.

Before writing the series, one scoping question: would such a refactor be welcome?

Sketch of the series:

1. Extend _check_overlay_feature() so element names without a matching module parameter fall back to treating the feature as fixed-default (per Amir's note), so callers can require "uuid=on" and friends uniformly.
2. Convert overlay/041, 043, 044, 067, 070, 071 to the generalized helper, deleting their open-coded variants.
3. Optionally, switch overlay/081's ad-hoc uuid= probe to the helper as well (currently _notrun on mount failure with EINVAL).

(A practical caveat: for the param-less options, presence still needs a probe either way for kernels predating the feature; the helper generalization mainly removes six near-identical code blocks and the shared "not supported vs default-off" semantics.)

The motivation and context are in this thread:
https://lore.kernel.org/fstests/CAOQ4uxjBc5CfCpjrq8Ut4xHHaenKicTxBCbNuQkBFuu-Mz9=EQ@mail.gmail.com/

Please let me know whether to proceed (or whether you would rather keep the open-coded xino blocks).

Thanks,
Prabhakar

#1 lore raw
Quoted 18 lines · Prabhakar Pujeri

Hi all,

During the overlay/081 _require_scratch review, Zorro asked whether the uuid=null/auto/on mount options (kernel v6.6+) warrant a _require_* helper. Amir replied that a dedicated helper is not the way; instead he suggested teaching _require_scratch_overlay_features / _check_overlay_feature about mount options that have no module parameter of the same name (uuid, xino, verity, fsync) -- a missing /sys/module/ overlay/parameters/<name> then means "defaults off" rather than "unsupported" -- and pointed out the xino tests (overlay/041, 043, 044, 067, 070, 071) practically open-code that pattern already.

Before writing the series, one scoping question: would such a refactor be welcome?

Sketch of the series:

Quoted 8 lines

1. Extend _check_overlay_feature() so element names without a matching module parameter fall back to treating the feature as fixed-default (per Amir's note), so callers can require "uuid=on" and friends uniformly.
2. Convert overlay/041, 043, 044, 067, 070, 071 to the generalized helper, deleting their open-coded variants.
3. Optionally, switch overlay/081's ad-hoc uuid= probe to the helper as well (currently _notrun on mount failure with EINVAL).

Well if you do the hard part of #1 and #2 better make the trivial change of #3

Quoted 6 lines

(A practical caveat: for the param-less options, presence still needs a probe either way for kernels predating the feature; the helper generalization mainly removes six near-identical code blocks and the shared "not supported vs default-off" semantics.)

I don't understand the question.

For param-less option the helper will be reduced to
- mount with -ouuid=on
- check that mount options include uuid=on

What is the problem that you are pointing out?

Quoted 6 lines

The motivation and context are in this thread:
https://lore.kernel.org/fstests/CAOQ4uxjBc5CfCpjrq8Ut4xHHaenKicTxBCbNuQkBFuu-Mz9=EQ@mail.gmail.com/

Please let me know whether to proceed (or whether you would rather keep the open-coded xino blocks).

The patch would be welcome.
You may encounter issues I did not think about which will complicate things - we can decide if that happens how to proceed.

Thanks for following up,
Amir.