• Amir Goldstein's avatar
    ovl: fix false positive ESTALE on lookup · 939ae4ef
    Amir Goldstein authored
    Commit b9ac5c27 ("ovl: hash overlay non-dir inodes by copy up origin")
    verifies that the origin lower inode stored in the overlayfs inode matched
    the inode of a copy up origin dentry found by lookup.
    
    There is a false positive result in that check when lower fs does not
    support file handles and copy up origin cannot be followed by file handle
    at lookup time.
    
    The false negative happens when finding an overlay inode in cache on a
    copied up overlay dentry lookup. The overlay inode still 'remembers' the
    copy up origin inode, but the copy up origin dentry is not available for
    verification.
    
    Relax the check in case copy up origin dentry is not available.
    
    Fixes: b9ac5c27 ("ovl: hash overlay non-dir inodes by copy up...")
    Cc: <stable@vger.kernel.org> # v4.13
    Reported-by: default avatarJordi Pujol <jordipujolp@gmail.com>
    Signed-off-by: default avatarAmir Goldstein <amir73il@gmail.com>
    Signed-off-by: default avatarMiklos Szeredi <mszeredi@redhat.com>
    939ae4ef
inode.c 16.7 KB