mon/OSDMonitor: Make the pg_num check more accurate
In check_pg_num function, finding the corresponding osd according to the
current pool's crush rule, and calculating whether the average value of
pg_num on these osd will exceed the value of 'mon_max_pg_per_osd'. Make
the pg_num check more accurate by counting all the pgs on the osd used
by the new pool.
Fixes: https://tracker.ceph.com/issues/47062
Signed-off-by: Jerry Luo <luojierui@chinatelecom.cn>
Note: This commit has been reverted and is cherry-picked as
dependency for other commits in this backport.
(cherry picked from commit
c726ce9e5088b30d29e0db5c0ecc8c03fe41da1d)