From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751738AbcFUNmu (ORCPT ); Tue, 21 Jun 2016 09:42:50 -0400 Received: from mx1.redhat.com ([209.132.183.28]:37305 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750707AbcFUNmr (ORCPT ); Tue, 21 Jun 2016 09:42:47 -0400 Date: Tue, 21 Jun 2016 09:41:47 -0400 From: Mike Snitzer To: "Kani, Toshimitsu" , axboe@fb.com Cc: "axboe@kernel.dk" , "sandeen@redhat.com" , "linux-nvdimm@ml01.01.org" , "linux-kernel@vger.kernel.org" , "linux-raid@vger.kernel.org" , "dm-devel@redhat.com" , "viro@zeniv.linux.org.uk" , "dan.j.williams@intel.com" , "ross.zwisler@linux.intel.com" , "agk@redhat.com" Subject: Re: [PATCH 0/6] Support DAX for device-mapper dm-linear devices Message-ID: <20160621134147.GA26392@redhat.com> References: <1465856497-19698-1-git-send-email-toshi.kani@hpe.com> <20160613225756.GA18417@redhat.com> <20160620180043.GA21261@redhat.com> <1466446861.3504.243.camel@hpe.com> <20160620194026.GA21657@redhat.com> <20160620195217.GB21657@redhat.com> <1466452883.3504.244.camel@hpe.com> <1466457467.3504.249.camel@hpe.com> <20160620222236.GA22461@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20160620222236.GA22461@redhat.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Tue, 21 Jun 2016 13:41:49 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jun 20 2016 at 6:22pm -0400, Mike Snitzer wrote: > On Mon, Jun 20 2016 at 5:28pm -0400, > Kani, Toshimitsu wrote: > > > > > Hi Mike, > > > > Can you fold the following patch to the dm-linear patch? > > > > Thanks, > > -Tsohi > > > > ------ > > Subject: [PATCH] dm-linear: Fix partition handling for DAX > > > > Partition handling was missing in linear_direct_access(). > > Call bdev_direct_access(), instead of directly calling > > target direct_access function. > > > > Signed-off-by: Toshi Kani > > --- > >  drivers/md/dm-linear.c |   14 ++++++++++---- > >  1 file changed, 10 insertions(+), 4 deletions(-) > > > > diff --git a/drivers/md/dm-linear.c b/drivers/md/dm-linear.c > > index 325aa06..38323e4 100644 > > --- a/drivers/md/dm-linear.c > > +++ b/drivers/md/dm-linear.c > > @@ -148,10 +148,16 @@ static long linear_direct_access(struct dm_target *ti, > > sector_t sector, > >  { > >   struct linear_c *lc = ti->private; > >   struct block_device *bdev = lc->dev->bdev; > > - const struct block_device_operations *bd_ops = bdev->bd_disk->fops; > > - > > - return bd_ops->direct_access(bdev, linear_map_sector(ti, sector), > > -      kaddr, pfn, size); > > + struct blk_dax_ctl dax = { > > + .sector = linear_map_sector(ti, sector), > > + .size = size, > > + }; > > + long ret; > > + > > + ret = bdev_direct_access(bdev, &dax); > > + *kaddr = dax.addr; > > + *pfn = dax.pfn; > > + return ret; > >  } > >   > >  static struct target_type linear_target = { > > Looks good, I folded it in and tested it to work. Pushed to my 'wip' > branch. > > No longer seeing any corruption in my test that was using partitions to > span pmem devices with a dm-linear device. > > Jens, any chance you'd be open to picking up the first 2 patches in this > series? Or would you like to see them folded or something different? I'm now wondering if we'd be better off setting a new QUEUE_FLAG_DAX rather than establish GENHD_FL_DAX on the genhd? It'd be quite a bit easier to allow upper layers (e.g. XFS and ext4) to check for a queue flag.