Received: by 2002:a05:6a10:6d10:0:0:0:0 with SMTP id gq16csp889458pxb; Fri, 22 Apr 2022 13:31:50 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwrmEN65vHwf/H4MaxJ5b8XD91Oan+dGicapiuQKs+WDTAVkBt6MtuKC0hFaFNFtSt0lK1y X-Received: by 2002:a05:6a00:24c3:b0:50a:8151:9aa6 with SMTP id d3-20020a056a0024c300b0050a81519aa6mr6626003pfv.78.1650659509928; Fri, 22 Apr 2022 13:31:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1650659509; cv=none; d=google.com; s=arc-20160816; b=pBKKlVbnfuyhqkesZYDy1g4HH/N4LpoajGp0D06LD3pW5GrMpJD7kwJClIGdirQL3s X7qEFBz9gJ255WMXskWytL84BjZTIHedI39aQjrYGCKUA0/dXEUytsGkvs86moUNrRhm /nUzWivtvbHEOVAnOx6iJJ6sa7zjGIYEerok0ebyk5aBy03taBYR8ZqAfIn95EZVBE5z Q1a5flmLGmQ8k8ddRtO887Gme0sdWr4stmVht1kzeyxxpyCMSaQIwqy4JbBkGIzPdxKN ZgsOTobnbMNidLILvqfi0smUW9y4/bu8HMi49tmuskW4q1RthFW5MsspLmjoROrAzu/f B1ag== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:content-id:mime-version:subject :cc:to:references:in-reply-to:from:organization:dkim-signature; bh=aPltoNX3v1MHdmgBq0oIkCAldNZyXJBcZt6C3pWO+9Q=; b=QOs46KBiFPbdqUHon6diWRDG24CD/Yuf3PsvrtkQJr02HkIM2g2mJhmph2hwt6Ijva XRmpFwDpQef78xjX2MvIvy5hQT0kC4XPZ6Z7/pRcrJS9zeogrrw1/Nv65GpWmGiGaXND 32P8QRMsWLgwd/3p0jXexugZwnhwfNabs7CCI5hL61uCKnBpSG0bjfmevVLPLErK2z0Z MET4p9ILrza6wanBlZ3R6kRcBc7kz8vLl/u+bL7MMyrXHRFYXs5MKZjlMepG/AHcebO+ Vc9Yg3ExvlF+7B8TOEGCAc9ytAKoLCW7OmQxm7sgsU75Af9wmnFX/0xNmO2KtX3BGZHz CutQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=Ae16fq2D; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id s25-20020a635259000000b003827f1fef8csi10197757pgl.400.2022.04.22.13.31.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Apr 2022 13:31:49 -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=@redhat.com header.s=mimecast20190719 header.b=Ae16fq2D; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id EF00D28C285; Fri, 22 Apr 2022 12:18:42 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1388610AbiDUOFg (ORCPT + 99 others); Thu, 21 Apr 2022 10:05:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38962 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1386439AbiDUOF1 (ORCPT ); Thu, 21 Apr 2022 10:05:27 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 99C053A5D4 for ; Thu, 21 Apr 2022 07:02:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1650549745; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=aPltoNX3v1MHdmgBq0oIkCAldNZyXJBcZt6C3pWO+9Q=; b=Ae16fq2DK+53wxe9VFpG3bbRhVpp297Ke8U9CahCGrGQBisLegYK5WKyXtjaNEJMBStx8v 1wRTmecqhOT+xr6GmpiFJsssp+Bht2VcD3I2AKqoztsIs4vhiUXxstzZZ8SgLs9asy4d13 5kteeiL3izVAtUPujnmEpYDnW2TvCcA= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-318-VGILzSB1Pqmxx7WgsHszIg-1; Thu, 21 Apr 2022 10:02:24 -0400 X-MC-Unique: VGILzSB1Pqmxx7WgsHszIg-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 0503F811E76; Thu, 21 Apr 2022 14:02:22 +0000 (UTC) Received: from warthog.procyon.org.uk (unknown [10.33.36.13]) by smtp.corp.redhat.com (Postfix) with ESMTP id 8B44340CFD22; Thu, 21 Apr 2022 14:02:19 +0000 (UTC) Organization: Red Hat UK Ltd. Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod Street, Windsor, Berkshire, SI4 1TE, United Kingdom. Registered in England and Wales under Company Registration No. 3798903 From: David Howells In-Reply-To: <20220415123614.54024-4-jefflexu@linux.alibaba.com> References: <20220415123614.54024-4-jefflexu@linux.alibaba.com> <20220415123614.54024-1-jefflexu@linux.alibaba.com> To: Jeffle Xu Cc: dhowells@redhat.com, linux-cachefs@redhat.com, xiang@kernel.org, chao@kernel.org, linux-erofs@lists.ozlabs.org, torvalds@linux-foundation.org, gregkh@linuxfoundation.org, willy@infradead.org, linux-fsdevel@vger.kernel.org, joseph.qi@linux.alibaba.com, bo.liu@linux.alibaba.com, tao.peng@linux.alibaba.com, gerry@linux.alibaba.com, eguan@linux.alibaba.com, linux-kernel@vger.kernel.org, luodaowen.backend@bytedance.com, tianzichen@kuaishou.com, fannaihao@baidu.com, zhangjiachen.jaycee@bytedance.com Subject: Re: [PATCH v9 03/21] cachefiles: unbind cachefiles gracefully in on-demand mode MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <1444915.1650549738.1@warthog.procyon.org.uk> Date: Thu, 21 Apr 2022 15:02:18 +0100 Message-ID: <1444916.1650549738@warthog.procyon.org.uk> X-Scanned-By: MIMEDefang 2.84 on 10.11.54.1 X-Spam-Status: No, score=-2.5 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE autolearn=unavailable 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 Jeffle Xu wrote: > + struct kref unbind_pincount;/* refcount to do daemon unbind */ Please use refcount_t or atomic_t, especially as this isn't the refcount for the structure. > - cachefiles_daemon_unbind(cache); > - > /* clean up the control file interface */ > cache->cachefilesd = NULL; > file->private_data = NULL; > cachefiles_open = 0; Please call cachefiles_daemon_unbind() before the cleanup. David