[lvc-project] [PATCH 2/2] ocfs2: validate cl_bpc in allocator inodes to prevent divide-by-zero

Deepanshu Kartikey kartikey406 at gmail.com
Wed Oct 29 18:02:03 MSK 2025


Hi Dmitry,

Thank you for catching this issue! Since this validation was originally my
contribution, I'd like to help fix it.

To debug this properly, I need some information:

1. When you run `mkfs.ocfs2 -b 512`, what value does it actually write
   for cl_bpc on disk? The error shows "bits per cluster 1" but our
   calculation expects 8 (4096/512). Is the on-disk value really 1, or
   is there something wrong with how we're reading it?

2. Could you share the complete error output with the expected value?
   The current message only shows the on-disk value, but it would help
   to see what our calculation produced.

3. For reference, what are the cluster size and block size settings
   being used in your test? (e.g., 4KB clusters with 512-byte blocks?)

4. Do you have access to the filesystem image or can dump the on-disk
   structures with debugfs.ocfs2?

I suspect either:
- Our calculation is wrong for non-4KB block sizes
- The cl_bpc field is stored/interpreted differently than we think
- We need to validate differently (range check vs exact match)

I'd like to investigate this and send a fix. Let me know what additional
information you have, or I can create test filesystems with different
block sizes and debug it myself.

Thanks,
Deepanshu



More information about the lvc-project mailing list