Skip to content

Commit

Permalink
Merge branch 'stable/for-jens-3.18' of git://git.kernel.org/pub/scm/l…
Browse files Browse the repository at this point in the history
…inux/kernel/git/konrad/xen into for-3.18/drivers

Konrad writes:

This pull has two fixes and one cleanup. Nothing earthshattering.
  • Loading branch information
axboe committed Oct 1, 2014
2 parents baf3781 + 0f1ca65 commit 7b7b7f7
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 6 deletions.
1 change: 1 addition & 0 deletions drivers/block/xen-blkback/blkback.c
Original file line number Diff line number Diff line change
Expand Up @@ -763,6 +763,7 @@ static int xen_blkbk_map(struct xen_blkif *blkif,
BUG_ON(new_map_idx >= segs_to_map);
if (unlikely(map[new_map_idx].status != 0)) {
pr_debug(DRV_PFX "invalid buffer -- could not remap it\n");
put_free_pages(blkif, &pages[seg_idx]->page, 1);
pages[seg_idx]->handle = BLKBACK_INVALID_HANDLE;
ret |= 1;
goto next;
Expand Down
6 changes: 3 additions & 3 deletions drivers/block/xen-blkback/xenbus.c
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,9 @@ static int xen_blkif_disconnect(struct xen_blkif *blkif)
blkif->blk_rings.common.sring = NULL;
}

/* Remove all persistent grants and the cache of ballooned pages. */
xen_blkbk_free_caches(blkif);

return 0;
}

Expand All @@ -281,9 +284,6 @@ static void xen_blkif_free(struct xen_blkif *blkif)
xen_blkif_disconnect(blkif);
xen_vbd_free(&blkif->vbd);

/* Remove all persistent grants and the cache of ballooned pages. */
xen_blkbk_free_caches(blkif);

/* Make sure everything is drained before shutting down */
BUG_ON(blkif->persistent_gnt_c != 0);
BUG_ON(atomic_read(&blkif->persistent_gnt_in_use) != 0);
Expand Down
12 changes: 9 additions & 3 deletions drivers/block/xen-blkfront.c
Original file line number Diff line number Diff line change
Expand Up @@ -582,6 +582,14 @@ static inline void flush_requests(struct blkfront_info *info)
notify_remote_via_irq(info->irq);
}

static inline bool blkif_request_flush_valid(struct request *req,
struct blkfront_info *info)
{
return ((req->cmd_type != REQ_TYPE_FS) ||
((req->cmd_flags & (REQ_FLUSH | REQ_FUA)) &&
!info->flush_op));
}

/*
* do_blkif_request
* read a block; request is in a request queue
Expand All @@ -604,9 +612,7 @@ static void do_blkif_request(struct request_queue *rq)

blk_start_request(req);

if ((req->cmd_type != REQ_TYPE_FS) ||
((req->cmd_flags & (REQ_FLUSH | REQ_FUA)) &&
!info->flush_op)) {
if (blkif_request_flush_valid(req, info)) {
__blk_end_request_all(req, -EIO);
continue;
}
Expand Down

0 comments on commit 7b7b7f7

Please sign in to comment.