HomeFreeBSD

fix: Shift exponent too large

Description

fix: Shift exponent too large

Undefined operation is reported by running ztest (or zloop) compiled with GCC
UndefinedBehaviorSanitizer. Error only happens on top level of dnode indirection
with large enough offset values. Logically, left shift operation would work,
but bit shift semantics in C, and limitation of uint64_t, do not produce desired
result.

Issue #5059, #4883

Signed-off-by: Gvozden Neskovic <neskovic@gmail.com>

Details

Provenance
Gvozden Neskovic <neskovic@gmail.com>Authored on Aug 31 2016, 8:12 AM
Brian Behlendorf <behlendorf1@llnl.gov>Committed on Sep 29 2016, 10:55 PM
Parents
rG0b78aeae9278: Fix coverity defects: CID 147443, 147656, 147655, 147441, 147653
Branches
Unknown
Tags
Unknown