提交 1a4c6be4 编写于 作者: L Linus Torvalds

Merge branch 'hotfixes' of git://git.linux-nfs.org/projects/trondmy/nfs-2.6

* 'hotfixes' of git://git.linux-nfs.org/projects/trondmy/nfs-2.6:
  Wrap buffers used for rpc debug printks into RPC_IFDEBUG
  nfs: fix sparse warnings
  NFS: flush signals before taking down callback thread
...@@ -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);
......
...@@ -93,6 +93,7 @@ static void nfs_callback_svc(struct svc_rqst *rqstp) ...@@ -93,6 +93,7 @@ static void nfs_callback_svc(struct svc_rqst *rqstp)
svc_process(rqstp); svc_process(rqstp);
} }
flush_signals(current);
svc_exit_thread(rqstp); svc_exit_thread(rqstp);
nfs_callback_info.pid = 0; nfs_callback_info.pid = 0;
complete(&nfs_callback_info.stopped); complete(&nfs_callback_info.stopped);
...@@ -171,7 +172,7 @@ void nfs_callback_down(void) ...@@ -171,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);
......
...@@ -254,7 +254,7 @@ static __be32 encode_attr_change(struct xdr_stream *xdr, const uint32_t *bitmap, ...@@ -254,7 +254,7 @@ static __be32 encode_attr_change(struct xdr_stream *xdr, const uint32_t *bitmap,
if (!(bitmap[0] & FATTR4_WORD0_CHANGE)) if (!(bitmap[0] & FATTR4_WORD0_CHANGE))
return 0; return 0;
p = xdr_reserve_space(xdr, 8); p = xdr_reserve_space(xdr, 8);
if (unlikely(p == 0)) if (unlikely(!p))
return htonl(NFS4ERR_RESOURCE); return htonl(NFS4ERR_RESOURCE);
p = xdr_encode_hyper(p, change); p = xdr_encode_hyper(p, change);
return 0; return 0;
...@@ -267,7 +267,7 @@ static __be32 encode_attr_size(struct xdr_stream *xdr, const uint32_t *bitmap, u ...@@ -267,7 +267,7 @@ static __be32 encode_attr_size(struct xdr_stream *xdr, const uint32_t *bitmap, u
if (!(bitmap[0] & FATTR4_WORD0_SIZE)) if (!(bitmap[0] & FATTR4_WORD0_SIZE))
return 0; return 0;
p = xdr_reserve_space(xdr, 8); p = xdr_reserve_space(xdr, 8);
if (unlikely(p == 0)) if (unlikely(!p))
return htonl(NFS4ERR_RESOURCE); return htonl(NFS4ERR_RESOURCE);
p = xdr_encode_hyper(p, size); p = xdr_encode_hyper(p, size);
return 0; return 0;
...@@ -278,7 +278,7 @@ static __be32 encode_attr_time(struct xdr_stream *xdr, const struct timespec *ti ...@@ -278,7 +278,7 @@ static __be32 encode_attr_time(struct xdr_stream *xdr, const struct timespec *ti
__be32 *p; __be32 *p;
p = xdr_reserve_space(xdr, 12); p = xdr_reserve_space(xdr, 12);
if (unlikely(p == 0)) if (unlikely(!p))
return htonl(NFS4ERR_RESOURCE); return htonl(NFS4ERR_RESOURCE);
p = xdr_encode_hyper(p, time->tv_sec); p = xdr_encode_hyper(p, time->tv_sec);
*p = htonl(time->tv_nsec); *p = htonl(time->tv_nsec);
......
...@@ -49,7 +49,7 @@ static int nfs_delegation_claim_locks(struct nfs_open_context *ctx, struct nfs4_ ...@@ -49,7 +49,7 @@ static int nfs_delegation_claim_locks(struct nfs_open_context *ctx, struct nfs4_
struct file_lock *fl; struct file_lock *fl;
int status; int status;
for (fl = inode->i_flock; fl != 0; fl = fl->fl_next) { for (fl = inode->i_flock; fl != NULL; fl = fl->fl_next) {
if (!(fl->fl_flags & (FL_POSIX|FL_FLOCK))) if (!(fl->fl_flags & (FL_POSIX|FL_FLOCK)))
continue; continue;
if (nfs_file_open_context(fl->fl_file) != ctx) if (nfs_file_open_context(fl->fl_file) != ctx)
......
...@@ -309,7 +309,7 @@ nfs_idmap_name(struct idmap *idmap, struct idmap_hashtable *h, ...@@ -309,7 +309,7 @@ nfs_idmap_name(struct idmap *idmap, struct idmap_hashtable *h,
mutex_lock(&idmap->idmap_im_lock); mutex_lock(&idmap->idmap_im_lock);
he = idmap_lookup_id(h, id); he = idmap_lookup_id(h, id);
if (he != 0) { if (he) {
memcpy(name, he->ih_name, he->ih_namelen); memcpy(name, he->ih_name, he->ih_namelen);
ret = he->ih_namelen; ret = he->ih_namelen;
goto out; goto out;
......
...@@ -785,7 +785,7 @@ static int nfs4_reclaim_locks(struct nfs4_state_recovery_ops *ops, struct nfs4_s ...@@ -785,7 +785,7 @@ static int nfs4_reclaim_locks(struct nfs4_state_recovery_ops *ops, struct nfs4_s
struct file_lock *fl; struct file_lock *fl;
int status = 0; int status = 0;
for (fl = inode->i_flock; fl != 0; fl = fl->fl_next) { for (fl = inode->i_flock; fl != NULL; fl = fl->fl_next) {
if (!(fl->fl_flags & (FL_POSIX|FL_FLOCK))) if (!(fl->fl_flags & (FL_POSIX|FL_FLOCK)))
continue; continue;
if (nfs_file_open_context(fl->fl_file)->state != state) if (nfs_file_open_context(fl->fl_file)->state != state)
......
...@@ -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% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册