main: skip ENOTDIR in a lookup

if we are looking for a path in a lower component, skip ENOTDIR as a
component might be a whiteout.

This happens only when running as root, as the whiteout takes the same
name of the deleted file/directory.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
This commit is contained in:
Giuseppe Scrivano 2019-05-15 17:08:13 +02:00
parent 89bd69ba91
commit 3732249217
No known key found for this signature in database
GPG Key ID: E4730F97F60286ED

4
main.c
View File

@ -1313,7 +1313,7 @@ do_lookup_file (struct ovl_data *lo, fuse_ino_t parent, const char *name)
{
int saved_errno = errno;
if (errno == ENOENT)
if (errno == ENOENT || errno == ENOTDIR)
{
if (node)
continue;
@ -1323,7 +1323,7 @@ do_lookup_file (struct ovl_data *lo, fuse_ino_t parent, const char *name)
return NULL;
ret = TEMP_FAILURE_RETRY (fstatat (it->fd, whpath, &tmp_st, AT_SYMLINK_NOFOLLOW));
if (ret < 0 && errno != ENOENT)
if (ret < 0 && errno != ENOENT && errno != ENOTDIR)
return NULL;
if (ret == 0)
{