From: Al Viro Date: Tue, 8 Mar 2016 03:17:07 +0000 (-0500) Subject: ncpfs: fix a braino in OOM handling in ncp_fill_cache() X-Git-Tag: v4.1.12-92~150^2~133 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=865a124feaf6ca6c7189155ca5741cc57574b2fd;p=users%2Fjedix%2Flinux-maple.git ncpfs: fix a braino in OOM handling in ncp_fill_cache() Orabug: 23331002 [ Upstream commit 803c00123a8012b3a283c0530910653973ef6d8f ] Failing to allocate an inode for child means that cache for *parent* is incompletely populated. So it's parent directory inode ('dir') that needs NCPI_DIR_CACHE flag removed, *not* the child inode ('inode', which is what we'd failed to allocate in the first place). Fucked-up-in: commit 5e993e25 ("ncpfs: get rid of d_validate() nonsense") Fucked-up-by: Al Viro Cc: stable@vger.kernel.org # v3.19 Signed-off-by: Al Viro Signed-off-by: Sasha Levin (cherry picked from commit 906e5a6e6e73316fa4741ca53be014c9477a100c) Signed-off-by: Dan Duval --- diff --git a/fs/ncpfs/dir.c b/fs/ncpfs/dir.c index 80021c709af9c..0c2632386f355 100644 --- a/fs/ncpfs/dir.c +++ b/fs/ncpfs/dir.c @@ -633,7 +633,7 @@ ncp_fill_cache(struct file *file, struct dir_context *ctx, d_rehash(newdent); } else { spin_lock(&dentry->d_lock); - NCP_FINFO(inode)->flags &= ~NCPI_DIR_CACHE; + NCP_FINFO(dir)->flags &= ~NCPI_DIR_CACHE; spin_unlock(&dentry->d_lock); } } else {