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]
Date: Fri, 26 Apr 2024 12:54:10 +0000
From: "Pankaj Raghav (Samsung)" <kernel@...kajraghav.com>
To: Matthew Wilcox <willy@...radead.org>
Cc: djwong@...nel.org, brauner@...nel.org, david@...morbit.com,
	chandan.babu@...cle.com, akpm@...ux-foundation.org,
	linux-fsdevel@...r.kernel.org, hare@...e.de,
	linux-kernel@...r.kernel.org, linux-mm@...ck.org,
	linux-xfs@...r.kernel.org, mcgrof@...nel.org, gost.dev@...sung.com,
	p.raghav@...sung.com
Subject: Re: [PATCH v4 06/11] filemap: cap PTE range to be created to i_size
 in folio_map_range()

On Thu, Apr 25, 2024 at 09:24:33PM +0100, Matthew Wilcox wrote:
> On Thu, Apr 25, 2024 at 01:37:41PM +0200, Pankaj Raghav (Samsung) wrote:
> >  	do {
> >  		unsigned long end;
> > +		unsigned long i_size;
> 
> Usually i_size is the name of a variable that contains an loff_t, not a
> page count.  Not sure what to call this though.  Also, can't we move
> this outside the loop?
You are right, this can move out as i_size is not going to change. I
will make this change. Thanks!
> 
> 	pgoff_t file_end = DIV_ROUND_UP(i_size_read(mapping->host),
> 					PAGE_SIZE) - 1;
> 
> 	if (end_pgoff > file_end)
> 		end_pgoff = file_end;

--
Pankaj

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ