]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blame - releases/4.4.6/ncpfs-fix-a-braino-in-oom-handling-in-ncp_fill_cache.patch
drop queue-4.14/mips-make-sure-dt-memory-regions-are-valid.patch
[thirdparty/kernel/stable-queue.git] / releases / 4.4.6 / ncpfs-fix-a-braino-in-oom-handling-in-ncp_fill_cache.patch
CommitLineData
d8546da0
GKH
1From 803c00123a8012b3a283c0530910653973ef6d8f Mon Sep 17 00:00:00 2001
2From: Al Viro <viro@zeniv.linux.org.uk>
3Date: Mon, 7 Mar 2016 22:17:07 -0500
4Subject: ncpfs: fix a braino in OOM handling in ncp_fill_cache()
5
6From: Al Viro <viro@zeniv.linux.org.uk>
7
8commit 803c00123a8012b3a283c0530910653973ef6d8f upstream.
9
10Failing to allocate an inode for child means that cache for *parent* is
11incompletely populated. So it's parent directory inode ('dir') that
12needs NCPI_DIR_CACHE flag removed, *not* the child inode ('inode', which
13is what we'd failed to allocate in the first place).
14
15Fucked-up-in: commit 5e993e25 ("ncpfs: get rid of d_validate() nonsense")
16Fucked-up-by: Al Viro <viro@zeniv.linux.org.uk>
17Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
18Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
19
20---
21 fs/ncpfs/dir.c | 2 +-
22 1 file changed, 1 insertion(+), 1 deletion(-)
23
24--- a/fs/ncpfs/dir.c
25+++ b/fs/ncpfs/dir.c
26@@ -633,7 +633,7 @@ ncp_fill_cache(struct file *file, struct
27 d_rehash(newdent);
28 } else {
29 spin_lock(&dentry->d_lock);
30- NCP_FINFO(inode)->flags &= ~NCPI_DIR_CACHE;
31+ NCP_FINFO(dir)->flags &= ~NCPI_DIR_CACHE;
32 spin_unlock(&dentry->d_lock);
33 }
34 } else {