ext4: add periodic superblock update check
authorVitaliy Kuznetsov <vk.en.mail@gmail.com>
Thu, 10 Aug 2023 14:38:52 +0000 (18:38 +0400)
committerTheodore Ts'o <tytso@mit.edu>
Sun, 27 Aug 2023 15:27:12 +0000 (11:27 -0400)
commitff0722de896eb278fca193888d22278c28f2782c
treeb8460e965761c1ac1f1abd3525bfe317b79778af
parent194505b55dd7899da114a4d47825204eefc0fff5
ext4: add periodic superblock update check

This patch introduces a mechanism to periodically check and update
the superblock within the ext4 file system. The main purpose of this
patch is to keep the disk superblock up to date. The update will be
performed if more than one hour has passed since the last update, and
if more than 16MB of data have been written to disk.

This check and update is performed within the ext4_journal_commit_callback
function, ensuring that the superblock is written while the disk is
active, rather than based on a timer that may trigger during disk idle
periods.

Discussion https://www.spinics.net/lists/linux-ext4/msg85865.html

Signed-off-by: Vitaliy Kuznetsov <vk.en.mail@gmail.com>
Link: https://lore.kernel.org/r/20230810143852.40228-1-vk.en.mail@gmail.com
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
fs/ext4/super.c