Skip to content

Commit b31559f

Browse files
author
Al Viro
committed
coda_flag_children(): cope with dentries turning negative
->d_lock on parent does not stabilize ->d_inode of child. We don't do much with that inode in there, but we need at least to avoid struct inode getting freed under us... [rcu_read_lock() is not needed here, since parent's ->d_lock provides an rcu-critical area] Reviewed-by: Christian Brauner <brauner@kernel.org> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
1 parent b7a1470 commit b31559f

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

fs/coda/cache.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -94,12 +94,12 @@ static void coda_flag_children(struct dentry *parent, int flag)
9494

9595
spin_lock(&parent->d_lock);
9696
list_for_each_entry(de, &parent->d_subdirs, d_child) {
97+
struct inode *inode = d_inode_rcu(de);
9798
/* don't know what to do with negative dentries */
98-
if (d_inode(de) )
99-
coda_flag_inode(d_inode(de), flag);
99+
if (inode)
100+
coda_flag_inode(inode, flag);
100101
}
101102
spin_unlock(&parent->d_lock);
102-
return;
103103
}
104104

105105
void coda_flag_inode_children(struct inode *inode, int flag)

0 commit comments

Comments
 (0)