diff -Naurp 08-idmap_fixes/include/linux/sunrpc/debug.h 09-pipefs_trace/include/linux/sunrpc/debug.h --- 08-idmap_fixes/include/linux/sunrpc/debug.h Sun May 4 19:53:13 2003 +++ 09-pipefs_trace/include/linux/sunrpc/debug.h Thu May 8 21:38:26 2003 @@ -32,6 +32,7 @@ #define RPCDBG_AUTH 0x0010 #define RPCDBG_PMAP 0x0020 #define RPCDBG_SCHED 0x0040 +#define RPCDBG_PIPE 0x0080 #define RPCDBG_SVCSOCK 0x0100 #define RPCDBG_SVCDSP 0x0200 #define RPCDBG_MISC 0x0400 diff -Naurp 08-idmap_fixes/net/sunrpc/rpc_pipe.c 09-pipefs_trace/net/sunrpc/rpc_pipe.c --- 08-idmap_fixes/net/sunrpc/rpc_pipe.c Sun May 4 19:53:09 2003 +++ 09-pipefs_trace/net/sunrpc/rpc_pipe.c Thu May 8 21:53:07 2003 @@ -28,6 +28,10 @@ #include #include +#ifdef RPC_DEBUG +# define RPCDBG_FACILITY RPCDBG_PIPE +#endif + static struct vfsmount *rpc_mount; static int rpc_mount_count; @@ -89,6 +93,8 @@ rpc_queue_upcall(struct inode *inode, st res = -EPIPE; up(&inode->i_sem); wake_up(&rpci->waitq); + dprintk("RPC: RPC upcall: msg %p%s queued\n", msg, + (res ? " not" : "")); return res; } @@ -131,6 +137,8 @@ rpc_pipe_open(struct inode *inode, struc rpci->nreaders ++; res = 0; } + dprintk("RPC: rpc_pipe_open '%s', inode=%p, readers=%d\n", + filp->f_dentry->d_name.name, inode, rpci->nreaders); up(&inode->i_sem); return res; } @@ -151,6 +159,8 @@ rpc_pipe_release(struct inode *inode, st rpci->nreaders --; if (!rpci->nreaders) __rpc_purge_upcall(inode, -EPIPE); + dprintk("RPC: rpc_pipe_release '%s', inode=%p, readers=%d\n", + filp->f_dentry->d_name.name, inode, rpci->nreaders); up(&inode->i_sem); return 0; } @@ -189,6 +199,8 @@ rpc_pipe_read(struct file *filp, char *b } out_unlock: up(&inode->i_sem); + dprintk("RPC: rpc_pipe_read '%s', len=%u, result=%d\n", + filp->f_dentry->d_name.name, len, res); return res; } @@ -204,6 +216,8 @@ rpc_pipe_write(struct file *filp, const if (rpci->private != NULL) res = rpci->ops->downcall(filp, buf, len); up(&inode->i_sem); + dprintk("RPC: rpc_pipe_write '%s', len=%u, result=%d\n", + filp->f_dentry->d_name.name, len, res); return res; } @@ -221,6 +235,8 @@ rpc_pipe_poll(struct file *filp, struct mask |= POLLERR | POLLHUP; if (!list_empty(&rpci->pipe)) mask |= POLLIN | POLLRDNORM; + dprintk("RPC: rpc_pipe_poll '%s', mask=%u\n", + filp->f_dentry->d_name.name, mask); return mask; } @@ -231,6 +247,9 @@ rpc_pipe_ioctl(struct inode *ino, struct struct rpc_inode *rpci = RPC_I(filp->f_dentry->d_inode); int len; + dprintk("RPC: rpc_pipe_ioctl '%s', cmd=%u, arg=%lu\n", + filp->f_dentry->d_name.name, cmd, arg); + switch (cmd) { case FIONREAD: if (!rpci->private) @@ -295,6 +314,8 @@ rpc_info_open(struct inode *inode, struc } up(&inode->i_sem); } + dprintk("RPC: rpc_info_open '%s', inode=%p\n", + file->f_dentry->d_name.name, inode); return ret; } @@ -304,6 +325,8 @@ rpc_info_release(struct inode *inode, st struct seq_file *m = file->private_data; struct rpc_clnt *clnt = (struct rpc_clnt *)m->private; + dprintk("RPC: rpc_info_release '%s', inode=%p\n", + file->f_dentry->d_name.name, inode); if (clnt) rpc_release_client(clnt); return single_release(inode, file); @@ -591,8 +614,11 @@ rpc_mkdir(char *path, struct rpc_clnt *r int error; dentry = rpc_lookup_negative(path, &nd); - if (IS_ERR(dentry)) + if (IS_ERR(dentry)) { + dprintk("RPC: rpc_mkdir '%s' clnt=%p, error=%lu\n", + path, rpc_client, PTR_ERR(dentry)); return dentry; + } dir = nd.dentry->d_inode; if ((error = __rpc_mkdir(dir, dentry)) != 0) goto err_dput; @@ -604,6 +630,8 @@ rpc_mkdir(char *path, struct rpc_clnt *r out: up(&dir->i_sem); rpc_release_path(&nd); + dprintk("RPC: rpc_mkdir '%s' clnt=%p, dentry=%p\n", + path, rpc_client, dentry); return dentry; err_depopulate: rpc_depopulate(dentry); @@ -625,7 +653,7 @@ rpc_rmdir(char *path) int error; if ((error = rpc_lookup_parent(path, &nd)) != 0) - return error; + goto out; dir = nd.dentry->d_inode; down(&dir->i_sem); dentry = lookup_hash(&nd.last, nd.dentry); @@ -639,6 +667,8 @@ rpc_rmdir(char *path) out_release: up(&dir->i_sem); rpc_release_path(&nd); +out: + dprintk("RPC: rpc_rmdir '%s', error=%d\n", path, error); return error; } @@ -651,8 +681,11 @@ rpc_mkpipe(char *path, void *private, st struct rpc_inode *rpci; dentry = rpc_lookup_negative(path, &nd); - if (IS_ERR(dentry)) + if (IS_ERR(dentry)) { + dprintk("RPC: rpc_mkpipe '%s', error=%lu\n", + path, PTR_ERR(dentry)); return dentry; + } dir = nd.dentry->d_inode; inode = rpc_get_inode(dir->i_sb, S_IFSOCK | S_IRUSR | S_IXUSR); if (!inode) @@ -667,6 +700,7 @@ rpc_mkpipe(char *path, void *private, st out: up(&dir->i_sem); rpc_release_path(&nd); + dprintk("RPC: rpc_mkpipe '%s', dentry=%p\n", path, dentry); return dentry; err_dput: dput(dentry); @@ -685,7 +719,7 @@ rpc_unlink(char *path) int error; if ((error = rpc_lookup_parent(path, &nd)) != 0) - return error; + goto out; dir = nd.dentry->d_inode; down(&dir->i_sem); dentry = lookup_hash(&nd.last, nd.dentry); @@ -703,6 +737,8 @@ rpc_unlink(char *path) out_release: up(&dir->i_sem); rpc_release_path(&nd); +out: + dprintk("RPC: rpc_unlink pipe '%s', error=%d\n", path, error); return error; }