Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp1826753pxb; Wed, 2 Feb 2022 13:26:38 -0800 (PST) X-Google-Smtp-Source: ABdhPJwF5kKIpBMOgPaNFLQQJUGJ3x7B+RW8JwtGGTsFTfh3782k0tQGbAPbH7zX5eFePHUvjUd+ X-Received: by 2002:a63:745:: with SMTP id 66mr25452500pgh.505.1643837198397; Wed, 02 Feb 2022 13:26:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643837198; cv=none; d=google.com; s=arc-20160816; b=Wo+5IvhltYzt+cQBp7qoCjxxXWNt+bZq9R5saihP1lPZFb5vea3W8cLvZgtvdrNDu/ XU3goGeZA0e4J4ywpMwCD2qYbUvATfklZN4z0pfV0768Yy+5MJFYU8XyOremELViLUol 7PUDHZz0bYaNdMhV0S9D5CNg7RkQU3ZTxJMrY8lrkajISLcyjrbJQT9TRbRHskfcZjd1 qIqcJjNXhSBZGKhI4PiyIsaC+FyFyAt2Tn8h1Uv0ivHCaD2tGdspLHOXCWgQS69GCChg iWYqX9UqG5c9KFUOSSZjqHjA8RH4mv1hBULiPTJRcoqO7JEgNxfv2jrWnicBSKlF6PwH 3u3Q== 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=dq3J4PURLRkL+u3uGPxxtzHSbIW9BWym1tctSNdLoyw=; b=uVtZ9/AtxZ4RsomFJi9rmAUWU736j5devdgPBlJpHBau3penePx48tgmDKONVdRCwQ LIHU/iDIbNBeDzD4vGzQC4QHUYDohVym7pYwhpEIAmQq9/3ywzuMXTFixmDYlB3kHSY7 z9Awmb14L95yJHmb1SoRZcY2Ya7KMC0j1FlxVkHSOYOiXUhzwdslwjLs3zjsM9cSjM+y 0nfHS8CcK0XDPKjY81tDlbhVHQODFxwr40TCVrUBLYP/aCvv248yheNUzZyEHhR23GGU bbycmJZmo7EJd3HpDHXwSWG7VJ6D0fMs+Vz4IWdbz6fqwBfjPfeihFNpWhxacI6wjcWC gCIw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=HbPestmY; 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 d17si22469022plh.278.2022.02.02.13.26.24; Wed, 02 Feb 2022 13:26:38 -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=HbPestmY; 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 S231989AbiBBNfI (ORCPT + 99 others); Wed, 2 Feb 2022 08:35:08 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57266 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229552AbiBBNfG (ORCPT ); Wed, 2 Feb 2022 08:35:06 -0500 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F3357C061714; Wed, 2 Feb 2022 05:35:06 -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=dq3J4PURLRkL+u3uGPxxtzHSbIW9BWym1tctSNdLoyw=; b=HbPestmYYX+VHHHvUgDZLk/k50 FccnMiv0tIhH9g0nmAcowBY/STZTiaTCjJfLpSedU0TwjxzEVc49lL4mdS+yQOhPP5Ctib1voaXUv kTyz5YV6z94HxOIH16cTotbstVsFOAQ6AmeQeY441YwMG9iYaGLdabMzN5eplbEcN0OoGj5D/FgoM JHM2ZWb1KR6fJ7Xc6KyoaWWmYvQvQOTjzjYeW0aQIO6qlk+dQRBuFdLQUMhQl18x4uZVcimwHKMGp Y1n23sROFF9D5qDT+gmuTpQhHbvaTeFcnHKHVKh8kgDY+EMtAltlB6loz41wEbAcHFAynD/6d4mYv mBhHOryQ==; Received: from hch by bombadil.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1nFFmk-00FN5h-1w; Wed, 02 Feb 2022 13:34:58 +0000 Date: Wed, 2 Feb 2022 05:34:58 -0800 From: Christoph Hellwig To: Jane Chu Cc: david@fromorbit.com, djwong@kernel.org, dan.j.williams@intel.com, hch@infradead.org, vishal.l.verma@intel.com, dave.jiang@intel.com, agk@redhat.com, snitzer@redhat.com, dm-devel@redhat.com, ira.weiny@intel.com, willy@infradead.org, vgoyal@redhat.com, linux-fsdevel@vger.kernel.org, nvdimm@lists.linux.dev, linux-kernel@vger.kernel.org, linux-xfs@vger.kernel.org Subject: Re: [PATCH v5 4/7] dax: add dax_recovery_write to dax_op and dm target type Message-ID: References: <20220128213150.1333552-1-jane.chu@oracle.com> <20220128213150.1333552-5-jane.chu@oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220128213150.1333552-5-jane.chu@oracle.com> X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jan 28, 2022 at 02:31:47PM -0700, Jane Chu wrote: > dax_recovery_write() dax op is only required for DAX device that > export DAXDEV_RECOVERY indicating its capability to recover from > poisons. > > DM may be nested, if part of the base dax devices forming a DM > device support dax recovery, the DM device is marked with such > capability. I'd fold this into the previous 2 patches as the flag and method are clearly very tightly coupled. > +static size_t linear_dax_recovery_write(struct dm_target *ti, pgoff_t pgoff, > + void *addr, size_t bytes, struct iov_iter *i) Function line continuations use two tab indentations or alignment after the opening brace. > +{ > + struct dax_device *dax_dev = linear_dax_pgoff(ti, &pgoff); > + > + if (!dax_recovery_capable(dax_dev)) > + return (size_t) -EOPNOTSUPP; Returning a negativ errno through an unsigned argument looks dangerous. > + /* recovery_write: optional operation. */ And explanation of what the method is use for might be more useful than mentioning that is is optional. > + size_t (*recovery_write)(struct dax_device *, pgoff_t, void *, size_t, > + struct iov_iter *); Spelling out the arguments tends to help readability, but then again none of the existing methods does it.