Return-Path: Received: from bombadil.infradead.org ([65.50.211.133]:36661 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752627AbeAQOZw (ORCPT ); Wed, 17 Jan 2018 09:25:52 -0500 Date: Wed, 17 Jan 2018 06:25:46 -0800 From: Matthew Wilcox To: Steven Whitehouse Cc: Joseph Qi , "linux-fsdevel@vger.kernel.org" , viro@zeniv.linux.org.uk, gnehzuil@linux.alibaba.com, caijingxian@linux.alibaba.com Subject: Re: [RFC] Handle EOF in case of not aligned direct io read in kernel Message-ID: <20180117142546.GC10398@bombadil.infradead.org> References: <386f442b-338a-161e-a4f9-3509bc1905ea@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <386f442b-338a-161e-a4f9-3509bc1905ea@redhat.com> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On Wed, Jan 17, 2018 at 10:09:28AM +0000, Steven Whitehouse wrote: > Hi, > > > On 17/01/18 09:28, Joseph Qi wrote: > > Hi All, > > > > commit 9fe55eea7e4b ("Fix race when checking i_size on direct i/o read") > > has removed the pos check due to the race case. > > > > Now if I want to do direct read on a file which size is not sector > > alignment, it will return EINVAL in the last round. That means I have to > > handle the case by checking file size in user space, which I think is a > > bit inconvenient. > What do you mean by "not sector alignment"? Are you intending to read files > with any arbitrary size, or those with 512 byte alignment on a filesystem > with some larger block size, or something else? I think he's saying that the file he's trying to read has a length which is not a multiple of 512.