Whamcloud - gitweb
LU-18924 hsm: fix the crash cause by huge max_requests
authorEmoly Liu <emoly@whamcloud.com>
Mon, 26 May 2025 08:31:41 +0000 (16:31 +0800)
committerOleg Drokin <green@linuxhacker.ru>
Tue, 17 Jun 2025 05:02:48 +0000 (01:02 -0400)
commit30c0ddcaf8e13ed3f3eef180b34df68c50f0ffef
treec42c70609c39a2de1c91ee61515a5ffdc9a87240
parent2a66df6c11bbea7bdbb9e10274fc2a44f8a621c9
LU-18924 hsm: fix the crash cause by huge max_requests

Some variables in function mdt_coordinator() should be unsigned
type to avoid memory allocation crash caused by huge parameter
mdt.*.hsm.max_requests.

To avoid such a failure earlier, the sum of MDT max_requests is
limited to 1/8 of total memory.
If it is bigger than this limit, it will be recalculated by this
limit and a useful warning message with memory information and
the limit will be printed.

Also, sanity-hsm.sh test_40 is modified to verify this patch and
stack_trap is added to test_50 and test_100 to restore the default
max_requests value correctly.

Test-Parameters: testlist=sanity-hsm env=ONLY=40,ONLY_REPEAT=20
Test-Parameters: testlist=sanity-hsm
Signed-off-by: Emoly Liu <emoly@whamcloud.com>
Signed-off-by: Etienne AUJAMES <eaujames@ddn.com>
Change-Id: I3f6f9722c2af34a4632dc1620ad191774b8ed403
lustre/mdt/mdt_coordinator.c
lustre/tests/sanity-hsm.sh
lustre/tests/test-framework.sh