Received: by 2002:a05:7412:b10a:b0:f3:1519:9f41 with SMTP id az10csp2581290rdb; Mon, 4 Dec 2023 01:18:42 -0800 (PST) X-Google-Smtp-Source: AGHT+IGhekjXRg/jiOOdDzQkXd4NkrBT8OZRIiRJE18AkymE23GeEYbQJouXN2DsG17tLiZvf7BJ X-Received: by 2002:a17:902:f684:b0:1d0:7d9a:3bca with SMTP id l4-20020a170902f68400b001d07d9a3bcamr3814285plg.52.1701681521803; Mon, 04 Dec 2023 01:18:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701681521; cv=none; d=google.com; s=arc-20160816; b=yMzDyvuJej0LDKsrByOLxRmuWM5p3kNHPzJH74lpRzYcFUW+yCQqxQQBdryJWzXexr KOaap4pQzDyI0U6aGe1KV3TTNW18nOvPZOa3+sLQVnD/11mC4IrCaggOOdF4K4SK63Sh qfSo2lIAJ8DXk4ZjAd1ubCt9xft+IqY+Q7RaxeFqxSM5XXeqcL+OFFkfhdJgWC34ewuC 3v51PDhUpDfcpOvm4Djl9lQBAQyiKmJXb0zvw97/bqIy1pYYOdXBtGMtQks7TBffrBVx G6h+RkkU4yYAv4sY8QbjkY3jR+QR8QeXsNQrX7sGt6JRKdZX18mDJly9wvy1Sm3rsQlg SQvA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=qXAi5NI2MrW3Fatk16RutSorqhrUvDxDYgQUDzoTfbM=; fh=HEuhBvX0SyslCi15CKnBfQCP5oV3budEBNXBuGUcWk4=; b=vnWfxYmS4QhmSQ+7q4x3437xF3a8sO0MrJkvAXuKtxfLVEpg+Bq0Y3Wyl+vQyZtWKW SN7ACXzkkAjO1n1/gBAkAyyjqCgcylsx/07aooaGvPZhJrIB4MTVZriV93zwQjC84n0v s3FBE3AYrYoEV3klCQiPVP23o77EdNdmxfYq1SoImOpR1J+aJTZLog4rCslJTz7q9rxS NFmh20AVIw2dKkSUBROVJ/DVHEnwWXdfDqz/CGuL97jJBC7hfX2J64fXsEDB9N6YFRVy qmslIPBQpnsPBoW8ko3c/3ZosBUyLjPhdeT2v+Zulo9NhHK5pO6lEjf9O5bfXC+velyF 5YxA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@szeredi.hu header.s=google header.b=pBTtMaNk; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=szeredi.hu Return-Path: Received: from pete.vger.email (pete.vger.email. [23.128.96.36]) by mx.google.com with ESMTPS id b23-20020a170902d89700b001d0b7902fbasi258425plz.189.2023.12.04.01.18.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 Dec 2023 01:18:41 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) client-ip=23.128.96.36; Authentication-Results: mx.google.com; dkim=pass header.i=@szeredi.hu header.s=google header.b=pBTtMaNk; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=szeredi.hu Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by pete.vger.email (Postfix) with ESMTP id 48A708041ECF; Mon, 4 Dec 2023 01:18:39 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232558AbjLDJSY (ORCPT + 99 others); Mon, 4 Dec 2023 04:18:24 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54502 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229526AbjLDJSW (ORCPT ); Mon, 4 Dec 2023 04:18:22 -0500 Received: from mail-ej1-x635.google.com (mail-ej1-x635.google.com [IPv6:2a00:1450:4864:20::635]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4C2CDD6 for ; Mon, 4 Dec 2023 01:18:26 -0800 (PST) Received: by mail-ej1-x635.google.com with SMTP id a640c23a62f3a-a196f84d217so407780366b.3 for ; Mon, 04 Dec 2023 01:18:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=szeredi.hu; s=google; t=1701681505; x=1702286305; darn=vger.kernel.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=qXAi5NI2MrW3Fatk16RutSorqhrUvDxDYgQUDzoTfbM=; b=pBTtMaNkFYJXWT8MvFNiQDVfo4JW05flMrS9IbSYHs1e8RO083Nqts+x0qd6aa/vbQ otyzFHXgxj00BydGqE611hGKDiArr/+gC6CVEWD1RHjwZUYFzADhrvK92+VEVIl8GTNS UF3mLqEBSUxFqJ/UN6WX0FPnVXFvzIGMvIx1U= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701681505; x=1702286305; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=qXAi5NI2MrW3Fatk16RutSorqhrUvDxDYgQUDzoTfbM=; b=NpXaflivGBpiOtvfbZc1B8tTunhYvBJGyzYTtfip8Nn1eL1t/khBVvc78drqc4COlT 7GbPrJd9nqbq2bHF0rpmPSUF31RBnDjpkyXWoxtYqgMMHPx00iivfUZFy7LwpeflLmHp nVOpvaMk1kootGfDHr6Yk8ZXP2qUaiYaFRvxKKyo7pcn0uQGVSd+Adx7rik7yK1g2T2R 7PdRfcDWjLjT4iQwuC6p88Wr8EUnmOHF2ccXApx8pCE7RvMqRhm0gUhsge42GrDo9Eo4 38yLxVfBZBueDKllOMel6F2r9icZKGt5Ym7D67G9pWSQf7w5orsUJHWfLB9BJh+Z778p yltA== X-Gm-Message-State: AOJu0YwuCnfMSRY+YK0FXHAeNTF2PPW3/kwK3XDyV+Tbiue7T4ggRKh7 5PIZXCUBvzerdUD/pUR7U0B+u7tpnrtLHptfiwV+mg== X-Received: by 2002:a17:907:1719:b0:a18:a4f6:39e6 with SMTP id le25-20020a170907171900b00a18a4f639e6mr2909772ejc.72.1701681504683; Mon, 04 Dec 2023 01:18:24 -0800 (PST) MIME-Version: 1.0 References: <20231116075726.28634-1-hbh25y@gmail.com> <27ad4e0d-ba00-449b-84b9-90f3ba7e4232@gmail.com> In-Reply-To: From: Miklos Szeredi Date: Mon, 4 Dec 2023 10:18:11 +0100 Message-ID: Subject: Re: [PATCH] fs: fuse: dax: set fc->dax to NULL in fuse_dax_conn_free() To: Vivek Goyal Cc: Hangyu Hua , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, jefflexu@linux.alibaba.com Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on pete.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (pete.vger.email [0.0.0.0]); Mon, 04 Dec 2023 01:18:39 -0800 (PST) On Fri, 1 Dec 2023 at 20:08, Vivek Goyal wrote: > > On Fri, Dec 01, 2023 at 10:42:53AM +0800, Hangyu Hua wrote: > > I think setting fc->dax to NULL keeps the memory allocation and release > > functions together in fuse_fill_super_common more readable. What do you > > think? > > I agree with this. fuse_fill_super_common() calls fuse_dax_conn_alloc() > which in-turn initializes fc->dax. If fuse_fill_super_common() fails > later after calling fuse_dax_conn_alloc(), then cleanup of fc->dax > and other associated stuff in same function makes sense. > > As a code reader I would like to know how fc->dax is being freed in > case of error and its right there in the error path (err_free_dax:). > > I think I set the fc->dax upon initialization. Upon failure I freed > the data structures but did not set fc->dax back to NULL. > > To me, this patch looks reasonable. > > Acked-by: Vivek Goyal Applied, thanks. The patch is clearly correct, so I have not major issue with it. It just bothers me a little that we have two cleanup instances when we only need one, but I bow to the opinion of the majority. Thanks, Miklos