Skip to content

Commit 225dcf1

Browse files
committed
nfs: propagate NFS errors of server-side-copy to the client
Motivation: when server-side-copy with an NFS error, like NOT_SUPP, then we want this error to be propagated to the client. Modification: Update OperationCOPY to map only non NFS errors to EIO. Result: proper error handling. Acked-by: Albert Rossi Target: master
1 parent 4247348 commit 225dcf1

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

core/src/main/java/org/dcache/nfs/v4/OperationCOPY.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,11 @@ public void process(CompoundContext context, nfs_resop4 result) throws ChimeraNF
124124
long n = copyFuture.get(1, TimeUnit.SECONDS);
125125
res.cr_resok4.cr_response.wr_count = new length4(n);
126126
} catch (InterruptedException | ExecutionException e) {
127-
LOGGER.error("Copy-offload interrupted: ", Throwables.getRootCause(e));
127+
128+
Throwable cause = Throwables.getRootCause(e);
129+
Throwables.propagateIfPossible(cause, ChimeraNFSException.class);
130+
131+
LOGGER.error("Copy-offload failed: {}", e.getMessage());
128132
res.cr_status = nfsstat.NFSERR_IO;
129133
} catch (TimeoutException e) {
130134
// continue as async copy

0 commit comments

Comments
 (0)