@@ -2319,6 +2319,7 @@ static int ocfs2_verify_volume(struct ocfs2_dinode *di,
2319
2319
struct ocfs2_blockcheck_stats * stats )
2320
2320
{
2321
2321
int status = - EAGAIN ;
2322
+ u32 blksz_bits ;
2322
2323
2323
2324
if (memcmp (di -> i_signature , OCFS2_SUPER_BLOCK_SIGNATURE ,
2324
2325
strlen (OCFS2_SUPER_BLOCK_SIGNATURE )) == 0 ) {
@@ -2333,11 +2334,15 @@ static int ocfs2_verify_volume(struct ocfs2_dinode *di,
2333
2334
goto out ;
2334
2335
}
2335
2336
status = - EINVAL ;
2336
- if ((1 << le32_to_cpu (di -> id2 .i_super .s_blocksize_bits )) != blksz ) {
2337
+ /* Acceptable block sizes are 512 bytes, 1K, 2K and 4K. */
2338
+ blksz_bits = le32_to_cpu (di -> id2 .i_super .s_blocksize_bits );
2339
+ if (blksz_bits < 9 || blksz_bits > 12 ) {
2337
2340
mlog (ML_ERROR , "found superblock with incorrect block "
2338
- "size: found %u, should be %u\n" ,
2339
- 1 << le32_to_cpu (di -> id2 .i_super .s_blocksize_bits ),
2340
- blksz );
2341
+ "size bits: found %u, should be 9, 10, 11, or 12\n" ,
2342
+ blksz_bits );
2343
+ } else if ((1 << le32_to_cpu (blksz_bits )) != blksz ) {
2344
+ mlog (ML_ERROR , "found superblock with incorrect block "
2345
+ "size: found %u, should be %u\n" , 1 << blksz_bits , blksz );
2341
2346
} else if (le16_to_cpu (di -> id2 .i_super .s_major_rev_level ) !=
2342
2347
OCFS2_MAJOR_REV_LEVEL ||
2343
2348
le16_to_cpu (di -> id2 .i_super .s_minor_rev_level ) !=
0 commit comments