public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* Problems with NFS exports
@ 2002-08-06 15:49 Florian Weimer
  2002-08-07  9:25 ` Florian Weimer
  0 siblings, 1 reply; 6+ messages in thread
From: Florian Weimer @ 2002-08-06 15:49 UTC (permalink / raw)
  To: linux-kernel

I'm seeing weired errors with nfsctl():

This works:

nfsservctl(NFSCTL_EXPORT, "deneb.enyo.de", "/mnt/storage/2/backup/deneb/tmp", makedev(3, 66), ino 167772288, uid 65534, gid 65534) = 0

But a subsequent call fails:

nfsservctl(NFSCTL_EXPORT, "deneb.enyo.de", "/mnt/storage/2/backup/deneb", makedev(3, 66), ino 150995072, uid 65534, gid 65534) = -1 EINVAL (Invalid argument)

I don't understand what makes the difference (the inode values are
correct).  This is kernel 2.4.18 with XFS support, and the directory
resides on an XFS file system.

Any ideas?

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Problems with NFS exports
  2002-08-06 15:49 Problems with NFS exports Florian Weimer
@ 2002-08-07  9:25 ` Florian Weimer
  2002-08-07 10:40   ` Neil Brown
  0 siblings, 1 reply; 6+ messages in thread
From: Florian Weimer @ 2002-08-07  9:25 UTC (permalink / raw)
  To: linux-kernel; +Cc: gam3

Florian Weimer <fw@deneb.enyo.de> writes:

> I'm seeing weired errors with nfsctl():
>
> This works:
>
> nfsservctl(NFSCTL_EXPORT, "deneb.enyo.de", "/mnt/storage/2/backup/deneb/tmp", makedev(3, 66), ino 167772288, uid 65534, gid 65534) = 0
>
> But a subsequent call fails:
>
> nfsservctl(NFSCTL_EXPORT, "deneb.enyo.de", "/mnt/storage/2/backup/deneb", makedev(3, 66), ino 150995072, uid 65534, gid 65534) = -1 EINVAL (Invalid argument)
>
> I don't understand what makes the difference (the inode values are
> correct).  This is kernel 2.4.18 with XFS support, and the directory
> resides on an XFS file system.
>
> Any ideas?

(Full quote because of additional recipeint.)

It appears that a directory tree can only be exported once.  Is this
intentional?  If yes, the following patch should be applied (to
linux/fs/nfsd/export.c), so that the return value is more meaningful:

--- export.c	2002/08/07 09:22:11	1.1
+++ export.c	2002/08/07 09:22:28
@@ -219,6 +219,7 @@
 		goto finish;
 	}
 
+	err = -EBUSY;
 	if ((parent = exp_child(clp, dev, nd.dentry)) != NULL) {
 		dprintk("exp_export: export not valid (Rule 3).\n");
 		goto finish;


After this change, the userspace tools can issue are more meaningful
error message for this case.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Problems with NFS exports
  2002-08-07  9:25 ` Florian Weimer
@ 2002-08-07 10:40   ` Neil Brown
  2002-08-07 11:13     ` Florian Weimer
  0 siblings, 1 reply; 6+ messages in thread
From: Neil Brown @ 2002-08-07 10:40 UTC (permalink / raw)
  To: Florian Weimer; +Cc: linux-kernel, gam3

On Wednesday August 7, fw@deneb.enyo.de wrote:
> Florian Weimer <fw@deneb.enyo.de> writes:
> 
> > I'm seeing weired errors with nfsctl():
> >
> > This works:
> >
> > nfsservctl(NFSCTL_EXPORT, "deneb.enyo.de", "/mnt/storage/2/backup/deneb/tmp", makedev(3, 66), ino 167772288, uid 65534, gid 65534) = 0
> >
> > But a subsequent call fails:
> >
> > nfsservctl(NFSCTL_EXPORT, "deneb.enyo.de", "/mnt/storage/2/backup/deneb", makedev(3, 66), ino 150995072, uid 65534, gid 65534) = -1 EINVAL (Invalid argument)
> >
> > I don't understand what makes the difference (the inode values are
> > correct).  This is kernel 2.4.18 with XFS support, and the directory
> > resides on an XFS file system.
> >
> > Any ideas?
> 
> (Full quote because of additional recipeint.)
> 
> It appears that a directory tree can only be exported once.  Is this
> intentional?  If yes, the following patch should be applied (to
> linux/fs/nfsd/export.c), so that the return value is more meaningful:

Probably better documentation in exports.5 would be just as useful.
And "BUSY" probably isn't correct ....
The rule is that you cannot export a directory and an ancestor of that
directory in the same filesystem.
/a/1 and /a/2 can both be exported, but not /a and /a/1.

Reason:  exporting "/a" means exporting that directoring and all
descendants of it in the same filesystem.
If you export /a with different flags than /a/1 it is ambiguous.

And personally, I doubt that there are very many situations where it
makes sense.

It would be possible to dis-ambiguate the ambiguity but it wouldn't be
very clean, and I really am not sure that it is worth the effort.

NeilBrown


> 
> --- export.c	2002/08/07 09:22:11	1.1
> +++ export.c	2002/08/07 09:22:28
> @@ -219,6 +219,7 @@
>  		goto finish;
>  	}
>  
> +	err = -EBUSY;
>  	if ((parent = exp_child(clp, dev, nd.dentry)) != NULL) {
>  		dprintk("exp_export: export not valid (Rule 3).\n");
>  		goto finish;
> 
> 
> After this change, the userspace tools can issue are more meaningful
> error message for this case.
> -
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Problems with NFS exports
  2002-08-07 10:40   ` Neil Brown
@ 2002-08-07 11:13     ` Florian Weimer
  2002-08-07 11:18       ` Neil Brown
  0 siblings, 1 reply; 6+ messages in thread
From: Florian Weimer @ 2002-08-07 11:13 UTC (permalink / raw)
  To: Neil Brown; +Cc: linux-kernel, gam3

Neil Brown <neilb@cse.unsw.edu.au> writes:

> Probably better documentation in exports.5 would be just as useful.

Maybe.

BTW, is it possible to export a directory tree under a different path,
using the kernel NFS daemon?

> And "BUSY" probably isn't correct ....

Why not? The ressource (the directory tree) is already being used, and
therefore the export fails.

> It would be possible to dis-ambiguate the ambiguity but it wouldn't be
> very clean, and I really am not sure that it is worth the effort.

Better error messages are always a good idea. :-)

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Problems with NFS exports
  2002-08-07 11:13     ` Florian Weimer
@ 2002-08-07 11:18       ` Neil Brown
  2002-08-07 11:51         ` Florian Weimer
  0 siblings, 1 reply; 6+ messages in thread
From: Neil Brown @ 2002-08-07 11:18 UTC (permalink / raw)
  To: Florian Weimer; +Cc: linux-kernel, gam3

On Wednesday August 7, fw@deneb.enyo.de wrote:
> Neil Brown <neilb@cse.unsw.edu.au> writes:
> 
> > Probably better documentation in exports.5 would be just as useful.
> 
> Maybe.
> 
> BTW, is it possible to export a directory tree under a different path,
> using the kernel NFS daemon?

Uhm... symlinks work.
Which is to say, the client can mount using a 'different path', though
they can also mount using the 'true' path.



> 
> > And "BUSY" probably isn't correct ....
> 
> Why not? The ressource (the directory tree) is already being used, and
> therefore the export fails.

I guess... I just feel it isn't really clear what it is that is
'busy'.

NeilBrown


> 
> > It would be possible to dis-ambiguate the ambiguity but it wouldn't be
> > very clean, and I really am not sure that it is worth the effort.
> 
> Better error messages are always a good idea. :-)

Can't disagree there.

NeilBrown

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Problems with NFS exports
  2002-08-07 11:18       ` Neil Brown
@ 2002-08-07 11:51         ` Florian Weimer
  0 siblings, 0 replies; 6+ messages in thread
From: Florian Weimer @ 2002-08-07 11:51 UTC (permalink / raw)
  To: Neil Brown; +Cc: linux-kernel, gam3

Neil Brown <neilb@cse.unsw.edu.au> writes:

>> > And "BUSY" probably isn't correct ....
>> 
>> Why not? The ressource (the directory tree) is already being used, and
>> therefore the export fails.
>
> I guess... I just feel it isn't really clear what it is that is
> 'busy'.

And it implies that it is just a temporary error condition, not a
configuration issue.

Maybe EEXIST is better?

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2002-08-07 11:47 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-08-06 15:49 Problems with NFS exports Florian Weimer
2002-08-07  9:25 ` Florian Weimer
2002-08-07 10:40   ` Neil Brown
2002-08-07 11:13     ` Florian Weimer
2002-08-07 11:18       ` Neil Brown
2002-08-07 11:51         ` Florian Weimer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox