[LU-10837] no bitmap check if block bitmap is uninitialized Created: 22/Mar/18  Updated: 20/Jul/18  Resolved: 09/Apr/18

Status: Resolved
Project: Lustre
Component/s: None
Affects Version/s: None
Fix Version/s: Lustre 2.12.0, Lustre 2.10.4

Type: Bug Priority: Minor
Reporter: Wang Shilong (Inactive) Assignee: Wang Shilong (Inactive)
Resolution: Fixed Votes: 0
Labels: patch

Issue Links:
Duplicate
Related
is related to LU-9410 on-disk bitmap corrupted Resolved
Severity: 3
Rank (Obsolete): 9223372036854775807

 Description   

Following commit:

LU-9410 ldiskfs: no check mb bitmap if flex_bg enabled

Tried to expose a problem that we should be careful with block bitmap uninitialized.

However, it only tried to skip 0 in @free_gdp, at some customer site, we observed

cases

Mar 13 13:59:29 oss2c105 kernel: LDISKFS-fs error (device sfa0002): ldiskfs_mb_check_ondisk_bitmap:3605: comm ll_ost_io01_057: on-disk bitmap for group 420934corrupted: 32768 blocks free in bitmap, 559 - in gd\x0a
Mar 13 13:59:29 oss2c105 kernel: LDISKFS-fs error (device sfa0002): ldiskfs_mb_check_ondisk_bitmap:3605: comm ll_ost_io00_056: on-disk bitmap for group 420938corrupted: 32768 blocks free in bitmap, 680 - in gd\x0a

And also, I did a very simple reformat and tried to dumpe2fs OST:

...

Group 158: (Blocks 5177344-5210111) [INODE_UNINIT, BLOCK_UNINIT, ITABLE_ZEROED]

  Checksum 0x0617, unused inodes 1920

  Block bitmap at 1182 (bg #0 + 1182), Inode bitmap at 1342 (bg #0 + 1342)

  Inode table at 40512-40751 (bg #1 + 7744)

  32768 free blocks, 1920 free inodes, 0 directories, 1920 unused inodes

  Free blocks: 5177344-5210111

  Free inodes: 303361-305280

Group 159: (Blocks 5210112-5242

....

With more check, I did not see any 0 counters...

See comments in ext4_free_clusters_after_init:

    /* Return the number of free blocks in a block group.  It is used when

     * the block bitmap is uninitialized, so we can't just count the bits

     * in the bitmap. */

    So extra check we enhanced here is wrong if this block group

    bitmap is uninitialized, since we only check bitmaps here.

 

    Further, Looking at EXT4_BG_BLOCK_UNINIT clear codes, Kernel

    will reinit free_clusters_count when tried to clear the flag, so

    extra check for uninited block bitmaps dosen't make much sense.

 

    Let's skip uninited block bitmap check if EXT4_BG_BLOCK_UNINIT

    is set, whatever free count group desc recorded is untrustable somehow.



 Comments   
Comment by Gerrit Updater [ 22/Mar/18 ]

Wang Shilong (wshilong@ddn.com) uploaded a new patch: https://review.whamcloud.com/31720
Subject: LU-10837 ldiskfs: skip bitmap check if block bitmap is uninitialized
Project: fs/lustre-release
Branch: master
Current Patch Set: 1
Commit: 6866d433d5c23f7e33c8512df041a2aa7a1c49fc

Comment by Peter Jones [ 22/Mar/18 ]

Thanks wangshilong

 

Comment by Gerrit Updater [ 09/Apr/18 ]

Oleg Drokin (oleg.drokin@intel.com) merged in patch https://review.whamcloud.com/31720/
Subject: LU-10837 ldiskfs: skip bitmap check if block bitmap is uninitialized
Project: fs/lustre-release
Branch: master
Current Patch Set:
Commit: f7672143843a86656eaed5b9a8b89ce171b99d7a

Comment by Peter Jones [ 09/Apr/18 ]

Landed for 2.12

Comment by Gerrit Updater [ 11/Apr/18 ]

Minh Diep (minh.diep@intel.com) uploaded a new patch: https://review.whamcloud.com/31957
Subject: LU-10837 ldiskfs: skip bitmap check if block bitmap is uninitialized
Project: fs/lustre-release
Branch: b2_10
Current Patch Set: 1
Commit: 4e96eeafaf124d301db118286188a7add34d1b68

Comment by Gerrit Updater [ 03/May/18 ]

John L. Hammond (john.hammond@intel.com) merged in patch https://review.whamcloud.com/31957/
Subject: LU-10837 ldiskfs: skip bitmap check if block bitmap is uninitialized
Project: fs/lustre-release
Branch: b2_10
Current Patch Set:
Commit: 94fb83d93880e678d9396fa380e71fc3447ed0af

Generated at Sat Feb 10 02:38:37 UTC 2024 using Jira 9.4.14#940014-sha1:734e6822bbf0d45eff9af51f82432957f73aa32c.