Commit fb7415f2 authored by Bruce Johnston's avatar Bruce Johnston Committed by Mikulas Patocka
Browse files

dm vdo: use GFP_NOIO for blkdev_issue_zeroout on format path



GFP_NOWAIT is inappropriate when blkdev_issue_zeroout may sleep and
bio_alloc can fail under pressure; use GFP_NOIO for clear_partition and
vdo_clear_layout zeroout calls.

Signed-off-by: default avatarBruce Johnston <bjohnsto@redhat.com>
Signed-off-by: default avatarMatthew Sakai <msakai@redhat.com>
Signed-off-by: default avatarMikulas Patocka <mpatocka@redhat.com>
Fixes: fc1d4382 ("dm vdo: save the formatted metadata to disk")
parent 8c0ee19d
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -965,7 +965,7 @@ static int __must_check clear_partition(struct vdo *vdo, enum partition_id id)
	return blkdev_issue_zeroout(vdo_get_backing_device(vdo),
				    partition->offset * VDO_SECTORS_PER_BLOCK,
				    partition->count * VDO_SECTORS_PER_BLOCK,
				    GFP_NOWAIT, 0);
				    GFP_NOIO, 0);
}

int vdo_clear_layout(struct vdo *vdo)
@@ -976,7 +976,7 @@ int vdo_clear_layout(struct vdo *vdo)
	result = blkdev_issue_zeroout(vdo_get_backing_device(vdo),
				      VDO_SECTORS_PER_BLOCK,
				      VDO_SECTORS_PER_BLOCK,
				      GFP_NOWAIT, 0);
				      GFP_NOIO, 0);
	if (result != VDO_SUCCESS)
		return result;