Skip to content

Commit

Permalink
Merge pull request #211 from earlchew/issues-210
Browse files Browse the repository at this point in the history
Check result of FSINFO before using result in nfs_mount_10_cb()
  • Loading branch information
sahlberg committed May 10, 2017
2 parents d8d9e55 + 63d6679 commit 14adfbf
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions lib/libnfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -954,6 +954,13 @@ static void nfs_mount_10_cb(struct rpc_context *rpc, int status, void *command_d
return;
}

if (res->status != NFS3_OK) {
rpc_set_error(nfs->rpc, "NFS: FSINFO of %s failed with %s(%d)", nfs->export, nfsstat3_to_str(res->status), nfsstat3_to_errno(res->status));
data->cb(nfsstat3_to_errno(res->status), nfs, rpc_get_error(nfs->rpc), data->private_data);
free_nfs_cb_data(data);
return;
}

nfs->readmax = res->FSINFO3res_u.resok.rtmax;
nfs->writemax = res->FSINFO3res_u.resok.wtmax;

Expand Down

0 comments on commit 14adfbf

Please sign in to comment.