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:	Wed, 25 Sep 2013 22:56:48 -0700
From:	Olof Johansson <olof@...om.net>
To:	Trond Myklebust <Trond.Myklebust@...app.com>,
	David Howells <dhowells@...hat.com>
Cc:	linux-nfs@...r.kernel.org, linux-kernel@...r.kernel.org,
	Olof Johansson <olof@...om.net>
Subject: [PATCH] NFS: Don't use debug-printk-only local variables

Due to commit 996a2493ed5d3a8d5db03b560fcbbf1ca3f10897 (NFS:
Use i_writecount to control whether to get an fscache cookie in
nfs_open(), in two instances a local variable is only used in debug
print statements. Said statements might be compiled out, which results
in unused variable warnings:

fs/nfs/fscache.c: In function 'nfs_fscache_release_page':
fs/nfs/fscache.c:263:21: warning: unused variable 'nfsi' [-Wunused-variable]

fs/nfs/fscache.c: In function '__nfs_fscache_invalidate_page':
fs/nfs/fscache.c:286:20: warning: unused variable 'nfsi' [-Wunused-variable]

Just skip the local variable in these cases.

Signed-off-by: Olof Johansson <olof@...om.net>
---

David,

This showed up in today's linux-next, seems to have come in through the fscache tree.

Either amend and roll in the fix (after review -- I'm guessing this is the right thing to do), or apply on top please. :)


Thanks!


-Olof

 fs/nfs/fscache.c |    6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/fs/nfs/fscache.c b/fs/nfs/fscache.c
index a01af20..3ef01f0 100644
--- a/fs/nfs/fscache.c
+++ b/fs/nfs/fscache.c
@@ -260,12 +260,11 @@ EXPORT_SYMBOL_GPL(nfs_fscache_open_file);
 int nfs_fscache_release_page(struct page *page, gfp_t gfp)
 {
 	if (PageFsCache(page)) {
-		struct nfs_inode *nfsi = NFS_I(page->mapping->host);
 		struct fscache_cookie *cookie = nfs_i_fscache(page->mapping->host);
 
 		BUG_ON(!cookie);
 		dfprintk(FSCACHE, "NFS: fscache releasepage (0x%p/0x%p/0x%p)\n",
-			 cookie, page, nfsi);
+			 cookie, page, NFS_I(page->mapping->host));
 
 		if (!fscache_maybe_release_page(cookie, page, gfp))
 			return 0;
@@ -283,13 +282,12 @@ int nfs_fscache_release_page(struct page *page, gfp_t gfp)
  */
 void __nfs_fscache_invalidate_page(struct page *page, struct inode *inode)
 {
-	struct nfs_inode *nfsi = NFS_I(inode);
 	struct fscache_cookie *cookie = nfs_i_fscache(inode);
 
 	BUG_ON(!cookie);
 
 	dfprintk(FSCACHE, "NFS: fscache invalidatepage (0x%p/0x%p/0x%p)\n",
-		 cookie, page, nfsi);
+		 cookie, page, NFS_I(inode));
 
 	fscache_wait_on_page_write(cookie, page);
 
-- 
1.7.10.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ