From 72e775c7d9de3eaa35a6edaf9d87cedee149d0f5 Mon Sep 17 00:00:00 2001 From: Kevin Wolf Date: Tue, 15 Mar 2016 14:34:37 +0100 Subject: block: Always set writeback mode in blk_new_open() All callers of blk_new_open() either don't rely on the WCE bit set after blk_new_open() because they explicitly set it anyway, or they pass BDRV_O_CACHE_WB unconditionally. This patch changes blk_new_open() so that it always enables writeback mode and asserts that BDRV_O_CACHE_WB is clear. For those callers that used to pass BDRV_O_CACHE_WB unconditionally, the flag is removed now. Signed-off-by: Kevin Wolf Reviewed-by: Max Reitz --- block/qed.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'block/qed.c') diff --git a/block/qed.c b/block/qed.c index c1cc625d55..0af52741df 100644 --- a/block/qed.c +++ b/block/qed.c @@ -576,8 +576,7 @@ static int qed_create(const char *filename, uint32_t cluster_size, } blk = blk_new_open(filename, NULL, NULL, - BDRV_O_RDWR | BDRV_O_CACHE_WB | BDRV_O_PROTOCOL, - &local_err); + BDRV_O_RDWR | BDRV_O_PROTOCOL, &local_err); if (blk == NULL) { error_propagate(errp, local_err); return -EIO; -- cgit v1.2.3