Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp3493062imw; Thu, 7 Jul 2022 02:43:54 -0700 (PDT) X-Google-Smtp-Source: AGRyM1vCg/n1GWsBIsWZ4bBbuUcLwH7GiO9Of+wDX70WPc6sNSCutJQE1XXAiwU0kJWqpJKhm010 X-Received: by 2002:a17:906:58cf:b0:722:e4e1:c174 with SMTP id e15-20020a17090658cf00b00722e4e1c174mr44237614ejs.85.1657187034606; Thu, 07 Jul 2022 02:43:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657187034; cv=none; d=google.com; s=arc-20160816; b=PvUbVdVudLWhz3Xq7Nl/ckxknlu4H2Jtit3I3d1qJ3EzxajmW+QbAtKoDOSGJlqMJg jX52zqbEVKXQ2QQ+zsu2NjorUDtPfq/FpVWtOuT64VXpjDhKi9ZPUv0M+I7lZTi0rTYM l+H/THJIA0BIUQPNp1yjCbsrjBUJdRfIgFq9iXOYgsLUVX06Ji2QKYYdlaM7pGPxfFuK YZ9sXgqDCzrkbI9RMzwkwGXaqq/OQjER0fIYLuVSaG1jytmw8M4LhyrEn5/NRvLSnnbR FvCAEe8Q6MqChgZoXnaezIyUVMHjZG5hSBOh9jrPVsCAkuAkS2nfr8OIzXWMV66S3yFj /CiA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=lO0+ynw53umMSGxq4f6KEddvl3ZO5H+vLPy0wh+Kmqo=; b=XWFPPETdznkOSGg69/VT8edtMzxtVNGalRUx9G9z/0/V4HqirNED5uT7Y4tn+2eETT xDqvI3D6KvUOEzx9cLsOJDvuTpO9t/2Hak2QRjsXHp643UAo93yWJmtlv++ihqaSkULG eheF6/yVSq4FIewz7Jt/q1fSv77zwNASLVD+cSz3w5Jj5qAsvbX9yOOhZnBNlFXrQcUj xMJKOwtlwwF4K1dD7IK8/vUEtOtNlXkOXRh1SwIoEi6zmwmxBPccClKnIA8UPNFSlUsZ +hTDm32jCKB/8Pa52ExX2U54AJQ/o/iA3fN/NhQ9W1PYg4ezIgAWyXypDS3KJgOjqSwR eD9w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@veeam.com header.s=mx2-2022 header.b=L92dnU98; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=veeam.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id dr22-20020a170907721600b007267675e19csi23873813ejc.691.2022.07.07.02.43.29; Thu, 07 Jul 2022 02:43:54 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@veeam.com header.s=mx2-2022 header.b=L92dnU98; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=veeam.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234998AbiGGJQv (ORCPT + 99 others); Thu, 7 Jul 2022 05:16:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57730 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230272AbiGGJQu (ORCPT ); Thu, 7 Jul 2022 05:16:50 -0400 Received: from mx2.veeam.com (mx2.veeam.com [64.129.123.6]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C257F2CDDC; Thu, 7 Jul 2022 02:16:49 -0700 (PDT) Received: from usmail.veeam.com (colmbx01.amust.local [172.18.0.171]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx2.veeam.com (Postfix) with ESMTPS id E5A3F40A6F; Thu, 7 Jul 2022 05:16:45 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=veeam.com; s=mx2-2022; t=1657185405; bh=lO0+ynw53umMSGxq4f6KEddvl3ZO5H+vLPy0wh+Kmqo=; h=Date:Subject:To:CC:References:From:In-Reply-To:From; b=L92dnU98ZSmTfOdwNQe427QO2VCUgXK/s+TcXmLUowzduFSLUP4cZBCazWLgrYM3K q+cGGOJvFbmJ35jcriJV7JbJnJ9ngMYY+a8rzVRfAH4a/3AycNZJK58lFJuQg0Jupd ENYelkQxeNp1yTGRn+B0vY6FX++v3woxbJr3JZG4xvr29xmuiKtQsqCaSc5lzhH5ak uHCAsoF0MWU2165u9EYfgik+StUnz4MiB++01p7ELm/oxmkMDooo/2rZcMTM82D/bL HlJ4LULqCRiQy6K8Zzuf77SyG7U8uim+/+2zB43QeWU3gkgPxkVqm2CQYhi0ttgvKC 80VYjTY/WZCXQ== Received: from [172.24.11.83] (172.24.11.83) by colmbx01.amust.local (172.18.0.171) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.9; Thu, 7 Jul 2022 05:16:43 -0400 Message-ID: <49039d2b-e4bc-62a1-7b4a-a78001a2f430@veeam.com> Date: Thu, 7 Jul 2022 11:16:42 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.11.0 Subject: Re: [PATCH 15/20] block, blksnap: snapshot image block device Content-Language: en-US To: Christoph Hellwig CC: "axboe@kernel.dk" , "linux-block@vger.kernel.org" , "linux-kernel@vger.kernel.org" References: <1655135593-1900-1-git-send-email-sergei.shtepa@veeam.com> <1655135593-1900-16-git-send-email-sergei.shtepa@veeam.com> From: Sergei Shtepa In-Reply-To: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Originating-IP: [172.24.11.83] X-ClientProxiedBy: prgmbx02.amust.local (172.24.128.103) To colmbx01.amust.local (172.18.0.171) X-EsetResult: clean, is OK X-EsetId: 37303A29078F7554657267 X-Veeam-MMEX: True X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > >> +static int snapimage_init_request(struct blk_mq_tag_set *set, >> + struct request *rq, unsigned int hctx_idx, >> + unsigned int numa_node) >> +{ >> + struct snapimage_cmd *cmd = blk_mq_rq_to_pdu(rq); >> + >> + kthread_init_work(&cmd->work, snapimage_queue_work); >> + return 0; >> +} > I'm a little confused on why this both has a blk-mq interface and > the new bio filter interface. Whow is going to submit I/O to this > blk-mq interface? > Sorry, it seems to me that I didn't understand this comment. The module creates a block device for each snapshot image. To make a backup of a block device, the backup tool reads snapshot image. This snapshot image block device allows to mount a file system on it and perform the necessary preparation. If not for this requirement, it would be possible to implement reading via an additional ioctl. But that wouldn't be a good design, I think. Perhaps I have implemented this block device incorrectly? Processing requests of the snapshot image block device is started in the function snapimage_queue_rq(). And ends in the snapimage_queue_work() in another kernel thread. Therefore, when the request is initialized in snapimage_init_request(), a kernel worker is prepared. >> + //.open = snapimage_open, >> + //.ioctl = snapimage_ioctl, >> + //.release = snapimage_close, > Please don't leave commented out code around. >