[stgt] [PATCH 15/15] Remove dummy RAID controller from LUN 0

FUJITA Tomonori fujita.tomonori at lab.ntt.co.jp
Fri Dec 4 10:35:27 CET 2009


On Fri, 04 Dec 2009 08:59:23 +0100
Arne Redlich <arne.redlich at googlemail.com> wrote:

> Am Donnerstag, den 26.11.2009, 20:07 +0900 schrieb FUJITA Tomonori: 
> > On Thu, 26 Nov 2009 12:27:37 +0200
> > Boaz Harrosh <bharrosh at panasas.com> wrote:
> > 
> > > On 11/26/2009 12:22 PM, FUJITA Tomonori wrote:
> > > > On Thu, 26 Nov 2009 12:08:21 +0200
> > > > Boaz Harrosh <bharrosh at panasas.com> wrote:
> > > > 
> > > >> On 11/26/2009 10:13 AM, FUJITA Tomonori wrote:
> > > >>> On Wed, 25 Nov 2009 17:42:04 +0200
> > > >>> Boaz Harrosh <bharrosh at panasas.com> wrote:
> > > > 
> > > >> Lets try and find an acceptable solution. What if we refuse any
> > > >> connections until we have the first LUN configured. I know how to do
> > > >> it in iscsi, is there a way to do it in a general way?
> > > > 
> > > > OpenSolaris target implementation requests you to create a target
> > > > *with* a logical unit. It's another hacky solution.
> > > > 
> > > > I don't think that we need to change the current way.
> > > 
> > > What about a command line option for us users who would like not
> > > to see that tgt-LUN0. Would you accept a command line switch, off
> > > by default. Something like --hide-lun0 ?
> > 
> > What I'm against is hacky code for shadow or hidden lun. I prefer to
> > keep the code clean rather than handle poor OSes kindly.
> 
> IMHO it just expands the hack that is LUN 0, but hey, I'm biased.
> 
> Since you obviously don't want to merge it as is: my patch also avoided
> spawning worker threads for this LUN 0 that end up doing nothing by
> setting the backing store to bs_null - can this be merged or does it
> conflict with 55b15d746fb ?

How about just passing 'bstype=null' to tgt_device_create()?

diff --git a/usr/target.c b/usr/target.c
index 1b81d0d..d56c276 100644
--- a/usr/target.c
+++ b/usr/target.c
@@ -471,14 +471,12 @@ int tgt_device_create(int tid, int dev_type, uint64_t lun, char *params,
 	}
 
 	bst = target->bst;
-	if (backing) {
-		if (bstype) {
-			bst = get_backingstore_template(bstype);
-			if (!bst) {
-				eprintf("failed to find bstype, %s\n", bstype);
-				ret = TGTADM_INVALID_REQUEST;
-				goto out;
-			}
+	if (bstype) {
+		bst = get_backingstore_template(bstype);
+		if (!bst) {
+			eprintf("failed to find bstype, %s\n", bstype);
+			ret = TGTADM_INVALID_REQUEST;
+			goto out;
 		}
 	}
 
@@ -1750,7 +1748,7 @@ int tgt_target_create(int lld, int tid, char *args)
 	INIT_LIST_HEAD(&target->acl_list);
 	INIT_LIST_HEAD(&target->it_nexus_list);
 
-	tgt_device_create(tid, TYPE_RAID, 0, NULL, 0);
+	tgt_device_create(tid, TYPE_RAID, 0, "bstype=null", 0);
 
 	if (tgt_drivers[lld]->target_create)
 		tgt_drivers[lld]->target_create(target);
--
To unsubscribe from this list: send the line "unsubscribe stgt" in
the body of a message to majordomo at vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html



More information about the stgt mailing list