Received: by 2002:ab2:b82:0:b0:1f3:401:3cfb with SMTP id 2csp802401lqh; Thu, 28 Mar 2024 17:59:40 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVwn/c9VVBkOCiVMWbPMHn7e228dUGjRx5YteBFeCl4cDWpymBePAaD3dfclZVjA1WzeCJdI1rQpZyqrbufTzZCJeIb6REbwhuwO7sjMw== X-Google-Smtp-Source: AGHT+IHfEyT47SdQyKvmMBcmQJaOYQ5ytfboq9OhFj7CRBNjeJZKyn4jIweTrBxhRwchXkdmASwV X-Received: by 2002:a05:620a:57d4:b0:788:2695:1d84 with SMTP id wl20-20020a05620a57d400b0078826951d84mr1100076qkn.67.1711673980570; Thu, 28 Mar 2024 17:59:40 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711673980; cv=pass; d=google.com; s=arc-20160816; b=ZabPLdECoEHW8JbS2eSdwHja2ApfjlejG6dv4u2NDaxgBOrBL+nVjQ5esRvHsewCai 59jKdFsDXF0vgQ881s/ERaNuNv9EPg4t2znxyJJlXxI2GFd5oliDyYB8IQJyF/CtFijk Znqo4XwgQ94O2WqbPPYvRNDfvSdvMX1kSpNf7QIQS4DTMV6bpbGwcZ3HeT0OGRhmrFVT SYJQv1XhxlaZXozZmZpOgjZ4QD3NL8tHm//q7YGO20pt60n6RYMMh6VvbITi6RAtwGX0 2hpBvqRHfG3V0Uz/mc541x36AzvtQnvHYrZ8TlF4VADSpYBkOBEcHdukR709Qmml3ZDR wuHg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=user-agent:in-reply-to:content-disposition:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:references :message-id:subject:cc:to:from:date:dkim-signature; bh=nARZ042JED3YY8PVgEd4GjTAZYkPl2errMjI0givjeE=; fh=zaNS7a0ivRt0Jtyv5L6ZQWkVjRrFTtwidT0IM+uzgbQ=; b=Mry3uy20HGfJMG6W5T/S3c7uvfGVeHqjdFeDnyMatExhgeZHyBDwG/SO7uBGVWeGq2 TmPyC42kEq3WqFuNsLzi/vzZHNIPkS4KAIK6eSpD3YkJIVHVqUm7RkO3v34MYmez31gs o1UvxSRtZ4iPTeVojkQzJdLAUa5XlxMj1XDEkZFsugXa1ljM4Cu1LCYRJ6tjvOn/JnCI nfTnMctyY/wI6XumAmyRR+BSIZWy8CD65S+4gQ65VU1C2LvaLdWZuGGNAVN9B+FD1EEn mKG6Hvg/XHr01WSozwgT690psLVMTKHTrLpp5XEgWFtztNPlQMEPQQOImYnzCVCcpZTn f6ow==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=WOe0Ojp3; arc=pass (i=1 spf=pass spfdomain=redhat.com dkim=pass dkdomain=redhat.com dmarc=pass fromdomain=redhat.com); spf=pass (google.com: domain of linux-kernel+bounces-123933-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-123933-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id l4-20020a05620a28c400b0078bc3fe3b3asi1703822qkp.349.2024.03.28.17.59.40 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Mar 2024 17:59:40 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-123933-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=WOe0Ojp3; arc=pass (i=1 spf=pass spfdomain=redhat.com dkim=pass dkdomain=redhat.com dmarc=pass fromdomain=redhat.com); spf=pass (google.com: domain of linux-kernel+bounces-123933-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-123933-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 4D4581C249CF for ; Fri, 29 Mar 2024 00:59:40 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id CB9841CAA4; Fri, 29 Mar 2024 00:59:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="WOe0Ojp3" Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 881AC17BD9 for ; Fri, 29 Mar 2024 00:59:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.133.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711673969; cv=none; b=iQIelaZIYI7434wsiOybTs/p0PYS2r4p46nY+HjTf7pG+M5BLJuGXbYYz8KMIfri7UrUtYJQZij6pDlhvtpuYOHg4xfITSp6My7n0TcG1q7ftP2dgNRiQXOEDZeTabGLxcyNRdBbkvPnR6OQXPEp4K7Qtrmze/r8W/FcnjHwgDM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711673969; c=relaxed/simple; bh=iF/vouNuh+hKx9L4wnVeRQ/T0SOFoiPL/06j048++fA=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=QlSy9lFFuFSeMlwsiVjZEsw1A19jC3rA5xahVRwY16rPNknHXmx1buR8XTSzhqTNRBr69g7ifDmVeTsCulAAyFUCo+ZXyLn62CtLaJ4KjKBTvA1JE2mcpdeH0/c94bW9EpQgUTWGgtr0cT0hAoFTPxt45KOYCQJBLfA6Uf92KOc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=WOe0Ojp3; arc=none smtp.client-ip=170.10.133.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1711673966; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=nARZ042JED3YY8PVgEd4GjTAZYkPl2errMjI0givjeE=; b=WOe0Ojp3uV3amJ1VzCP5tyRetow/fOWsle4UPPwO6YDWvSQwKz9HoAZXXvxkIVSO9ymd+S Uq56fwxtmsh3OGYsAOV+fW6yyNGSL7tHdYy8u9WB5yAwoy2rTomCqEXT3E81GTw9PdL7xJ mmiZNONQLr2O67K9sJ7mIAAbj+pQtpg= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-84-Cqvuhfa0N5COFzV2AFzFHg-1; Thu, 28 Mar 2024 20:59:22 -0400 X-MC-Unique: Cqvuhfa0N5COFzV2AFzFHg-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 63828101A526; Fri, 29 Mar 2024 00:59:22 +0000 (UTC) Received: from redhat.com (unknown [10.2.16.33]) by smtp.corp.redhat.com (Postfix) with ESMTPS id AC6E6C1576F; Fri, 29 Mar 2024 00:59:19 +0000 (UTC) Date: Thu, 28 Mar 2024 19:59:14 -0500 From: Eric Blake To: Stefan Hajnoczi Cc: linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, Alasdair Kergon , Mikulas Patocka , dm-devel@lists.linux.dev, David Teigland , Mike Snitzer , Jens Axboe , Christoph Hellwig , Joe Thornber Subject: Re: [RFC 7/9] selftests: block_seek_hole: add dm-linear test Message-ID: References: <20240328203910.2370087-1-stefanha@redhat.com> <20240328203910.2370087-8-stefanha@redhat.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240328203910.2370087-8-stefanha@redhat.com> User-Agent: NeoMutt/20240201 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.8 On Thu, Mar 28, 2024 at 04:39:08PM -0400, Stefan Hajnoczi wrote: > The dm-linear linear target passes through SEEK_HOLE/SEEK_DATA. Extend > the test case to check that the same holes/data are reported as for the > underlying file. > > Signed-off-by: Stefan Hajnoczi > --- > tools/testing/selftests/block_seek_hole/test.py | 16 +++++++++++++++- > 1 file changed, 15 insertions(+), 1 deletion(-) > > diff --git a/tools/testing/selftests/block_seek_hole/test.py b/tools/testing/selftests/block_seek_hole/test.py > index 4f7c2d01ab3d3..6360b72aee338 100755 > --- a/tools/testing/selftests/block_seek_hole/test.py > +++ b/tools/testing/selftests/block_seek_hole/test.py > @@ -45,6 +45,20 @@ def loop_device(file_path): > finally: > run(['losetup', '-d', loop_path]) > > +@contextmanager > +def dm_linear(file_path): > + file_size = os.path.getsize(file_path) > + > + with loop_device(file_path) as loop_path: > + dm_name = f'test-{os.getpid()}' > + run(['dmsetup', 'create', dm_name, '--table', > + f'0 {file_size // 512} linear {loop_path} 0']) Would it be worth tryiing to create the dm with two copies of loop_path concatenated one after the other? You'd have to do more work on expected output (coalescing adjacent data or holes between the tail of the first copy and the head of the second), but without that in place, I worry that you are missing logic bugs for when there is more than one table in the overall dm (as evidenced by my review in 4/9). -- Eric Blake, Principal Software Engineer Red Hat, Inc. Virtualization: qemu.org | libguestfs.org