overlay/077: check for inconsistent d_ino/st_ino
After unlink of a directory entry, that entry may still apear in getdents
results of an already open directory fd, but it should return a d_ino
value that is consistent with the already observed st_ino of that entry.
Remove redundant break condition from gendents read loop.
For testing of inconsistent d_ino/st_ino we need to unlink an entry
whose st_ino is not that of the upper inode.
In the former merge dir setup we unlink all the files in the lower
dir after copyup, so they all use st_ino of the upper inode.
Let the unlinked file f100 reside in a lower path that is not being
unlinked so it will have the st_ino of the lower inode.
This is a regression test for kernel commit
fcb7f373684d
("ovl: skip stale entries in merge dir cache iteration")
Signed-off-by: Amir Goldstein <amir73il@gmail.com>
Reviewed-by: Eryu Guan <guaneryu@gmail.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>