From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755287AbbIHQQd (ORCPT ); Tue, 8 Sep 2015 12:16:33 -0400 Received: from g2t4625.austin.hp.com ([15.73.212.76]:55310 "EHLO g2t4625.austin.hp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755178AbbIHQQb (ORCPT ); Tue, 8 Sep 2015 12:16:31 -0400 X-Greylist: delayed 388 seconds by postgrey-1.27 at vger.kernel.org; Tue, 08 Sep 2015 12:16:31 EDT Subject: Re: [PATCH 1/2] dax: fix O_DIRECT I/O to the last block of a blockdev To: Linda Knippers , Jeff Moyer , matthew.r.wilcox@intel.com References: <1439583332-13754-1-git-send-email-jmoyer@redhat.com> <1439583332-13754-2-git-send-email-jmoyer@redhat.com> <55CE5545.7010304@hp.com> Cc: linux-fsdevel@vger.kernel.org, linux-nvdimm@ml01.01.org, linux-kernel@vger.kernel.org, Ross Zwisler From: Linda Knippers X-Enigmail-Draft-Status: N1110 Message-ID: <55EF0858.6010906@hpe.com> Date: Tue, 8 Sep 2015 12:10:00 -0400 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.2.0 MIME-Version: 1.0 In-Reply-To: <55CE5545.7010304@hp.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This patch and the 2/2 patch don't seem to have gone anywhere. Willy? or Ross? -- ljk On 8/14/2015 4:53 PM, Linda Knippers wrote: > On 8/14/2015 4:15 PM, Jeff Moyer wrote: >> commit bbab37ddc20b (block: Add support for DAX reads/writes to >> block devices) caused a regression in mkfs.xfs. That utility >> sets the block size of the device to the logical block size >> using the BLKBSZSET ioctl, and then issues a single sector read >> from the last sector of the device. This results in the dax_io >> code trying to do a page-sized read from 512 bytes from the end >> of the device. The result is -ERANGE being returned to userspace. >> >> The fix is to align the block to the page size before calling >> get_block. >> >> Thanks to willy for simplifying my original patch. >> >> Signed-off-by: Jeff Moyer > > Tested-by: Linda Knippers > >> --- >> fs/dax.c | 3 ++- >> 1 file changed, 2 insertions(+), 1 deletion(-) >> >> diff --git a/fs/dax.c b/fs/dax.c >> index a7f77e1..ef35a20 100644 >> --- a/fs/dax.c >> +++ b/fs/dax.c >> @@ -116,7 +116,8 @@ static ssize_t dax_io(struct inode *inode, struct iov_iter *iter, >> unsigned len; >> if (pos == max) { >> unsigned blkbits = inode->i_blkbits; >> - sector_t block = pos >> blkbits; >> + long page = pos >> PAGE_SHIFT; >> + sector_t block = page << (PAGE_SHIFT - blkbits); >> unsigned first = pos - (block << blkbits); >> long size; >> >> >