diff options
author | NeilBrown <neilb@suse.de> | 2006-12-13 03:35:45 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.osdl.org> | 2006-12-13 12:05:54 -0500 |
commit | f988443a84528bd30c2f474efa5e2c511959f19b (patch) | |
tree | 40c2cfaaa7381e0dd1f5315c5b55979f40799e04 /fs/nfsd/export.c | |
parent | dd08d6ea443abafe9455997d2889719364b8794b (diff) |
[PATCH] knfsd: Fix up some bit-rot in exp_export
The nfsservctl system call isn't used but recent nfs-utils releases for
exporting filesystems, and consequently the code that is uses - exp_export -
has suffered some bitrot.
Particular:
- some newly added fields in 'struct svc_export' are being initialised
properly.
- the return value is now always -ENOMEM ...
This patch fixes both these problems.
Signed-off-by: Neil Brown <neilb@suse.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'fs/nfsd/export.c')
-rw-r--r-- | fs/nfsd/export.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/fs/nfsd/export.c b/fs/nfsd/export.c index 1137d09c5976..248dd92e6a56 100644 --- a/fs/nfsd/export.c +++ b/fs/nfsd/export.c | |||
@@ -955,6 +955,8 @@ exp_export(struct nfsctl_export *nxp) | |||
955 | 955 | ||
956 | exp = exp_get_by_name(clp, nd.mnt, nd.dentry, NULL); | 956 | exp = exp_get_by_name(clp, nd.mnt, nd.dentry, NULL); |
957 | 957 | ||
958 | memset(&new, 0, sizeof(new)); | ||
959 | |||
958 | /* must make sure there won't be an ex_fsid clash */ | 960 | /* must make sure there won't be an ex_fsid clash */ |
959 | if ((nxp->ex_flags & NFSEXP_FSID) && | 961 | if ((nxp->ex_flags & NFSEXP_FSID) && |
960 | (fsid_key = exp_get_fsid_key(clp, nxp->ex_dev)) && | 962 | (fsid_key = exp_get_fsid_key(clp, nxp->ex_dev)) && |
@@ -985,6 +987,9 @@ exp_export(struct nfsctl_export *nxp) | |||
985 | 987 | ||
986 | new.h.expiry_time = NEVER; | 988 | new.h.expiry_time = NEVER; |
987 | new.h.flags = 0; | 989 | new.h.flags = 0; |
990 | new.ex_path = kstrdup(nxp->ex_path, GFP_KERNEL); | ||
991 | if (!new.ex_path) | ||
992 | goto finish; | ||
988 | new.ex_client = clp; | 993 | new.ex_client = clp; |
989 | new.ex_mnt = nd.mnt; | 994 | new.ex_mnt = nd.mnt; |
990 | new.ex_dentry = nd.dentry; | 995 | new.ex_dentry = nd.dentry; |
@@ -1005,10 +1010,11 @@ exp_export(struct nfsctl_export *nxp) | |||
1005 | /* failed to create at least one index */ | 1010 | /* failed to create at least one index */ |
1006 | exp_do_unexport(exp); | 1011 | exp_do_unexport(exp); |
1007 | cache_flush(); | 1012 | cache_flush(); |
1008 | err = -ENOMEM; | 1013 | } else |
1009 | } | 1014 | err = 0; |
1010 | |||
1011 | finish: | 1015 | finish: |
1016 | if (new.ex_path) | ||
1017 | kfree(new.ex_path); | ||
1012 | if (exp) | 1018 | if (exp) |
1013 | exp_put(exp); | 1019 | exp_put(exp); |
1014 | if (fsid_key && !IS_ERR(fsid_key)) | 1020 | if (fsid_key && !IS_ERR(fsid_key)) |