Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp6274890yba; Wed, 1 May 2019 09:07:56 -0700 (PDT) X-Google-Smtp-Source: APXvYqyP7I1POLa7+VAjH2JMcpJ3zld6Kd3GCuXqMGWIxXbL+Xm+uahia/APiK1WDvm0ptGYZgHq X-Received: by 2002:aa7:9148:: with SMTP id 8mr48106324pfi.176.1556726875959; Wed, 01 May 2019 09:07:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556726875; cv=none; d=google.com; s=arc-20160816; b=Puz/NGUqxwjpHwDY9gBo+3s1EkSGWrXjqVkgHAK1ACxRXj2tL31HIw4n6184Z3C0TS r7Pf5B520LTq8I2AGcaLqpOenX0SAlRyir14J6GKkK4qDu51oLBx9AuNnUlQyVcdWMuA KwrvjtfDCT8VrErT9pl2tH67+bxIebF6P2l6q8YRg3hsIoxdNPVNJMlOXPQgF1vfOeq3 5Wj4kJ7dxTzfmM82f72dTbFXtBRRHXeYwYa6tzCjeM7EB5piPP1swCq88ls7H0UfFz3v cKAlCn0m9NxTbgbvuor1eq/K4+4LLTlZWgRLckJ9mk5cjen2MrpjUJ9gbzDvrScd2AA/ 7PIw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=UYhsUC45x3BaFz65BgDHiQpOpAjMvMtZBCkBOB8hL5Q=; b=LHmEikFxcaPC5+Umdqiqv70xB1deX/qiMTL6yL59HfQYCXq/XT7e/BTV3Xx7Se1/jF hsjmtwaw3Y0pQBMBg5yW+4+drRtpD7zgN8aSqupAIWt8fibhLHBeAhN58SlUjaQdtA4W +0j00cUB36pggTY3k5rIYJqC0PI9j9dY+pE/HZipmNAKCJtx0UEvpBoZcp/8bE2LK1H+ kG8fFSKMfAJtJl5JQHEFwcfoQ2oDrYjB8DvstnU3xiLBuggCB4FqLN+KEV7PI8lo8kb3 wOHrWSp14JVZBBO3lhXM3Dy9zEJavme0ZQy3g+D9K/KKV05pxur5W30iFr1agWiHbQ4S i6Og== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b="N9hkv1/K"; spf=pass (google.com: best guess record for domain of linux-nfs-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j8si4362613pfn.74.2019.05.01.09.07.41; Wed, 01 May 2019 09:07:55 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-nfs-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b="N9hkv1/K"; spf=pass (google.com: best guess record for domain of linux-nfs-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726472AbfEAQHY (ORCPT + 99 others); Wed, 1 May 2019 12:07:24 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:35878 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726685AbfEAQHY (ORCPT ); Wed, 1 May 2019 12:07:24 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender :Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From :Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=UYhsUC45x3BaFz65BgDHiQpOpAjMvMtZBCkBOB8hL5Q=; b=N9hkv1/KxvUiY8l8aDh5EzrKDf aX39LFBLR0uVkQvhJLeEuPzxrJ0HtEIeY1e9ikhySWDweBLiPvDrdzTlg6Wi0QSSQyaH9yXwYdcov pBzp0wGVJgNK7NXNtPiDAUZ9JEhgdVCOcXx35OAT/umKz11Mt42tyvCSvcGByPL85Lm1hqWDO1jDB 3eWTieiEchWRQ2uYH/Y5x99PF4advsXL+oOmTaa4AVdjheR/oqOCWxx1j8RQR+gadGYSv+v5Gdcjt uilpaJBDPY/A3oCNijbOhKOerYmle8m2zgrUn4qQy2u/DTcJ71W+0FaQ0X2cTtzC+j/lhgvo5htPv w1zfZX8A==; Received: from adsl-173-228-226-134.prtc.net ([173.228.226.134] helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.90_1 #2 (Red Hat Linux)) id 1hLrlQ-0008P9-2K; Wed, 01 May 2019 16:07:20 +0000 From: Christoph Hellwig To: Andrew Morton Cc: Sami Tolvanen , Kees Cook , Nick Desaulniers , linux-mtd@lists.infradead.org, linux-nfs@vger.kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: [PATCH 4/4] jffs2: pass the correct prototype to read_cache_page Date: Wed, 1 May 2019 12:06:36 -0400 Message-Id: <20190501160636.30841-5-hch@lst.de> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190501160636.30841-1-hch@lst.de> References: <20190501160636.30841-1-hch@lst.de> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org Fix the callback jffs2 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/jffs2/file.c | 4 ++-- fs/jffs2/fs.c | 2 +- fs/jffs2/os-linux.h | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/fs/jffs2/file.c b/fs/jffs2/file.c index 7d8654a1472e..f8fb89b10227 100644 --- a/fs/jffs2/file.c +++ b/fs/jffs2/file.c @@ -109,9 +109,9 @@ static int jffs2_do_readpage_nolock (struct inode *inode, struct page *pg) return ret; } -int jffs2_do_readpage_unlock(struct inode *inode, struct page *pg) +int jffs2_do_readpage_unlock(void *data, struct page *pg) { - int ret = jffs2_do_readpage_nolock(inode, pg); + int ret = jffs2_do_readpage_nolock(data, pg); unlock_page(pg); return ret; } diff --git a/fs/jffs2/fs.c b/fs/jffs2/fs.c index eab04eca95a3..7fbe8a7843b9 100644 --- a/fs/jffs2/fs.c +++ b/fs/jffs2/fs.c @@ -686,7 +686,7 @@ unsigned char *jffs2_gc_fetch_page(struct jffs2_sb_info *c, struct page *pg; pg = read_cache_page(inode->i_mapping, offset >> PAGE_SHIFT, - (void *)jffs2_do_readpage_unlock, inode); + jffs2_do_readpage_unlock, inode); if (IS_ERR(pg)) return (void *)pg; diff --git a/fs/jffs2/os-linux.h b/fs/jffs2/os-linux.h index a2dbbb3f4c74..bd3d5f0ddc34 100644 --- a/fs/jffs2/os-linux.h +++ b/fs/jffs2/os-linux.h @@ -155,7 +155,7 @@ extern const struct file_operations jffs2_file_operations; extern const struct inode_operations jffs2_file_inode_operations; extern const struct address_space_operations jffs2_file_address_operations; int jffs2_fsync(struct file *, loff_t, loff_t, int); -int jffs2_do_readpage_unlock (struct inode *inode, struct page *pg); +int jffs2_do_readpage_unlock(void *data, struct page *pg); /* ioctl.c */ long jffs2_ioctl(struct file *, unsigned int, unsigned long); -- 2.20.1