summaryrefslogtreecommitdiffstats
path: root/xlators/nfs
diff options
context:
space:
mode:
authorRajesh Amaravathi <rajesh.amaravathi@gmail.com>2011-08-29 10:30:56 +0530
committerAnand Avati <avati@gluster.com>2011-09-08 00:23:15 -0700
commitd7b1463bf35a9c5ac30456d143cb4b67a03a93a6 (patch)
tree09e9e7c7fce95d14defe6658294bc0a2e1be1489 /xlators/nfs
parent51138e1cbf602e16011768040440cf829367c40c (diff)
mount/nfs: Gluster nfs crashes with subdirectory mount
Glusterfs used to crash trying to dereference a NULL pointer. Also, in mnt3_resolve_export_subdir, volume name was prefixed to sub directory exported, resulting in mount fail of sub directory. Fixed both issues. Change-Id: I746f0c244b4cbf03033d73ac3e40518762d76385 BUG: 3481 Reviewed-on: http://review.gluster.com/323 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Anand Avati <avati@gluster.com>
Diffstat (limited to 'xlators/nfs')
-rw-r--r--xlators/nfs/server/src/mount3.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/xlators/nfs/server/src/mount3.c b/xlators/nfs/server/src/mount3.c
index 30005846b..9c57f280c 100644
--- a/xlators/nfs/server/src/mount3.c
+++ b/xlators/nfs/server/src/mount3.c
@@ -425,6 +425,9 @@ __volume_subdir (char *dirpath, char **volname)
if (!subdir)
goto out;
+ if (!volname)
+ goto out;
+
if (!*volname)
goto out;
@@ -683,7 +686,7 @@ mnt3_resolve_export_subdir (rpcsvc_request_t *req, struct mount3_state *ms,
if (!volume_subdir)
goto err;
- ret = mnt3_resolve_subdir (req, ms, exp, exp->expname);
+ ret = mnt3_resolve_subdir (req, ms, exp, volume_subdir);
if (ret < 0) {
gf_log (GF_MNT, GF_LOG_ERROR, "Failed to resolve export dir: %s"
, exp->expname);