Skip to content

Commit

Permalink
[PATCH] v9fs: fix bug in atomic create open fix
Browse files Browse the repository at this point in the history
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: Eric Van Hensbergen <ericvh@gmail.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
  • Loading branch information
Eric Van Hensbergen authored and Linus Torvalds committed Mar 2, 2006
1 parent 6a3124a commit 74b8054
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions fs/9p/vfs_super.c
Original file line number Diff line number Diff line change
Expand Up @@ -160,23 +160,26 @@ static struct super_block *v9fs_get_sb(struct file_system_type
v9fs_t_clunk(v9ses, newfid);
} else {
/* Setup the Root Inode */
kfree(fcall);
root_fid = v9fs_fid_create(v9ses, newfid);
if (root_fid == NULL) {
retval = -ENOMEM;
goto put_back_sb;
}

retval = v9fs_fid_insert(root_fid, root);
if (retval < 0)
if (retval < 0) {
kfree(fcall);
goto put_back_sb;
}

root_fid->qid = fcall->params.rstat.stat.qid;
root->d_inode->i_ino =
v9fs_qid2ino(&fcall->params.rstat.stat.qid);
v9fs_stat2inode(&fcall->params.rstat.stat, root->d_inode, sb);
}

kfree(fcall);

if (stat_result < 0) {
retval = stat_result;
goto put_back_sb;
Expand Down

0 comments on commit 74b8054

Please sign in to comment.