lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20201121011516.GD3837269@magnolia>
Date:   Fri, 20 Nov 2020 18:03:18 -0800
From:   "Darrick J. Wong" <darrick.wong@...cle.com>
To:     XiaoLi Feng <xifeng@...hat.com>
Cc:     Randy Dunlap <rdunlap@...radead.org>, linux-kernel@...r.kernel.org,
        ira.weiny@...el.com, Xiaoli Feng <fengxiaoli0714@...il.com>,
        linux-fsdevel <linux-fsdevel@...r.kernel.org>
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@...il.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?

Extra question: should we only set this in the attributes mask if
CONFIG_FS_DAX=y ?

--D

> >  	if (inode->i_op->getattr)
> >  		return inode->i_op->getattr(path, stat, request_mask,
> >  					    query_flags);
> > 
> 
> thanks.
> -- 
> ~Randy
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ