Skip to content

Commit

Permalink
Merge pull request #249 from shreyassiravara/nfs_opendir_cb_bug
Browse files Browse the repository at this point in the history
nfs_opendir_cb should not queue a READDIR on error
  • Loading branch information
sahlberg committed Apr 29, 2018
2 parents 63ba842 + df72323 commit 9edb107
Showing 1 changed file with 8 additions and 11 deletions.
19 changes: 8 additions & 11 deletions lib/nfs_v3.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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,
Expand Down

0 comments on commit 9edb107

Please sign in to comment.