From 33d1a2fc8809cc8aec42cd4c5330c9a27f0f32f8 Mon Sep 17 00:00:00 2001 From: Josh Durgin Date: Sat, 30 Mar 2013 17:28:35 -0700 Subject: [PATCH] librbd: return -ENOENT from diff_iterate when the snap doesn't exist This is a bit more helpful than -EINVAL. Signed-off-by: Josh Durgin --- src/librbd/internal.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/librbd/internal.cc b/src/librbd/internal.cc index 49573966f8ba3..939a485587bb1 100644 --- a/src/librbd/internal.cc +++ b/src/librbd/internal.cc @@ -2315,7 +2315,7 @@ reprotect_and_return_err: ictx->snap_lock.put_read(); ictx->md_lock.put_read(); if (from_snap_id == CEPH_NOSNAP) { - return -EINVAL; + return -ENOENT; } if (from_snap_id == end_snap_id) { // no diff. -- 2.39.5