Josh Durgin da6a6b6397 rbd: fix error handling from rbd_snap_name()
rbd_snap_name() calls rbd_dev_v{1,2}_snap_name() depending on the
format of the image. The format 1 version returns NULL on error, which
is handled by the caller. The format 2 version returns an ERR_PTR,
which the caller of rbd_snap_name() does not expect.

Fortunately this is unlikely to occur in practice because
rbd_snap_id_by_name() is called before rbd_snap_name(). This would hit
similar errors to rbd_snap_name() (like the snapshot not existing) and
return early, so rbd_snap_name() would not hit an error unless the
snapshot was removed between the two calls or memory was exhausted.

Use an ERR_PTR in rbd_dev_v1_snap_name() so that the specific error
can be propagated, and it is consistent with rbd_dev_v2_snap_name().
Handle the ERR_PTR in the only rbd_snap_name() caller.

Suggested-by: Alex Elder <alex.elder@linaro.org>
Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
Reviewed-by: Alex Elder <elder@linaro.org>
2013-09-09 11:16:44 -07:00
..
2013-08-20 08:38:23 -04:00
2013-07-02 14:23:01 -07:00
2013-07-23 16:01:28 -07:00
2013-07-10 14:46:40 -07:00
2013-07-26 11:36:12 -07:00
2013-07-02 11:44:19 -07:00
2013-08-07 21:57:17 +02:00
2013-07-22 09:34:46 +08:00
2013-07-24 16:36:41 -06:00
2013-07-23 14:38:20 -07:00
2013-08-09 11:52:34 -07:00
2013-07-10 14:50:58 -07:00
2013-08-21 16:38:33 -07:00