]>
Commit | Line | Data |
---|---|---|
d8546da0 GKH |
1 | From 803c00123a8012b3a283c0530910653973ef6d8f Mon Sep 17 00:00:00 2001 |
2 | From: Al Viro <viro@zeniv.linux.org.uk> | |
3 | Date: Mon, 7 Mar 2016 22:17:07 -0500 | |
4 | Subject: ncpfs: fix a braino in OOM handling in ncp_fill_cache() | |
5 | ||
6 | From: Al Viro <viro@zeniv.linux.org.uk> | |
7 | ||
8 | commit 803c00123a8012b3a283c0530910653973ef6d8f upstream. | |
9 | ||
10 | Failing to allocate an inode for child means that cache for *parent* is | |
11 | incompletely populated. So it's parent directory inode ('dir') that | |
12 | needs NCPI_DIR_CACHE flag removed, *not* the child inode ('inode', which | |
13 | is what we'd failed to allocate in the first place). | |
14 | ||
15 | Fucked-up-in: commit 5e993e25 ("ncpfs: get rid of d_validate() nonsense") | |
16 | Fucked-up-by: Al Viro <viro@zeniv.linux.org.uk> | |
17 | Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> | |
18 | Signed-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 { |