From nobody Fri Dec 19 15:46:15 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1664557889; cv=none; d=zohomail.com; s=zohoarc; b=ZWmmzkU+E9xzLtsvMTr7T2+lqUBGhZ5XpN67om2MUrI7eBkdbd1L216i8Y08xJpdPfv51RdHF07IXifj68hdtfmp5/z+7uUCxlQOjGWT4xct34rdgX8Zj72AR5yruaBNqTLmWMF0sVSH3oSzEjZ2CQAYeNDhufT2ngjSZVzKF54= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1664557889; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=8CpiEaC6fQLkwLnh9nDraGTX4x6FvrG4leRszaPih6k=; b=JQubSFC5v/yD9maHclSOU+Frq0AH3M9/3xWTsA3zfPf5x10Z1718ijoY7Ey6mOHWJ0f0BiCpO+Qrb7AzAnn6IEDQqptrAFDGj2UMjX5mJDYC7jyxxCAqR6L33085Pj2sXzBboNcDmN1KX8mL8FOKuupBJunpcnh/nWn5x05EnVs= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1664557889654563.2395484863147; Fri, 30 Sep 2022 10:11:29 -0700 (PDT) Received: from localhost ([::1]:48924 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oeJXs-0002qF-Mr for importer@patchew.org; Fri, 30 Sep 2022 13:11:28 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:55228) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oeJFr-0006g3-81 for qemu-devel@nongnu.org; Fri, 30 Sep 2022 12:52:52 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:33397) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oeJFp-0006g8-Lq for qemu-devel@nongnu.org; Fri, 30 Sep 2022 12:52:50 -0400 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-663-2EfTpU70P8CzYkDWULsb0A-1; Fri, 30 Sep 2022 12:52:47 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id C5903882823; Fri, 30 Sep 2022 16:52:46 +0000 (UTC) Received: from merkur.fritz.box (unknown [10.39.192.112]) by smtp.corp.redhat.com (Postfix) with ESMTP id 1100817582; Fri, 30 Sep 2022 16:52:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1664556769; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=8CpiEaC6fQLkwLnh9nDraGTX4x6FvrG4leRszaPih6k=; b=YY09AxPIhV73H8qCSLH/gvBdU5mDGDa754+j6L3psTPSi9AUpDsZRarF3CDnHAb8yPTFL7 qPa72dFlBjHtRNOL14qKcgGle5LNRlSyD6CwkVpsypTMGM7o7ik7ykQl2jZJpvfHLvtHOD YSVr5GNV+SrUOftyOGrgJhby0K+7jWw= X-MC-Unique: 2EfTpU70P8CzYkDWULsb0A-1 From: Kevin Wolf To: qemu-block@nongnu.org Cc: kwolf@redhat.com, stefanha@redhat.com, qemu-devel@nongnu.org Subject: [PULL 13/18] block: use the request length for iov alignment Date: Fri, 30 Sep 2022 18:52:17 +0200 Message-Id: <20220930165222.249716-14-kwolf@redhat.com> In-Reply-To: <20220930165222.249716-1-kwolf@redhat.com> References: <20220930165222.249716-1-kwolf@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.5 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=kwolf@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -28 X-Spam_score: -2.9 X-Spam_bar: -- X-Spam_report: (-2.9 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.082, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1664557891236100001 Content-Type: text/plain; charset="utf-8" From: Keith Busch An iov length needs to be aligned to the logical block size, which may be larger than the memory alignment. Tested-by: Jens Axboe Signed-off-by: Keith Busch Message-Id: <20220929200523.3218710-3-kbusch@meta.com> Reviewed-by: Kevin Wolf Signed-off-by: Kevin Wolf --- block/file-posix.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/block/file-posix.c b/block/file-posix.c index 989dfc4586..66fdb07820 100644 --- a/block/file-posix.c +++ b/block/file-posix.c @@ -2068,13 +2068,14 @@ static bool bdrv_qiov_is_aligned(BlockDriverState *= bs, QEMUIOVector *qiov) { int i; size_t alignment =3D bdrv_min_mem_align(bs); + size_t len =3D bs->bl.request_alignment; IO_CODE(); =20 for (i =3D 0; i < qiov->niov; i++) { if ((uintptr_t) qiov->iov[i].iov_base % alignment) { return false; } - if (qiov->iov[i].iov_len % alignment) { + if (qiov->iov[i].iov_len % len) { return false; } } --=20 2.37.3