linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] fs/stat: set attributes_mask for STATX_ATTR_DAX
@ 2020-11-25  2:08 XiaoLi Feng
  2020-11-25  2:46 ` Darrick J. Wong
  0 siblings, 1 reply; 3+ messages in thread
From: XiaoLi Feng @ 2020-11-25  2:08 UTC (permalink / raw)
  To: linux-fsdevel, david, darrick.wong; +Cc: Xiaoli Feng

From: Xiaoli Feng <fengxiaoli0714@gmail.com>

keep attributes and attributes_mask are consistent for
STATX_ATTR_DAX.
---
Hi,
Please help to review this patch. I send this patch because xfstests generic/532
is failed for dax test.

 fs/stat.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/fs/stat.c b/fs/stat.c
index dacecdda2e79..4619b3fc9694 100644
--- a/fs/stat.c
+++ b/fs/stat.c
@@ -80,8 +80,10 @@ int vfs_getattr_nosec(const struct path *path, struct kstat *stat,
 	if (IS_AUTOMOUNT(inode))
 		stat->attributes |= STATX_ATTR_AUTOMOUNT;
 
-	if (IS_DAX(inode))
+	if (IS_DAX(inode)) {
 		stat->attributes |= STATX_ATTR_DAX;
+		stat->attributes_mask |= STATX_ATTR_DAX;
+	}
 
 	if (inode->i_op->getattr)
 		return inode->i_op->getattr(path, stat, request_mask,
-- 
2.18.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH v2] fs/stat: set attributes_mask for STATX_ATTR_DAX
  2020-11-25  2:08 [PATCH v2] fs/stat: set attributes_mask for STATX_ATTR_DAX XiaoLi Feng
@ 2020-11-25  2:46 ` Darrick J. Wong
  2020-11-25  5:53   ` Xiaoli Feng
  0 siblings, 1 reply; 3+ messages in thread
From: Darrick J. Wong @ 2020-11-25  2:46 UTC (permalink / raw)
  To: XiaoLi Feng; +Cc: linux-fsdevel, david, Xiaoli Feng

On Wed, Nov 25, 2020 at 10:08:40AM +0800, XiaoLi Feng wrote:
> From: Xiaoli Feng <fengxiaoli0714@gmail.com>
> 
> keep attributes and attributes_mask are consistent for
> STATX_ATTR_DAX.
> ---
> Hi,
> Please help to review this patch. I send this patch because xfstests generic/532
> is failed for dax test.
> 
>  fs/stat.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/fs/stat.c b/fs/stat.c
> index dacecdda2e79..4619b3fc9694 100644
> --- a/fs/stat.c
> +++ b/fs/stat.c
> @@ -80,8 +80,10 @@ int vfs_getattr_nosec(const struct path *path, struct kstat *stat,
>  	if (IS_AUTOMOUNT(inode))
>  		stat->attributes |= STATX_ATTR_AUTOMOUNT;
>  
> -	if (IS_DAX(inode))
> +	if (IS_DAX(inode)) {
>  		stat->attributes |= STATX_ATTR_DAX;
> +		stat->attributes_mask |= STATX_ATTR_DAX;

From the discussion of the V1 patch:

Doesn't it make more sense for /filesystems/ driver to set the attr_mask
bit when the filesystem is capable of DAX?  Surely we should be able to
tell applications that DAX is a possibility for the fs even if it's not
enabled on this specific file.

IOWs the place to make this change is in the ext2/ext4/fuse/xfs code,
not in the generic vfs.

--D

> +	}
>  
>  	if (inode->i_op->getattr)
>  		return inode->i_op->getattr(path, stat, request_mask,
> -- 
> 2.18.1
> 

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH v2] fs/stat: set attributes_mask for STATX_ATTR_DAX
  2020-11-25  2:46 ` Darrick J. Wong
@ 2020-11-25  5:53   ` Xiaoli Feng
  0 siblings, 0 replies; 3+ messages in thread
From: Xiaoli Feng @ 2020-11-25  5:53 UTC (permalink / raw)
  To: Darrick J. Wong; +Cc: linux-fsdevel, david, Xiaoli Feng

Hi,

----- Original Message -----
> From: "Darrick J. Wong" <darrick.wong@oracle.com>
> To: "XiaoLi Feng" <xifeng@redhat.com>
> Cc: linux-fsdevel@vger.kernel.org, david@fromorbit.com, "Xiaoli Feng" <fengxiaoli0714@gmail.com>
> Sent: Wednesday, November 25, 2020 10:46:44 AM
> Subject: Re: [PATCH v2] fs/stat: set attributes_mask for STATX_ATTR_DAX
> 
> On Wed, Nov 25, 2020 at 10:08:40AM +0800, XiaoLi Feng wrote:
> > From: Xiaoli Feng <fengxiaoli0714@gmail.com>
> > 
> > keep attributes and attributes_mask are consistent for
> > STATX_ATTR_DAX.
> > ---
> > Hi,
> > Please help to review this patch. I send this patch because xfstests
> > generic/532
> > is failed for dax test.
> > 
> >  fs/stat.c | 4 +++-
> >  1 file changed, 3 insertions(+), 1 deletion(-)
> > 
> > diff --git a/fs/stat.c b/fs/stat.c
> > index dacecdda2e79..4619b3fc9694 100644
> > --- a/fs/stat.c
> > +++ b/fs/stat.c
> > @@ -80,8 +80,10 @@ int vfs_getattr_nosec(const struct path *path, struct
> > kstat *stat,
> >  	if (IS_AUTOMOUNT(inode))
> >  		stat->attributes |= STATX_ATTR_AUTOMOUNT;
> >  
> > -	if (IS_DAX(inode))
> > +	if (IS_DAX(inode)) {
> >  		stat->attributes |= STATX_ATTR_DAX;
> > +		stat->attributes_mask |= STATX_ATTR_DAX;
> 
> From the discussion of the V1 patch:
> 
> Doesn't it make more sense for /filesystems/ driver to set the attr_mask
> bit when the filesystem is capable of DAX?  Surely we should be able to
> tell applications that DAX is a possibility for the fs even if it's not
> enabled on this specific file.
> 
> IOWs the place to make this change is in the ext2/ext4/fuse/xfs code,
> not in the generic vfs.

Got it. Thanks for review.

> 
> --D
> 
> > +	}
> >  
> >  	if (inode->i_op->getattr)
> >  		return inode->i_op->getattr(path, stat, request_mask,
> > --
> > 2.18.1
> > 
> 
> 


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-11-25  5:53 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-25  2:08 [PATCH v2] fs/stat: set attributes_mask for STATX_ATTR_DAX XiaoLi Feng
2020-11-25  2:46 ` Darrick J. Wong
2020-11-25  5:53   ` Xiaoli Feng

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).