lkml.org 
[lkml]   [2003]   [Mar]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Date
SubjectRe: NFS/ReiserFS problems 2.5.64-mbj1
On Friday March 28, schlicht@uni-mannheim.de wrote:
> On Mar 27, 2003 18:07, Oleg Drokin wrote:
> > sb->s_export_op->find_exported_dentry is NULL
> > in reiserfs_decode_fh, well. In fact we never set this field at all.
> > What is supposed to be there, anyway?
> > I guess following patch should fix the problem.
>
> Yes, it did fix the problem, but now I was not allowed anymore to compile NFS
> as a module as I need reiserfs to be in the kernel... :-(
>
> > In fact I guess somebody should put find_exported_dentry() declaration to
> > include/linux/fs.h or something like that.
> > Also absolutely the same problem must exist if you try to export fat
> filesystem.
>
> That is true, too. I saw the Oops with a VFAT partition, too
>
> I just wonder why the code in fs/nfsd/export.c lines 684-687 does not work.
> This code should set the find_exported_dentry field correctly. But I do not
> know when this function (exp_export()) is called...
>

One possibility is that you are using the new nfs-utils 1.0.3, but you
reported the bug before I announced it (though it was in CVS and on
kernel.org by then so maybe...)!
The new code uses a different path to export filesystems which didn't
include the setting of find_exported_dentry.
The following patch should fix that.

If you aren't using 1.0.3, then I am at a loss. A filesystem can only
be exported via call to exp_export, and that does set
sb->s_export_op->find_exported_dentry

NeilBrown


----------- Diffstat output ------------
./fs/nfsd/export.c | 42 ++++++++++++++++++++++++++++++++++++++----
1 files changed, 38 insertions(+), 4 deletions(-)

diff ./fs/nfsd/export.c~current~ ./fs/nfsd/export.c
--- ./fs/nfsd/export.c~current~ 2003-03-28 10:51:35.000000000 +1100
+++ ./fs/nfsd/export.c 2003-03-29 16:14:04.000000000 +1100
@@ -270,6 +270,11 @@ void svc_export_request(struct cache_det
(*bpp)[-1] = '\n';
}

+extern struct dentry *
+find_exported_dentry(struct super_block *sb, void *obj, void *parent,
+ int (*acceptable)(void *context, struct dentry *de),
+ void *context);
+
static struct svc_export *svc_export_lookup(struct svc_export *, int);
int svc_export_parse(struct cache_detail *cd, char *mesg, int mlen)
{
@@ -342,6 +347,39 @@ int svc_export_parse(struct cache_detail
err = get_int(&mesg, &an_int);
if (err) goto out;
exp.ex_fsid = an_int;
+
+
+ /* We currently export only dirs and regular files.
+ * This is what umountd does.
+ */
+ err = -ENOTDIR;
+ if (!S_ISDIR(nd.dentry->d_inode->i_mode) &&
+ !S_ISREG(nd.dentry->d_inode->i_mode))
+ goto out;
+
+ err = -EINVAL;
+ /* There are two requirements on a filesystem to be exportable.
+ * 1: We must be able to identify the filesystem from a number.
+ * either a device number (so FS_REQUIRES_DEV needed)
+ * or an FSID number (so NFSEXP_FSID needed).
+ * 2: We must be able to find an inode from a filehandle.
+ * This means that s_export_op must be set.
+ */
+ if (!(nd.dentry->d_inode->i_sb->s_type->fs_flags & FS_REQUIRES_DEV)) {
+ if (!(exp.ex_flags & NFSEXP_FSID)) {
+ dprintk("exp_export: export of non-dev fs without fsid");
+ goto out;
+ }
+ }
+ if (!nd.dentry->d_inode->i_sb->s_export_op) {
+ dprintk("exp_export: export of invalid fs type.\n");
+ goto out;
+ }
+
+ /* Ok, we can export it */;
+ if (!nd.dentry->d_inode->i_sb->s_export_op->find_exported_dentry)
+ nd.dentry->d_inode->i_sb->s_export_op->find_exported_dentry =
+ find_exported_dentry;
}

expp = svc_export_lookup(&exp, 1);
@@ -594,10 +632,6 @@ static void exp_unhash(struct svc_export
svc_expkey_cache.nextcheck = get_seconds();
}

-extern struct dentry *
-find_exported_dentry(struct super_block *sb, void *obj, void *parent,
- int (*acceptable)(void *context, struct dentry *de),
- void *context);
/*
* Export a file system.
*/
-
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/
\
 
 \ /
  Last update: 2005-03-22 13:34    [W:0.129 / U:0.820 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site