From mboxrd@z Thu Jan 1 00:00:00 1970 From: Mike Snitzer Subject: Re: dm: check the sector size of underlying device when verifying start Date: Fri, 10 Aug 2018 11:56:51 -0400 Message-ID: <20180810155651.GA22384@redhat.com> References: Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline In-Reply-To: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: dm-devel-bounces@redhat.com Errors-To: dm-devel-bounces@redhat.com To: Mikulas Patocka Cc: Ondrej Kozina , dm-devel@redhat.com, "Alasdair G. Kergon" List-Id: dm-devel.ids On Fri, Aug 10 2018 at 11:23am -0400, Mikulas Patocka wrote: > It was found out that these commands would fail: > # modprobe scsi_debug dev_size_mb=128 sector_size=512 > # dmsetup create crypt0 --table "0 245752 crypt cipher_null-ecb - 0 /dev/sda 16385 1 sector_size:4096" > with the error > "device-mapper: table: 253:0: start=16385 not aligned to h/w logical block size 4096 of sda" > > The logic incorrectly checks the starting sector offset on the underlying > device against the block size of the device that is being created. > > This patch fixes it by checking the starting sector offset against the > block size of the underlying device, not the device that is being created. > > Signed-off-by: Mikulas Patocka > Cc: stable@vger.kernel.org tweaked like we discussed and staged for 4.19 here: https://git.kernel.org/pub/scm/linux/kernel/git/device-mapper/linux-dm.git/commit/?h=dm-4.19&id=b2f9960fd34e6dddba7975133b84263a2f594a20