linux/drivers/target/iscsi
Al Viro bf6932f44a iscsi-target: Drop bogus struct file usage for iSCSI/SCTP
From Al Viro:

	BTW, speaking of struct file treatment related to sockets -
        there's this piece of code in iscsi:
        /*
         * The SCTP stack needs struct socket->file.
         */
        if ((np->np_network_transport == ISCSI_SCTP_TCP) ||
            (np->np_network_transport == ISCSI_SCTP_UDP)) {
                if (!new_sock->file) {
                        new_sock->file = kzalloc(
                                        sizeof(struct file), GFP_KERNEL);

For one thing, as far as I can see it'not true - sctp does *not* depend on
socket->file being non-NULL; it does, in one place, check socket->file->f_flags
for O_NONBLOCK, but there it treats NULL socket->file as "flag not set".
Which is the case here anyway - the fake struct file created in
__iscsi_target_login_thread() (and in iscsi_target_setup_login_socket(), with
the same excuse) do *not* get that flag set.

Moreover, it's a bloody serious violation of a bunch of asserts in VFS;
all struct file instances should come from filp_cachep, via get_empty_filp()
(or alloc_file(), which is a wrapper for it).  FWIW, I'm very tempted to
do this and be done with the entire mess:

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Cc: Andy Grover <agrover@redhat.com>
Cc: Hannes Reinecke <hare@suse.de>
Cc: Christoph Hellwig <hch@lst.de>
Cc: stable@vger.kernel.org
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
2012-07-21 02:44:13 -07:00
..
Kconfig target: iscsi_target depends on NET 2011-07-28 20:16:18 +00:00
Makefile
iscsi_target.c iscsi-target: Drop bogus struct file usage for iSCSI/SCTP 2012-07-21 02:44:13 -07:00
iscsi_target.h target/iscsi: Misc cleanups from Agrover (round 2) 2012-04-14 17:40:35 -07:00
iscsi_target_auth.c iscsi-target: fix chap identifier simple_strtoul usage 2011-12-14 11:28:09 +00:00
iscsi_target_auth.h
iscsi_target_configfs.c target/iscsi: Remove dead code in lio_get_tpg_from_tpg_item() 2012-07-16 17:29:11 -07:00
iscsi_target_configfs.h
iscsi_target_core.h iscsi-target: Drop bogus struct file usage for iSCSI/SCTP 2012-07-21 02:44:13 -07:00
iscsi_target_datain_values.c target/iscsi: Eliminate iscsi_cmd.data_length 2012-04-14 17:40:38 -07:00
iscsi_target_datain_values.h
iscsi_target_device.c target/iscsi: Remove unneeded wrapper functions 2012-02-25 14:37:47 -08:00
iscsi_target_device.h target/iscsi: Remove unneeded wrapper functions 2012-02-25 14:37:47 -08:00
iscsi_target_erl0.c target/iscsi: Eliminate iscsi_cmd.data_length 2012-04-14 17:40:38 -07:00
iscsi_target_erl0.h
iscsi_target_erl1.c iscsit: use target_execute_cmd for WRITEs 2012-07-16 17:35:18 -07:00
iscsi_target_erl1.h
iscsi_target_erl2.c target/iscsi: Rename iscsi_cmd.i_list to iscsi_cmd.i_conn_node 2012-04-14 17:40:33 -07:00
iscsi_target_erl2.h
iscsi_target_login.c iscsi-target: Drop bogus struct file usage for iSCSI/SCTP 2012-07-21 02:44:13 -07:00
iscsi_target_login.h
iscsi_target_nego.c target: remove obvious warnings 2012-03-15 19:16:09 -07:00
iscsi_target_nego.h
iscsi_target_nodeattrib.c iscsi-target: remove improper externs 2012-03-17 18:07:04 -07:00
iscsi_target_nodeattrib.h
iscsi_target_parameters.c target: Misc retval cleanups 2012-07-16 17:35:23 -07:00
iscsi_target_parameters.h
iscsi_target_seq_pdu_list.c target/iscsi: cleanup some allocation style issues 2012-05-06 15:02:33 -07:00
iscsi_target_seq_pdu_list.h target/iscsi: Fold _decide_list_to_build into _build_pdu_and_seq_lists 2012-04-14 17:40:38 -07:00
iscsi_target_stat.c target: remove useless casts 2011-12-14 11:28:07 +00:00
iscsi_target_stat.h
iscsi_target_tmr.c iscsit: use target_execute_cmd for WRITEs 2012-07-16 17:35:18 -07:00
iscsi_target_tmr.h
iscsi_target_tpg.c target: Misc retval cleanups 2012-07-16 17:35:23 -07:00
iscsi_target_tpg.h
iscsi_target_tq.c target: Use LIST_HEAD()/DEFINE_MUTEX() for static objects 2012-02-25 14:37:46 -08:00
iscsi_target_tq.h
iscsi_target_util.c target/iscsi: Go back to core allocating data buffer for cmd 2012-04-14 17:40:39 -07:00
iscsi_target_util.h target/iscsi: Fold _decide_list_to_build into _build_pdu_and_seq_lists 2012-04-14 17:40:38 -07:00