diff mbox

[06/11] fedfsd: Report legal but non-existent path during lookup-junction

Message ID 20150708182653.24274.82058.stgit@seurat.1015granger.net
State Accepted
Headers show

Commit Message

Chuck Lever July 8, 2015, 6:26 p.m. UTC
FEDFS_LOOKUP_JUNCTION reports FEDFS_ERR_INVAL if the specified
path doesn't exist. INVAL is a little broad: it could mean, for
example, that any one of the arguments is incorrect.

RFC 7533 does not have a "does not exist" error code. But it does
allow FEDFS_LOOKUP_JUNCTION to return FEDFS_ERR_NOTJUNCT. That seems
closer in spirit than FEDFS_ERR_INVAL.

XXX: I need to check FEDFS_CREATE_JUNCTION and FEDFS_DELETE_JUNCTION
with crazy pathnames as well.

Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
---
 src/fedfsd/svc.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
diff mbox

Patch

diff --git a/src/fedfsd/svc.c b/src/fedfsd/svc.c
index c02daad..9198c69 100644
--- a/src/fedfsd/svc.c
+++ b/src/fedfsd/svc.c
@@ -888,9 +888,11 @@  fedfsd_svc_lookup_junction_1(SVCXPRT *xprt)
 	case FEDFS_ERR_EXIST:
 		break;
 	case FEDFS_OK:
-	case FEDFS_ERR_NOTJUNCT:
 		result.status = FEDFS_ERR_INVAL;
 		goto out;
+	case FEDFS_ERR_INVAL:
+		result.status = FEDFS_ERR_NOTJUNCT;
+		goto out;
 	default:
 		goto out;
 	}