2003-01-19 21:30:35

by Martin Josefsson

[permalink] [raw]
Subject: problems with nfs-server in 2.5 bk as of 030115

Hi Trond,

This is the first time I've tried running an nfs-server in 2.5 and I
believe the problem I'm seeing is caused by your recent changes.

This kernel includes the two fixes you made.
"[PATCH] Fix RPC client warning in 2.5.58..."
and
"[PATCH] Fix NFS root mount handling"

I havn't seen any nfs/rpc related changes since these patches.

This is what I get when trying to start the nfs-server
(/etc/init.d/nfs-kernel-server in debian):

Installing knfsd (copyright (C) 1996 [email protected]).
RPC: Couldn't create pipefs entry /portmap/clntcfac0540
RPC: Couldn't create pipefs entry /portmap/clntcfac0540
RPC: Couldn't create pipefs entry /portmap/clntcfac0540

I've mounted the rpc_pipefs filesystem and the directory
portmap/clntcfac0540 is created. It's empty but created.
It gets created with 500 as permissions.

the directories at the root of the rpc_pipefs filesystem get created
correctly with the permissions that your patch changed but not the
entries in these directories.

portmap does run as user daemon on this system.

I did check to make sure your patches were included and they were.

Output from rpcinfo:
# rpcinfo -p localhost
program vers proto port
100000 2 tcp 111 portmapper
100000 2 udp 111 portmapper
100005 1 udp 32832 mountd
100005 1 tcp 35561 mountd
100005 2 udp 32832 mountd
100005 2 tcp 35561 mountd

modules loaded:

nfsd 118640 0
exportfs 4224 1 nfsd
lockd 61040 1 nfsd
sunrpc 115844 3 nfsd,lockd

relevant parts of .config:
CONFIG_NFS_FS=m
CONFIG_NFS_V3=y
CONFIG_NFS_V4=y
CONFIG_NFSD=m
CONFIG_NFSD_V3=y
CONFIG_NFSD_V4=y
# CONFIG_NFSD_TCP is not set
CONFIG_SUNRPC=m
# CONFIG_SUNRPC_GSS is not set
CONFIG_LOCKD=m
CONFIG_LOCKD_V4=y
CONFIG_EXPORTFS=m

kernel compiled with gcc 3.2.2 if that matters.

Looking forward to suggestions/patches to test :)

--
/Martin

Never argue with an idiot. They drag you down to their level, then beat you with experience.


2003-01-19 21:56:38

by Trond Myklebust

[permalink] [raw]
Subject: problems with nfs-server in 2.5 bk as of 030115

>>>>> " " == Martin Josefsson <[email protected]> writes:

> This is what I get when trying to start the nfs-server
> (/etc/init.d/nfs-kernel-server in debian):

> Installing knfsd (copyright (C) 1996 [email protected]). RPC:
> Couldn't create pipefs entry /portmap/clntcfac0540 RPC:
> Couldn't create pipefs entry /portmap/clntcfac0540 RPC:
> Couldn't create pipefs entry /portmap/clntcfac0540

Could you apply the following patch, so that I can see what the actual
returned error is?

Cheers,
Trond

--- linux-2.5.59/net/sunrpc/clnt.c 2003-01-12 22:40:13.000000000 +0100
+++ linux-2.5.59-00-fix/net/sunrpc/clnt.c 2003-01-19 23:01:09.000000000 +0100
@@ -113,8 +113,8 @@
"/%s/clnt%p", clnt->cl_protname, clnt);
clnt->cl_dentry = rpc_mkdir(clnt->cl_pathname, clnt);
if (IS_ERR(clnt->cl_dentry)) {
- printk(KERN_INFO "RPC: Couldn't create pipefs entry %s\n",
- clnt->cl_pathname);
+ printk(KERN_INFO "RPC: Couldn't create pipefs entry %s, error %ld\n",
+ clnt->cl_pathname, PTR_ERR(clnt->cl_dentry));
goto out_no_path;
}
if (!rpcauth_create(flavor, clnt)) {

2003-01-19 22:41:07

by Martin Josefsson

[permalink] [raw]
Subject: Re: problems with nfs-server in 2.5 bk as of 030115

On Sun, 2003-01-19 at 23:05, Trond Myklebust wrote:

> Could you apply the following patch, so that I can see what the actual
> returned error is?

RPC: Couldn't create pipefs entry /portmap/clnteb11b574, error -17
RPC: Couldn't create pipefs entry /portmap/clnteb11b574, error -17
RPC: Couldn't create pipefs entry /portmap/clnteb11b574, error -17

--
/Martin

Never argue with an idiot. They drag you down to their level, then beat you with experience.

2003-01-19 23:13:30

by Martin Josefsson

[permalink] [raw]
Subject: Re: problems with nfs-server in 2.5 bk as of 030115

On Sun, 2003-01-19 at 23:50, Martin Josefsson wrote:
> On Sun, 2003-01-19 at 23:05, Trond Myklebust wrote:
>
> > Could you apply the following patch, so that I can see what the actual
> > returned error is?
>
> RPC: Couldn't create pipefs entry /portmap/clnteb11b574, error -17
> RPC: Couldn't create pipefs entry /portmap/clnteb11b574, error -17
> RPC: Couldn't create pipefs entry /portmap/clnteb11b574, error -17

it appears it is this code in rpc_lookup_negative() that returns -EEXIST
I added a debug-printk and it was printed.

if (dentry->d_inode) {
dput(dentry);
dentry = ERR_PTR(-EEXIST);
goto out_err;
}

--
/Martin

Never argue with an idiot. They drag you down to their level, then beat you with experience.

2003-01-19 23:15:44

by Trond Myklebust

[permalink] [raw]
Subject: Re: problems with nfs-server in 2.5 bk as of 030115

>>>>> " " == Martin Josefsson <[email protected]> writes:

> On Sun, 2003-01-19 at 23:05, Trond Myklebust wrote:
>> Could you apply the following patch, so that I can see what the
>> actual returned error is?

> RPC: Couldn't create pipefs entry /portmap/clnteb11b574, error
> -17 RPC: Couldn't create pipefs entry /portmap/clnteb11b574,
> error -17 RPC: Couldn't create pipefs entry
> /portmap/clnteb11b574, error -17

OK. That's what I thought it might be...

Looks like rmdir() is failing, so that when 'clnt' gets reused, then
a directory with the old pathname still exists so mkdir() fails...

Could you try applying the following extra patch, just in order to
confirm that this is indeed the case (and to trace what the eventual
rmdir() error might be)?

Cheers,
Trond

--- linux-2.5.59-00-fix/net/sunrpc/clnt.c.orig 2003-01-12 22:40:13.000000000 +0100
+++ linux-2.5.59-00-fix/net/sunrpc/clnt.c 2003-01-20 00:19:15.000000000 +0100
@@ -135,7 +135,12 @@
printk(KERN_INFO "RPC: out of memory in rpc_create_client\n");
goto out;
out_no_auth:
- rpc_rmdir(clnt->cl_pathname);
+ {
+ int error = rpc_rmdir(clnt->cl_pathname);
+ if (error)
+ printk(KERN_INFO "%s: rpc_rmdir(%s) failed with error %d\n",
+ __FUNCTION__, clnt->cl_pathname, error)
+ }
out_no_path:
kfree(clnt);
clnt = NULL;
@@ -188,7 +193,12 @@
rpcauth_destroy(clnt->cl_auth);
clnt->cl_auth = NULL;
}
- rpc_rmdir(clnt->cl_pathname);
+ {
+ int error = rpc_rmdir(clnt->cl_pathname);
+ if (error)
+ printk(KERN_INFO "%s: rpc_rmdir(%s) failed with error %d\n",
+ __FUNCTION__, clnt->cl_pathname, error)
+ }
if (clnt->cl_xprt) {
xprt_destroy(clnt->cl_xprt);
clnt->cl_xprt = NULL;

2003-01-20 00:08:21

by Martin Josefsson

[permalink] [raw]
Subject: Re: problems with nfs-server in 2.5 bk as of 030115

On Mon, 2003-01-20 at 00:24, Trond Myklebust wrote:
> >>>>> " " == Martin Josefsson <[email protected]> writes:
>
> > On Sun, 2003-01-19 at 23:05, Trond Myklebust wrote:
> >> Could you apply the following patch, so that I can see what the
> >> actual returned error is?
>
> > RPC: Couldn't create pipefs entry /portmap/clnteb11b574, error
> > -17 RPC: Couldn't create pipefs entry /portmap/clnteb11b574,
> > error -17 RPC: Couldn't create pipefs entry
> > /portmap/clnteb11b574, error -17
>
> OK. That's what I thought it might be...
>
> Looks like rmdir() is failing, so that when 'clnt' gets reused, then
> a directory with the old pathname still exists so mkdir() fails...
>
> Could you try applying the following extra patch, just in order to
> confirm that this is indeed the case (and to trace what the eventual
> rmdir() error might be)?

With two added ; the patch compiled and produced this output:

Installing knfsd (copyright (C) 1996 [email protected]).
rpc_destroy_client: rpc_rmdir(/portmap/clnteb10c63c) failed with error -39
RPC: Couldn't create pipefs entry /portmap/clnteb10c63c, error -17
RPC: Couldn't create pipefs entry /portmap/clnteb10c63c, error -17
RPC: Couldn't create pipefs entry /portmap/clnteb10c63c, error -17

--
/Martin

Never argue with an idiot. They drag you down to their level, then beat you with experience.

2003-01-20 00:51:10

by Trond Myklebust

[permalink] [raw]
Subject: Re: problems with nfs-server in 2.5 bk as of 030115

>>>>> " " == Martin Josefsson <[email protected]> writes:

> With two added ; the patch compiled and produced this output:

> Installing knfsd (copyright (C) 1996 [email protected]).
> rpc_destroy_client: rpc_rmdir(/portmap/clnteb10c63c) failed
> with error -39 RPC: Couldn't create pipefs entry
> /portmap/clnteb10c63c, error -17 RPC: Couldn't create pipefs
> entry /portmap/clnteb10c63c, error -17 RPC: Couldn't create
> pipefs entry /portmap/clnteb10c63c, error -17

Hmm... Does the following help?

Cheers,
Trond

--- linux-2.5.59-00-fix/net/sunrpc/rpc_pipe.c.orig 2003-01-14 16:29:23.000000000 +0100
+++ linux-2.5.59-00-fix/net/sunrpc/rpc_pipe.c 2003-01-20 01:38:59.000000000 +0100
@@ -476,15 +476,16 @@
* FIXME: This probably has races.
*/
static void
-rpc_depopulate(struct dentry *dir)
+rpc_depopulate(struct dentry *parent)
{
+ struct inode *dir = parent->d_inode;
LIST_HEAD(head);
struct list_head *pos, *next;
struct dentry *dentry;

- down(&dir->d_inode->i_sem);
+ down(&dir->i_sem);
spin_lock(&dcache_lock);
- list_for_each_safe(pos, next, &dir->d_subdirs) {
+ list_for_each_safe(pos, next, &parent->d_subdirs) {
dentry = list_entry(pos, struct dentry, d_child);
if (!d_unhashed(dentry)) {
dget_locked(dentry);
@@ -498,32 +499,34 @@
list_del_init(&dentry->d_hash);
if (dentry->d_inode) {
rpc_inode_setowner(dentry->d_inode, NULL);
- simple_unlink(dir->d_inode, dentry);
+ simple_unlink(dir, dentry);
}
dput(dentry);
}
- up(&dir->d_inode->i_sem);
+ up(&dir->i_sem);
}

static int
-rpc_populate(struct dentry *dir,
+rpc_populate(struct dentry *parent,
struct rpc_filelist *files,
int start, int eof)
{
- void *private = RPC_I(dir->d_inode)->private;
+ struct inode *inode, *dir = parent->d_inode;
+ void *private = RPC_I(dir)->private;
struct qstr name;
struct dentry *dentry;
- struct inode *inode;
int mode, i;
+
+ down(&dir->i_sem);
for (i = start; i < eof; i++) {
name.name = files[i].name;
name.len = strlen(name.name);
name.hash = full_name_hash(name.name, name.len);
- dentry = d_alloc(dir, &name);
+ dentry = d_alloc(parent, &name);
if (!dentry)
goto out_bad;
mode = files[i].mode;
- inode = rpc_get_inode(dir->d_inode->i_sb, mode);
+ inode = rpc_get_inode(dir->i_sb, mode);
if (!inode) {
dput(dentry);
goto out_bad;
@@ -534,13 +537,15 @@
if (private)
rpc_inode_setowner(inode, private);
if (S_ISDIR(mode))
- dir->d_inode->i_nlink++;
+ dir->i_nlink++;
d_add(dentry, inode);
}
+ up(&dir->i_sem);
return 0;
out_bad:
+ up(&dir->i_sem);
printk(KERN_WARNING "%s: %s failed to populate directory %s\n",
- __FILE__, __FUNCTION__, dir->d_name.name);
+ __FILE__, __FUNCTION__, parent->d_name.name);
return -ENOMEM;
}

2003-01-20 01:11:27

by Trond Myklebust

[permalink] [raw]
Subject: Re: problems with nfs-server in 2.5 bk as of 030115

>>>>> " " == Martin Josefsson <[email protected]> writes:

> Do you have working nfs-server?

Yes (and I see no messages such as the ones you describe)...

Cheers,
Trond

2003-01-20 01:08:34

by Martin Josefsson

[permalink] [raw]
Subject: Re: problems with nfs-server in 2.5 bk as of 030115

On Mon, 2003-01-20 at 02:00, Trond Myklebust wrote:
> >>>>> " " == Martin Josefsson <[email protected]> writes:
>
> > With two added ; the patch compiled and produced this output:
>
> > Installing knfsd (copyright (C) 1996 [email protected]).
> > rpc_destroy_client: rpc_rmdir(/portmap/clnteb10c63c) failed
> > with error -39 RPC: Couldn't create pipefs entry
> > /portmap/clnteb10c63c, error -17 RPC: Couldn't create pipefs
> > entry /portmap/clnteb10c63c, error -17 RPC: Couldn't create
> > pipefs entry /portmap/clnteb10c63c, error -17
>
> Hmm... Does the following help?

I'm afraid not, I get the exact same errormessage as without this patch.
(the one above)

Do you have working nfs-server?

--
/Martin

Never argue with an idiot. They drag you down to their level, then beat you with experience.

2003-01-20 01:17:23

by Martin Josefsson

[permalink] [raw]
Subject: Re: problems with nfs-server in 2.5 bk as of 030115

On Mon, 2003-01-20 at 02:20, Trond Myklebust wrote:
> >>>>> " " == Martin Josefsson <[email protected]> writes:
>
> > Do you have working nfs-server?
>
> Yes (and I see no messages such as the ones you describe)...

Can it have anything to do with my .config?
Anything I should try diffrently?

--
/Martin

Never argue with an idiot. They drag you down to their level, then beat you with experience.

2003-01-20 01:25:54

by Trond Myklebust

[permalink] [raw]
Subject: problems with nfs-server in 2.5 bk as of 030115

>>>>> " " == Martin Josefsson <[email protected]> writes:

> I've mounted the rpc_pipefs filesystem and the directory
> portmap/clntcfac0540 is created. It's empty but created. It
> gets created with 500 as permissions.

Ah... Can this be the same problem as before? Try this...

Cheers,
Trond

--- linux-2.5.59-00-fix/net/sunrpc/rpc_pipe.c.orig 2003-01-14 16:29:23.000000000 +0100
+++ linux-2.5.59-00-fix/net/sunrpc/rpc_pipe.c 2003-01-20 02:30:38.000000000 +0100
@@ -549,7 +549,7 @@
{
struct inode *inode;

- inode = rpc_get_inode(dir->i_sb, S_IFDIR | S_IRUSR | S_IXUSR);
+ inode = rpc_get_inode(dir->i_sb, S_IFDIR | S_IRUGO | S_IXUGO);
if (!inode)
goto out_err;
inode->i_ino = iunique(dir->i_sb, 100);

2003-01-20 01:41:20

by Martin Josefsson

[permalink] [raw]
Subject: Re: problems with nfs-server in 2.5 bk as of 030115

On Mon, 2003-01-20 at 02:34, Trond Myklebust wrote:
> >>>>> " " == Martin Josefsson <[email protected]> writes:
>
> > I've mounted the rpc_pipefs filesystem and the directory
> > portmap/clntcfac0540 is created. It's empty but created. It
> > gets created with 500 as permissions.
>
> Ah... Can this be the same problem as before? Try this...

Now the directories under portmap/ are created with 555 permissions but
I still get the exact same messages and the directories are still empty
except for this weird thing:

# ls portmap/clnteb2bbc7c
info

# ls portmap/clnteb2bbc7c -l
ls: portmap/clnteb2bbc7c/info: No such file or directory
total 0


--
/Martin

Never argue with an idiot. They drag you down to their level, then beat you with experience.

2003-01-20 01:52:52

by Trond Myklebust

[permalink] [raw]
Subject: Re: problems with nfs-server in 2.5 bk as of 030115

>>>>> " " == Martin Josefsson <[email protected]> writes:

> # ls portmap/clnteb2bbc7c -l
> ls: portmap/clnteb2bbc7c/info: No such file or directory total
> 0

OK. Try this...

Cheers,
Trond

--- linux-2.5.59-00-fix/net/sunrpc/rpc_pipe.c.orig 2003-01-14 16:29:23.000000000 +0100
+++ linux-2.5.59-00-fix/net/sunrpc/rpc_pipe.c 2003-01-20 02:58:08.000000000 +0100
@@ -569,6 +569,7 @@
{
int error;

+ shrink_dcache_parent(dentry);
rpc_inode_setowner(dentry->d_inode, NULL);
if ((error = simple_rmdir(dir, dentry)) != 0)
return error;

2003-01-20 02:08:26

by Martin Josefsson

[permalink] [raw]
Subject: Re: problems with nfs-server in 2.5 bk as of 030115

On Mon, 2003-01-20 at 03:01, Trond Myklebust wrote:
> >>>>> " " == Martin Josefsson <[email protected]> writes:
>
> > # ls portmap/clnteb2bbc7c -l
> > ls: portmap/clnteb2bbc7c/info: No such file or directory total
> > 0
>
> OK. Try this...

Ohh, now it works, or at least it starts. It doesn't complain about
anything now.

And it actually works, I tried mounting an exported directory on another
machine and it works!

This is with all 5 patches you sent, I just applied them as I got them.
If you want I can try with just a few of them, just tell me which you
want me to test.

Thank you _very_ much for the rapid help.

--
/Martin

Never argue with an idiot. They drag you down to their level, then beat you with experience.