zbd: handle conventional start zone in zbd_convert_to_open_zone()
authorDmitry Fomichev <dmitry.fomichev@wdc.com>
Wed, 27 Jan 2021 04:19:25 +0000 (13:19 +0900)
committerJens Axboe <axboe@kernel.dk>
Fri, 29 Jan 2021 15:14:00 +0000 (08:14 -0700)
commit1435114818c399ebe2a8216acbc4c80b3136d676
treefd3a5538c5ae2525d097ac2f3b93eaa3329b558f
parent9fc5c3fd1ba59faa04458fd87d3ee92493bde357
zbd: handle conventional start zone in zbd_convert_to_open_zone()

At the beginning of zbd_convert_to_open_zone() function, a zone
is picked in semi-random manner to become a candidate zone for
redirecting the incoming write. In some circumstances, such as
unlimited MaxOpen or i/o range that spans the boundary between
conventional and sequential zones, a conventional zone may be
selected.

This may create problems in the subsequent for (;;) loop in the
same function. Failed assertions were observed during the execution
of newly introduced test #51 that showed that the code in that loop
was trying to lock and unlock conventional zones.

Check if the zone which has been initially picked is conventional.
If yes, force the zone selection to be re-tried until a sequential
zone is selected for further processing.

Signed-off-by: Dmitry Fomichev <dmitry.fomichev@wdc.com>
Reviewed-by: Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
zbd.c