On Fri, Aug 21, 2009 at 3:24 AM, Frank Batschulat
(Home)<Frank.Batschulat at sun.com> wrote:
> I bet when you dtrace the kernel exportfs syscall s entry exportfs() you'll
> find that it fails
> in treeclimb_export() because your underlaying FUSE file system does
> not implement VOP_FID(). this is during the time we attempt
> build the servers namespace ?for the export.
>
> http://src.opensolaris.org/source/xref/onnv/onnv-gate/usr/src/uts/common/fs/nfs/nfs_export.c#997
> http://src.opensolaris.org/source/xref/onnv/onnv-gate/usr/src/uts/common/fs/nfs/nfs4_srv_ns.c#555
> http://src.opensolaris.org/source/xref/onnv/onnv-gate/usr/src/uts/common/fs/nfs/nfs4_srv_ns.c#vop_fid_pseudo
>
> dtrace will tell you for sure.
Thanks, Frank. I tried to attach a probe to treeclimb_export:return
but found that it never got fired when I tried to export the
FUSE-based filesystem. Or maybe my DTrace mojo isn't strong enough.
But I traced the exportfs call using the script below and found
something that definitely points to a problem with fop_fid. The
trimmed trace looks like this:
CPU FUNCTION
0 -> exportfs
0 -> lookupname
[a bunch of stuff here]
0 <- lookupname
0 -> fop_access
0 -> crgetmapped
0 <- crgetmapped
0 -> fuse_access
[a bunch of FUSE-related stuff here]
0 <- fuse_access
0 <- fop_access
0 -> vn_mountedvfs
0 <- vn_mountedvfs
0 -> fop_fid
0 -> fs_nosys
0 <- fs_nosys
0 <- fop_fid
[then exportfs returns with 89, ENOSYS]
I think I'll try hacking something together in the FUSE kernel module
to return a value for the VOP_FID call. I guess the best solution
would be to expose that call to userspace through /dev/fuse (or would
that break compatibility with existing Linux+BSD fuse implementations?
Is that important?) but a quick kernel hack will get me started.
Can anybody explain to me why I don't see the call to fop_access or
fop_fid when I look at the exportfs function in nfs_export.c? I
expect I'm missing something really basic.
Thanks,
Russ
>
> --
> ---
> frankB
>
Dtrace script to follow exportfs call:
#!/usr/sbin/dtrace -qs
#pragma D option flowindent
fbt:nfssrv:exportfs:entry
{
self->traceme = 1;
}
fbt:nfssrv:exportfs:return
{
printf( "exportfs retval == %d", args[1] );
self->traceme = 0;
}
fbt:::
/self->traceme == 1/
{
printf( "\n" );
}