> But I am chaging my mind again, and thinking about another new option > "nocheck". > > - without "nocheck" (default), aufs checks the consistency even if the > src/dst are specified. > - specifying "nocheck" explicitly, aufs skips the check. this option is > just for the users who know what he is doing. > > Hmm, probably I need to review the design again.
Here is a (fomatted) user's manual of the command aumvdown. The semantics is that "specifying source/target branch means 'nocheck' automatically". So the "nocheck" option will not be implemented. Any comments are welcome. J. R. Okajima ---------------------------------------------------------------------- NAME aumvdown - moves-down a file between aufs branches SYNOPSIS aumvdown [options] file ... DESCRIPTION "aumvdown" command finds the first branch where the given file exists, copies it to the next lower writable branch, and then removes the file on the first branch. You can customize the behaviour by specifing options. See OPTIONS in detail. There are several conditions to achieve the operation. o It is obvious that when the file exists between the first and the next lower writable branches, or hidden by the whiteout or direcotry's opaque-ness, then the operation failed (by default). Because it breaks the consistency in aufs world. o Files in use (both in aufs world and in branch filesystem) are not be handled. o Hard-linked (both in aufs world and in branch filesystem, or pseudo-linked in aufs world) files are not be handled. For such file, remount aufs or use "auplink." o Directories are not be handled since the action doesn't behave recursivly and the moving-down an empty dir has less meaning. When all these conditions are not satisfied, EBUSY will be returned. Note that any directory in aufs can be "opaque". If any of the interme- diate dir of the file between the source and taget branch is set to opaque, then the command returns an error (by default) since you won't see the moved-down (or copied-down) file. In order to reduce setting the opaque-ness for directories, it is strongly discouraged to specify "diropq=always." This confusing situation can happen when a user rename(2) a dir directly on a branch (by-passing aufs) since aufs can- not stop such user's direct rename(2) operation. Also note about the whiteout on the lower branches, including the read- only branches with the attribute "=ro+wh" is set. Similar to the opaqued dir, the whiteout can hide the lower same-named file and you may not see the moved (or copied) file either. Of course the command will return an error when such whiteout is found (by default). Again direct change on the branch (by-passing aufs) can cause such confusing situation. OPTIONS -s index | --source-index index | --source-branch path -t index | --target-index index | --target-branch path By default, the source branch is the first branch where the file exists, and the target branch is the next lower writable branch. Both branches must be natively writable and marked as writable in aufs world, and the same-named file should not exist on the intermediate branches. Otherwise the command will return an error. By specifying source and target branch explicitly, you can choose other source/target branch even if the branch permission is marked as readonly in aufs world. And --overwrite option is automatically set. You can specify the branch, either by the branch path or by the branch index. Obviously no can write to the natively readonly filesystem. In this case, EROFS will be returned. Caution: It means these options skip the internal checkings around the branch and force aumvdown(8) to use the specified branch. The result may confuse you since it can easily hide the moved-down (or copied-down) file. -w | --overwrite When this option is enabled and if the same named file exists on the target branch, it will be over-written. Otherwise EEXIST will be returned unless the branch is explicitly specified (by -t or something). -c | --copy Essentially this option choose the action whether "copy" or "move." Unless this option is specified, the source file on the upper writable branch is removed after copying-down, which results the "move" operation. -i | --interactive Prompt to the user for every given file. -v | --verbose Make it verbose particulary for the error cases. Note that the messages are printed by kernel (and left in your syslog). ------------------------------------------------------------------------------ This SF.net email is sponsored by Windows: Build for Windows Store. http://p.sf.net/sfu/windows-dev2dev