Linux XFS filesystem development
 help / color / mirror / Atom feed
From: "Darrick J. Wong" <djwong@kernel.org>
To: "ruansy.fnst@fujitsu.com" <ruansy.fnst@fujitsu.com>
Cc: Dave Chinner <david@fromorbit.com>,
	"yangx.jy@fujitsu.com" <yangx.jy@fujitsu.com>,
	"Yasunori Gotou (Fujitsu)" <y-goto@fujitsu.com>,
	Brian Foster <bfoster@redhat.com>,
	"hch@infradead.org" <hch@infradead.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"linux-xfs@vger.kernel.org" <linux-xfs@vger.kernel.org>,
	"nvdimm@lists.linux.dev" <nvdimm@lists.linux.dev>,
	"linux-fsdevel@vger.kernel.org" <linux-fsdevel@vger.kernel.org>,
	"zwisler@kernel.org" <zwisler@kernel.org>,
	Jeff Moyer <jmoyer@redhat.com>,
	"dm-devel@redhat.com" <dm-devel@redhat.com>,
	"toshi.kani@hpe.com" <toshi.kani@hpe.com>,
	Theodore Ts'o <tytso@mit.edu>
Subject: Re: [PATCH] xfs: fail dax mount if reflink is enabled on a partition
Date: Thu, 27 Oct 2022 14:08:52 -0700	[thread overview]
Message-ID: <Y1rzZN0wgLcie47z@magnolia> (raw)
In-Reply-To: <Y1gjQ4wNZr3ve2+K@magnolia>

[add tytso to cc since he asked about "How do you actually /get/ fsdax
mode these days?" this morning]

On Tue, Oct 25, 2022 at 10:56:19AM -0700, Darrick J. Wong wrote:
> On Tue, Oct 25, 2022 at 02:26:50PM +0000, ruansy.fnst@fujitsu.com wrote:
> > 
> > 
> > 在 2022/10/24 13:31, Dave Chinner 写道:
> > > On Mon, Oct 24, 2022 at 03:17:52AM +0000, ruansy.fnst@fujitsu.com wrote:
> > >> 在 2022/10/24 6:00, Dave Chinner 写道:
> > >>> On Fri, Oct 21, 2022 at 07:11:02PM -0700, Darrick J. Wong wrote:
> > >>>> On Thu, Oct 20, 2022 at 10:17:45PM +0800, Yang, Xiao/杨 晓 wrote:
> > >>>>> In addition, I don't like your idea about the test change because it will
> > >>>>> make generic/470 become the special test for XFS. Do you know if we can fix
> > >>>>> the issue by changing the test in another way? blkdiscard -z can fix the
> > >>>>> issue because it does zero-fill rather than discard on the block device.
> > >>>>> However, blkdiscard -z will take a lot of time when the block device is
> > >>>>> large.
> > >>>>
> > >>>> Well we /could/ just do that too, but that will suck if you have 2TB of
> > >>>> pmem. ;)
> > >>>>
> > >>>> Maybe as an alternative path we could just create a very small
> > >>>> filesystem on the pmem and then blkdiscard -z it?
> > >>>>
> > >>>> That said -- does persistent memory actually have a future?  Intel
> > >>>> scuttled the entire Optane product, cxl.mem sounds like expansion
> > >>>> chassis full of DRAM, and fsdax is horribly broken in 6.0 (weird kernel
> > >>>> asserts everywhere) and 6.1 (every time I run fstests now I see massive
> > >>>> data corruption).
> > >>>
> > >>> Yup, I see the same thing. fsdax was a train wreck in 6.0 - broken
> > >>> on both ext4 and XFS. Now that I run a quick check on 6.1-rc1, I
> > >>> don't think that has changed at all - I still see lots of kernel
> > >>> warnings, data corruption and "XFS_IOC_CLONE_RANGE: Invalid
> > >>> argument" errors.
> > >>
> > >> Firstly, I think the "XFS_IOC_CLONE_RANGE: Invalid argument" error is
> > >> caused by the restrictions which prevent reflink work together with DAX:
> > >>
> > >> a. fs/xfs/xfs_ioctl.c:1141
> > >> /* Don't allow us to set DAX mode for a reflinked file for now. */
> > >> if ((fa->fsx_xflags & FS_XFLAG_DAX) && xfs_is_reflink_inode(ip))
> > >>          return -EINVAL;
> > >>
> > >> b. fs/xfs/xfs_iops.c:1174
> > >> /* Only supported on non-reflinked files. */
> > >> if (xfs_is_reflink_inode(ip))
> > >>          return false;
> > >>
> > >> These restrictions were removed in "drop experimental warning" patch[1].
> > >>    I think they should be separated from that patch.
> > >>
> > >> [1]
> > >> https://lore.kernel.org/linux-xfs/1663234002-17-1-git-send-email-ruansy.fnst@fujitsu.com/
> > >>
> > >>
> > >> Secondly, how the data corruption happened?
> > > 
> > > No idea - i"m just reporting that lots of fsx tests failed with data
> > > corruptions. I haven't had time to look at why, I'm still trying to
> > > sort out the fix for a different data corruption...
> > > 
> > >> Or which case failed?
> > > 
> > > *lots* of them failed with kernel warnings with reflink turned off:
> > > 
> > > SECTION       -- xfs_dax_noreflink
> > > =========================
> > > Failures: generic/051 generic/068 generic/075 generic/083
> > > generic/112 generic/127 generic/198 generic/231 generic/247
> > > generic/269 generic/270 generic/340 generic/344 generic/388
> > > generic/461 generic/471 generic/476 generic/519 generic/561 xfs/011
> > > xfs/013 xfs/073 xfs/297 xfs/305 xfs/517 xfs/538
> > > Failed 26 of 1079 tests
> > > 
> > > All of those except xfs/073 and generic/471 are failures due to
> > > warnings found in dmesg.
> > > 
> > > With reflink enabled, I terminated the run after g/075, g/091, g/112
> > > and generic/127 reported fsx data corruptions and g/051, g/068,
> > > g/075 and g/083 had reported kernel warnings in dmesg.
> > > 
> > >> Could
> > >> you give me more info (such as mkfs options, xfstests configs)?
> > > 
> > > They are exactly the same as last time I reported these problems.
> > > 
> > > For the "no reflink" test issues:
> > > 
> > > mkfs options are "-m reflink=0,rmapbt=1", mount options "-o
> > > dax=always" for both filesytems.  Config output at start of test
> > > run:
> > > 
> > > SECTION       -- xfs_dax_noreflink
> > > FSTYP         -- xfs (debug)
> > > PLATFORM      -- Linux/x86_64 test3 6.1.0-rc1-dgc+ #1615 SMP PREEMPT_DYNAMIC Wed Oct 19 12:24:16 AEDT 2022
> > > MKFS_OPTIONS  -- -f -m reflink=0,rmapbt=1 /dev/pmem1
> > > MOUNT_OPTIONS -- -o dax=always -o context=system_u:object_r:root_t:s0 /dev/pmem1 /mnt/scratch
> > > 
> > > pmem devices are a pair of fake 8GB pmem regions set up by kernel
> > > CLI via "memmap=8G!15G,8G!24G". I don't have anything special set up
> > > - the kernel config is kept minimal for these VMs - and the only
> > > kernel debug option I have turned on for these specific test runs is
> > > CONFIG_XFS_DEBUG=y.
> > 
> > Thanks for the detailed info.  But, in my environment (and my 
> > colleagues', and our real server with DCPMM) these failure cases (you 
> > mentioned above, in dax+non_reflink mode, with same test options) cannot 
> > reproduce.
> > 
> > Here's our test environment info:
> >   - Ruan's env: fedora 36(v6.0-rc1) on kvm,pmem 2x4G:file backended
> >   - Yang's env: fedora 35(v6.1-rc1) on kvm,pmem 2x1G:memmap=1G!1G,1G!2G
> >   - Server's  : Ubuntu 20.04(v6.0-rc1) real machine,pmem 2x4G:real DCPMM
> > 
> > (To quickly confirm the difference, I just ran the failed 26 cases you 
> > mentioned above.)  Except for generic/471 and generic/519, which failed 
> > even when dax is off, the rest passed.
> > 
> > 
> > We don't want fsdax to be truned off.  Right now, I think the most 
> > important thing is solving the failed cases in dax+non_reflink mode. 
> > So, firstly, I have to reproduce those failures.  Is there any thing 
> > wrong with my test environments?  I konw you are using 'memmap=XXG!YYG' to 
> > simulate pmem.  So, (to Darrick) could you show me your config of dev 
> > environment and the 'testcloud'(I am guessing it's a server with real 
> > nvdimm just like ours)?
> 
> Nope.  Since the announcement of pmem as a product, I have had 15
> minutes of acces to one preproduction prototype server with actual
> optane DIMMs in them.
> 
> I have /never/ had access to real hardware to test any of this, so it's
> all configured via libvirt to simulate pmem in qemu:
> https://lore.kernel.org/linux-xfs/YzXsavOWMSuwTBEC@magnolia/
> 
> /run/mtrdisk/[gh].mem are both regular files on a tmpfs filesystem:
> 
> $ grep mtrdisk /proc/mounts
> none /run/mtrdisk tmpfs rw,relatime,size=82894848k,inode64 0 0
> 
> $ ls -la /run/mtrdisk/[gh].mem
> -rw-r--r-- 1 libvirt-qemu kvm 10739515392 Oct 24 18:09 /run/mtrdisk/g.mem
> -rw-r--r-- 1 libvirt-qemu kvm 10739515392 Oct 24 19:28 /run/mtrdisk/h.mem

Also forgot to mention that the VM with the fake pmem attached has a
script to do:

ndctl create-namespace --mode fsdax --map dev -e namespace0.0 -f
ndctl create-namespace --mode fsdax --map dev -e namespace1.0 -f

Every time the pmem device gets recreated, because apparently that's the
only way to get S_DAX mode nowadays?

--D

> --D
> 
> > 
> > 
> > (I just found I only tested on 4G and smaller pmem device.  I'll try the 
> > test on 8G pmem)
> > 
> > > 
> > > THe only difference between the noreflink and reflink runs is that I
> > > drop the "-m reflink=0" mkfs parameter. Otherwise they are identical
> > > and the errors I reported are from back-to-back fstests runs without
> > > rebooting the VM....
> > > 
> > > -Dave.
> > 
> > 
> > --
> > Thanks,
> > Ruan.

  reply	other threads:[~2022-10-27 21:11 UTC|newest]

Thread overview: 41+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-09 14:34 [PATCH] xfs: fail dax mount if reflink is enabled on a partition Shiyang Ruan
2022-06-10  5:46 ` Christoph Hellwig
2022-07-01  0:31 ` Darrick J. Wong
2022-07-01  5:14   ` Shiyang Ruan
2022-07-21 12:43     ` ruansy.fnst
2022-07-21 14:06   ` ruansy.fnst
2022-07-21 16:16     ` Darrick J. Wong
2022-07-29  3:55       ` ruansy.fnst
2022-07-29  4:54         ` Darrick J. Wong
2022-08-03  6:47           ` ruansy.fnst
2022-08-04  0:51             ` Darrick J. Wong
2022-08-04  1:36               ` Shiyang Ruan
2022-09-08 13:46               ` Shiyang Ruan
2022-09-09 13:01                 ` Brian Foster
2022-09-14  6:44                   ` Yang, Xiao/杨 晓
2022-09-14  9:38                     ` Yang, Xiao/杨 晓
2022-09-14 12:34                       ` Brian Foster
2022-09-14 16:28                         ` Darrick J. Wong
2022-09-15 10:14                           ` Yang, Xiao/杨 晓
2022-09-16  2:04                             ` Yang, Xiao/杨 晓
2022-09-20  2:38                               ` Yang, Xiao/杨 晓
2022-09-30  0:56                                 ` Gotou, Yasunori/五島 康文
2022-10-04  0:12                                   ` Darrick J. Wong
2022-10-04  4:12                                     ` Gotou, Yasunori/五島 康文
2022-10-04 18:26                                       ` Darrick J. Wong
2022-10-20 14:17                                         ` Yang, Xiao/杨 晓
2022-10-22  2:11                                           ` Darrick J. Wong
     [not found]                                             ` <09f522cd-e846-12ee-d662-14f34a2977c4@fujitsu.com>
2022-10-23  7:04                                               ` yangx.jy
2022-10-23 22:00                                             ` Dave Chinner
2022-10-24  3:17                                               ` ruansy.fnst
2022-10-24  4:05                                                 ` Darrick J. Wong
2022-10-24  5:31                                                 ` Dave Chinner
2022-10-25 14:26                                                   ` ruansy.fnst
2022-10-25 17:56                                                     ` Darrick J. Wong
2022-10-27 21:08                                                       ` Darrick J. Wong [this message]
2022-10-28  1:37                                                         ` Dan Williams
2022-10-30  9:31                                                           ` Shiyang Ruan
2022-11-02  0:45                                                             ` Darrick J. Wong
2022-11-02  5:17                                                               ` ruansy.fnst
2022-11-03  2:32                                                                 ` Dave Chinner
2022-10-24 17:12                                               ` Dan Williams

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Y1rzZN0wgLcie47z@magnolia \
    --to=djwong@kernel.org \
    --cc=bfoster@redhat.com \
    --cc=david@fromorbit.com \
    --cc=dm-devel@redhat.com \
    --cc=hch@infradead.org \
    --cc=jmoyer@redhat.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-xfs@vger.kernel.org \
    --cc=nvdimm@lists.linux.dev \
    --cc=ruansy.fnst@fujitsu.com \
    --cc=toshi.kani@hpe.com \
    --cc=tytso@mit.edu \
    --cc=y-goto@fujitsu.com \
    --cc=yangx.jy@fujitsu.com \
    --cc=zwisler@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox