summaryrefslogtreecommitdiffstats
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:21:55 -0700
commit709c954c5a74a2ee3e437e26b0872152cc82220b (patch)
treec6bc2f3d66ff85a851680437acc7ecf910caad4f
parent91f4c7cfa8d51a5c0411d24041725bdf1be3cef0 (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/345 Reviewed-by: Shehjar Tikoo <shehjart@gluster.com> Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Anand Avati <avati@gluster.com>
-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 05745a5..b8e47c2 100644
--- a/xlators/nfs/server/src/mount3.c
+++ b/xlators/nfs/server/src/mount3.c
@@ -415,6 +415,9 @@ __volume_subdir (char *dirpath, char **volname)
if (!subdir)
goto out;
+ if (!volname)
+ goto out;
+
if (!*volname)
goto out;
@@ -672,7 +675,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);