From mboxrd@z Thu Jan 1 00:00:00 1970 From: Asias He Subject: Re: [PATCH V3 3/3] virtio-blk: Add bio-based IO path for virtio-blk Date: Mon, 30 Jul 2012 12:43:12 +0800 Message-ID: <501610E0.8000504@redhat.com> References: <971756309.4742543.1343457753475.JavaMail.root@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; Format="flowed" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <971756309.4742543.1343457753475.JavaMail.root@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: Paolo Bonzini 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 On 07/28/2012 02:42 PM, Paolo Bonzini wrote: >>> 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. Yes. Something like this: qemu -drive file=foo.img,cache=writeback/unsafe is not safe against power losses also? I think we can add REQ_FLUSH & REQ_FUA support to bio path and that deserves another patch. -- Asias