diff options
author | Amir Goldstein <amir73il@gmail.com> | 2021-04-26 18:20:21 +0300 |
---|---|---|
committer | Miklos Szeredi <mszeredi@redhat.com> | 2021-08-10 10:21:30 +0200 |
commit | 9011c2791e63fc05721b545c41ad025d8073566e (patch) | |
tree | 4168367806b39326e1abebf0607eb1b39ec5369f /fs/proc | |
parent | Linux 5.14-rc1 (diff) | |
download | linux-dev-9011c2791e63fc05721b545c41ad025d8073566e.tar.xz linux-dev-9011c2791e63fc05721b545c41ad025d8073566e.zip |
ovl: skip stale entries in merge dir cache iteration
On the first getdents call, ovl_iterate() populates the readdir cache
with a list of entries, but for upper entries with origin lower inode,
p->ino remains zero.
Following getdents calls traverse the readdir cache list and call
ovl_cache_update_ino() for entries with zero p->ino to lookup the entry
in the overlay and return d_ino that is consistent with st_ino.
If the upper file was unlinked between the first getdents call and the
getdents call that lists the file entry, ovl_cache_update_ino() will not
find the entry and fall back to setting d_ino to the upper real st_ino,
which is inconsistent with how this object was presented to users.
Instead of listing a stale entry with inconsistent d_ino, simply skip
the stale entry, which is better for users.
xfstest overlay/077 is failing without this patch.
Signed-off-by: Amir Goldstein <amir73il@gmail.com>
Link: https://lore.kernel.org/fstests/CAOQ4uxgR_cLnC_vdU5=seP3fwqVkuZM_-WfD6maFTMbMYq=a9w@mail.gmail.com/
Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
Diffstat (limited to 'fs/proc')
0 files changed, 0 insertions, 0 deletions