[LTP] [PATCH] save_restore: Check whether path is writable
Cyril Hrubis
chrubis@suse.cz
Wed Oct 26 15:10:25 CEST 2022
Hi!
> The case 2) looks like it could apply to non-optional paths too. So maybe
> best option would be to drop "!" and "?" prefixes and turn them into flags/enums
> which can be then combined together.
>
> "/proc/sys/kernel/pid_max", 0, val // TCONF if path doesn't exist
> "/proc/sys/kernel/pid_max", SR_MUST_EXIST, val // TBROK if path doesn't exist
> "/proc/sys/kernel/pid_max", SR_MAY_EXIST, val // if exists, save it
> "/proc/sys/kernel/pid_max", SR_CONST_VAL, val // if already has val,
> skip saving it
> "/proc/sys/kernel/pid_max", SR_MAY_EXIST | SR_CONST_VAL, val // if
> exists check it already has val, otherwise save it
>
> What do you think? Would that make it easier to represent/implement all cases?
Ah Jan already proposed something similar to what I had in mind. I agree
with moving the attributes from the path to a separate field too.
--
Cyril Hrubis
chrubis@suse.cz
More information about the ltp
mailing list