On Sat, Jun 24, 2017 at 8:57 AM, zhangyi (F) <yi.zhang@xxxxxxxxxx> wrote: > If an "impure && not merged" upper dir have left whiteouts > (last mount created), ovl cannot clear this dir when we > removing it, which may lead to rmdir fail or temp file left > in workdir. > > Simple reproducer: > mkdir lower upper work merge > mkdir -p lower/dir > touch lower/dir/a > mount -t overlay overlay -olowerdir=lower,upperdir=upper,\ > workdir=work merge > rm merge/dir/a > umount merge > rm -rf lower/* > touch lower/dir (*) > mount -t overlay overlay -olowerdir=lower,upperdir=upper,\ > workdir=work merge > rm -rf merge/dir > > Syslog dump: > overlayfs: cleanup of 'work/#7' failed (-39) > > (*): if we are not creat this file, the result is different: > rm: cannot remove "dir/": Directory not empty > > This patch add explicitly check of OVL_XATTR_ORIGIN, use > (merge || origin) to indicate the dir may have whiteouts. > Finally, check and clean up the dir when deleting it. > > Signed-off-by: zhangyi (F) <yi.zhang@xxxxxxxxxx> > Looks good. Reviewed-by: Amir Goldstein <amir73il@xxxxxxxxx> -- 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