fs/9p: Fix error handling in v9fs_get_sb
This was introduced by 7cadb63d58a932041afa3f957d5cbb6ce69dcee5 Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com> Signed-off-by: Eric Van Hensbergen <ericvh@gmail.com>
This commit is contained in:
committed by
Eric Van Hensbergen
parent
62b2be591a
commit
5c25f347a7
@@ -122,6 +122,10 @@ static int v9fs_get_sb(struct file_system_type *fs_type, int flags,
|
|||||||
fid = v9fs_session_init(v9ses, dev_name, data);
|
fid = v9fs_session_init(v9ses, dev_name, data);
|
||||||
if (IS_ERR(fid)) {
|
if (IS_ERR(fid)) {
|
||||||
retval = PTR_ERR(fid);
|
retval = PTR_ERR(fid);
|
||||||
|
/*
|
||||||
|
* we need to call session_close to tear down some
|
||||||
|
* of the data structure setup by session_init
|
||||||
|
*/
|
||||||
goto close_session;
|
goto close_session;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -144,7 +148,6 @@ static int v9fs_get_sb(struct file_system_type *fs_type, int flags,
|
|||||||
retval = -ENOMEM;
|
retval = -ENOMEM;
|
||||||
goto release_sb;
|
goto release_sb;
|
||||||
}
|
}
|
||||||
|
|
||||||
sb->s_root = root;
|
sb->s_root = root;
|
||||||
|
|
||||||
if (v9fs_proto_dotl(v9ses)) {
|
if (v9fs_proto_dotl(v9ses)) {
|
||||||
@@ -152,7 +155,7 @@ static int v9fs_get_sb(struct file_system_type *fs_type, int flags,
|
|||||||
st = p9_client_getattr_dotl(fid, P9_STATS_BASIC);
|
st = p9_client_getattr_dotl(fid, P9_STATS_BASIC);
|
||||||
if (IS_ERR(st)) {
|
if (IS_ERR(st)) {
|
||||||
retval = PTR_ERR(st);
|
retval = PTR_ERR(st);
|
||||||
goto clunk_fid;
|
goto release_sb;
|
||||||
}
|
}
|
||||||
|
|
||||||
v9fs_stat2inode_dotl(st, root->d_inode);
|
v9fs_stat2inode_dotl(st, root->d_inode);
|
||||||
@@ -162,7 +165,7 @@ static int v9fs_get_sb(struct file_system_type *fs_type, int flags,
|
|||||||
st = p9_client_stat(fid);
|
st = p9_client_stat(fid);
|
||||||
if (IS_ERR(st)) {
|
if (IS_ERR(st)) {
|
||||||
retval = PTR_ERR(st);
|
retval = PTR_ERR(st);
|
||||||
goto clunk_fid;
|
goto release_sb;
|
||||||
}
|
}
|
||||||
|
|
||||||
root->d_inode->i_ino = v9fs_qid2ino(&st->qid);
|
root->d_inode->i_ino = v9fs_qid2ino(&st->qid);
|
||||||
@@ -180,13 +183,18 @@ P9_DPRINTK(P9_DEBUG_VFS, " simple set mount, return 0\n");
|
|||||||
|
|
||||||
clunk_fid:
|
clunk_fid:
|
||||||
p9_client_clunk(fid);
|
p9_client_clunk(fid);
|
||||||
|
|
||||||
close_session:
|
close_session:
|
||||||
v9fs_session_close(v9ses);
|
v9fs_session_close(v9ses);
|
||||||
kfree(v9ses);
|
kfree(v9ses);
|
||||||
return retval;
|
return retval;
|
||||||
|
|
||||||
release_sb:
|
release_sb:
|
||||||
|
/*
|
||||||
|
* we will do the session_close and root dentry release
|
||||||
|
* in the below call. But we need to clunk fid, because we haven't
|
||||||
|
* attached the fid to dentry so it won't get clunked
|
||||||
|
* automatically.
|
||||||
|
*/
|
||||||
|
p9_client_clunk(fid);
|
||||||
deactivate_locked_super(sb);
|
deactivate_locked_super(sb);
|
||||||
return retval;
|
return retval;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user