]> git.apps.os.sepia.ceph.com Git - ceph.git/commit
cephfs: Fixes for coverity bugs 716840 and 716970
authorSam Lang <sam.lang@inktank.com>
Tue, 25 Sep 2012 14:03:57 +0000 (07:03 -0700)
committerSage Weil <sage@inktank.com>
Wed, 26 Sep 2012 23:44:47 +0000 (16:44 -0700)
commitbc45cded3f4dc3855358126c64cc94f2a1f249c5
tree27d63749a9bc1c1f91eeb49c75c0056858fb07ee
parent3ca3cd4c6cd6b96ed4b207196ea3a3f3b95bc1fe
cephfs:  Fixes for coverity bugs 716840 and 716970

Fixes for two coverity bugs in cephfs.cc.

716840 (CHECKED_RETURN) reported that the return value from
fstat wasn't getting checked.  It now is checked, reports an
error and returns to the caller.

716970 (NEGATIVE_RETURNS) reported that the file descriptor passed
to fstat (*fd) might be negative, which isn't allowed.  The check at
the top that open failed wasn't aborting the function (when *fd < 0),
now it does.

Signed-off-by: Sam Lang <sam.lang@inktank.com>
src/cephfs.cc