Commit 5216a8e7 authored by Pavel Emelyanov's avatar Pavel Emelyanov Committed by Trond Myklebust

Wrap buffers used for rpc debug printks into RPC_IFDEBUG

Sorry for the noise, but here's the v3 of this compilation fix :)

There are some places, which declare the char buf[...] on the stack
to push it later into dprintk(). Since the dprintk sometimes (if the
CONFIG_SYSCTL=n) becomes an empty do { } while (0) stub, these buffers
cause gcc to produce appropriate warnings.

Wrap these buffers with RPC_IFDEBUG macro, as Trond proposed, to
compile them out when not needed.
Signed-off-by: default avatarPavel Emelyanov <xemul@openvz.org>
Acked-by: default avatarJ. Bruce Fields <bfields@citi.umich.edu>
Signed-off-by: default avatarTrond Myklebust <Trond.Myklebust@netapp.com>
parent 90dc7d27
...@@ -153,7 +153,7 @@ lockd(struct svc_rqst *rqstp) ...@@ -153,7 +153,7 @@ lockd(struct svc_rqst *rqstp)
*/ */
while ((nlmsvc_users || !signalled()) && nlmsvc_pid == current->pid) { while ((nlmsvc_users || !signalled()) && nlmsvc_pid == current->pid) {
long timeout = MAX_SCHEDULE_TIMEOUT; long timeout = MAX_SCHEDULE_TIMEOUT;
char buf[RPC_MAX_ADDRBUFLEN]; RPC_IFDEBUG(char buf[RPC_MAX_ADDRBUFLEN]);
if (signalled()) { if (signalled()) {
flush_signals(current); flush_signals(current);
......
...@@ -172,7 +172,7 @@ void nfs_callback_down(void) ...@@ -172,7 +172,7 @@ void nfs_callback_down(void)
static int nfs_callback_authenticate(struct svc_rqst *rqstp) static int nfs_callback_authenticate(struct svc_rqst *rqstp)
{ {
struct nfs_client *clp; struct nfs_client *clp;
char buf[RPC_MAX_ADDRBUFLEN]; RPC_IFDEBUG(char buf[RPC_MAX_ADDRBUFLEN]);
/* Don't talk to strangers */ /* Don't talk to strangers */
clp = nfs_find_client(svc_addr(rqstp), 4); clp = nfs_find_client(svc_addr(rqstp), 4);
......
...@@ -101,7 +101,7 @@ static __be32 nfsd_setuser_and_check_port(struct svc_rqst *rqstp, ...@@ -101,7 +101,7 @@ static __be32 nfsd_setuser_and_check_port(struct svc_rqst *rqstp,
{ {
/* Check if the request originated from a secure port. */ /* Check if the request originated from a secure port. */
if (!rqstp->rq_secure && EX_SECURE(exp)) { if (!rqstp->rq_secure && EX_SECURE(exp)) {
char buf[RPC_MAX_ADDRBUFLEN]; RPC_IFDEBUG(char buf[RPC_MAX_ADDRBUFLEN]);
dprintk(KERN_WARNING dprintk(KERN_WARNING
"nfsd: request from insecure port %s!\n", "nfsd: request from insecure port %s!\n",
svc_print_addr(rqstp, buf, sizeof(buf))); svc_print_addr(rqstp, buf, sizeof(buf)));
......
...@@ -175,7 +175,7 @@ static int svc_sendto(struct svc_rqst *rqstp, struct xdr_buf *xdr) ...@@ -175,7 +175,7 @@ static int svc_sendto(struct svc_rqst *rqstp, struct xdr_buf *xdr)
size_t base = xdr->page_base; size_t base = xdr->page_base;
unsigned int pglen = xdr->page_len; unsigned int pglen = xdr->page_len;
unsigned int flags = MSG_MORE; unsigned int flags = MSG_MORE;
char buf[RPC_MAX_ADDRBUFLEN]; RPC_IFDEBUG(char buf[RPC_MAX_ADDRBUFLEN]);
slen = xdr->len; slen = xdr->len;
...@@ -716,7 +716,7 @@ static struct svc_xprt *svc_tcp_accept(struct svc_xprt *xprt) ...@@ -716,7 +716,7 @@ static struct svc_xprt *svc_tcp_accept(struct svc_xprt *xprt)
struct socket *newsock; struct socket *newsock;
struct svc_sock *newsvsk; struct svc_sock *newsvsk;
int err, slen; int err, slen;
char buf[RPC_MAX_ADDRBUFLEN]; RPC_IFDEBUG(char buf[RPC_MAX_ADDRBUFLEN]);
dprintk("svc: tcp_accept %p sock %p\n", svsk, sock); dprintk("svc: tcp_accept %p sock %p\n", svsk, sock);
if (!sock) if (!sock)
...@@ -1206,10 +1206,10 @@ static struct svc_xprt *svc_create_socket(struct svc_serv *serv, ...@@ -1206,10 +1206,10 @@ static struct svc_xprt *svc_create_socket(struct svc_serv *serv,
struct socket *sock; struct socket *sock;
int error; int error;
int type; int type;
char buf[RPC_MAX_ADDRBUFLEN];
struct sockaddr_storage addr; struct sockaddr_storage addr;
struct sockaddr *newsin = (struct sockaddr *)&addr; struct sockaddr *newsin = (struct sockaddr *)&addr;
int newlen; int newlen;
RPC_IFDEBUG(char buf[RPC_MAX_ADDRBUFLEN]);
dprintk("svc: svc_create_socket(%s, %d, %s)\n", dprintk("svc: svc_create_socket(%s, %d, %s)\n",
serv->sv_program->pg_name, protocol, serv->sv_program->pg_name, protocol,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment