Skip to content

Commit

Permalink
ovl: handle ENOENT on index lookup
Browse files Browse the repository at this point in the history
Treat ENOENT from index entry lookup the same way as treating a returned
negative dentry. Apparently, either could be returned if file is not
found, depending on the underlying file system.

Fixes: 359f392 ("ovl: lookup index entry for copy up origin")
Cc: <[email protected]> # v4.13
Signed-off-by: Amir Goldstein <[email protected]>
  • Loading branch information
amir73il authored and Miklos Szeredi committed Oct 24, 2017
1 parent 6eaf011 commit 7937a56
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions fs/overlayfs/namei.c
Original file line number Diff line number Diff line change
Expand Up @@ -507,6 +507,10 @@ static struct dentry *ovl_lookup_index(struct dentry *dentry,
index = lookup_one_len_unlocked(name.name, ofs->indexdir, name.len);
if (IS_ERR(index)) {
err = PTR_ERR(index);
if (err == -ENOENT) {
index = NULL;
goto out;
}
pr_warn_ratelimited("overlayfs: failed inode index lookup (ino=%lu, key=%*s, err=%i);\n"
"overlayfs: mount with '-o index=off' to disable inodes index.\n",
d_inode(origin)->i_ino, name.len, name.name,
Expand Down

0 comments on commit 7937a56

Please sign in to comment.