Whamcloud - gitweb
LU-17770 quota: don't panic in qmt_map_lge_idx 76/55476/6
authorSergey Cheremencev <scherementsev@ddn.com>
Mon, 15 Apr 2024 20:35:56 +0000 (23:35 +0300)
committerOleg Drokin <green@whamcloud.com>
Mon, 2 Dec 2024 05:45:49 +0000 (05:45 +0000)
commit1f9689d0f92e8a8cdfe162ea0e56b9bed2c9f6d2
tree1911d14cfe0b3458d22ba3cbe067cf47283b018c
parent2c7e62340dc65fc9e8047a11c738a05e9e4fc416
LU-17770 quota: don't panic in qmt_map_lge_idx

There is a valid case when it is impossible to
map OST index into an appropriate index of lqe global
array(lqe_gblb_array). This might happen when newly
added OSTs haven't connected yet to QMT and there is
no corresponding index files in quota_master/dt-0x0
directory. At the same time if these OSTs already
exist in OST pools, this might cause following panic:

    qmt_map_lge_idx()) ASSERTION( k < lgd->lqeg_num_used )
        failed: Cannot map ostidx 32 for 000000000505fcbe
    qmt_map_lge_idx()) LBUG
    ...
    Call Trace TBD:
    libcfs_call_trace+0x6f/0xa0 [libcfs]
    lbug_with_loc+0x3f/0x70 [libcfs]
    qmt_map_lge_idx+0x7f/0x90 [lquota]
    qmt_seed_glbe_all+0x17f/0x770 [lquota]
    qmt_revalidate_lqes+0x213/0x360 [lquota]
    qmt_dqacq0+0x7d5/0x2320 [lquota]
    qmt_intent_policy+0x8d2/0xf10 [lquota]
    mdt_intent_opc+0x9a9/0xa80 [mdt]
    mdt_intent_policy+0x1fd/0x390 [mdt]
    ldlm_lock_enqueue+0x469/0xa90 [ptlrpc]
    ldlm_handle_enqueue0+0x61a/0x16c0 [ptlrpc]
    tgt_enqueue+0xa4/0x200 [ptlrpc]
    tgt_request_handle+0xc9c/0x1950 [ptlrpc]
    ptlrpc_server_handle_request+0x323/0xbd0 [ptlrpc]
    ptlrpc_main+0xbf1/0x1510 [ptlrpc]
    kthread+0x134/0x150
    ret_from_fork+0x1f/0x40
    Kernel panic - not syncing: LBUG

Add sanity-quota_91. It removes and creates quota slave
index files in quota_master/dt-0x0 to simulate adding
new OSTs in a system.

Signed-off-by: Sergey Cheremencev <scherementsev@ddn.com>
Change-Id: I747366af736d408a8965812b48660cca1367becb
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/55476
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Alexander Boyko <alexander.boyko@hpe.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/quota/qmt_entry.c
lustre/quota/qmt_lock.c
lustre/tests/sanity-quota.sh
lustre/tests/test-framework.sh