Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp30199pxb; Wed, 30 Mar 2022 22:03:07 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyWjG2eLmRckSE8y3LVLuIeSLoB1axaIGEDJhyX9ildeOFSS5TFEaqHiHYjQOjALJnVVchM X-Received: by 2002:a17:902:7006:b0:156:3cbe:6b04 with SMTP id y6-20020a170902700600b001563cbe6b04mr3232802plk.68.1648702987133; Wed, 30 Mar 2022 22:03:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1648702987; cv=none; d=google.com; s=arc-20160816; b=JyHNat1mGQ8AMh8q2HQX0IHzIe5fM9elHpcHInoxE+2gwF3rZMfzdTtlemjUQeSm2k Wpi06GqQpvtMgUWwrT1ESRPTM751stAUNrSmXiM1xByGdCBSLrvaAi96UJ2M9kam+isv +Kl5tUbrF8fuBXzQS9M7hCiozG/LjqNBcwao3ISv4kxYDBL3yybqhEric+694s1hOWHT Gj+VdRnCnrU2iWm2frerLoE/LeoHOG7PyxaTSWj6o/Ko6jPGiEqfipodAhn6PSXcGRmE ilOxVcmooOS440FU07jIytVq/Fs2kjpC3f5UrePEVepgwv8O7axR/apwg+KPUWcWZxBt MmfQ== 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=BW4xB1E0Wz9zQM2RhY0W9y2eD+oHCvNkoCEgXM+QgRg=; b=WJDlFKYuO0cp4McpGHX538Vb/5VXtMZmkYngy/3X4XNKVvZWeJsXpP/JMbO+sbh3TH bAqSzlKurfqGV09W8OCKHTBSv3Y1oUhVVJQbuVHFuy89U0S7Txk54zj6I4IvupPjgcco C16BKr2PXJ+PXAgDIXNEo/Yku4SpcF0n2pSQpG+7tpXXKFlOQiqc3DqyQSzeGzuMY+93 r8e3wa/73pDhCj/GcaXZxXgnQPUNeAfrRB4Llwm6Cv+m/6S0Uzq2FEj9iM4oDJNAJESo vYXi79B4v7kiSdNB86/fRMKHY6rZaQZDP6TsXI45QqBxMLnQ0cHmK/snZ7XjPs0vijrO f+4A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=cKQgGbj3; 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 ba8-20020a170902720800b00153b2d16491si21024827plb.153.2022.03.30.22.03.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 30 Mar 2022 22:03:07 -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=cKQgGbj3; 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 CD1E8262D73; Wed, 30 Mar 2022 20:38:48 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1348415AbiC3PyJ (ORCPT + 99 others); Wed, 30 Mar 2022 11:54:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35876 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1348425AbiC3PyH (ORCPT ); Wed, 30 Mar 2022 11:54:07 -0400 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6F3ACF05; Wed, 30 Mar 2022 08:52:22 -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=BW4xB1E0Wz9zQM2RhY0W9y2eD+oHCvNkoCEgXM+QgRg=; b=cKQgGbj3Q5DyGXPpUah3X4jqQ/ E4zT/CCDEFDmGH6GZFsioH1Rzvzp/Qv7GNxXSV1AzJU/lwoR8DWgL1Py5fzwRRa0OKiqWi544F4iL jAsfiaqCuYvKVBk0mJNe1FXjiajtDG+SDTjeeqneFCZ/qD+zgTc9hDT7uL7rDPacPdxpZVbbYTYGu AB55ncNM+WLF1lw375xOZvn4r0ONt6GXBt3Bo8QvUPJ8EgW4ZHakxLUCOzDEPHcuuRAq8FPbltqaz JlGOY1qTwnKEEFLiRxBWNyDUQ2RV8DIJeYed2YbbLfN1p1MdhrEVlveSg2gloIlAdEQpZoKmoRoIb 4QbqS9Dw==; Received: from hch by bombadil.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1nZacP-00GfjC-Rv; Wed, 30 Mar 2022 15:52:21 +0000 Date: Wed, 30 Mar 2022 08:52:21 -0700 From: Christoph Hellwig To: Shiyang Ruan Cc: Christoph Hellwig , linux-kernel@vger.kernel.org, linux-xfs@vger.kernel.org, nvdimm@lists.linux.dev, linux-mm@kvack.org, linux-fsdevel@vger.kernel.org, djwong@kernel.org, dan.j.williams@intel.com, david@fromorbit.com, jane.chu@oracle.com Subject: Re: [PATCH v11 7/8] xfs: Implement ->notify_failure() for XFS Message-ID: References: <20220227120747.711169-1-ruansy.fnst@fujitsu.com> <20220227120747.711169-8-ruansy.fnst@fujitsu.com> <894ed00b-b174-6a10-ee45-320007957ea4@fujitsu.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <894ed00b-b174-6a10-ee45-320007957ea4@fujitsu.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 Wed, Mar 30, 2022 at 11:16:10PM +0800, Shiyang Ruan wrote: > > > +#if IS_ENABLED(CONFIG_MEMORY_FAILURE) && IS_ENABLED(CONFIG_FS_DAX) > > > > No real need for the IS_ENABLED. Also any reason to even build this > > file if the options are not set? It seems like > > xfs_dax_holder_operations should just be defined to NULL and the > > whole file not supported if we can't support the functionality. > > Got it. These two CONFIG seem not related for now. So, I think I should > wrap these code with #ifdef CONFIG_MEMORY_FAILURE here, and add > `xfs-$(CONFIG_FS_DAX) += xfs_notify_failure.o` in the makefile. I'd do ifeq ($(CONFIG_MEMORY_FAILURE),y) xfs-$(CONFIG_FS_DAX) += xfs_notify_failure.o endif in the makefile and keep it out of the actual source file entirely. > > > + > > > + /* Ignore the range out of filesystem area */ > > > + if ((offset + len) < ddev_start) > > > > No need for the inner braces. > > > > > + if ((offset + len) > ddev_end) > > > > No need for the braces either. > > Really no need? It is to make sure the range to be handled won't out of the > filesystem area. And make sure the @offset and @len are valid and correct > after subtract the bbdev_start. Yes, but there is no need for the braces per the precedence rules in C. So these could be: if (offset + len < ddev_start) and if (offset + len > ddev_end)