On Mon 14-06-21 15:38:57, Andreas Dilger wrote: > > > On Jun 14, 2021, at 3:28 PM, Jan Kara <jack@xxxxxxx> wrote: > > > > When adding or removing journal from a filesystem, we also need to add / > > remove journal blocks from overhead stored in the superblock. Otherwise > > total number of blocks in the filesystem as reported by statfs(2) need > > not match reality and could lead to odd results like negative number of > > used blocks reported by df(1). > > > > Signed-off-by: Jan Kara <jack@xxxxxxx> > > You could add: > > Fixes: 9046b4dfd0ce ("mke2fs: set overhead in super block") > > and > > Reviewed-by: Andreas Dilger <adilger@xxxxxxxxx> Thanks! > That also makes me wonder if resize2fs also needs to recalculate or > invalidate the s_overhead_clusters field when adding new block groups. > It *looks* like that is done correctly in adjust_fs_info() already? Yes. From a quick look I had when doing this tune2fs patch I've noticed that adjust_fs_info() just zeros s_overhead_clusters which makes the kernel compute the overhead instead... Honza -- Jan Kara <jack@xxxxxxxx> SUSE Labs, CR