Skip to content

Commit 7e35019

Browse files
olgakorn1Olga Kornievskaia
authored andcommitted
NFS: for "inter" copy treat ESTALE as ENOTSUPP
If the client sends an "inter" copy to the destination server but it only supports "intra" copy, it can return ESTALE (since it doesn't know anything about the file handle from the other server and does not recognize the special case of "inter" copy). Translate this error as ENOTSUPP and also send OFFLOAD_CANCEL to the source server so that it can clean up state. Signed-off-by: Olga Kornievskaia <[email protected]>
1 parent 0b9018b commit 7e35019

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

fs/nfs/nfs42proc.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -391,6 +391,11 @@ ssize_t nfs42_proc_copy(struct file *src, loff_t pos_src,
391391
args.sync = true;
392392
dst_exception.retry = 1;
393393
continue;
394+
} else if (err == -ESTALE &&
395+
!nfs42_files_from_same_server(src, dst)) {
396+
nfs42_do_offload_cancel_async(src, &args.src_stateid);
397+
err = -EOPNOTSUPP;
398+
break;
394399
}
395400

396401
err2 = nfs4_handle_exception(server, err, &src_exception);

0 commit comments

Comments
 (0)