Commit 74b8054c authored by Eric Van Hensbergen's avatar Eric Van Hensbergen Committed by Linus Torvalds

[PATCH] v9fs: fix bug in atomic create open fix

Lucho's atomic create+open fix had a bug in the super block initialization
causing all mounts to fail.  He was freeing an fcall too early.  This patch
fixes that oversight.
Signed-off-by: default avatarEric Van Hensbergen <ericvh@gmail.com>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 6a3124a3
...@@ -160,7 +160,6 @@ static struct super_block *v9fs_get_sb(struct file_system_type ...@@ -160,7 +160,6 @@ static struct super_block *v9fs_get_sb(struct file_system_type
v9fs_t_clunk(v9ses, newfid); v9fs_t_clunk(v9ses, newfid);
} else { } else {
/* Setup the Root Inode */ /* Setup the Root Inode */
kfree(fcall);
root_fid = v9fs_fid_create(v9ses, newfid); root_fid = v9fs_fid_create(v9ses, newfid);
if (root_fid == NULL) { if (root_fid == NULL) {
retval = -ENOMEM; retval = -ENOMEM;
...@@ -168,8 +167,10 @@ static struct super_block *v9fs_get_sb(struct file_system_type ...@@ -168,8 +167,10 @@ static struct super_block *v9fs_get_sb(struct file_system_type
} }
retval = v9fs_fid_insert(root_fid, root); retval = v9fs_fid_insert(root_fid, root);
if (retval < 0) if (retval < 0) {
kfree(fcall);
goto put_back_sb; goto put_back_sb;
}
root_fid->qid = fcall->params.rstat.stat.qid; root_fid->qid = fcall->params.rstat.stat.qid;
root->d_inode->i_ino = root->d_inode->i_ino =
...@@ -177,6 +178,8 @@ static struct super_block *v9fs_get_sb(struct file_system_type ...@@ -177,6 +178,8 @@ static struct super_block *v9fs_get_sb(struct file_system_type
v9fs_stat2inode(&fcall->params.rstat.stat, root->d_inode, sb); v9fs_stat2inode(&fcall->params.rstat.stat, root->d_inode, sb);
} }
kfree(fcall);
if (stat_result < 0) { if (stat_result < 0) {
retval = stat_result; retval = stat_result;
goto put_back_sb; goto put_back_sb;
......
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