From: Dmitry Bogdanov <d.bogdanov@yadro.com>
To: Grzegorz Uriasz <gorbak25@gmail.com>
Cc: "Martin K. Petersen" <martin.petersen@oracle.com>,
<linux-scsi@vger.kernel.org>, <target-devel@vger.kernel.org>,
<linux-kernel@vger.kernel.org>, <dutkahugo@gmail.com>
Subject: Re: [PATCH] scsi: target: Fix data corruption under concurrent target configuration
Date: Sat, 20 May 2023 11:46:00 +0300 [thread overview]
Message-ID: <20230520084600.GC20571@yadro.com> (raw)
In-Reply-To: <5f637569-36af-a8d0-e378-b27a63f08501@gmail.com>
Hi Grzegorz,
On Sat, May 20, 2023 at 02:26:14AM +0200, Grzegorz Uriasz wrote:
>
> This fixes data corruptions arising from concurrent enabling of a target
> devices. When multiple enable calls are made concurrently then it is
> possible for the target device to be set up twice which results in a
> kernel BUG.
> Introduces a per target device mutex for serializing enable requests.
Device enable call is already secured by configfs per-file mutex. That
is actually per device. So Enable procedures are already not executed
simulteniously.
Look like you wrongly identified the root cause of double list_add.
If you have an evidence that dev->dev_flags could have no DF_CONFIGURED
bit, then it meeans that it (dev_flags) is raced in other
configuration actions (udev_path, vpd_unit_serial, alias).
Bits in dev->dev_flags are written not atomically and if you writes to
enable, alias, udev_path,unit_serial files simulteniously, then some
bits could be lost.
IHMO the best solution is to make dev_flags changes be atomical.
BR,
Dmitry
next prev parent reply other threads:[~2023-05-20 8:46 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-05-20 0:26 Grzegorz Uriasz
2023-05-20 8:46 ` Dmitry Bogdanov [this message]
2023-05-21 11:28 ` Grzegorz Uriasz
2023-05-22 11:27 ` Grzegorz Uriasz
2023-06-12 12:19 ` Grzegorz Uriasz
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=20230520084600.GC20571@yadro.com \
--to=d.bogdanov@yadro.com \
--cc=dutkahugo@gmail.com \
--cc=gorbak25@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=martin.petersen@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
Powered by JetHome