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: <2285032.1616433227@warthog.procyon.org.uk>
Date:   Mon, 22 Mar 2021 17:13:47 +0000
From:   David Howells <dhowells@...hat.com>
To:     Matthew Wilcox <willy@...radead.org>
Cc:     dhowells@...hat.com, Trond Myklebust <trondmy@...merspace.com>,
        Anna Schumaker <anna.schumaker@...app.com>,
        Steve French <sfrench@...ba.org>,
        Dominique Martinet <asmadeus@...ewreck.org>,
        Jeff Layton <jlayton@...hat.com>, linux-mm@...ck.org,
        linux-cachefs@...hat.com, linux-afs@...ts.infradead.org,
        linux-nfs@...r.kernel.org, linux-cifs@...r.kernel.org,
        ceph-devel@...r.kernel.org, v9fs-developer@...ts.sourceforge.net,
        linux-fsdevel@...r.kernel.org,
        David Wysochanski <dwysocha@...hat.com>,
        Alexander Viro <viro@...iv.linux.org.uk>,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH v4 08/28] netfs: Provide readahead and readpage netfs helpers

Matthew Wilcox <willy@...radead.org> wrote:

> > +	while ((page = readahead_page(ractl)))
> > +		put_page(page);
> 
> You don't need this pair of lines (unless I'm missing something).
> read_pages() in mm/readahead.c puts the reference and unlocks any
> pages which are not read by the readahead op.  Indeed, I think doing
> this is buggy because you don't unlock the page.

Actually, I do need them.  The pages haven't been removed from the ractl at
this point so just returning would cause them all to be unlocked prematurely.

I don't pass the ractl to the filesystem or the cache because I may be calling
them for partial pages, I may be issuing multiple ops sequentially on a page
and the ractl may have ceased to exist by the time I issue an op.

The unlocking is done by netfs_rreq_unlock(), even for pages that didn't get
read.

I've added a comment to this effect.

David

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ