diff mbox series

ceph: decoding error in ceph_update_snap_realm should return -EIO

Message ID 20210603133914.79072-1-jlayton@kernel.org
State New
Headers show
Series ceph: decoding error in ceph_update_snap_realm should return -EIO | expand

Commit Message

Jeff Layton June 3, 2021, 1:39 p.m. UTC
Currently ceph_update_snap_realm returns -EINVAL when it hits a decoding
error, which is the wrong error code. -EINVAL implies that the user gave
us a bogus argument to a syscall or something similar. -EIO is more
descriptive when we hit a decoding error.

Signed-off-by: Jeff Layton <jlayton@kernel.org>
---
 fs/ceph/snap.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/fs/ceph/snap.c b/fs/ceph/snap.c
index d07c1c6ac8fb..f8cac2abab3f 100644
--- a/fs/ceph/snap.c
+++ b/fs/ceph/snap.c
@@ -807,7 +807,7 @@  int ceph_update_snap_trace(struct ceph_mds_client *mdsc,
 	return 0;
 
 bad:
-	err = -EINVAL;
+	err = -EIO;
 fail:
 	if (realm && !IS_ERR(realm))
 		ceph_put_snap_realm(mdsc, realm);