summaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorAmir Goldstein <amir73il@gmail.com>2017-10-20 17:19:06 +0300
committerMiklos Szeredi <mszeredi@redhat.com>2017-10-24 16:06:17 +0200
commit7937a56fdf0b064c2ffa33025210f725a4ebc822 (patch)
tree188addb3f80fe0cb3e1973b5e6aba085b7f408dc /fs
parent6eaf011144af10cad34c0d46f82e50d382c8e926 (diff)
downloadlinux-7937a56fdf0b064c2ffa33025210f725a4ebc822.tar.bz2
ovl: handle ENOENT on index lookup
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: 359f392ca53e ("ovl: lookup index entry for copy up origin") Cc: <stable@vger.kernel.org> # v4.13 Signed-off-by: Amir Goldstein <amir73il@gmail.com>
Diffstat (limited to 'fs')
-rw-r--r--fs/overlayfs/namei.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/fs/overlayfs/namei.c b/fs/overlayfs/namei.c
index 05e9a0ad5c08..0d9b8ce5ea43 100644
--- a/fs/overlayfs/namei.c
+++ b/fs/overlayfs/namei.c
@@ -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,