On Thu, Feb 5, 2015 at 11:01 AM, 王旭 <xuw2015@xxxxxxxxx> wrote: > Hi, > I read the source code of overlay fs, it's amazing, but a few > confusion for the rename2 function. > > Here is the code: > 799 if (overwrite) { > > 800 if (old_opaque) { > 801 if (new->d_inode || !new_opaque) { > 802 /* Whiteout source */ > 803 flags |= RENAME_WHITEOUT; > 804 } else { > 805 /* Switch whiteouts */ > 806 flags |= RENAME_EXCHANGE; > 807 } > 808 } else if (is_dir && !new->d_inode && new_opaque) { > 809 flags |= RENAME_EXCHANGE; > ^^^^^^^^^^Is necessary to use RENAME_EXCHANGE? why > not let vfs_rename to remove the new(dest) entry? Source is a directory, dest is a whiteout represented by a chardev. There's a rule that directory can only overwrite directory and non-directory can only overwrite non-directory. Thanks, Miklos -- 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