fsx/fsstress: round blocksize properly
authorDarrick J. Wong <djwong@kernel.org>
Wed, 19 May 2021 23:57:04 +0000 (16:57 -0700)
committerEryu Guan <guaneryu@gmail.com>
Sun, 23 May 2021 13:31:24 +0000 (21:31 +0800)
commit0049872c9acc28f5df30090346805b47d41b8343
tree02f0c99f6409dadcfd67e251bbb9d84cb0be17a9
parentb77d5dab83798fd80ca2fe93df39d23a09e67eda
fsx/fsstress: round blocksize properly

The block sizes reported by stat and DIOINFO aren't required to be
powers of two.  This can happen on an XFS filesystem with a realtime
extent size that isn't a power of two; on such filesystems, certain IO
calls will fail due to alignment issues.  Fix that by providing rounding
helpers that work for all sizes.

Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
ltp/fsstress.c
ltp/fsx.c
src/global.h