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:   Mon, 26 Apr 2021 22:09:39 +0100
From:   Matthew Wilcox <willy@...radead.org>
To:     David Howells <dhowells@...hat.com>
Cc:     linux-fsdevel@...r.kernel.org,
        Alexander Viro <viro@...iv.linux.org.uk>,
        linux-nfs@...r.kernel.org, linux-cifs@...r.kernel.org,
        ceph-devel@...r.kernel.org, Marc Dionne <marc.dionne@...istor.com>,
        Mike Marshall <hubcap@...ibond.com>,
        Linus Torvalds <torvalds@...ux-foundation.org>,
        linux-cachefs@...hat.com, Jeff Layton <jlayton@...nel.org>,
        Christoph Hellwig <hch@....de>,
        v9fs-developer@...ts.sourceforge.net, linux-mm@...ck.org,
        linux-afs@...ts.infradead.org,
        Dave Wysochanski <dwysocha@...hat.com>,
        Trond Myklebust <trond.myklebust@...merspace.com>,
        Anna Schumaker <anna.schumaker@...app.com>,
        Steve French <sfrench@...ba.org>,
        Dominique Martinet <asmadeus@...ewreck.org>,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH] netfs: Miscellaneous fixes

On Mon, Apr 26, 2021 at 10:06:24PM +0100, David Howells wrote:
> @@ -968,7 +968,7 @@ int netfs_readpage(struct file *file,
>  		return -ENOMEM;
>  	}
>  	rreq->mapping	= page_file_mapping(page);
> -	rreq->start	= page_index(page) * PAGE_SIZE;
> +	rreq->start	= page_offset(page);

This one needs to use page_file_offset() because swap-over-NFS.

> @@ -1105,8 +1105,8 @@ int netfs_write_begin(struct file *file, struct address_space *mapping,
>  	rreq = netfs_alloc_read_request(ops, netfs_priv, file);
>  	if (!rreq)
>  		goto error;
> -	rreq->mapping		= page->mapping;
> -	rreq->start		= page->index * PAGE_SIZE;
> +	rreq->mapping		= page_file_mapping(page);

There's nothing wrong with using page->mapping here.  The swap-over-NFS
path doesn't use write_begin, it uses O_DIRECT writes.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ