Skip to contentSkip to conversation

mismatch between 2.6.19 and nfs-utils-1.0.10 nfsctl_arg structure???

DISCUSSION Wouter Batelaan 2 participants 5 messages Feb 20, 2007 – Feb 23, 2007 VFS

lore
Share & tools
lore
#0 lore raw

Hi,

I'm trying to get an nfs server setup on our embedded 2.6.19 kernel system. I've chosen to use the kernel nfsd module, and am using the latest nfs-utils.
It all starts running, but I get this:

    mount -t nfs 127.0.0.1:/etc /tmp/try

mount: 127.0.0.1:/etc failed, reason given by server: Permission denied
mount: nfsmount failed: Bad file descriptor
mount: Mounting 127.0.0.1:/etc on /tmp/try failed: Bad file descriptor

Having added a bit of debugging /var/log/messages shows this:
daemon.warn mountd[545]: getfh.c:73: getfh_size (/etc) daemon.warn mountd[545]: nfsctl.c:26: syscall nfsctl daemon.warn mountd[545]: nfsctl.c:28: syscall nfsctl => -1 daemon.warn mountd[545]: getfh failed: Operation not permitted

Looking in detail at the syscall made, I see that the structure definition for nfsctl_arg is different between kernel and nfs-utils.

Huh? What am I missing here? Any pointers appreciated. Wouter.

Kernel 2.6.19.1: include/linux/nfsd/syscall.h:

struct nfsctl_arg {
	int			ca_version;	/* safeguard */
	union {
		struct nfsctl_svc	u_svc;
		struct nfsctl_client	u_client;
		struct nfsctl_export	u_export;
		struct nfsctl_fdparm	u_getfd;
		struct nfsctl_fsparm	u_getfs;
                <snip>
		void *u_ptr;
	} u;

nfs-utils 1.0.10: support/include/nfs/nfs.h:

struct nfsctl_arg {
	int			ca_version;	/* safeguard */
	union {
		struct nfsctl_svc	u_svc;
		struct nfsctl_client	u_client;
		struct nfsctl_export	u_export;
		struct nfsctl_uidmap	u_umap;
		struct nfsctl_fhparm	u_getfh;
		struct nfsctl_fdparm	u_getfd;
		struct nfsctl_fsparm	u_getfs;
	} u;
#1 lore raw
Quoted 11 lines · On Tuesday February 20, [email protected] wrote:

Hi,

I'm trying to get an nfs server setup on our embedded 2.6.19 kernel system. I've chosen to use the kernel nfsd module,
and am using the latest nfs-utils.
It all starts running, but I get this:

     mount -t nfs 127.0.0.1:/etc /tmp/try

mount: 127.0.0.1:/etc failed, reason given by server: Permission denied
mount: nfsmount failed: Bad file descriptor
mount: Mounting 127.0.0.1:/etc on /tmp/try failed: Bad file descriptor

Quoted 5 lines

Having added a bit of debugging /var/log/messages shows this:
daemon.warn mountd[545]: getfh.c:73: getfh_size (/etc) daemon.warn mountd[545]: nfsctl.c:26: syscall nfsctl daemon.warn mountd[545]: nfsctl.c:28: syscall nfsctl => -1 daemon.warn mountd[545]: getfh failed: Operation not permitted

You will need patch f988443a84528bd30c2f474efa5e2c511959f19b [1] or run
mount -t nfsd nfsd /proc/fs/nfs/nfsd
before starting mountd.

Quoted 6 lines

Looking in detail at the syscall made, I see that the structure definition for nfsctl_arg is different between kernel and nfs-utils.

Huh? What am I missing here? Any pointers appreciated. Wouter.

The differences are not significant.

NeilBrown

[1] http://www.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h=f988443a84528bd30c2f474efa5e2c511959f19b

Quoted 34 lines

Kernel 2.6.19.1: include/linux/nfsd/syscall.h:

struct nfsctl_arg {
	int			ca_version;	/* safeguard */
	union {
		struct nfsctl_svc	u_svc;
		struct nfsctl_client	u_client;
		struct nfsctl_export	u_export;
		struct nfsctl_fdparm	u_getfd;
		struct nfsctl_fsparm	u_getfs;
                 <snip>
		void *u_ptr;
	} u;

nfs-utils 1.0.10: support/include/nfs/nfs.h:

struct nfsctl_arg {
	int			ca_version;	/* safeguard */
	union {
		struct nfsctl_svc	u_svc;
		struct nfsctl_client	u_client;
		struct nfsctl_export	u_export;
		struct nfsctl_uidmap	u_umap;
		struct nfsctl_fhparm	u_getfh;
		struct nfsctl_fdparm	u_getfd;
		struct nfsctl_fsparm	u_getfs;
	} u;

-
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#2 lore raw
In reply to Wouter Batelaan

[email protected] wrote on 2007-02-21 00:04:40:

Quoted 4 lines

You will need patch f988443a84528bd30c2f474efa5e2c511959f19b [1] or run
mount -t nfsd nfsd /proc/fs/nfs/nfsd
before starting mountd.

I applied the patch, and attempted the mount cmd above. I assume you mistyped the directory path, because /proc/fs/nfs/nfsd does not exist, so I used /proc/fs/nfsd

Unfortunately it has not made any difference.

Quoted 1 line

The differences are not significant.

Really? Surely if userspace uses this order

Quoted 4 lines
Quoted 4 lines
      struct nfsctl_uidmap   u_umap;
      struct nfsctl_fhparm   u_getfh;
      struct nfsctl_fdparm   u_getfd;
      struct nfsctl_fsparm   u_getfs;

but kernelspace expects this

Quoted 2 lines
Quoted 2 lines
      struct nfsctl_fdparm   u_getfd;
      struct nfsctl_fsparm   u_getfs;

then we have significant differences?
But if you're sure, then what else can be wrong?
My /etc/exports file contains (adding all 'unsafe' options I can find):

/p (rw,sync,no_root_squash,no_subtree_check,crossmnt,insecure,nohide,insecure_locks,no_acl)

I tried with and without (empty) hosts.allow and hosts.deny files.

I'm running out of ideas :-(

Wouter Batelaan

#3 lore raw
Quoted 10 lines · On Wednesday February 21, [email protected] wrote:

[email protected] wrote on 2007-02-21 00:04:40:

Quoted 4 lines

You will need patch f988443a84528bd30c2f474efa5e2c511959f19b [1] or run
mount -t nfsd nfsd /proc/fs/nfs/nfsd
before starting mountd.

I applied the patch, and attempted the mount cmd above. I assume you mistyped the directory path, because /proc/fs/nfs/nfsd does not exist, so I used /proc/fs/nfsd

Sorry, yes. You chose the right path.

Quoted 5 lines

Unfortunately it has not made any difference.

Quoted 1 line

The differences are not significant.

Quoted 10 lines

Really? Surely if userspace uses this order

Quoted 4 lines
Quoted 4 lines
      struct nfsctl_uidmap   u_umap;
      struct nfsctl_fhparm   u_getfh;
      struct nfsctl_fdparm   u_getfd;
      struct nfsctl_fsparm   u_getfs;

but kernelspace expects this

Quoted 2 lines
Quoted 2 lines
      struct nfsctl_fdparm   u_getfd;
      struct nfsctl_fsparm   u_getfs;

They are inside a 'union' Order is unimportant.

Quoted 11 lines

then we have significant differences?
But if you're sure, then what else can be wrong?
My /etc/exports file contains (adding all 'unsafe' options I can find):

/p (rw,sync,no_root_squash,no_subtree_check,crossmnt,insecure,nohide,insecure_locks,no_acl)

I tried with and without (empty) hosts.allow and hosts.deny files.

I'm running out of ideas :-(

Run
strace -o /tmp/strace -s 1000 -p pidof mountd
on the server, then attempt the mount on the client. Then interrupt the 'strace' and send me "/tmp/trace".

NeilBrown

#4 lore raw
In reply to Wouter Batelaan

To all who took an interest, and Neil Brown who gave help:

I've got the nfs server working now.

At the end there were several issues
(note that we're on dual-MIPS embedded system, starting off with a very minimal system because of space constraints):

- /etc/services was not correct
- no network loopback interface
- trying to export part of an NFSROOT (imported) file system
- /etc/exports netmask problem
- having to run portmap on client machine as well
- missing fsid option in exports file

:-(I'm not 100% sure that ALL of the above were/are critical)

I temporarily also used the unfs3 server with success, but eventually got the knfsd working.

Thanks for the help.

Kind Regards,
Wouter Batelaan
NXP Semiconductors.