]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/commit - net/ceph/osdmap.c
libceph: fixup error handling in osdmap_decode()
authorIlya Dryomov <ilya.dryomov@inktank.com>
Thu, 13 Mar 2014 14:36:14 +0000 (16:36 +0200)
committerSage Weil <sage@inktank.com>
Sat, 5 Apr 2014 04:07:38 +0000 (21:07 -0700)
commit597b52f6ca247086371abd67e5083292a500e736
tree15a2b0ca2d8a8f7ef8328d3803bba173d869aff0
parenta2505d63ee0541d9b4685250b033192e68222e97
libceph: fixup error handling in osdmap_decode()

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.  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