From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754491AbbHIIwk (ORCPT ); Sun, 9 Aug 2015 04:52:40 -0400 Received: from mail-wi0-f175.google.com ([209.85.212.175]:36115 "EHLO mail-wi0-f175.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754099AbbHIIwf (ORCPT ); Sun, 9 Aug 2015 04:52:35 -0400 Message-ID: <55C714D0.8070003@plexistor.com> Date: Sun, 09 Aug 2015 11:52:32 +0300 From: Boaz Harrosh User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 MIME-Version: 1.0 To: Dave Chinner CC: Linda Knippers , Jeff Moyer , "matthew r. wilcox" , linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, Vishal Verma Subject: Re: regression introduced by "block: Add support for DAX reads/writes to block devices" References: <20150805220113.GC3902@dastard> <55C2BB9E.3040709@hp.com> <20150806032421.GA16638@dastard> <55C3124F.3020602@plexistor.com> <20150806203450.GB16638@dastard> In-Reply-To: <20150806203450.GB16638@dastard> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 08/06/2015 11:34 PM, Dave Chinner wrote: > On Thu, Aug 06, 2015 at 10:52:47AM +0300, Boaz Harrosh wrote: >> On 08/06/2015 06:24 AM, Dave Chinner wrote: >>> On Wed, Aug 05, 2015 at 09:42:54PM -0400, Linda Knippers wrote: >>>> On 08/05/2015 06:01 PM, Dave Chinner wrote: >>>>> On Wed, Aug 05, 2015 at 04:19:08PM -0400, Jeff Moyer wrote: >> <> >>>>>> >>>>>> I sat down with Linda to look into it, and the problem is that mkfs.xfs >>>>>> sets the blocksize of the device to 512 (via BLKBSZSET), and then reads >>>>>> from the last sector of the device. This results in dax_io trying to do >>>>>> a page-sized I/O at 512 bytes from the end of the device. >>>>> >> >> This part I do not understand. how is mkfs.xfs reading the sector? >> Is it through open(/dev/pmem0,...) ? O_DIRECT? > > mkfs.xfs uses O_DIRECT. Only if open(O_DIRECT) fails or mkfs.xfs is > told that it is working on an image file does it fall back to > buffered IO. All of the XFS userspace tools work this way to prevent > page cache pollution issues with read-once or write-once data during > operation. > Thanks, yes makes sense. This is a bug at the DAX implementation of bdev. Since as you know with DAX there is no difference between O_DIRECT and buffered, we must support any aligned IO. I bet it should be something with bdev not giving 4K buffer-heads to dax.c. Or ... It might just be the infamous bug where the actual partition they used was not 4k aligned on its start sector. So the last sector IO after partition translation came out wrong. This bug then should be fixed by: https://lists.01.org/pipermail/linux-nvdimm/2015-July/001555.html by:Vishal Verma Vishal I think we should add CC: stable@vger.kernel.org to your patch because of these fdisk bugs. > Cheers, > Dave. Thanks Boaz