All of lore.kernel.org
 help / color / mirror / Atom feed
From: Lee Duncan <lduncan@suse.com>
To: "Nicholas A. Bellinger" <nab@linux-iscsi.org>
Cc: linux-scsi@vger.kernel.org, target-devel@vger.kernel.org,
	hch@infradead.org, lkml@vger.kernel.org, hare@suse.com,
	Andy Grover <agrover@redhat.com>, Jerome Martin <jxm@netiant.com>
Subject: Re: [PATCH 0/2] target: make location of /var/target configurable
Date: Mon, 4 Apr 2016 18:15:27 -0700	[thread overview]
Message-ID: <570311AF.4070709@suse.com> (raw)
In-Reply-To: <1459654584.13184.39.camel@haakon3.risingtidesystems.com>

On 04/02/2016 08:36 PM, Nicholas A. Bellinger wrote:
> On Thu, 2016-03-31 at 11:05 -0700, Lee Duncan wrote:
>> These patches make the location of "/var/target" configurable,
>> though it still defauls to "/var/target".
>>
>> This configuration is accomplished via the configfs
>> top-level target attribute "dbroot", i.e. dumping
>> out "/sys/kernel/config/target/dbroot" will normally
>> return "/var/target". Writing to this attribute
>> changes the loation where the kernel looks for the
>> target database.
>>
>> ** NOTE/QUESTION: no sanity checks are done on the path passed in,
>>    but it seems like *some* should be done. At least checking that
>>    it's an abosolute path (i.e. starts with '/')? Opinions?
>>
> 
> Wrt to sanity checking db_root at configfs attribute store time, how
> about doing a filp_open() + S_DIR(f_inode->imode) + filp_close() of the
> requested path to verify it's really a directory..?

That seems reasonable. I will try that out and add it assuming it works. :)

> 
> Also, it would probably be a good idea to limit when db_root can be
> changed.  Eg, only allow db_root to be changed when no active target
> fabric drivers have been registered (list_empty(g_tf_list)), and require
> userspace to set a different db_root after modprobe target_core_mod
> completes, but before any fabric drivers are loaded.
> 

I will also try that.

Would it be worthwhile to have a module parameter for target_core_mod to
set the root, so it could be accomplished at the right time? (As much as
I like playing with configfs.)

> 
> 
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 

-- 
Lee Duncan
SUSE Labs

  reply	other threads:[~2016-04-05  1:15 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-31 18:05 [PATCH 0/2] target: make location of /var/target configurable Lee Duncan
2016-03-31 18:05 ` [PATCH 1/2] target: Make target db location configurable Lee Duncan
2016-04-01  7:57   ` Johannes Thumshirn
2016-03-31 18:05 ` [PATCH 2/2] target: use new "dbroot" target attribute Lee Duncan
2016-04-01  7:58   ` Johannes Thumshirn
2016-04-01 18:01     ` Lee Duncan
2016-04-01 18:18       ` Andy Grover
2016-04-05  1:09         ` Lee Duncan
2016-04-03  3:36 ` [PATCH 0/2] target: make location of /var/target configurable Nicholas A. Bellinger
2016-04-05  1:15   ` Lee Duncan [this message]
2016-04-05  2:15     ` Nicholas A. Bellinger

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=570311AF.4070709@suse.com \
    --to=lduncan@suse.com \
    --cc=agrover@redhat.com \
    --cc=hare@suse.com \
    --cc=hch@infradead.org \
    --cc=jxm@netiant.com \
    --cc=linux-scsi@vger.kernel.org \
    --cc=lkml@vger.kernel.org \
    --cc=nab@linux-iscsi.org \
    --cc=target-devel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.