From: Eric Sandeen <sandeen@redhat.com>
To: "Darrick J. Wong" <darrick.wong@oracle.com>
Cc: xfs <linux-xfs@vger.kernel.org>
Subject: Re: [PATCH 1/2] xfs: don't catch dax+reflink inodes as corruption in verifier
Date: Thu, 3 Dec 2020 16:19:35 -0600 [thread overview]
Message-ID: <4db6efd8-2cf0-180c-4315-a96120e63c31@redhat.com> (raw)
In-Reply-To: <20201203214436.GA629293@magnolia>
On 12/3/20 3:44 PM, Darrick J. Wong wrote:
> On Tue, Dec 01, 2020 at 01:16:09PM -0600, Eric Sandeen wrote:
>> We don't yet support dax on reflinked files, but that is in the works.
>>
>> Further, having the flag set does not automatically mean that the inode
>> is actually "in the CPU direct access state," which depends on several
>> other conditions in addition to the flag being set.
>>
>> As such, we should not catch this as corruption in the verifier - simply
>> not actually enabling S_DAX on reflinked files is enough for now.
>>
>> Fixes: 4f435ebe7d04 ("xfs: don't mix reflink and DAX mode for now")
>> Signed-off-by: Eric Sandeen <sandeen@redhat.com>
>> ---
>> fs/xfs/libxfs/xfs_inode_buf.c | 4 ----
>> 1 file changed, 4 deletions(-)
>>
>> diff --git a/fs/xfs/libxfs/xfs_inode_buf.c b/fs/xfs/libxfs/xfs_inode_buf.c
>> index c667c63f2cb0..4d7410e49db4 100644
>> --- a/fs/xfs/libxfs/xfs_inode_buf.c
>> +++ b/fs/xfs/libxfs/xfs_inode_buf.c
>> @@ -547,10 +547,6 @@ xfs_dinode_verify(
>> if ((flags2 & XFS_DIFLAG2_REFLINK) && (flags & XFS_DIFLAG_REALTIME))
>> return __this_address;
>>
>> - /* don't let reflink and dax mix */
>> - if ((flags2 & XFS_DIFLAG2_REFLINK) && (flags2 & XFS_DIFLAG2_DAX))
>> - return __this_address;
>
> If we're going to let in inodes with the DAX and REFLINK iflags set,
> doesn't that mean that xfs_inode_should_enable_dax needs to return false
> if REFLINK is set?
I think it does already, no?
static bool
xfs_inode_should_enable_dax(
struct xfs_inode *ip)
{
if (!IS_ENABLED(CONFIG_FS_DAX))
return false;
if (ip->i_mount->m_flags & XFS_MOUNT_DAX_NEVER)
return false;
if (!xfs_inode_supports_dax(ip)) <------
return false;
----> xfs_inode_supports_dax --->
static bool
xfs_inode_supports_dax(
struct xfs_inode *ip)
{
struct xfs_mount *mp = ip->i_mount;
/* Only supported on regular files. */
if (!S_ISREG(VFS_I(ip)->i_mode))
return false;
/* Only supported on non-reflinked files. */
if (xfs_is_reflink_inode(ip))
return false;
next prev parent reply other threads:[~2020-12-03 22:21 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-12-01 19:10 [PATCH 0/2] xfs: fix up some reflink+dax interactions Eric Sandeen
2020-12-01 19:16 ` [PATCH 1/2] xfs: don't catch dax+reflink inodes as corruption in verifier Eric Sandeen
2020-12-02 10:16 ` Christoph Hellwig
2020-12-03 21:44 ` Darrick J. Wong
2020-12-03 22:19 ` Eric Sandeen [this message]
2020-12-03 23:03 ` Darrick J. Wong
2020-12-01 19:20 ` [RFC PATCH 2/2] xfs: do not allow reflinking inodes with the dax flag set Eric Sandeen
2020-12-02 10:22 ` Christoph Hellwig
2020-12-02 14:44 ` Eric Sandeen
2020-12-02 17:15 ` Christoph Hellwig
2020-12-02 17:15 ` Christoph Hellwig
2020-12-01 19:23 ` [PATCH 0/2] xfs: fix up some reflink+dax interactions Eric Sandeen
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=4db6efd8-2cf0-180c-4315-a96120e63c31@redhat.com \
--to=sandeen@redhat.com \
--cc=darrick.wong@oracle.com \
--cc=linux-xfs@vger.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;
as well as URLs for NNTP newsgroup(s).