Commit b31559f8 authored by Al Viro's avatar Al Viro

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: default avatarChristian Brauner <brauner@kernel.org>
Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
parent b7a14708
......@@ -94,12 +94,12 @@ static void coda_flag_children(struct dentry *parent, int flag)
spin_lock(&parent->d_lock);
list_for_each_entry(de, &parent->d_subdirs, d_child) {
struct inode *inode = d_inode_rcu(de);
/* don't know what to do with negative dentries */
if (d_inode(de) )
coda_flag_inode(d_inode(de), flag);
if (inode)
coda_flag_inode(inode, flag);
}
spin_unlock(&parent->d_lock);
return;
}
void coda_flag_inode_children(struct inode *inode, int flag)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment