Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp520250pxb; Thu, 21 Oct 2021 04:24:59 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxNLW0GnQTxakRzfskymQ0QSUu+HJIIj5SZ+8BUopE74tynu9lsy2LeqtAU8n0WfYjRogQD X-Received: by 2002:a17:90a:df18:: with SMTP id gp24mr5816822pjb.63.1634815498962; Thu, 21 Oct 2021 04:24:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634815498; cv=none; d=google.com; s=arc-20160816; b=O4+SGIHEoYIRPOosG/24HgE+KxbdBgHW/XmOLsJ8jkOYeegH8MbZZHFCdNW72qalvU dNUgQrj0ExqdNjUelGQN1zEo4rVUJWYP18pyyYjGWfFhm2uO/0Pxk6hLtemNOc9BqA1Y spshKpHFigNvaL4buEaTZlEfFn4+8Ze+S0VSRXtDs5KpNmsz6DIpoVCQOYHxWBVhYc69 /Vvu6ttoh6IpzW5GXlWtI6xF2be1Uhcs7pzbWL4S4dm2Lzhu982aOFvZnKCj+eN0l2wZ d3AvwIX9mUsyZ8Dv5x94WhxTvdX1a1xRpt1E0P5vTlSNcrrgHYAGXR+LlhuqG0dN2LTy RYTw== 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=jHNkeu1MGIkme3Ou2Fc+7gjNFGDmVI77OK4rHIfkekk=; b=gi6b1Gh5mlCLdF0HzaJz0Tpl5hELhVVac7EQTuZxI69JjEtGG2N/42Kqn/91EAzwfL HESD6vfQxttRaxo0tk3rBHV86j3gawoAJHAdpD0TycYX/g9tdCSGx2XyJqyKuzaPF1W2 cG3veUt7BvrKLp3rjQXlDzJ/kqnIq2n5vDDryQ+Ogt4qU5gNledfC8YA97RrFtAPQL4y LWhBeJJKIGmqNuzaKOiFIhghRivcB5TWULCKR/YszXg/uBibSzJw9qcg0PCZ1ebpOu44 1xMippncc/VP6JhJzLGV8nymk2+kn+WWsF+znXqzCwiVJ8vwAyD7JifUXHnqNrfdAqcp Eyyw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=RKBcfzKO; 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 q189si1941898pgq.160.2021.10.21.04.24.44; Thu, 21 Oct 2021 04:24:58 -0700 (PDT) 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=bombadil.20210309 header.b=RKBcfzKO; 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 S230235AbhJULZs (ORCPT + 99 others); Thu, 21 Oct 2021 07:25:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51716 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229765AbhJULZr (ORCPT ); Thu, 21 Oct 2021 07:25:47 -0400 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E3857C06161C; Thu, 21 Oct 2021 04:23:31 -0700 (PDT) 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=jHNkeu1MGIkme3Ou2Fc+7gjNFGDmVI77OK4rHIfkekk=; b=RKBcfzKOloAfOxSWW6IBPF/yTy 9xwY27QTnR5eroggOBW+EDNgmwreHjqT/35SHF1zkvDj55xydrRDW/N0wSeBHA+4i+5MMkKTTuP5q gml2cOIUbFnnMiSZJkYYAP1EVNdP4VbvLVFiUGO3fD8bkuItik+q6L+PQbqY8A0rPHagJijvV9Ko+ hrhSnV4C/7BzabxgOV1kEc6hNQ07BomA/cyaBUxcocLjXPjyveHl/BTUAN7gWJOn514IYJq0FTZnC GGn1NaFxVDiS4uHEXP8wHZyl3BRXrq4T/z6Uv/aivbSJkEF4V9VnlTzw4Y7GCWi/7mhNtgnU2WZma fgpfBGxg==; Received: from hch by bombadil.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1mdWAK-007Kld-Ns; Thu, 21 Oct 2021 11:23:20 +0000 Date: Thu, 21 Oct 2021 04:23:20 -0700 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 3/6] pmem: pmem_dax_direct_access() to honor the DAXDEV_F_RECOVERY flag Message-ID: References: <20211021001059.438843-1-jane.chu@oracle.com> <20211021001059.438843-4-jane.chu@oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20211021001059.438843-4-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 Wed, Oct 20, 2021 at 06:10:56PM -0600, Jane Chu wrote: > - if (unlikely(is_bad_pmem(&pmem->bb, PFN_PHYS(pgoff) / 512, > - PFN_PHYS(nr_pages)))) > + if (unlikely(!(flags & DAXDEV_F_RECOVERY) && > + is_bad_pmem(&pmem->bb, PFN_PHYS(pgoff) / 512, > + PFN_PHYS(nr_pages)))) The indentation here is pretty messed up. Something like this would be move normal: if (unlikely(!(flags & DAXDEV_F_RECOVERY) && is_bad_pmem(&pmem->bb, PFN_PHYS(pgoff) / 512, PFN_PHYS(nr_pages)))) { but if we don't really need the unlikely we could do an actually readable variant: if (!(flags & DAXDEV_F_RECOVERY) && is_bad_pmem(&pmem->bb, PFN_PHYS(pgoff) / 512, PFN_PHYS(nr_pages)))