Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp906916ybl; Fri, 30 Aug 2019 08:51:44 -0700 (PDT) X-Google-Smtp-Source: APXvYqyOqUXMYQzY/3L0te+eq7qu7G2RHuHBzXT4jIj8UvAqEl0vIviA1T9AdqvKXll06Gb5TUQv X-Received: by 2002:a17:90a:17ab:: with SMTP id q40mr16662953pja.106.1567180304047; Fri, 30 Aug 2019 08:51:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567180304; cv=none; d=google.com; s=arc-20160816; b=o58b1Ft4oQe/fVyB9RBjhwaDeANR+SPncRvjDQYOjhWseJxoa4B14de9voQWfJyNRO aAvPkuaMR4G5gU/vdJiJ9hZHj7JLxKxtmhm+j880iiHiY+gbwiaG8GY+9tPAibSVAufm G1Rz4eb8BIr/+l8beRS0ISf/vw5WO9cLW/Jolgn2HXt4hPSme9TKergtyrduIai+sQj0 0dLBZhLbBNInsBJh6HqGNUiRk+UXlSHp2LM/oRJoVJCtQ9nYnhiT4Brr/bP9C2hBRNAj NhRV+73R5mvQiq/9LyHlBoIIbWzMLvG9f+Z12YZvBDURKGYDdbxvNu7Ug4ZSC4i04dFA /pJg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=jKLZ9AV4Cad35GVTWRj4qMk4Kj0vjxf5uuMYmkOMgQM=; b=awlQIlOp4kJddc1+7++10aAFJ7vCPrNstkjFn5w5YYZKYqev1ONMmnFumUtDWooJHh pCs3SWOryQwUX+qBOBfiarTKqfm4qyhtPFMQIkJrVxZKVLlFJT6+i2kUw5KBvdyNvBf+ Jw8SwvMLXydeMUo5iNMAYRm9k/TnfjLLkYEIwgAsutfjwdtgF/iQHh9WArN/8e7trh0F kbKUzpTnRdXzDsd3ATTb5j1geGVbRcyoiv+QGgBOYyQRAlJZVeD5u5bWL0ZPVjpvPqJr ihcpZwxPXL03XsDbwQw7wWMSXn7IwKUbK1W1m2Wyk/AOkKAkdzGHa91qkDgVubGTnlim n6pg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=uPARJ3or; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y8si4684347pgk.594.2019.08.30.08.51.28; Fri, 30 Aug 2019 08:51:44 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=uPARJ3or; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728135AbfH3PuZ (ORCPT + 99 others); Fri, 30 Aug 2019 11:50:25 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:42936 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727135AbfH3PuZ (ORCPT ); Fri, 30 Aug 2019 11:50:25 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=jKLZ9AV4Cad35GVTWRj4qMk4Kj0vjxf5uuMYmkOMgQM=; b=uPARJ3orrGsiJB42mMqVRNTsi FtVgdPrcmYDIkLdtdrY4xxPet7vxfI/PykXneJ2pU0g6sa3nLsdJKYasFzWIR70lznoOyfa392xvu 31OSlpr+tw6B3k3bid7RQ5aK8NMT75HZmZ7HFYh2ICUT7fkg//detK0CdHqpJ7edFi/k/dLahx4Df TcjIJ15HMTpO4r6qQawJE7fc3fk3wgL8pkWKSzizo3lmZKs00HchVxR6/nhXRQbA1PhGiUV9mXkvo Glw7gZOLpfDCmmfoDzyg1NXnBTJ8SH78miIfY+Jp/dfw2+nTK7V+vVz8WUoXommnSXw0cQ1R4sH+3 SU8oEYHDA==; Received: from hch by bombadil.infradead.org with local (Exim 4.92 #3 (Red Hat Linux)) id 1i3jAO-0007o7-H4; Fri, 30 Aug 2019 15:50:24 +0000 Date: Fri, 30 Aug 2019 08:50:24 -0700 From: Christoph Hellwig To: Martijn Coenen Cc: axboe@kernel.dk, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, gregkh@linuxfoundatio.org, kernel-team@android.com, narayan@google.com, dariofreni@google.com, ioffe@google.com, jiyong@google.com, maco@google.com Subject: Re: [PATCH] loop: change queue block size to match when using DIO. Message-ID: <20190830155024.GA23882@infradead.org> References: <20190828103229.191853-1-maco@android.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190828103229.191853-1-maco@android.com> User-Agent: Mutt/1.11.4 (2019-03-13) 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 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Aug 28, 2019 at 12:32:29PM +0200, Martijn Coenen wrote: > The loop driver assumes that if the passed in fd is opened with > O_DIRECT, the caller wants to use direct I/O on the loop device. > However, if the underlying filesystem has a different block size than > the loop block queue, direct I/O can't be enabled. Instead of requiring > userspace to manually change the blocksize and re-enable direct I/O, > just change the queue block size to match. Why can't we enable the block device in that case? All the usual block filesystems support 512 byte aligned direct I/O with a 4k file system block size (as long as the underlying block device sector size is also 512 bytes).