From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.6 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_PASS,USER_AGENT_MUTT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id ECCF7C43219 for ; Wed, 1 May 2019 17:35:06 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id BD52C20866 for ; Wed, 1 May 2019 17:35:06 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="p8s+LmT9" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org BD52C20866 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=lst.de Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-mtd-bounces+linux-mtd=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=c1LBAw7I39Peu/3ZJh2lWLd3lZnY3tS2xj9EJVSIIAc=; b=p8s+LmT9P5QeOE cWLJml682AmyOgmPb52jbHTA2y9OTdWlEF+bQ+y0Db4tAVdy6fqRPTiVxfxDX3ywVctADhI7hS1e5 lydz9ECgyp/fY+NgzWtrWiGO53HVVZR6q5ficrolp0TH8bLn0uTsok6PBr8NG0tnNtw+1MzsspiMC tBy2hwK3wrbPjS3T97wfT2uSJD5PvUB0aBf3Uuayy3c4Ljkb/bcjAoaOJ4+AK0bUAWhS2ZxsnZCrX 5oi63r9nKnGjGD+JA4L4u6OGKaRsXhbcCb2ANZ2ZIRDPZhmzvIojb1C+nLKoJbiszbOYtJ+Pv4M0c iE5RmZn+C3LhWjpFpKtQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1hLt8K-0003Om-QP; Wed, 01 May 2019 17:35:04 +0000 Received: from verein.lst.de ([213.95.11.211] helo=newverein.lst.de) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1hLt8H-0002zd-W6 for linux-mtd@lists.infradead.org; Wed, 01 May 2019 17:35:03 +0000 Received: by newverein.lst.de (Postfix, from userid 2407) id 5364068AFE; Wed, 1 May 2019 19:34:43 +0200 (CEST) Date: Wed, 1 May 2019 19:34:43 +0200 From: Christoph Hellwig To: Andrew Morton Subject: [PATCH 5/4] 9p: pass the correct prototype to read_cache_page Message-ID: <20190501173443.GA19969@lst.de> References: <20190501160636.30841-1-hch@lst.de> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20190501160636.30841-1-hch@lst.de> User-Agent: Mutt/1.5.17 (2007-11-01) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190501_103502_284013_CDCBA371 X-CRM114-Status: GOOD ( 10.85 ) X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-nfs@vger.kernel.org, Kees Cook , Nick Desaulniers , linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-mtd@lists.infradead.org, Sami Tolvanen Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-mtd" Errors-To: linux-mtd-bounces+linux-mtd=archiver.kernel.org@lists.infradead.org Fix the callback 9p passes to read_cache_page to actually have the proper type expected. Casting around function pointers can easily hide typing bugs, and defeats control flow protection. Signed-off-by: Christoph Hellwig --- fs/9p/vfs_addr.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/fs/9p/vfs_addr.c b/fs/9p/vfs_addr.c index 0bcbcc20f769..02e0fc51401e 100644 --- a/fs/9p/vfs_addr.c +++ b/fs/9p/vfs_addr.c @@ -50,8 +50,9 @@ * @page: structure to page * */ -static int v9fs_fid_readpage(struct p9_fid *fid, struct page *page) +static int v9fs_fid_readpage(void *data, struct page *page) { + struct p9_fid *fid = data; struct inode *inode = page->mapping->host; struct bio_vec bvec = {.bv_page = page, .bv_len = PAGE_SIZE}; struct iov_iter to; @@ -122,7 +123,8 @@ static int v9fs_vfs_readpages(struct file *filp, struct address_space *mapping, if (ret == 0) return ret; - ret = read_cache_pages(mapping, pages, (void *)v9fs_vfs_readpage, filp); + ret = read_cache_pages(mapping, pages, v9fs_fid_readpage, + filp->private_data); p9_debug(P9_DEBUG_VFS, " = %d\n", ret); return ret; } -- 2.20.1 ______________________________________________________ Linux MTD discussion mailing list http://lists.infradead.org/mailman/listinfo/linux-mtd/