[PATCH 4/9] coda: Avoid flagging NULL inodes

From
Jan Harkes <jaharkes@cs.cmu.edu>
Date
2021-09-08 14:29:23
Reply to
Jan Harkes, 2021-09-08
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.

Signed-off-by: Jan Harkes <jaharkes@cs.cmu.edu>
---
 fs/coda/coda_linux.h | 3 +++
 1 file changed, 3 insertions(+)
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);
-- 
2.25.1
Thread (10 messages) 10 messages, 1 author, last reply 2021-09-08
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help