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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Tue, 27 Apr 2021 09:34:26 -0700
From:   Ira Weiny <ira.weiny@...el.com>
To:     "ruansy.fnst@...itsu.com" <ruansy.fnst@...itsu.com>
Cc:     "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        "linux-xfs@...r.kernel.org" <linux-xfs@...r.kernel.org>,
        "linux-nvdimm@...ts.01.org" <linux-nvdimm@...ts.01.org>,
        "linux-fsdevel@...r.kernel.org" <linux-fsdevel@...r.kernel.org>,
        "darrick.wong@...cle.com" <darrick.wong@...cle.com>,
        "dan.j.williams@...el.com" <dan.j.williams@...el.com>,
        "willy@...radead.org" <willy@...radead.org>,
        "jack@...e.cz" <jack@...e.cz>,
        "viro@...iv.linux.org.uk" <viro@...iv.linux.org.uk>,
        "linux-btrfs@...r.kernel.org" <linux-btrfs@...r.kernel.org>,
        "david@...morbit.com" <david@...morbit.com>,
        "hch@....de" <hch@....de>, "rgoldwyn@...e.de" <rgoldwyn@...e.de>,
        Ritesh Harjani <riteshh@...ux.ibm.com>
Subject: Re: [PATCH v3 1/3] fsdax: Factor helpers to simplify dax fault code

On Tue, Apr 27, 2021 at 02:44:33AM +0000, ruansy.fnst@...itsu.com wrote:
> > -----Original Message-----
> > From: Ira Weiny <ira.weiny@...el.com>
> > Sent: Tuesday, April 27, 2021 7:38 AM
> > Subject: Re: [PATCH v3 1/3] fsdax: Factor helpers to simplify dax fault code
> > 
> > On Thu, Apr 22, 2021 at 09:44:59PM +0800, Shiyang Ruan wrote:
> > > The dax page fault code is too long and a bit difficult to read. And
> > > it is hard to understand when we trying to add new features. Some of
> > > the PTE/PMD codes have similar logic. So, factor them as helper
> > > functions to simplify the code.
> > >
> > > Signed-off-by: Shiyang Ruan <ruansy.fnst@...itsu.com>
> > > Reviewed-by: Christoph Hellwig <hch@....de>
> > > Reviewed-by: Ritesh Harjani <riteshh@...ux.ibm.com>
> > > ---
> > >  fs/dax.c | 153
> > > ++++++++++++++++++++++++++++++-------------------------
> > >  1 file changed, 84 insertions(+), 69 deletions(-)
> > >
> > > diff --git a/fs/dax.c b/fs/dax.c
> > > index b3d27fdc6775..f843fb8fbbf1 100644
> > > --- a/fs/dax.c
> > > +++ b/fs/dax.c
> > 
> > [snip]
> > 
> > > @@ -1355,19 +1379,8 @@ static vm_fault_t dax_iomap_pte_fault(struct
> > vm_fault *vmf, pfn_t *pfnp,
> > >  		entry = dax_insert_entry(&xas, mapping, vmf, entry, pfn,
> > >  						 0, write && !sync);
> > >
> > > -		/*
> > > -		 * If we are doing synchronous page fault and inode needs fsync,
> > > -		 * we can insert PTE into page tables only after that happens.
> > > -		 * Skip insertion for now and return the pfn so that caller can
> > > -		 * insert it after fsync is done.
> > > -		 */
> > >  		if (sync) {
> > > -			if (WARN_ON_ONCE(!pfnp)) {
> > > -				error = -EIO;
> > > -				goto error_finish_iomap;
> > > -			}
> > > -			*pfnp = pfn;
> > > -			ret = VM_FAULT_NEEDDSYNC | major;
> > > +			ret = dax_fault_synchronous_pfnp(pfnp, pfn);
> > 
> > I commented on the previous version...  So I'll ask here too.
> > 
> > Why is it ok to drop 'major' here?
> 
> This dax_iomap_pte_fault () finally returns 'ret | major', so I think the major here is not dropped.  The origin code seems OR the return value and major twice.
> 

Thanks I missed that!
Ira

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ