From: Xiaoli Feng <xifeng@redhat.com>
To: "Darrick J. Wong" <darrick.wong@oracle.com>,
Eric Sandeen <esandeen@redhat.com>
Cc: Randy Dunlap <rdunlap@infradead.org>,
linux-kernel@vger.kernel.org, ira weiny <ira.weiny@intel.com>,
Xiaoli Feng <fengxiaoli0714@gmail.com>,
linux-fsdevel <linux-fsdevel@vger.kernel.org>
Subject: Re: [PATCH] fs/stat: set attributes_mask for STATX_ATTR_DAX
Date: Sun, 22 Nov 2020 10:57:25 -0500 (EST) [thread overview]
Message-ID: <1450940377.59255884.1606060645520.JavaMail.zimbra@redhat.com> (raw)
In-Reply-To: <20201121011516.GD3837269@magnolia>
Hi,
Thanks for review.
----- Original Message -----
> From: "Darrick J. Wong" <darrick.wong@oracle.com>
> To: "XiaoLi Feng" <xifeng@redhat.com>
> Cc: "Randy Dunlap" <rdunlap@infradead.org>, linux-kernel@vger.kernel.org, "ira weiny" <ira.weiny@intel.com>, "Xiaoli
> Feng" <fengxiaoli0714@gmail.com>, "linux-fsdevel" <linux-fsdevel@vger.kernel.org>
> Sent: Saturday, November 21, 2020 10:03:18 AM
> Subject: Re: [PATCH] fs/stat: set attributes_mask for STATX_ATTR_DAX
>
> [Adding fsdevel to cc since this is a filesystems question]
>
> On Fri, Nov 20, 2020 at 04:58:09PM -0800, Randy Dunlap wrote:
> > Hi,
> >
> > I don't know this code, but:
> >
> > On 11/20/20 4:33 PM, XiaoLi Feng wrote:
> > > From: Xiaoli Feng <fengxiaoli0714@gmail.com>
> > >
> > > keep attributes and attributes_mask are consistent for
> > > STATX_ATTR_DAX.
> > > ---
> > > fs/stat.c | 2 +-
> > > 1 file changed, 1 insertion(+), 1 deletion(-)
> > >
> > > diff --git a/fs/stat.c b/fs/stat.c
> > > index dacecdda2e79..914a61d256b0 100644
> > > --- a/fs/stat.c
> > > +++ b/fs/stat.c
> > > @@ -82,7 +82,7 @@ int vfs_getattr_nosec(const struct path *path, struct
> > > kstat *stat,
> > >
> > > if (IS_DAX(inode))
> > > stat->attributes |= STATX_ATTR_DAX;
> > > -
> > > + stat->attributes_mask |= STATX_ATTR_DAX;
> >
> > Why shouldn't that be:
> >
> > if (IS_DAX(inode))
> > stat->attributes_mask |= STATX_ATTR_DAX;
> >
> > or combine them, like this:
> >
> > if (IS_DAX(inode)) {
> > stat->attributes |= STATX_ATTR_DAX;
> > stat->attributes_mask |= STATX_ATTR_DAX;
> > }
> >
> >
> > and no need to delete that blank line.
>
> Some filesystems could support DAX but not have it enabled for this
> particular file, so this won't work.
>
> General question: should filesystems that are /capable/ of DAX signal
> this by setting the DAX bit in the attributes mask? Or is this a VFS
> feature and hence here is the appropriate place to be setting the mask?
Actually I just see here set the attributes. Then set the attributes mask
after it.
>
> Extra question: should we only set this in the attributes mask if
> CONFIG_FS_DAX=y ?
No, my origin patch always set this attributes mask. It's out of if condition.
if (IS_DAX(inode))
stat->attributes |= STATX_ATTR_DAX;
-
+ stat->attributes_mask |= STATX_ATTR_DAX;
>
> --D
>
> > > if (inode->i_op->getattr)
> > > return inode->i_op->getattr(path, stat, request_mask,
> > > query_flags);
> > >
> >
> > thanks.
> > --
> > ~Randy
> >
>
>
next prev parent reply other threads:[~2020-11-22 15:57 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20201121003331.21342-1-xifeng@redhat.com>
[not found] ` <21890103-fce2-bb50-7fc2-6c6d509b982f@infradead.org>
2020-11-21 2:03 ` [PATCH] fs/stat: set attributes_mask for STATX_ATTR_DAX Darrick J. Wong
2020-11-22 15:57 ` Xiaoli Feng [this message]
2020-11-23 21:37 ` Dave Chinner
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=1450940377.59255884.1606060645520.JavaMail.zimbra@redhat.com \
--to=xifeng@redhat.com \
--cc=darrick.wong@oracle.com \
--cc=esandeen@redhat.com \
--cc=fengxiaoli0714@gmail.com \
--cc=ira.weiny@intel.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=rdunlap@infradead.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).