From e6992c73dc39a8e9e17f83eb1a6d5ab63c31f511 Mon Sep 17 00:00:00 2001 From: Rajesh Amaravathi Date: Mon, 29 Aug 2011 10:30:56 +0530 Subject: 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/346 Tested-by: Gluster Build System Reviewed-by: Shehjar Tikoo --- xlators/nfs/server/src/mount3.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'xlators/nfs') diff --git a/xlators/nfs/server/src/mount3.c b/xlators/nfs/server/src/mount3.c index 688711a0f37..2addc7f14d0 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); -- cgit