Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

dm thin metadata: don't issue prefetches if a transaction abort has failed

If a transaction abort has failed then we can no longer use the metadata
device. Typically this happens if the superblock is unreadable.

This fix addresses a crash seen during metadata device failure testing.

Fixes: 8a01a6af75 ("dm thin: prefetch missing metadata pages")
Cc: stable@vger.kernel.org # 3.19+
Signed-off-by: Joe Thornber <ejt@redhat.com>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>

authored by

Joe Thornber and committed by
Mike Snitzer
2eae9e44 4df2bf46

+4 -1
+4 -1
drivers/md/dm-thin-metadata.c
··· 1981 1981 1982 1982 void dm_pool_issue_prefetches(struct dm_pool_metadata *pmd) 1983 1983 { 1984 - dm_tm_issue_prefetches(pmd->tm); 1984 + down_read(&pmd->root_lock); 1985 + if (!pmd->fail_io) 1986 + dm_tm_issue_prefetches(pmd->tm); 1987 + up_read(&pmd->root_lock); 1985 1988 }