diff options
Diffstat (limited to 'fs')
-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)) |