提交 698d8d87 编写于 作者: J Jeff Layton 提交者: J. Bruce Fields

nfsd: fix error handling in nfsd4_remove_clid_dir

If the credential save fails, then we'll leak our mnt_want_write_file
reference.
Signed-off-by: NJeff Layton <jlayton@redhat.com>
Signed-off-by: NJ. Bruce Fields <bfields@redhat.com>
上级 292a4171
...@@ -301,12 +301,13 @@ nfsd4_remove_clid_dir(struct nfs4_client *clp) ...@@ -301,12 +301,13 @@ nfsd4_remove_clid_dir(struct nfs4_client *clp)
status = nfs4_save_creds(&original_cred); status = nfs4_save_creds(&original_cred);
if (status < 0) if (status < 0)
goto out; goto out_drop_write;
status = nfsd4_unlink_clid_dir(clp->cl_recdir, HEXDIR_LEN-1); status = nfsd4_unlink_clid_dir(clp->cl_recdir, HEXDIR_LEN-1);
nfs4_reset_creds(original_cred); nfs4_reset_creds(original_cred);
if (status == 0) if (status == 0)
vfs_fsync(rec_file, 0); vfs_fsync(rec_file, 0);
out_drop_write:
mnt_drop_write_file(rec_file); mnt_drop_write_file(rec_file);
out: out:
if (status) if (status)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册