aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Harkes <[email protected]>2021-11-08 18:34:39 -0800
committerLinus Torvalds <[email protected]>2021-11-09 10:02:51 -0800
commit76097eb7a48a2ddcf4755773bd501c7aa14cbb7d (patch)
treeb1b5bb4a103e03217fbddef0391e1fd39042ecf7
parentb1deb685b07945bb374fa75857033bb658a1253b (diff)
coda: avoid flagging NULL inodes
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/[email protected] Signed-off-by: Jan Harkes <[email protected]> Cc: Alex Shi <[email protected]> Cc: Jing Yangyang <[email protected]> Cc: Xin Tan <[email protected]> Cc: Xiyu Yang <[email protected]> Cc: Zeal Robot <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
-rw-r--r--fs/coda/coda_linux.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/fs/coda/coda_linux.h b/fs/coda/coda_linux.h
index e7b27754ce78..3c2947bba5e5 100644
--- a/fs/coda/coda_linux.h
+++ b/fs/coda/coda_linux.h
@@ -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);