Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp1021537pxb; Wed, 6 Apr 2022 06:56:55 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwHWl07HbIN6NCCn3gvPnCAe9xMJSvEHj6OppEQsQtREDi84yF09dwD3AVm69TTB68TupZG X-Received: by 2002:a17:90a:6501:b0:1ca:a7df:695c with SMTP id i1-20020a17090a650100b001caa7df695cmr10222806pjj.152.1649253415713; Wed, 06 Apr 2022 06:56:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649253415; cv=none; d=google.com; s=arc-20160816; b=JRwplLLVZuIbdlWOyFIFp5ck/kDZUytdHEP/h0Rhun9a45O2l9vlw049cWmeKiYm56 FYnoawZceTF1HiIE1iaKitfmZI5sP03di41qyOVbseWKzyQnkiAKUkya9XM1su75P/Sj giGd11nvU1KjpLQKIAvILpt49/7m8EUBeq/w76d87u+D6FmvNqrNxhGr95mu/kBtdAJg uC8BSc1qXgagsNT1cUz+mc4eWx28cxDEH4BL6p5jfiqxv/km92Tu5+uF1xUOfQI0vB3J XUn+sgdZV3GoytT0PmEA8l7poqVDTrbWFukJ8rsw7Bm9TSHnkThXZR6GsTcymEmJPnSM bUWw== 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=xkKN41eLVrIheZpH/2SH1i+aJL00RRx4irbbX94rx9Q=; b=hpH/P67K4sam0C9WufqGZ9Xe4gY72pJF2KVJpRdoAQx7pSeya1SeP72GSxKtQpLUTj Tbbhd9Q4RpwMGfOt5gNoHayJMLjP+gqCJQCEOW7KBPQBZh0OhaCLcRnviomNh/gsFw6v mBIstFq3n/J72GioP/WXzEnfKfJh3fDlm1da+ttHfkQb/hppN6WMyERAghQb84fktdjj QdTm/BLEmil8VJu0jTgnaHi8U+4yQdEmzbhrfOr6OsVGrtiAQOOtPbGDe36Stm0yM9sF mo82cU3EM4/W5faQUEDg9/Pi+lIZ4cBvoPXyA9VxNMjQQHiMO7TDpCHY8o++r24PbdjK uQjQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b="Q/3lDXWd"; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id na4-20020a17090b4c0400b001bf80eb1bcdsi5315707pjb.120.2022.04.06.06.56.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Apr 2022 06:56:55 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b="Q/3lDXWd"; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id DF7645840FB; Wed, 6 Apr 2022 04:49:53 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229666AbiDFHFO (ORCPT + 99 others); Wed, 6 Apr 2022 03:05:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48086 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1386973AbiDFGTp (ORCPT ); Wed, 6 Apr 2022 02:19:45 -0400 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 87C161B757E; Tue, 5 Apr 2022 22:21:50 -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=xkKN41eLVrIheZpH/2SH1i+aJL00RRx4irbbX94rx9Q=; b=Q/3lDXWd19Mt0b3/k3Rb7zcP5h p5Eze/s2YucUMuPYsP3/q20TplDhpywYDITWcq7DW8bCL9f9peotPecyp39tdZIQ1ExUkalAybXyS Sxt54IpLbAnxVjk06D6a2NNMvqpMHsxgMeosQjblK8oh9AW6ILrD0OEcrPhOIK4bCqie2ImxZgB4X gS/zqX5LtXLSyVWRgAmLMMXXDrccEDWzqicolNHUqaDXH8PiWuHSYpqXNQ8jCr6Cn3U5UgMr7P2gH bzB3VhlCqf6aRtj6S9vDNsm1YM8SxrSXMJeCnnlVBFrEDH/mbtk/QwMI4mI6duvxeYNJiTCqNnT1B dCRczSmQ==; Received: from hch by bombadil.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1nby6y-003oOR-F6; Wed, 06 Apr 2022 05:21:44 +0000 Date: Tue, 5 Apr 2022 22:21:44 -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, x86@kernel.org Subject: Re: [PATCH v7 6/6] pmem: implement pmem_recovery_write() Message-ID: References: <20220405194747.2386619-1-jane.chu@oracle.com> <20220405194747.2386619-7-jane.chu@oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220405194747.2386619-7-jane.chu@oracle.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=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no 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 Tue, Apr 05, 2022 at 01:47:47PM -0600, Jane Chu wrote: > + off = (unsigned long)addr & ~PAGE_MASK; offset_inpage() > + if (off || !(PAGE_ALIGNED(bytes))) { No need for the inner braces. > + mutex_lock(&pmem->recovery_lock); > + pmem_off = PFN_PHYS(pgoff) + pmem->data_offset; > + cleared = __pmem_clear_poison(pmem, pmem_off, len); > + if (cleared > 0 && cleared < len) { > + dev_warn(dev, "poison cleared only %ld out of %lu\n", > + cleared, len); > + mutex_unlock(&pmem->recovery_lock); > + return 0; > + } else if (cleared < 0) { No need for an else after a return.