Skip to content

Commit 2eae9e4

Browse files
jthornbersnitm
authored andcommitted
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: 8a01a6a ("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>
1 parent 4df2bf4 commit 2eae9e4

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

drivers/md/dm-thin-metadata.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1981,5 +1981,8 @@ bool dm_pool_metadata_needs_check(struct dm_pool_metadata *pmd)
19811981

19821982
void dm_pool_issue_prefetches(struct dm_pool_metadata *pmd)
19831983
{
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);
19851988
}

0 commit comments

Comments
 (0)