In choose_target_mds, the mds number is initialized to 0 and
then a separate target mds number is chosen based on the inode
set in the request. If the inode isn't set, we drop to choosing
a random mds, but only if the mds number is < 0, which doesn't
happen with the initialize to 0. This fix initializes the mds
number to -1, ensuring a random mds is chosen.
Signed-off-by: Sam Lang <sam.lang@inktank.com>
int Client::choose_target_mds(MetaRequest *req)
{
- int mds = 0;
+ int mds = -1;
__u32 hash = 0;
bool is_hash = false;