You've already forked linux-apfs
mirror of
https://github.com/linux-apfs/linux-apfs.git
synced 2026-05-01 15:00:59 -07:00
dm thin: avoid metadata commit if a pool's thin devices haven't changed
Commit 905e51b ("dm thin: commit outstanding data every second")
introduced a periodic commit. This commit occurs regardless of whether
any thin devices have made changes.
Fix the periodic commit to check if any of a pool's thin devices have
changed using dm_pool_changed_this_transaction().
Reported-by: Alexander Larsson <alexl@redhat.com>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Acked-by: Joe Thornber <ejt@redhat.com>
Cc: stable@vger.kernel.org
This commit is contained in:
@@ -1489,6 +1489,23 @@ bool dm_thin_changed_this_transaction(struct dm_thin_device *td)
|
||||
return r;
|
||||
}
|
||||
|
||||
bool dm_pool_changed_this_transaction(struct dm_pool_metadata *pmd)
|
||||
{
|
||||
bool r = false;
|
||||
struct dm_thin_device *td, *tmp;
|
||||
|
||||
down_read(&pmd->root_lock);
|
||||
list_for_each_entry_safe(td, tmp, &pmd->thin_devices, list) {
|
||||
if (td->changed) {
|
||||
r = td->changed;
|
||||
break;
|
||||
}
|
||||
}
|
||||
up_read(&pmd->root_lock);
|
||||
|
||||
return r;
|
||||
}
|
||||
|
||||
bool dm_thin_aborted_changes(struct dm_thin_device *td)
|
||||
{
|
||||
bool r;
|
||||
|
||||
Reference in New Issue
Block a user