NFS: also send OFFLOAD_CANCEL to source server
In case of copy is cancelled, also send OFFLOAD_CANCEL to the source server. Signed-off-by: Olga Kornievskaia <kolga@netapp.com>
This commit is contained in:
parent
6b61c969d5
commit
124060255d
@ -206,12 +206,14 @@ out:
|
|||||||
memcpy(&res->write_res.verifier, ©->verf, sizeof(copy->verf));
|
memcpy(&res->write_res.verifier, ©->verf, sizeof(copy->verf));
|
||||||
status = -copy->error;
|
status = -copy->error;
|
||||||
|
|
||||||
|
out_free:
|
||||||
kfree(copy);
|
kfree(copy);
|
||||||
return status;
|
return status;
|
||||||
out_cancel:
|
out_cancel:
|
||||||
nfs42_do_offload_cancel_async(dst, ©->stateid);
|
nfs42_do_offload_cancel_async(dst, ©->stateid);
|
||||||
kfree(copy);
|
if (!nfs42_files_from_same_server(src, dst))
|
||||||
return status;
|
nfs42_do_offload_cancel_async(src, src_stateid);
|
||||||
|
goto out_free;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int process_copy_commit(struct file *dst, loff_t pos_dst,
|
static int process_copy_commit(struct file *dst, loff_t pos_dst,
|
||||||
@ -381,7 +383,8 @@ ssize_t nfs42_proc_copy(struct file *src, loff_t pos_src,
|
|||||||
|
|
||||||
if (err >= 0)
|
if (err >= 0)
|
||||||
break;
|
break;
|
||||||
if (err == -ENOTSUPP) {
|
if (err == -ENOTSUPP &&
|
||||||
|
nfs42_files_from_same_server(src, dst)) {
|
||||||
err = -EOPNOTSUPP;
|
err = -EOPNOTSUPP;
|
||||||
break;
|
break;
|
||||||
} else if (err == -EAGAIN) {
|
} else if (err == -EAGAIN) {
|
||||||
@ -392,7 +395,8 @@ ssize_t nfs42_proc_copy(struct file *src, loff_t pos_src,
|
|||||||
dst_exception.retry = 1;
|
dst_exception.retry = 1;
|
||||||
continue;
|
continue;
|
||||||
} else if ((err == -ESTALE ||
|
} else if ((err == -ESTALE ||
|
||||||
err == -NFS4ERR_OFFLOAD_DENIED) &&
|
err == -NFS4ERR_OFFLOAD_DENIED ||
|
||||||
|
err == -ENOTSUPP) &&
|
||||||
!nfs42_files_from_same_server(src, dst)) {
|
!nfs42_files_from_same_server(src, dst)) {
|
||||||
nfs42_do_offload_cancel_async(src, &args.src_stateid);
|
nfs42_do_offload_cancel_async(src, &args.src_stateid);
|
||||||
err = -EOPNOTSUPP;
|
err = -EOPNOTSUPP;
|
||||||
|
Loading…
Reference in New Issue
Block a user