Skip to content

Commit

Permalink
nfs4: return EACCESS when stage is not allowed
Browse files Browse the repository at this point in the history
Motivation:
newer kernels ignores EPERM on READ and tries the request as in
case of a transient error, thus nfs client hangs forever when
staging is not allowed.

Modification:
Return EACCESS (which is spec defined error on READ) to propagate
stage protection decision to the calling app.

Result:
NFS client propagates stage restriction to calling application.

Acked-by: Lea Morschel
Target: master, 8.2
Require-book: no
Require-notes: yes
(cherry picked from commit ff557a0)
Signed-off-by: Tigran Mkrtchyan <[email protected]>
  • Loading branch information
kofemann authored and mksahakyan committed Sep 20, 2022
1 parent 312ea69 commit 283c8b7
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@
import org.dcache.chimera.ChimeraFsException;
import org.dcache.chimera.FileNotFoundChimeraFsException;
import org.dcache.nfs.ChimeraNFSException;
import org.dcache.nfs.status.AccessException;
import org.dcache.nfs.status.DelayException;
import org.dcache.nfs.status.LayoutTryLaterException;
import org.dcache.nfs.status.NfsIoException;
import org.dcache.nfs.status.NoEntException;
import org.dcache.nfs.status.NoSpcException;
import org.dcache.nfs.status.PermException;
import org.dcache.nfs.status.ServerFaultException;

/**
Expand Down Expand Up @@ -80,7 +80,7 @@ public static ChimeraNFSException asNfsException(CacheException e,
case NO_POOL_ONLINE:
return new LayoutTryLaterException(e.getMessage(), e);
case PERMISSION_DENIED:
return new PermException(e.getMessage(), e);
return new AccessException(e.getMessage(), e);
case NO_POOL_CONFIGURED:
case RESOURCE:
return new NoSpcException(e.getMessage(), e);
Expand Down

0 comments on commit 283c8b7

Please sign in to comment.