aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/block/xen-blkfront.c
diff options
context:
space:
mode:
authorBob Liu <bob.liu@oracle.com>2015-07-22 02:40:09 -0400
committerKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>2015-07-24 09:09:16 -0400
commit7b0767502b5db11cb1f0daef2d01f6d71b1192dc (patch)
tree602757756fa51dbe32b67fbd584495ab58edb69c /drivers/block/xen-blkfront.c
parentd50babbe300eedf33ea5b00a12c5df3a05bd96c7 (diff)
xen-blkfront: don't add indirect pages to list when !feature_persistent
We should consider info->feature_persistent when adding indirect page to list info->indirect_pages, else the BUG_ON() in blkif_free() would be triggered. When we are using persistent grants the indirect_pages list should always be empty because blkfront has pre-allocated enough persistent pages to fill all requests on the ring. CC: stable@vger.kernel.org Acked-by: Roger Pau Monné <roger.pau@citrix.com> Signed-off-by: Bob Liu <bob.liu@oracle.com> Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Diffstat (limited to 'drivers/block/xen-blkfront.c')
-rw-r--r--drivers/block/xen-blkfront.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/block/xen-blkfront.c b/drivers/block/xen-blkfront.c
index f45f4e67c5d4..44b33d39441b 100644
--- a/drivers/block/xen-blkfront.c
+++ b/drivers/block/xen-blkfront.c
@@ -1135,8 +1135,10 @@ static void blkif_completion(struct blk_shadow *s, struct blkfront_info *info,
1135 * Add the used indirect page back to the list of 1135 * Add the used indirect page back to the list of
1136 * available pages for indirect grefs. 1136 * available pages for indirect grefs.
1137 */ 1137 */
1138 indirect_page = pfn_to_page(s->indirect_grants[i]->pfn); 1138 if (!info->feature_persistent) {
1139 list_add(&indirect_page->lru, &info->indirect_pages); 1139 indirect_page = pfn_to_page(s->indirect_grants[i]->pfn);
1140 list_add(&indirect_page->lru, &info->indirect_pages);
1141 }
1140 s->indirect_grants[i]->gref = GRANT_INVALID_REF; 1142 s->indirect_grants[i]->gref = GRANT_INVALID_REF;
1141 list_add_tail(&s->indirect_grants[i]->node, &info->grants); 1143 list_add_tail(&s->indirect_grants[i]->node, &info->grants);
1142 } 1144 }