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: <CADZ9YHhq91+Td03OjWbX0rwHwb6Y7QhicsuDqqAUSy2O8=05BA@mail.gmail.com>
Date:	Mon, 31 Oct 2011 23:12:50 +0600
From:	Rakib Mullick <rakib.mullick@...il.com>
To:	Trond Myklebust <Trond.Myklebust@...app.com>
Cc:	linux-kernel@...r.kernel.org, linux-nfs@...r.kernel.org,
	akpm@...ux-foundation.org
Subject: Re: [PATCH] nfs: Fix unused variable warning.

On Mon, Oct 31, 2011 at 9:18 PM, Trond Myklebust
<Trond.Myklebust@...app.com> wrote:
> On Fri, 2011-10-28 at 16:36 +0600, Rakib Mullick wrote:
>
> This will still cause a warning if you compile without RPC_DEBUG (e.g.
> if CONFIG_SYSCTL isn't defined).
>
I didn't get any warning with CONFIG_SYSCTL=n.

> Since there is only one user, it seems better to just open-code the
> NFS_SERVER(data->inode) in the dprintk()...

Okay, it seems reasonable. We can simply remove 'server'. Please
consider the following patch (also attached, might have some white
space issue).

---

 When CONFIG_NFS=y and CONFIG_NFS_V3_{,V4}=n we get the following warning.
	
	fs/nfs/write.c: In function ‘nfs_writeback_done’:
	fs/nfs/write.c:1246:21: warning: unused variable ‘server’

 Remove the variable 'server' to fix the above warning.

Signed-off-by: Rakib Mullick <rakib.mullick@...il.com>
---

diff --git a/fs/nfs/write.c b/fs/nfs/write.c
index 2219c88..a2e4b27 100644
--- a/fs/nfs/write.c
+++ b/fs/nfs/write.c
@@ -1243,7 +1243,6 @@ void nfs_writeback_done(struct rpc_task *task,
struct nfs_write_data *data)
 {
 	struct nfs_writeargs	*argp = &data->args;
 	struct nfs_writeres	*resp = &data->res;
-	struct nfs_server	*server = NFS_SERVER(data->inode);
 	int status;

 	dprintk("NFS: %5u nfs_writeback_done (status %d)\n",
@@ -1277,7 +1276,7 @@ void nfs_writeback_done(struct rpc_task *task,
struct nfs_write_data *data)
 		if (time_before(complain, jiffies)) {
 			dprintk("NFS:       faulty NFS server %s:"
 				" (committed = %d) != (stable = %d)\n",
-				server->nfs_client->cl_hostname,
+				data->inode->nfs_client->cl_hostname,
 				resp->verf->committed, argp->stable);
 			complain = jiffies + 300 * HZ;
 		}

Download attachment "nfs_unused_var_fix.patch" of type "application/octet-stream" (1139 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ