]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/commitdiff
ovl: handle ENOENT on index lookup
authorAmir Goldstein <amir73il@gmail.com>
Fri, 20 Oct 2017 14:19:06 +0000 (17:19 +0300)
committerThadeu Lima de Souza Cascardo <cascardo@canonical.com>
Thu, 16 Nov 2017 13:23:26 +0000 (11:23 -0200)
BugLink: http://bugs.launchpad.net/bugs/1731961
commit 7937a56fdf0b064c2ffa33025210f725a4ebc822 upstream.

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")
Signed-off-by: Amir Goldstein <amir73il@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
fs/overlayfs/namei.c

index b88b2165e8eb5c84fa666973c04a49b005c8ca06..e2fc425da165d5272e07a18a404036bf4e1ef009 100644 (file)
@@ -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,