On Sat, Dec 30, 2017 at 9:49 AM, zhangyi (F) <yi.zhang@xxxxxxxxxx> wrote: > Current ovl_getattr() (stat(2)) return lower's d_ino for merge > directory (No any extended attribute) but ovl_iterate() > (getdents(2)) return upper's d_ino. > > This patch correct inconsistent d_ino for this case, change to > return lower's d_ino in ovl_iterate() for merge dir. > > Signed-off-by: zhangyi (F) <yi.zhang@xxxxxxxxxx> > --- > fs/overlayfs/readdir.c | 5 +++++ > 1 file changed, 5 insertions(+) > > diff --git a/fs/overlayfs/readdir.c b/fs/overlayfs/readdir.c > index 8c98578..9548712 100644 > --- a/fs/overlayfs/readdir.c > +++ b/fs/overlayfs/readdir.c > @@ -136,6 +136,11 @@ static bool ovl_calc_d_ino(struct ovl_readdir_data *rdd, > ovl_test_flag(OVL_IMPURE, d_inode(rdd->dentry))) > return true; > > + /* Recalc d_ino for all dir in merge dir (contains merge subdirs) */ > + if (p->type == DT_DIR && > + OVL_TYPE_MERGE(ovl_path_type(rdd->dentry))) Why only subdirs and not files with origin? This is a partial fix and I think Miklos has rejected a similar fix by Chandan and said that this should be fixed by a future fsck.overlay (hint hint). The inconsistency is that the directory contains origin (and merge subdir) and is not marked "impure". That is what fsck.overlay needs to fix and then "Recalc d_ino for for all entries if dir is impure (contains copied up entries)" will do the right thing. Amir. -- 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