target-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Bart Van Assche <bvanassche@acm.org>
To: jejb@linux.ibm.com, target-devel@vger.kernel.org,
	Hannes Reinecke <hare@suse.com>,
	Mike Christie <michael.christie@oracle.com>
Subject: Re: About the tcm_fc FCoE target driver
Date: Mon, 4 Jan 2021 09:04:35 -0800	[thread overview]
Message-ID: <ae011110-fb45-428d-b336-f9b7ab33ca5d@acm.org> (raw)
In-Reply-To: <92ab516c9493accb64630e7e86033a87be018458.camel@linux.ibm.com>

On 1/4/21 8:06 AM, James Bottomley wrote:
> On Mon, 2021-01-04 at 07:51 -0800, Bart Van Assche wrote:
>> Hi,
>>
>> My understanding is that the ft_queue_data_in() function in the
>> tcm_fc driver gets called while processing SCSI READ commands. That
>> function queues data for sending by calling fc_seq_send(). The FCoE
>> driver translates that call into a dev_queue_xmit(skb) which sends
>> the data asynchronously.  ft_queue_data_in() frees the data buffer
>> synchronously from inside ft_queue_status(). I believe that this race
>> condition can trigger data corruption. Since nobody ever reported
>> this race condition, does this mean that the FCoE target driver has
>> no users and hence that it can be removed from the kernel tree?
> 
> It could just mean the race condition is so rare no user has ever
> triggered it reliably enough to report ... have you managed to trigger
> it?

Hi James,

That's a great question. With a driver that is closely related (the SCST
FCoE target driver; the driver from which the upstream tcm_fc driver has
been derived) I could trigger this race condition easily by running fio
--verify against the FCoE initiator driver. Changing "use_sg = !(remaining %
4) && lport->sg_supp" into "use_sg = false" made the fio verification errors
disappear.

Bart.

      reply	other threads:[~2021-01-04 17:05 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-04 15:51 About the tcm_fc FCoE target driver Bart Van Assche
2021-01-04 16:06 ` James Bottomley
2021-01-04 17:04   ` Bart Van Assche [this message]

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=ae011110-fb45-428d-b336-f9b7ab33ca5d@acm.org \
    --to=bvanassche@acm.org \
    --cc=hare@suse.com \
    --cc=jejb@linux.ibm.com \
    --cc=michael.christie@oracle.com \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).