Whamcloud - gitweb
e2fsck: declare the size of bh->b_data to be 4096 in jfs_user.h
authorTheodore Ts'o <tytso@mit.edu>
Wed, 27 Jan 2021 21:41:05 +0000 (16:41 -0500)
committerTheodore Ts'o <tytso@mit.edu>
Wed, 27 Jan 2021 21:41:05 +0000 (16:41 -0500)
When allocating buffer_heads in e2fsck and debugfs the actual size of
the memory which is requested is based on the file system block size.
So the actual size of b_data in struct buffer_head doesn't actually
matter, except that it can triggers a UBSAN error when running the
e2fsck regression test.  So change it to be 4096 to avoid this false
positive.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
e2fsck/jfs_user.h

index a1c6951..f073355 100644 (file)
@@ -51,7 +51,7 @@ struct buffer_head {
        unsigned int    b_dirty:1;
        unsigned int    b_uptodate:1;
        unsigned long long b_blocknr;
-       char            b_data[1024];
+       char            b_data[4096];
 };
 
 struct inode {