Received: by 2002:a89:48b:0:b0:1f5:f2ab:c469 with SMTP id a11csp836758lqd; Wed, 24 Apr 2024 20:14:53 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCULOeYfZ0R4aBNsDDdg8lYdx/03ACisTAyyFQCCW3e18zyNJoJkHVlPEdVb8WA84Yn4QiThPIoYAExRr1uv75btV2fo4MIACuUf8AUqdg== X-Google-Smtp-Source: AGHT+IEnc16i9FNZ69SiAErtrYzX4BNP5Fq1IbcfkS/Z+RxiBevCfTVuTYqIfDHmdB1vWdflqJ/I X-Received: by 2002:a05:6a20:d428:b0:1aa:2917:4b79 with SMTP id il40-20020a056a20d42800b001aa29174b79mr4286405pzb.15.1714014893162; Wed, 24 Apr 2024 20:14:53 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714014893; cv=pass; d=google.com; s=arc-20160816; b=W0qXPLM8NuLhebWNXbVEiT8aWH1UkMmBxordMVCE45FGyqkFrW2qR02Ak3eZHezLsa /wj3+n8JVPSs7dQUg6e7n2BSgl2ST9MQpxaq1H1XY9ekr8y2KFsbthR7zLSHkxIa5ntC C6ykYqiPDAqQ2BDMI0GEA5ZtJ0bmescdD8tiwSV8wlAp4t21VE0+ZwFXOjcTL9x0K5Zs qrWhEZ7WNUlMGCGwH5uG9JyD0ZNkBQkaU8ieEOpfUGls3bRTYyJzdWTPzXkYZNYJGaEf kp90aA5PCQfV5SmWkuXriOtBaj4o6qWXBFrtXF5EIqKXGZrBhaUg9GE4lRMHLcko1l4X NZFg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:references:cc:to:subject :user-agent:mime-version:list-unsubscribe:list-subscribe:list-id :precedence:date:message-id:dkim-signature; bh=45q2opjjuUYEePVm3ifdMLHGn3JYGUOldjvko9Req9k=; fh=Ni7lnUjRKNmeSOKhKofbhNcLhXg5mhcTrDSUNlZIoY0=; b=S8j91rTtHsFD/Bi/QvW3/+AcH0FDA38swvZFhtJ+rvr1Kt1e2nQXHtnhNuk0WtyXmH xlGmeyTUSRm3z0fVcpNGO684k092U0PVM5sZsJDxpZqPCkRUA2pcaW+qqbduejA7lWpb 87mcHa6hiBJtaDZZzNYNm2SFfzVYKnFYeDEIhY3xnP74DiCRXHvj8DnLZlD7k4wAFyH6 EsVH4cr8ygy91hV4O/kNb1BWDMv3r/PUdQeLTspUy7+P1KoSP7rOfcL+zTmitVmrnNnH +3HXT8SvuoismXlszNWGYjboPiR5Cu2G3BwvmhX5InSzSTlGTdgeAB6Ei/HmhNRKLGIw IREw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@bytedance.com header.s=google header.b="P0skKWW/"; arc=pass (i=1 spf=pass spfdomain=bytedance.com dkim=pass dkdomain=bytedance.com dmarc=pass fromdomain=bytedance.com); spf=pass (google.com: domain of linux-kernel+bounces-157957-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-157957-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=bytedance.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id p7-20020a170902b08700b001e78de621a4si12030269plr.384.2024.04.24.20.14.52 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Apr 2024 20:14:53 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-157957-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@bytedance.com header.s=google header.b="P0skKWW/"; arc=pass (i=1 spf=pass spfdomain=bytedance.com dkim=pass dkdomain=bytedance.com dmarc=pass fromdomain=bytedance.com); spf=pass (google.com: domain of linux-kernel+bounces-157957-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-157957-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=bytedance.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id EFD9EB25835 for ; Thu, 25 Apr 2024 03:13:48 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 52CB11B5A4; Thu, 25 Apr 2024 03:13:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bytedance.com header.i=@bytedance.com header.b="P0skKWW/" Received: from mail-pj1-f54.google.com (mail-pj1-f54.google.com [209.85.216.54]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0FA9D10A3D for ; Thu, 25 Apr 2024 03:13:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.54 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714014820; cv=none; b=L1LzmjBnD5pGAhNILGkTCCTFdnTeEqfw9qrL92ojyNr6OPFQZ51t83rM+dLGf2F8XQJ+3bvLdV1UPt35eomL+l8CeUKW5BS8ZRsB8TxSkT2I0EikxO8aSDEWQVpG5MNMmkIdSrwFjeA3HKIh2SBIMFxE/MhAv2nlWTUQ387EWBw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714014820; c=relaxed/simple; bh=F/1VMu7Ncu+E5GMEYHg5FIcaKmH6+lOLwTRFwG32kF8=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=XTF92F+/9B0mBfAYdlTCCRPt7l2ZBYV2qdMAGH4KfGM7AqlygLgCBgwzanDRC3iIe6a5DI1/1xC8E5Yh48GjgIWWZjLaGAqiVuI/evqNWEwS0iiOtkxkZhBUv22+aMp4dNicvFpBJ1pji7e6L1ibzgQPL+pPcC+O00usMMR89t0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=bytedance.com; spf=pass smtp.mailfrom=bytedance.com; dkim=pass (2048-bit key) header.d=bytedance.com header.i=@bytedance.com header.b=P0skKWW/; arc=none smtp.client-ip=209.85.216.54 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=bytedance.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bytedance.com Received: by mail-pj1-f54.google.com with SMTP id 98e67ed59e1d1-2ad8fb779d2so494230a91.0 for ; Wed, 24 Apr 2024 20:13:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytedance.com; s=google; t=1714014817; x=1714619617; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:from:references:cc:to:subject :user-agent:mime-version:date:message-id:from:to:cc:subject:date :message-id:reply-to; bh=45q2opjjuUYEePVm3ifdMLHGn3JYGUOldjvko9Req9k=; b=P0skKWW/Jai0p9npUPOBKXvqbhGdkkvN7178oAs0Ss0Be0O8QXZbmIm/X/ZNfCWKYa oI8IuO5pewkfNzmCEBUWh/EIpCnfOQE6BP8IPOk8Jw8k0TZe4JkLBByIXm4DKLrY3QUx 2hBvDfzFEQcgQPOsz2faZssNLWKmkH4OrD16ydQeGtD2+h4SE4F7SL4SwfiRcs+lUKzS 79PAzhFaLaKBktuXPN1xqKopr5AkCk9PXXRMfAlCv2eke86+32BK4RTlVoGuVDO7mBbH aANQl6H1nlEGL111WtHTBYrCDaN271Q9ea+W9lCQG0V7tX5oXIb4U3cMIYhNtmad8SKe HTMA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714014817; x=1714619617; h=content-transfer-encoding:in-reply-to:from:references:cc:to:subject :user-agent:mime-version:date:message-id:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=45q2opjjuUYEePVm3ifdMLHGn3JYGUOldjvko9Req9k=; b=X69OfRW3siBrF954SvLG/xVv853q9xpaJhcEu3O/MLHFq1DZvJs21YRuz77fg+nmDY Uh88Z+07Ywz8K9etfcaShDo1/rc3Q3c+B5d/jpOcouDrobtzGVBoerjfMO/Ex227K2Fs k/mdG7AtOiWQKdr1W0uv6ofycV56szFybfOK4InRkUyin0NHmp6TJmi5Th3JnkRKcOso jF0V1zdT/kT1vxYZ7DptqZrneci9JU1qFQ4GMPZbkZj9pCI64lvPJzijwMB7tnQfmnhw gJkMyuKzLOlkqYR3sqW031+GWpUifM9wwpRa1FeaF1Aqf66e4aNu1Em6aTdPQ3UIQKIZ hdQA== X-Forwarded-Encrypted: i=1; AJvYcCUu/97cYcRp/G8ceXMYucMzT32YaaMoG5yTJ8S9uiqCZVFw5jLS9B4w6BOTLAbpfbxJ0I1uV15JI4aLtta/P55IPa4jlXqHMoQKuCov X-Gm-Message-State: AOJu0YzQho5o7H1EZL6fjTgd6KdnRiPXUxDmwHi8lZ73GK7Bmn0Qcya5 iOnaVK1NXjap+c0XgNZAkt6xnTo7vLNLwctwmYd9OFFSS89m2t1A7JzBmTwIRkQ= X-Received: by 2002:a17:90a:6b47:b0:2ad:6294:7112 with SMTP id x7-20020a17090a6b4700b002ad62947112mr4177222pjl.14.1714014817331; Wed, 24 Apr 2024 20:13:37 -0700 (PDT) Received: from [10.3.132.118] ([61.213.176.5]) by smtp.gmail.com with ESMTPSA id gk1-20020a17090b118100b002a5290ad3d4sm11981013pjb.3.2024.04.24.20.13.33 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 24 Apr 2024 20:13:36 -0700 (PDT) Message-ID: <6c04aab1-44d7-464c-8080-b06d5c0f16ee@bytedance.com> Date: Thu, 25 Apr 2024 11:13:30 +0800 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 01/12] cachefiles: remove request from xarry during flush requests To: libaokun@huaweicloud.com, netfs@lists.linux.dev Cc: dhowells@redhat.com, jlayton@kernel.org, jefflexu@linux.alibaba.com, linux-erofs@lists.ozlabs.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, Baokun Li , zhujia.zj@bytedance.com References: <20240424033916.2748488-1-libaokun@huaweicloud.com> <20240424033916.2748488-2-libaokun@huaweicloud.com> From: Jia Zhu In-Reply-To: <20240424033916.2748488-2-libaokun@huaweicloud.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit 在 2024/4/24 11:39, libaokun@huaweicloud.com 写道: > From: Baokun Li > > This prevents concurrency from causing access to a freed req. > > Signed-off-by: Baokun Li Reviewed-by: Jia Zhu > --- > fs/cachefiles/daemon.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/fs/cachefiles/daemon.c b/fs/cachefiles/daemon.c > index 6465e2574230..ccb7b707ea4b 100644 > --- a/fs/cachefiles/daemon.c > +++ b/fs/cachefiles/daemon.c > @@ -159,6 +159,7 @@ static void cachefiles_flush_reqs(struct cachefiles_cache *cache) > xa_for_each(xa, index, req) { > req->error = -EIO; > complete(&req->done); > + __xa_erase(xa, index); > } > xa_unlock(xa); >