diff options
author | Mariusz Tkaczyk <mariusz.tkaczyk@intel.com> | 2019-06-13 16:11:41 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2019-07-21 09:07:08 +0200 |
commit | 50e8a09f5521f7c5a030d67038d6b5a670858900 (patch) | |
tree | 841ecb9ba6d9aedd53a431b40d62bc553496f28c /drivers/net/ethernet/broadcom/bnx2x/bnx2x_dump.h | |
parent | 44aa12109c339399ac6c695ed54c04c50f549c9c (diff) |
md: fix for divide error in status_resync
[ Upstream commit 9642fa73d073527b0cbc337cc17a47d545d82cd2 ]
Stopping external metadata arrays during resync/recovery causes
retries, loop of interrupting and starting reconstruction, until it
hit at good moment to stop completely. While these retries
curr_mark_cnt can be small- especially on HDD drives, so subtraction
result can be smaller than 0. However it is casted to uint without
checking. As a result of it the status bar in /proc/mdstat while stopping
is strange (it jumps between 0% and 99%).
The real problem occurs here after commit 72deb455b5ec ("block: remove
CONFIG_LBDAF"). Sector_div() macro has been changed, now the
divisor is casted to uint32. For db = -8 the divisior(db/32-1) becomes 0.
Check if db value can be really counted and replace these macro by
div64_u64() inline.
Signed-off-by: Mariusz Tkaczyk <mariusz.tkaczyk@intel.com>
Signed-off-by: Song Liu <songliubraving@fb.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'drivers/net/ethernet/broadcom/bnx2x/bnx2x_dump.h')
0 files changed, 0 insertions, 0 deletions