From mboxrd@z Thu Jan 1 00:00:00 1970 From: Mike Snitzer Subject: Re: [PATCH 0/6] Support DAX for device-mapper dm-linear devices Date: Mon, 20 Jun 2016 18:22:36 -0400 Message-ID: <20160620222236.GA22461@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> Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Return-path: Content-Disposition: inline In-Reply-To: <1466457467.3504.249.camel-ZPxbGqLxI0U@public.gmane.org> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: linux-nvdimm-bounces-hn68Rpc1hR1g9hUCZPvPmw@public.gmane.org Sender: "Linux-nvdimm" To: "Kani, Toshimitsu" Cc: "axboe-tSWWG44O7X1aa/9Udqfwiw@public.gmane.org" , "sandeen-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org" , "linux-nvdimm-y27Ovi1pjclAfugRpC6u6w@public.gmane.org" , "linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org" , "linux-raid-u79uwXL29TY76Z2rM5mHXA@public.gmane.org" , "dm-devel-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org" , "viro-RmSDqhL/yNMiFSDQTTA3OLVCufUGDwFn@public.gmane.org" , "agk-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org" List-Id: linux-raid.ids On Mon, Jun 20 2016 at 5:28pm -0400, Kani, Toshimitsu wrote: > On Mon, 2016-06-20 at 14:01 -0600, Kani, Toshimitsu wrote: > > On Mon, 2016-06-20 at 15:52 -0400, Mike Snitzer wrote: > > > = > > > On Mon, Jun 20 2016 at=A0=A03:40pm -0400, > > > Mike Snitzer wrote: > > > =A0 > =A0: > > > > If I don't use XFS, and only issue IO directly to the /dev/pmem/lv,= I > > > > don't see this corruption. > > > > > > I did the same test with ext4 instead of xfs and it resulted in the s= ame > > > type of systemic corruption (lvm2 metadata corrupted too): > > > = > =A0: > > I will look into the issue. > = > 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 > --- > =A0drivers/md/dm-linear.c |=A0=A0=A014 ++++++++++---- > =A01 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, > =A0{ > =A0 struct linear_c *lc =3D ti->private; > =A0 struct block_device *bdev =3D lc->dev->bdev; > - const struct block_device_operations *bd_ops =3D bdev->bd_disk->fops; > - > - return bd_ops->direct_access(bdev, linear_map_sector(ti, sector), > - =A0=A0=A0=A0=A0kaddr, pfn, size); > + struct blk_dax_ctl dax =3D { > + .sector =3D linear_map_sector(ti, sector), > + .size =3D size, > + }; > + long ret; > + > + ret =3D bdev_direct_access(bdev, &dax); > + *kaddr =3D dax.addr; > + *pfn =3D dax.pfn; > + return ret; > =A0} > =A0 > =A0static struct target_type linear_target =3D { 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? Mike