coda: avoid flagging NULL inodes
authorJan Harkes <jaharkes@cs.cmu.edu>
Tue, 9 Nov 2021 02:34:39 +0000 (18:34 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Tue, 9 Nov 2021 18:02:51 +0000 (10:02 -0800)
Somehow we hit a negative dentry in coda_rename even after checking with
d_really_is_positive.  Maybe something raced and turned the new_dentry
negative while we were fixing up directory link counts.

Link: https://lkml.kernel.org/r/20210908140308.18491-5-jaharkes@cs.cmu.edu
Signed-off-by: Jan Harkes <jaharkes@cs.cmu.edu>
Cc: Alex Shi <alex.shi@linux.alibaba.com>
Cc: Jing Yangyang <jing.yangyang@zte.com.cn>
Cc: Xin Tan <tanxin.ctf@gmail.com>
Cc: Xiyu Yang <xiyuyang19@fudan.edu.cn>
Cc: Zeal Robot <zealci@zte.com.cn>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
fs/coda/coda_linux.h

index e7b27754ce782ad3b77781d291413c79f0fce4ee..3c2947bba5e5303e2938ce1b98b5f23b744d0999 100644 (file)
@@ -83,6 +83,9 @@ static __inline__ void coda_flag_inode(struct inode *inode, int flag)
 {
        struct coda_inode_info *cii = ITOC(inode);
 
+       if (!inode)
+               return;
+
        spin_lock(&cii->c_lock);
        cii->c_flags |= flag;
        spin_unlock(&cii->c_lock);