Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp786905rwb; Thu, 15 Dec 2022 02:22:55 -0800 (PST) X-Google-Smtp-Source: AA0mqf6aoIITA9bLO95kU5jV0w9XSnC1yPfWs3xfTZBl36eh6BBApEaZ1y6/C8vZRE3GFa5Omqdh X-Received: by 2002:a05:6a20:6d8a:b0:ad:a0c2:53ee with SMTP id gl10-20020a056a206d8a00b000ada0c253eemr17638542pzb.12.1671099775394; Thu, 15 Dec 2022 02:22:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1671099775; cv=none; d=google.com; s=arc-20160816; b=E2NeJHeYs9bJ0jWHD6LkdXbWGMXlfG9ZplOGsuRtVXdDCw1Fnb2rl9rToRea26JSuY OoGRcE3mgSRiS+qBLKN/GtsKB8yYyekAWB2JdlkISDCgL7S8dZa+lpb1o8fEFuDt3JE7 CUyU77tb+fKHVSjqfXQjrJeM+JvRKY2qG4zx5aRqPz/otX6ALZWXlGCOVL4uDIMY4A6B 0AD5w8SBDXArePWIJk8kiBtgzqgERqfUlY+AwFptZt2JYJVwqH8DZz4wgb2sUKWqiyAb Gvp/wJpIt1Nc3uVRVeOeBSyyW0ZkgaFpBBh6mEk+rYXeY9x8W9iN5s1u6rI6RRy9+Fb7 VsPA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=IlJozU8OcvQayugAj056DEYAilBtzE6ivKVmxPXiPjk=; b=Be00gQSbv41D0ihamTJMjrANfRxqgtuPWKEENa4UFYRKr5/REVJCXW9IeOLZXTCiB0 mG+fLyPv6E3TYFTSeJxUF4mqQSOAqjsLZxRjB6b46YWSk+xCr3L+PCdo3OGyMXzt+B1F bfNX5mXkxl5j7drthWRsLtk83mPiprYLImNznWhWMiX327Y9qDvOgLhkyi+OQskm4WM6 9f7tIcP3BP54qYka72j20Y5uaXE4j5TlOQesVeOQY4/Pl909Z5jJG3y0sJqh5JZ9CsO+ h0TrZFDRmGDED18W5Ol/QwmBzxKB9EBwHRWoOSEm9hW5VYsES5hfuA9vaCMaWMli61zR JsPQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=KwL0SIsM; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id l189-20020a6388c6000000b00477bf7b0c43si2397703pgd.458.2022.12.15.02.22.46; Thu, 15 Dec 2022 02:22:55 -0800 (PST) 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=@infradead.org header.s=bombadil.20210309 header.b=KwL0SIsM; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229995AbiLOJaY (ORCPT + 68 others); Thu, 15 Dec 2022 04:30:24 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35616 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229868AbiLOJaT (ORCPT ); Thu, 15 Dec 2022 04:30:19 -0500 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9BAB1379E5; Thu, 15 Dec 2022 01:30:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=IlJozU8OcvQayugAj056DEYAilBtzE6ivKVmxPXiPjk=; b=KwL0SIsMaRie20LTB50JeyVkKV POMk7lwcQE7zJUjIsRTtQq8GEMo7/nLrkOmO6nZIpJnGAv/SzZQAQ1a4aQyzrgwzCw435vslZO6H2 cA93wdjgSACqBxvjHiLQYJhuGX65OwIAYQgmwBWgKEUIOv3SPuIL6ccFpRdbMFAJTBda0JmSptqaq ea4y2Nu96SWWKLgPdgO8tds7ISBV1IlSdQ1jOcjIW3gRq229Qqi5Qlhn8USxSwfC8pJn+AyI4jMkc UneNesuw7+JfPgOQY8LKbFNx2r7/+AB/pH3mOVOGX1zuYukb1nEpgQGkdzemkKJXmV+xAhUmI6+xv NRn5VSQg==; Received: from hch by bombadil.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1p5kZF-008HLa-4H; Thu, 15 Dec 2022 09:30:17 +0000 Date: Thu, 15 Dec 2022 01:30:17 -0800 From: Christoph Hellwig To: Sergei Shtepa Cc: axboe@kernel.dk, corbet@lwn.net, linux-block@vger.kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 07/21] block, blksnap: init() and exit() functions Message-ID: References: <20221209142331.26395-1-sergei.shtepa@veeam.com> <20221209142331.26395-8-sergei.shtepa@veeam.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20221209142331.26395-8-sergei.shtepa@veeam.com> X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_NONE 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 On Fri, Dec 09, 2022 at 03:23:17PM +0100, Sergei Shtepa wrote: > + result = diff_io_init(); > + if (result) > + return result; > + > + result = snapimage_init(); > + if (result) > + return result; > + > + result = tracker_init(); > + if (result) > + return result; You need to clean up all these initialization if a later one fails. Also, does this really need a separate file? Any good reason to not just keep the tiny amount of init code in ctrl.c? > +static void __exit blk_snap_exit(void) > +{ > + pr_info("Unloading module\n"); Also we try to avoid these verbose messages for new code normally.