lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <4CE210D3.5060703@cisco.com>
Date:	Mon, 15 Nov 2010 21:04:19 -0800
From:	Joe Eykholt <jeykholt@...co.com>
To:	Greg KH <greg@...ah.com>
CC:	Vladislav Bolkhovitin <vst@...b.net>,
	Bart Van Assche <bvanassche@....org>,
	Dmitry Torokhov <dmitry.torokhov@...il.com>,
	Boaz Harrosh <bharrosh@...asas.com>,
	linux-scsi@...r.kernel.org, linux-kernel@...r.kernel.org,
	scst-devel <scst-devel@...ts.sourceforge.net>,
	James Bottomley <James.Bottomley@...senpartnership.com>,
	Andrew Morton <akpm@...ux-foundation.org>,
	FUJITA Tomonori <fujita.tomonori@....ntt.co.jp>,
	Mike Christie <michaelc@...wisc.edu>,
	Vu Pham <vuhuong@...lanox.com>,
	James Smart <James.Smart@...lex.com>,
	Andy Yan <ayan@...vell.com>,
	Chetan Loke <generationgnu@...oo.com>,
	Hannes Reinecke <hare@...e.de>,
	Richard Sharpe <realrichardsharpe@...il.com>,
	Daniel Henrique Debonzi <debonzi@...ux.vnet.ibm.com>
Subject: Re: [PATCH 8/19]: SCST SYSFS interface implementation



On 11/15/10 2:13 PM, Greg KH wrote:
> On Mon, Nov 15, 2010 at 11:39:48PM +0300, Vladislav Bolkhovitin wrote:
>> Greg KH, on 11/15/2010 09:44 PM wrote:
>> > On Mon, Nov 15, 2010 at 06:45:24PM +0100, Bart Van Assche wrote:
>> >> On Sun, Nov 14, 2010 at 12:59 AM, Greg KH <greg@...ah.com> wrote:
>> >>>
>> >>> On Sat, Nov 13, 2010 at 08:20:18PM +0300, Vladislav Bolkhovitin wrote:
>> >>>> So, I decided to reimplement it to be completely synchronous. SYSFS
>> >>>> authors did really great job and thanks to the excellent internal SYSFS
>> >>>> design and implementation it is absolutely safe. See:
>> >>>>
>> >>>> [root@tgt ~]# modprobe scst
>> >>>> [root@tgt ~]# cd /sys/kernel/scst_tgt/
>> >>>
>> >>> Sorry, but no, you can't put this in /sys/kernel/ without getting the
>> >>> approval of the sysfs maintainer.
>> >>>
>> >>> I really don't understand why you are using kobjects in the first place,
>> >>> why isn't this in the main device tree in the kernel, using 'struct
>> >>> device'?
>> >>
>> >> We might have missed something, but as far as we know it has not yet
>> >> been explained in this thread why using 'struct device' would be an
>> >> advantage over using 'struct kobject'.
>> >
>> > It's very simple.
>> >
>> > You want your device to show up in the global device tree in the kernel,
>> > not off to one side, unconnected to anything else.
>> >
>> > Please use 'struct device', it is what you want to do here.
>>
>> But we don't have any device to show up in the global device tree!
> 
> Not true at all.
> 
>> We don't have any devices in the struct device's understanding at all!
> 
> Then create them just like you are doing so for your kobject use.
> 
> The first device would be the root one, and then everything trickles
> down from there.
> 
> And use configfs for your configuration stuff, that's what it is there
> for, and if it doesn't somehow work properly for you, please work with
> the configfs developers to fix that up.
> 
> thanks,
> 
> greg k-h

I don't have any opinion on the above, but I don't see why sysfs can't be
used for configuration as well as its other roles. It seems to me wasteful
to require configfs to be used in order to change configuration when
sysfs works fine for this.

Here are a couple of existing examples where sysfs is used in a role that
would seem similar to SCST's usage:

1) scsi_transport_fc already has an sysfs file, fc_host/vport_create, which
can be written to create new fc_host and scsi_host instances.

2) fcoe.ko uses a write to the sysfs file /sys/module/fcoe/parameters/create
to start the protocol on a particular ethernet interface.  There's another
file for destroy.

I'll bet there are other examples in other subsystems, and I don't think
there is anything wrong with the above usages of sysfs.

I agree with Vladislav's point that configfs doesn't work instead of sysfs
because configs doesn't make it easy for the kernel side to create nodes for
dynamic information like connected initiators and statistics.
So, if the above examples are considered a misuse of sysfs,
SCST would need to use both sysfs and configfs.  It would use configfs to
do configuration, and sysfs to display and access the dynamic information
like connected initiators.  That seems a minor role for configfs,
which is easily handled in sysfs as SCST currently does.

Just my two cents.

	Joe
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ