Merge pull request #249 from shreyassiravara/nfs_opendir_cb_bug

nfs_opendir_cb should not queue a READDIR on error
libnfs-4.0.0-vitalif
Ronnie Sahlberg 2018-04-29 10:28:23 +10:00 committed by GitHub
commit 9edb1078e6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 11 deletions

View File

@ -2714,8 +2714,14 @@ nfs3_opendir_cb(struct rpc_context *rpc, int status, void *command_data,
assert(rpc->magic == RPC_CONTEXT_MAGIC);
if (status == RPC_STATUS_ERROR ||
(status == RPC_STATUS_SUCCESS && res->status == NFS3ERR_NOTSUPP)) {
if (check_nfs3_error(nfs, status, data, command_data)) {
nfs_free_nfsdir(nfsdir);
data->continue_data = NULL;
free_nfs_cb_data(data);
return;
}
if (status == RPC_STATUS_SUCCESS && res->status == NFS3ERR_NOTSUPP) {
READDIR3args args;
args.dir.data.data_len = data->fh.len;
@ -2738,15 +2744,6 @@ nfs3_opendir_cb(struct rpc_context *rpc, int status, void *command_data,
return;
}
if (status == RPC_STATUS_CANCEL) {
data->cb(-EINTR, nfs, "Command was cancelled",
data->private_data);
nfs_free_nfsdir(nfsdir);
data->continue_data = NULL;
free_nfs_cb_data(data);
return;
}
if (res->status != NFS3_OK) {
nfs_set_error(nfs, "NFS: READDIRPLUS of %s failed with "
"%s(%d)", data->saved_path,