Commit ace2dc79 authored by Alexander Viro's avatar Alexander Viro Committed by Linus Torvalds

[PATCH] (2/4) d_move() BKL removal

	default encode_fh() doesn't take dparent_lock around messing
with dereferences of ->d_parent->d_inode->i_....  Fixed.
parent 6524fa5c
......@@ -457,7 +457,6 @@ static int export_encode_fh(struct dentry *dentry, __u32 *fh, int *max_len,
int connectable)
{
struct inode * inode = dentry->d_inode;
struct inode *parent = dentry->d_parent->d_inode;
int len = *max_len;
int type = 1;
......@@ -468,8 +467,12 @@ static int export_encode_fh(struct dentry *dentry, __u32 *fh, int *max_len,
fh[0] = inode->i_ino;
fh[1] = inode->i_generation;
if (connectable && !S_ISDIR(inode->i_mode)) {
struct inode *parent;
read_lock(&dparent_lock);
parent = dentry->d_parent->d_inode;
fh[2] = parent->i_ino;
fh[3] = parent->i_generation;
read_unlock(&dparent_lock);
len = 4;
type = 2;
}
......
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