mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-12-04 09:34:12 +08:00
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
This commit is contained in:
commit
1a4c6be4ac
@ -153,7 +153,7 @@ lockd(struct svc_rqst *rqstp)
|
||||
*/
|
||||
while ((nlmsvc_users || !signalled()) && nlmsvc_pid == current->pid) {
|
||||
long timeout = MAX_SCHEDULE_TIMEOUT;
|
||||
char buf[RPC_MAX_ADDRBUFLEN];
|
||||
RPC_IFDEBUG(char buf[RPC_MAX_ADDRBUFLEN]);
|
||||
|
||||
if (signalled()) {
|
||||
flush_signals(current);
|
||||
|
@ -93,6 +93,7 @@ static void nfs_callback_svc(struct svc_rqst *rqstp)
|
||||
svc_process(rqstp);
|
||||
}
|
||||
|
||||
flush_signals(current);
|
||||
svc_exit_thread(rqstp);
|
||||
nfs_callback_info.pid = 0;
|
||||
complete(&nfs_callback_info.stopped);
|
||||
@ -171,7 +172,7 @@ void nfs_callback_down(void)
|
||||
static int nfs_callback_authenticate(struct svc_rqst *rqstp)
|
||||
{
|
||||
struct nfs_client *clp;
|
||||
char buf[RPC_MAX_ADDRBUFLEN];
|
||||
RPC_IFDEBUG(char buf[RPC_MAX_ADDRBUFLEN]);
|
||||
|
||||
/* Don't talk to strangers */
|
||||
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,
|
||||
if (!(bitmap[0] & FATTR4_WORD0_CHANGE))
|
||||
return 0;
|
||||
p = xdr_reserve_space(xdr, 8);
|
||||
if (unlikely(p == 0))
|
||||
if (unlikely(!p))
|
||||
return htonl(NFS4ERR_RESOURCE);
|
||||
p = xdr_encode_hyper(p, change);
|
||||
return 0;
|
||||
@ -267,7 +267,7 @@ static __be32 encode_attr_size(struct xdr_stream *xdr, const uint32_t *bitmap, u
|
||||
if (!(bitmap[0] & FATTR4_WORD0_SIZE))
|
||||
return 0;
|
||||
p = xdr_reserve_space(xdr, 8);
|
||||
if (unlikely(p == 0))
|
||||
if (unlikely(!p))
|
||||
return htonl(NFS4ERR_RESOURCE);
|
||||
p = xdr_encode_hyper(p, size);
|
||||
return 0;
|
||||
@ -278,7 +278,7 @@ static __be32 encode_attr_time(struct xdr_stream *xdr, const struct timespec *ti
|
||||
__be32 *p;
|
||||
|
||||
p = xdr_reserve_space(xdr, 12);
|
||||
if (unlikely(p == 0))
|
||||
if (unlikely(!p))
|
||||
return htonl(NFS4ERR_RESOURCE);
|
||||
p = xdr_encode_hyper(p, time->tv_sec);
|
||||
*p = htonl(time->tv_nsec);
|
||||
|
@ -49,7 +49,7 @@ static int nfs_delegation_claim_locks(struct nfs_open_context *ctx, struct nfs4_
|
||||
struct file_lock *fl;
|
||||
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)))
|
||||
continue;
|
||||
if (nfs_file_open_context(fl->fl_file) != ctx)
|
||||
|
@ -309,7 +309,7 @@ nfs_idmap_name(struct idmap *idmap, struct idmap_hashtable *h,
|
||||
mutex_lock(&idmap->idmap_im_lock);
|
||||
|
||||
he = idmap_lookup_id(h, id);
|
||||
if (he != 0) {
|
||||
if (he) {
|
||||
memcpy(name, he->ih_name, he->ih_namelen);
|
||||
ret = he->ih_namelen;
|
||||
goto out;
|
||||
|
@ -785,7 +785,7 @@ static int nfs4_reclaim_locks(struct nfs4_state_recovery_ops *ops, struct nfs4_s
|
||||
struct file_lock *fl;
|
||||
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)))
|
||||
continue;
|
||||
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,
|
||||
{
|
||||
/* Check if the request originated from a secure port. */
|
||||
if (!rqstp->rq_secure && EX_SECURE(exp)) {
|
||||
char buf[RPC_MAX_ADDRBUFLEN];
|
||||
RPC_IFDEBUG(char buf[RPC_MAX_ADDRBUFLEN]);
|
||||
dprintk(KERN_WARNING
|
||||
"nfsd: request from insecure port %s!\n",
|
||||
svc_print_addr(rqstp, buf, sizeof(buf)));
|
||||
|
@ -175,7 +175,7 @@ static int svc_sendto(struct svc_rqst *rqstp, struct xdr_buf *xdr)
|
||||
size_t base = xdr->page_base;
|
||||
unsigned int pglen = xdr->page_len;
|
||||
unsigned int flags = MSG_MORE;
|
||||
char buf[RPC_MAX_ADDRBUFLEN];
|
||||
RPC_IFDEBUG(char buf[RPC_MAX_ADDRBUFLEN]);
|
||||
|
||||
slen = xdr->len;
|
||||
|
||||
@ -716,7 +716,7 @@ static struct svc_xprt *svc_tcp_accept(struct svc_xprt *xprt)
|
||||
struct socket *newsock;
|
||||
struct svc_sock *newsvsk;
|
||||
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);
|
||||
if (!sock)
|
||||
@ -1206,10 +1206,10 @@ static struct svc_xprt *svc_create_socket(struct svc_serv *serv,
|
||||
struct socket *sock;
|
||||
int error;
|
||||
int type;
|
||||
char buf[RPC_MAX_ADDRBUFLEN];
|
||||
struct sockaddr_storage addr;
|
||||
struct sockaddr *newsin = (struct sockaddr *)&addr;
|
||||
int newlen;
|
||||
RPC_IFDEBUG(char buf[RPC_MAX_ADDRBUFLEN]);
|
||||
|
||||
dprintk("svc: svc_create_socket(%s, %d, %s)\n",
|
||||
serv->sv_program->pg_name, protocol,
|
||||
|
Loading…
Reference in New Issue
Block a user