On Wed, Oct 18, 2017 at 12:05 AM, Vivek Goyal <vgoyal@xxxxxxxxxx> wrote: > OVL_METACOPY in oi->flags can be accessed in lockless manner. So if a file > is being copied up metadata only, we need to make sure that upperdentry is > visible only after OVL_METACOPY flag has been set. IOW, if oi->__upperdentry > is visble to a cpu, then we also need to make sure any updates to OVL_METACOPY > flags are visible too. > You know, I have a feeling that this ordering requirement could be simplified or completely avoided if you flip the meaning of the flag, i.e.: bool ovl_dentry_has_upper_data(struct dentry *dentry) { return ovl_test_flag(OVL_UPPER_DATA, d_inode(dentry)); } Then flag visibility requirements are the same as visibility requirements for oe->has_upper. You probably don't need to add any new barriers for setting setting the flag on normal copy up. For setting the flag in copy_up_meta_inode_data, and testing the flag in ovl_d_real() the requirements stay the same as you implemented in patch 10. Am I wrong? -- 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