]> git.baikalelectronics.ru Git - kernel.git/commit
libceph: fixup error handling in osdmap_apply_incremental()
authorIlya Dryomov <ilya.dryomov@inktank.com>
Thu, 13 Mar 2014 14:36:15 +0000 (16:36 +0200)
committerSage Weil <sage@inktank.com>
Sat, 5 Apr 2014 04:07:44 +0000 (21:07 -0700)
commitd0b15e88d3e32c5a4f0452c2f113d4210eca2f31
tree3ac1c58709b0aba00d2acb15ef17bc49ff630cf8
parentdb56bb88452027f11acf37f31e6c65e44eae19a6
libceph: fixup error handling in osdmap_apply_incremental()

The existing error handling scheme requires resetting err to -EINVAL
prior to calling any ceph_decode_* macro.  This is ugly and fragile,
and there already are a few places where we would return 0 on error,
due to a missing reset.  Follow osdmap_decode() and fix this by adding
a special e_inval label to be used by all ceph_decode_* macros.

Signed-off-by: Ilya Dryomov <ilya.dryomov@inktank.com>
Reviewed-by: Alex Elder <elder@linaro.org>
net/ceph/osdmap.c