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: <ZuM0xHQqSpen_xxY@casper.infradead.org>
Date: Thu, 12 Sep 2024 19:36:52 +0100
From: Matthew Wilcox <willy@...radead.org>
To: Richard Weinberger <richard@....at>
Cc: Li Zetao <lizetao1@...wei.com>,
	anton ivanov <anton.ivanov@...bridgegreys.com>,
	Johannes Berg <johannes@...solutions.net>,
	linux-um <linux-um@...ts.infradead.org>,
	linux-kernel <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH -next] hostfs: Convert hostfs_writepage to use folio

On Thu, Sep 12, 2024 at 08:22:48PM +0200, Richard Weinberger wrote:
> ----- Ursprüngliche Mail -----
> > Von: "Li Zetao" <lizetao1@...wei.com>
> > An: "richard" <richard@....at>, "anton ivanov" <anton.ivanov@...bridgegreys.com>, "Johannes Berg"
> > <johannes@...solutions.net>
> > CC: lizetao1@...wei.com, "linux-um" <linux-um@...ts.infradead.org>, "linux-kernel" <linux-kernel@...r.kernel.org>
> > Gesendet: Dienstag, 20. August 2024 04:50:45
> > Betreff: [PATCH -next] hostfs: Convert hostfs_writepage to use folio
> 
> > convert to use folio, so that we can get rid of 'page->index' to
> > prepare for removal of 'index' field in structure page [1].

Ideally, we would not do this, instead converting hostfs to use
writepages instead of writepage.  I haven't done this work; would
someone like to do it?

> > static int hostfs_writepage(struct page *page, struct writeback_control *wbc)
> > {
> > -	struct address_space *mapping = page->mapping;
> > -	struct inode *inode = mapping->host;
> > +	struct folio *folio = page_folio(page);
> > +	struct address_space *mapping = folio->mapping;
> > +	struct inode *inode = folio_inode(folio);

Don't use folio_inode() here, leave it as it was.

> > -	if (page->index >= end_index)
> > +	if (folio->index >= end_index)
> > 		count = inode->i_size & (PAGE_SIZE-1);
> > 
> > -	buffer = kmap_local_page(page);
> > +	buffer = kmap_local_folio(folio, 0);

These two lines assume that hostfs remains a non-large-folio filesystem.
I'm not sure what the plans are for hostfs.


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ