diff options
author | Rajesh Amaravathi <rajesh.amaravathi@gmail.com> | 2011-08-29 10:30:56 +0530 |
---|---|---|
committer | Anand Avati <avati@gluster.com> | 2011-09-07 23:55:18 -0700 |
commit | e6992c73dc39a8e9e17f83eb1a6d5ab63c31f511 (patch) | |
tree | ecbab1ba87b68ac0e6274e4064a9bbff8aaa8946 | |
parent | 875740c702d6b30754d46b17d37dd0865743216a (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/346
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Shehjar Tikoo <shehjart@gluster.com>
-rw-r--r-- | xlators/nfs/server/src/mount3.c | 5 |
1 files changed, 4 insertions, 1 deletions
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); |