From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755693AbbHGHnq (ORCPT ); Fri, 7 Aug 2015 03:43:46 -0400 Received: from bombadil.infradead.org ([198.137.202.9]:60721 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754773AbbHGHno (ORCPT ); Fri, 7 Aug 2015 03:43:44 -0400 Date: Fri, 7 Aug 2015 00:43:42 -0700 From: Christoph Hellwig To: Ming Lei Cc: Jens Axboe , linux-kernel@vger.kernel.org, Dave Kleikamp , Zach Brown , Christoph Hellwig , Maxim Patlasov , Andrew Morton , Alexander Viro , Tejun Heo , Dave Chinner Subject: Re: [PATCH v9 6/6] block: loop: support DIO & AIO Message-ID: <20150807074342.GA30547@infradead.org> References: <1438850538-15682-1-git-send-email-ming.lei@canonical.com> <1438850538-15682-7-git-send-email-ming.lei@canonical.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1438850538-15682-7-git-send-email-ming.lei@canonical.com> User-Agent: Mutt/1.5.23 (2014-03-12) X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org See http://www.infradead.org/rpr.html Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org I really disagree with the per-cmd use_dio tracking. If we know at setup time that the loop device sector size is smaller than the sector size of the underlying device we should never allow dio, and othewise it should always work for data. The ->transfer check also is one to be done at setup time, and there is no need for draining or mode checking for an fsync - FLUSH is always only guranteed to flush out I/O that has completed by the time it's issued.