Received: by 2002:a05:6a10:17d3:0:0:0:0 with SMTP id hz19csp485245pxb; Sat, 10 Apr 2021 09:03:23 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyATP5EYdJ7gM969N3Dp5lYOPZmXfBLOKAtDL09vfNt13cZvvkdTiygcqSIlZ4WltZSOinF X-Received: by 2002:aa7:d898:: with SMTP id u24mr22665762edq.198.1618070603387; Sat, 10 Apr 2021 09:03:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1618070603; cv=none; d=google.com; s=arc-20160816; b=DrUUnXx0uwV+/75x526D119mm4qWUxTe7G5CcdQ253U9jqQ4YOBbMU/Un7aKD9qRmB G4m5hGcztHnRtAzo4Csbl5/8LlF+Dt+nGExCtJdbYPeLYnmAyO4W8pthXKKJrO4aXthc iM1u0RCtdYE7Lp70o/2ZtJJG+cFA9oh+V7TbeoS/pidOEVw/6nnMQrMtA4723BtZUnVi P05uryhz9UGn74q6p+AKumw08o2NaEsVjipJ73Caa+JFM7SV82xclobRWR+XLYmrP+To tBIbfe8ACcNc7tfNw068erW1mDjG7PHqpPEaobidbOZHJwirIYF0lWFpSWJc4xFNY5Oo mY8w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=t5iqG9FUBzwcyOwRzFSiqyP9MM8Qxl1nWZFUgq/4DbQ=; b=t722Una78WUOaRIO4KafjNlJ7OXsQYtvyJsA6xHnZzZU8fgT2zLrVn7dcykkdWmvyO 2Qg1atq5KpGY8Q6LlP5Mw211k6fiV/IE8jbpoTGf3kcvUZ7POVdy5gkGoAKU3Q3Upu2e in4lxF980wmkcNLCpZRvLdrF4p/8b8vFqIyXH4/uWeIe/2k6LNJ5cjodJGt5XTmV+MBE b7PUmHNaJ/Ofrc1UxqGsq5q+o+v5c0I9z7N4fcmxRRYrSpjQbJRq2Kgvc+7PZ5FHT06g MoxnbqmaYs0KEQTpfe8aAGGKxfK0PwYdPb99sa9CP7g4nwJuXXsD3tPDnvcenNGrxtOe g6qQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=WbfBwKYz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id x21si4268044ejb.180.2021.04.10.09.02.57; Sat, 10 Apr 2021 09:03:23 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=WbfBwKYz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234587AbhDJQCM (ORCPT + 99 others); Sat, 10 Apr 2021 12:02:12 -0400 Received: from mail.kernel.org ([198.145.29.99]:41862 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234392AbhDJQCM (ORCPT ); Sat, 10 Apr 2021 12:02:12 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 7686F611C2; Sat, 10 Apr 2021 16:01:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1618070517; bh=Y1k95pTSuUEBVcAjP2VWjsCkb9TRXfXUUTasTVjd7l8=; h=From:To:Cc:Subject:Date:From; b=WbfBwKYzc+t2RO9/N13YtjyygZkiapOxwTI377ciY/iHobzMLfn1b/3joh0kEIiPe AzojM4v3+FCor4wRzeRpnzJzEDunLr5e+zsvPEi0PRxjYYMKWAv2EPpM5nTU6Driq1 OCsJTyJCG9FCFFNrTUoldXiRbcuKZJaQu63gJLdnumN8CCVenEPXY8HoDwFk4OlqqE P1X46S1+aO8WXA6u0PBWBND8FO8cJqTMHz+UAH4np7HHbHKoVA3URrNSq38oEQsc4T rC1qiQkBQkO08kNczQCO3jnPQYsrOhAGkoZyjJjhqdm1A7L86C7OiFgvGSz+yc6oCe 0amtBtj0VAwXg== From: Jaegeuk Kim To: linux-kernel@vger.kernel.org, Greg Kroah-Hartman , Mike Snitzer , kernel-team@android.com Cc: Jaegeuk Kim , stable@vger.kernel.org Subject: [PATCH] dm verity: fix unaligned block size Date: Sat, 10 Apr 2021 09:01:51 -0700 Message-Id: <20210410160151.1224296-1-jaegeuk@kernel.org> X-Mailer: git-send-email 2.31.1.295.g9ea45b61b8-goog MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Jaegeuk Kim When f->roots is 2 and block size is 4096, it will gives unaligned block size length in the scsi command like below. Let's allocate dm_bufio to set the block size length to match IO chunk size. E sd 0 : 0:0:0: [sda] tag#30 request not aligned to the logical block size E blk_update_request: I/O error, dev sda, sector 10368424 op 0x0:(READ) flags 0x0 phys_seg 1 prio class 0 E device-mapper: verity-fec: 254:8: FEC 9244672: parity read failed (block 18056): -5 Fixes: ce1cca17381f ("dm verity: fix FEC for RS roots unaligned to block size") Cc: stable@vger.kernel.org Signed-off-by: Jaegeuk Kim --- drivers/md/dm-verity-fec.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/md/dm-verity-fec.c b/drivers/md/dm-verity-fec.c index 66f4c6398f67..656238131dd7 100644 --- a/drivers/md/dm-verity-fec.c +++ b/drivers/md/dm-verity-fec.c @@ -743,7 +743,7 @@ int verity_fec_ctr(struct dm_verity *v) } f->bufio = dm_bufio_client_create(f->dev->bdev, - f->roots << SECTOR_SHIFT, + 1 << v->data_dev_block_bits, 1, 0, NULL, NULL); if (IS_ERR(f->bufio)) { ti->error = "Cannot initialize FEC bufio client"; -- 2.31.1.295.g9ea45b61b8-goog