Re: [PATCH] tune2fs: Update overhead when toggling journal feature
From: Jan Kara <jack@suse.cz>
Date: 2021-06-15 07:52:39
On Mon 14-06-21 15:38:57, Andreas Dilger wrote:
quoted
On Jun 14, 2021, at 3:28 PM, Jan Kara [off-list ref] 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@suse.cz>You could add: Fixes: 9046b4dfd0ce ("mke2fs: set overhead in super block") and Reviewed-by: Andreas Dilger <redacted>
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 [off-list ref] SUSE Labs, CR