Re: 2.6.19: OOPS in cat /proc/fs/nfs/exports

From: Neil Brown
Date: Wed Dec 06 2006 - 20:39:08 EST


On Tuesday December 5, Olaf.Titz@xxxxxxx wrote:
>
> strace on exportfs shows this:nfsservctl(0x3, 0xbf875824, 0) =
> - -1 ENOMEM

What version of nfs-utils are you running? We haven't been using
nfsservctl(3, ...) on 2.6 kernels for ages - which probably explains
why exp_export() has suffered so much bit-rot. When I convinced
exportfs to use that nfsservctl I got a very similar oops.


This patch fixes it for me. Does it fix it for you too?

Thanks,
NeilBrown



diff .prev/fs/nfsd/export.c ./fs/nfsd/export.c
--- .prev/fs/nfsd/export.c 2006-12-06 14:57:24.000000000 +1100
+++ ./fs/nfsd/export.c 2006-12-07 12:36:28.000000000 +1100
@@ -983,6 +983,9 @@ exp_export(struct nfsctl_export *nxp)

dprintk("nfsd: creating export entry %p for client %p\n", exp, clp);

+ new.ex_path = kstrdup(nxp->ex_path, GFP_KERNEL);
+ if (!new.ex_path)
+ goto finish;
new.h.expiry_time = NEVER;
new.h.flags = 0;
new.ex_client = clp;
@@ -992,6 +995,9 @@ exp_export(struct nfsctl_export *nxp)
new.ex_anon_uid = nxp->ex_anon_uid;
new.ex_anon_gid = nxp->ex_anon_gid;
new.ex_fsid = nxp->ex_dev;
+ new.ex_fslocs.locations = NULL;
+ new.ex_fslocs.locations_count = 0;
+ new.ex_fslocs.migrated = 0;

exp = svc_export_lookup(&new);
if (exp)
@@ -1007,8 +1013,10 @@ exp_export(struct nfsctl_export *nxp)
cache_flush();
err = -ENOMEM;
}
-
+ err = 0;
finish:
+ if (new.ex_path)
+ kfree(new.ex_path);
if (exp)
exp_put(exp);
if (fsid_key && !IS_ERR(fsid_key))

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/