All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Martin K. Petersen" <martin.petersen@oracle.com>
To: Roman Bolshakov <r.bolshakov@yadro.com>
Cc: target-devel@vger.kernel.org, linux-scsi@vger.kernel.org,
	"Martin K. Petersen" <martin.petersen@oracle.com>,
	stable@vger.kernel.org, Bart Van Assche <bvanassche@acm.org>
Subject: Re: [RESEND PATCH] scsi: target/iblock: Fix overrun in WRITE SAME emulation
Date: Tue, 02 Jul 2019 16:37:16 -0400	[thread overview]
Message-ID: <yq1pnmsfa0z.fsf@oracle.com> (raw)
In-Reply-To: <20190702191636.26481-1-r.bolshakov@yadro.com> (Roman Bolshakov's message of "Tue, 2 Jul 2019 22:16:38 +0300")


Roman,

> WRITE SAME corrupts data on the block device behind iblock if the
> command is emulated. The emulation code issues (M - 1) * N times more
> bios than requested, where M is the number of 512 blocks per real
> block size and N is the NUMBER OF LOGICAL BLOCKS specified in WRITE
> SAME command. So, for a device with 4k blocks, 7 * N more LBAs gets
> written after the requested range.
>
> The issue happens because the number of 512 byte sectors to be written
> is decreased one by one while the real bios are typically from 1 to 8
> 512 byte sectors per bio.

Applied to 5.2/scsi-fixes, thanks!

-- 
Martin K. Petersen	Oracle Linux Engineering

WARNING: multiple messages have this Message-ID (diff)
From: "Martin K. Petersen" <martin.petersen@oracle.com>
To: Roman Bolshakov <r.bolshakov@yadro.com>
Cc: target-devel@vger.kernel.org, linux-scsi@vger.kernel.org,
	"Martin K. Petersen" <martin.petersen@oracle.com>,
	stable@vger.kernel.org, Bart Van Assche <bvanassche@acm.org>
Subject: Re: [RESEND PATCH] scsi: target/iblock: Fix overrun in WRITE SAME emulation
Date: Tue, 02 Jul 2019 20:37:16 +0000	[thread overview]
Message-ID: <yq1pnmsfa0z.fsf@oracle.com> (raw)
In-Reply-To: <20190702191636.26481-1-r.bolshakov@yadro.com> (Roman Bolshakov's message of "Tue, 2 Jul 2019 22:16:38 +0300")


Roman,

> WRITE SAME corrupts data on the block device behind iblock if the
> command is emulated. The emulation code issues (M - 1) * N times more
> bios than requested, where M is the number of 512 blocks per real
> block size and N is the NUMBER OF LOGICAL BLOCKS specified in WRITE
> SAME command. So, for a device with 4k blocks, 7 * N more LBAs gets
> written after the requested range.
>
> The issue happens because the number of 512 byte sectors to be written
> is decreased one by one while the real bios are typically from 1 to 8
> 512 byte sectors per bio.

Applied to 5.2/scsi-fixes, thanks!

-- 
Martin K. Petersen	Oracle Linux Engineering

WARNING: multiple messages have this Message-ID (diff)
From: "Martin K. Petersen" <martin.petersen@oracle.com>
To: Roman Bolshakov <r.bolshakov@yadro.com>
Cc: <target-devel@vger.kernel.org>, <linux-scsi@vger.kernel.org>,
	"Martin K. Petersen" <martin.petersen@oracle.com>,
	<stable@vger.kernel.org>, Bart Van Assche <bvanassche@acm.org>
Subject: Re: [RESEND PATCH] scsi: target/iblock: Fix overrun in WRITE SAME emulation
Date: Tue, 02 Jul 2019 16:37:16 -0400	[thread overview]
Message-ID: <yq1pnmsfa0z.fsf@oracle.com> (raw)
In-Reply-To: <20190702191636.26481-1-r.bolshakov@yadro.com> (Roman Bolshakov's message of "Tue, 2 Jul 2019 22:16:38 +0300")


Roman,

> WRITE SAME corrupts data on the block device behind iblock if the
> command is emulated. The emulation code issues (M - 1) * N times more
> bios than requested, where M is the number of 512 blocks per real
> block size and N is the NUMBER OF LOGICAL BLOCKS specified in WRITE
> SAME command. So, for a device with 4k blocks, 7 * N more LBAs gets
> written after the requested range.
>
> The issue happens because the number of 512 byte sectors to be written
> is decreased one by one while the real bios are typically from 1 to 8
> 512 byte sectors per bio.

Applied to 5.2/scsi-fixes, thanks!

-- 
Martin K. Petersen	Oracle Linux Engineering

  reply	other threads:[~2019-07-02 20:37 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-02 19:16 [RESEND PATCH] scsi: target/iblock: Fix overrun in WRITE SAME emulation Roman Bolshakov
2019-07-02 19:16 ` Roman Bolshakov
2019-07-02 19:16 ` Roman Bolshakov
2019-07-02 20:37 ` Martin K. Petersen [this message]
2019-07-02 20:37   ` Martin K. Petersen
2019-07-02 20:37   ` Martin K. Petersen
2019-07-03  3:40 ` Michael Christie
2019-07-03  3:40   ` Michael Christie
2019-07-03 13:24   ` Roman Bolshakov
2019-07-03 13:24     ` Roman Bolshakov
2019-07-03 13:24     ` Roman Bolshakov

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=yq1pnmsfa0z.fsf@oracle.com \
    --to=martin.petersen@oracle.com \
    --cc=bvanassche@acm.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=r.bolshakov@yadro.com \
    --cc=stable@vger.kernel.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.