Mercurial > illumos > nfs4.1
changeset 13953:c702e1fe80fb
dserv: fix panic during strlen() at dserv_mds_exibi due to non set inst->dmi_name
author | Vitaliy Gusev <gusev.vitaliy@nexenta.com> |
---|---|
date | Thu, 12 Jul 2012 11:11:59 +0400 |
parents | efa4353d4edf |
children | bd01f634e673 |
files | usr/src/uts/common/fs/nfs/dserv_mds.c usr/src/uts/common/nfs/dserv_impl.h |
diffstat | 2 files changed, 7 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/usr/src/uts/common/fs/nfs/dserv_mds.c Mon Mar 12 18:42:56 2012 +0400 +++ b/usr/src/uts/common/fs/nfs/dserv_mds.c Thu Jul 12 11:11:59 2012 +0400 @@ -1037,6 +1037,7 @@ mutex_enter(&inst->dmi_content_lock); list_insert_tail(&inst->dmi_uaddrs, keep); inst->dmi_name = dserv_strdup(in); + inst->dmi_flags |= DSERV_MDS_INSTANCE_PORT_VALID; mutex_exit(&inst->dmi_content_lock); dserv_instance_exit(inst); @@ -1245,6 +1246,10 @@ return (error); } + if (!(inst->dmi_flags & DSERV_MDS_INSTANCE_NET_VALID && + inst->dmi_flags & DSERV_MDS_INSTANCE_PORT_VALID)) + error = EDESTADDRREQ; + /* * Start a heartbeat thread from the DS * to the MDS. Using the heartbeat thread, the DS will detect
--- a/usr/src/uts/common/nfs/dserv_impl.h Mon Mar 12 18:42:56 2012 +0400 +++ b/usr/src/uts/common/nfs/dserv_impl.h Thu Jul 12 11:11:59 2012 +0400 @@ -182,7 +182,8 @@ ds_verifier dmi_mds_boot_verifier; } dserv_mds_instance_t; -#define DSERV_MDS_INSTANCE_NET_VALID 0x01 +#define DSERV_MDS_INSTANCE_NET_VALID 0x01 +#define DSERV_MDS_INSTANCE_PORT_VALID 0x02 /* * Useful macros