Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp125538pxf; Wed, 10 Mar 2021 02:06:45 -0800 (PST) X-Google-Smtp-Source: ABdhPJyg6wIzBINykwyqcCUHvzeEEROngOqpFMHWDmoO0E4c+RqOzycFV1YfRqS49cTEDT7mZKhz X-Received: by 2002:a17:906:68c5:: with SMTP id y5mr2815283ejr.371.1615370805548; Wed, 10 Mar 2021 02:06:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1615370805; cv=none; d=google.com; s=arc-20160816; b=AR8eDmWGS9yhKgmXFig+XN5nWWqEm8deh4KML8sKZGBfHUNHzcw+1aP202vW9p+iB4 q3j1vR9SYghQtYHNSZtljckzYtk3TkhA3M81S0pcIdujBrmkDlV3xtd96LdG1DeIiFt+ /yMkwafPbEsylxQ0mWFpYIwdNKRu6rQJngcN16lWF7CsiDlMIWVgTi88K+NnGXBR3uzO lVu61dv51H4Sp+Mpzjp/gvzXu801GOJNFHv53QkRSOnulaiSd/N/2IKX53DFQ+mJwnzF 2tYV0o6kip0iMNuCt9Hl7aN6vvG3NA9DMehHxWgQ3NLqR7dyiTje+9sIFeQ7ccVIIwwW FZAg== 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=LuVa+oXdbXA4zmkmkPx1PW6NzzvlYeYE2D2gOIbMwjE=; b=xvbtBRHTDCQo1bfbQqJTsRjvg3W9pFPWME3EJqRWrQxNjOa+6Lrb+0SYHTO4aU43t7 +vs+oLh0ZXKL204Xdc85g1gqeJsnoWMy4184H1HtGDy+M6XJ1kUrkvI1PiWQGzo8KRwv Mmd3YAZYSsStLB8HJw0YIZGffAXYVTe+x2VQgBtJXYi0VYHgfqlTMaHarKjOZ0f/ApV9 rAA85blFAk3bJWKWPTBcHu1/c1SbJtzrBrGxKAYCSU9+03/AiYa1BjfIyESO/OVbIc06 2K2587Ux3CUsSfcrYo6ky1SE//BauPctNcHkiMCSRKOF59bK2Lu5V4cXQwOsqwOYyXNq n1dw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=TQZbVS+m; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id fx8si11186874ejb.481.2021.03.10.02.06.22; Wed, 10 Mar 2021 02:06:45 -0800 (PST) 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=@infradead.org header.s=casper.20170209 header.b=TQZbVS+m; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232349AbhCJKFR (ORCPT + 99 others); Wed, 10 Mar 2021 05:05:17 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58872 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229657AbhCJKFG (ORCPT ); Wed, 10 Mar 2021 05:05:06 -0500 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1244EC06174A; Wed, 10 Mar 2021 02:05:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; 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=LuVa+oXdbXA4zmkmkPx1PW6NzzvlYeYE2D2gOIbMwjE=; b=TQZbVS+mdD61bxIXG6v05MBw5n /Ri8XBRdul+NOumajbMAGLnKYfoWeqRxu7WZZvK5eE1/lMVfmthEcjXti8vZKamB4E57ShYrCADVO FUqfV9r+6w5y4cUAfmuwxCa9qYvUixBdYpBInqvljBi+Zo2ckFrdMOG0YQeQwsehiA27CviFyAs2V m1928byywQPHrtqw0/9aObQrKGELZ+EelTC1EJFvTexnyov0wePzIl30dKgPydUsrqT8l++mPXTDn 56TbkHOVgdrzaWT6ym6bHaQiwFBx2FYLuJqPwu+6b/FvV3HVNOahODOwg/HIpQ7lgXxUiZJI7gGHE oHL4LE+g==; Received: from hch by casper.infradead.org with local (Exim 4.94 #2 (Red Hat Linux)) id 1lJvho-0036nv-IR; Wed, 10 Mar 2021 10:04:42 +0000 Date: Wed, 10 Mar 2021 10:04:40 +0000 From: Christoph Hellwig To: Sergei Shtepa Cc: Christoph Hellwig , "snitzer@redhat.com" , "agk@redhat.com" , "hare@suse.de" , "song@kernel.org" , "axboe@kernel.dk" , "dm-devel@redhat.com" , "linux-block@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "linux-raid@vger.kernel.org" , "linux-api@vger.kernel.org" , Pavel Tide Subject: Re: [PATCH v6 2/4] block: add blk_interposer Message-ID: <20210310100440.GA736136@infradead.org> References: <1614774618-22410-1-git-send-email-sergei.shtepa@veeam.com> <1614774618-22410-3-git-send-email-sergei.shtepa@veeam.com> <20210309172717.GB201344@infradead.org> <20210310045313.GA26929@veeam.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210310045313.GA26929@veeam.com> X-SRS-Rewrite: SMTP reverse-path rewritten from by casper.infradead.org. See http://www.infradead.org/rpr.html Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Mar 10, 2021 at 07:53:13AM +0300, Sergei Shtepa wrote: > > Please avoid the overly long line. > > > > > + int ret = 0; > > > + > > > + if (WARN_ON(!interposer)) > > > > WARN_ON_ONCE? > > This function should be called quite rarely, and the absence of the interposer > parameter indicates that the function is being used incorrectly. > I would like to see this warning every time. Yes. Most kernel code would in fact just remove the check entirely and let the kernel crash to indicate this. Maybe that is an even better option for such a grave API usage mistake. > > > +struct bdev_interposer { > > > + ip_submit_bio_t ip_submit_bio; > > > + struct block_device *bdev; > > > > Do we need the ip_ prefix here? Also we probably don't really the > > the typedef for the function pointer. > > Ok. Maybe submit_bio_hook would be better? or submit_bio_interposer. Or interpose_bio?