From mboxrd@z Thu Jan 1 00:00:00 1970 From: Paolo Bonzini Subject: Re: [PATCH V3 3/3] virtio-blk: Add bio-based IO path for virtio-blk Date: Sat, 28 Jul 2012 02:42:33 -0400 (EDT) Message-ID: <971756309.4742543.1343457753475.JavaMail.root@redhat.com> References: <501350B1.7080908@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <501350B1.7080908@redhat.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: virtualization-bounces@lists.linux-foundation.org Errors-To: virtualization-bounces@lists.linux-foundation.org To: Asias He Cc: kvm@vger.kernel.org, "Michael S. Tsirkin" , linux-kernel@vger.kernel.org, virtualization@lists.linux-foundation.org, Christoph Hellwig List-Id: virtualization@lists.linuxfoundation.org > > I'm not sure what the correct behavior for bio & cacheflush is, if > > any. > > REQ_FLUSH is not supported in the bio path. Ouch, that's correct: @@ -414,7 +529,7 @@ static void virtblk_update_cache_mode(struct virtio_device *vdev) u8 writeback = virtblk_get_cache_mode(vdev); struct virtio_blk *vblk = vdev->priv; - if (writeback) + if (writeback && !use_bio) blk_queue_flush(vblk->disk->queue, REQ_FLUSH); else blk_queue_flush(vblk->disk->queue, 0); then it is not safe against power losses. Paolo From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751709Ab2G1Gml (ORCPT ); Sat, 28 Jul 2012 02:42:41 -0400 Received: from mx3-phx2.redhat.com ([209.132.183.24]:53258 "EHLO mx3-phx2.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750785Ab2G1Gmk (ORCPT ); Sat, 28 Jul 2012 02:42:40 -0400 Date: Sat, 28 Jul 2012 02:42:33 -0400 (EDT) From: Paolo Bonzini To: Asias He Cc: kvm@vger.kernel.org, linux-kernel@vger.kernel.org, virtualization@lists.linux-foundation.org, "Michael S. Tsirkin" , Christoph Hellwig , Minchan Kim , Rusty Russell Message-ID: <971756309.4742543.1343457753475.JavaMail.root@redhat.com> In-Reply-To: <501350B1.7080908@redhat.com> Subject: Re: [PATCH V3 3/3] virtio-blk: Add bio-based IO path for virtio-blk MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Originating-IP: [93.34.189.113] X-Mailer: Zimbra 7.2.0_GA_2669 (ZimbraWebClient - FF3.0 (Linux)/7.2.0_GA_2669) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > > I'm not sure what the correct behavior for bio & cacheflush is, if > > any. > > REQ_FLUSH is not supported in the bio path. Ouch, that's correct: @@ -414,7 +529,7 @@ static void virtblk_update_cache_mode(struct virtio_device *vdev) u8 writeback = virtblk_get_cache_mode(vdev); struct virtio_blk *vblk = vdev->priv; - if (writeback) + if (writeback && !use_bio) blk_queue_flush(vblk->disk->queue, REQ_FLUSH); else blk_queue_flush(vblk->disk->queue, 0); then it is not safe against power losses. Paolo