在 2018年4月1日,下午9:31,Amir Goldstein <amir73il@xxxxxxxxx> 写道: > > On Sun, Apr 1, 2018 at 3:16 PM, cgxu519@xxxxxxx <cgxu519@xxxxxxx> wrote: >> 在 2018年4月1日,下午7:33,Amir Goldstein <amir73il@xxxxxxxxx> 写道: >>> > [...] >>> >>> Not much logic. Only 3 classifications that can be encoded in 3 different >>> parsing helpers: >>> 1. disallow change >>> 2. allow change NULL->non-NULL >>> 3. allow change non-NULL->non-NULL >>> >>> The parsing code doesn't do anything except setting the new >>> values in config struct and applying one of the limitations above >>> while parsing. >> >> For example, >> In ro->rw case, We need check a condition that from mount flags(rw) >> to consider if workdir/upperdir change to non-NULL from NULL is >> reasonable. So we have to pass mount flag to option parsing, right? >> >> If we specify index=on with ro->rw, then in the index case, at least >> we should check if workdir/upperdir mount option and rw mount flags have >> already set and based on that to consider index=on is reasonable. >> > > The idea is to encode the limitations that are always enforced in > parsing code (i.e. options that can never change or that can only > changed from NULL) and do the rest of the dependency checks > in outer (remount) code. > > What you gain is shorter and more generic code to print the error: > "overlayfs: option %s cannot be changed on remount" > AND > "overlayfs: option %s cannot be added on remount” I’m wondering how we deal with the case which is specifying same option several times in a remount. More specifically current lowerdir=aaa and specify options -o remount,lowerdir=bbb,lowerdir=aaa,ro then if we fail at first different value, it seems we will break compatibility with mount in parsing options. Thanks, Chengguang. -- To unsubscribe from this list: send the line "unsubscribe linux-unionfs" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html