Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp516914rwd; Wed, 31 May 2023 01:21:29 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ67QyBfL7sLdQqbZqwTyD5N4UvHJY8S/neNttg5j1btZvQsbNS1nbLCREzoLJlDoVVneLDi X-Received: by 2002:a05:6358:24a3:b0:11c:7287:8add with SMTP id m35-20020a05635824a300b0011c72878addmr170381rwc.20.1685521289092; Wed, 31 May 2023 01:21:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685521289; cv=none; d=google.com; s=arc-20160816; b=bzGbCJ6WOsshT8t5oHC5X6A6Ykw0n6zx58epVCVrZbWXaYHultkmzYqSqFqn+88TeO JofuC8W+TLoMOJrmhTvuuLc2t3mVI3eEWm34B7nSMibekNmsIbs6Zm7m9Baze+9/3U4J a1VrNWarP5BNH63mGAc57OD3VA7ZmDu2Mv0WxmBnd0l6WsVP9KuGYzIDglgj85v6VPaO 5Lkw9PmNn8g62AIiWYIrsm9PLvaOeZqBMF0AQQDfxUa9AvloKJ0Szxyom1ofj0xTsZuo r2b+ZPC6yNhAQrspW7aB62r/6pgRn5nD5t9mYWuyRGusQooO36Pe+RDHXgOVHtsM59R2 aSLw== 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=fpp6vb1ffOq3H9oreXWD/3pedOmUmO10fzG6wyB/G8M=; b=Zasu1NYQ7XWnwvoAGCKhHAEYA5Dbic1CSIN72UwB+Werlc06cQg1Eo1fnJk0uXA5F+ 6mRYeU/NNexolwKHBPAts/PQKHqpBPVbpRFtDuj7L75xMDxqB/0zruXDndZjqBukZwza ey39UbL8JMKA3Jx45ObjwoLZyDVT7WBL25kS8Q9IQv1lvJh0yTBkKGBd8IPmNZXIcswM GWG9gYWeY6/lv3A1kssSyUYem7q/AGfvx/x2nZ/Upl5SBMI+VrA1/rTkkLA/5GCFt/fK zFvmiqTIFOTWOVQwZb5/16sr0wRF45aRKK+5hxDJhVFzohjDT8L8xo7IFy+bFTfVqtry W97g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=HNGpOMbq; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id v3-20020a655c43000000b0053f82f20bb6si542926pgr.667.2023.05.31.01.21.16; Wed, 31 May 2023 01:21:29 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=HNGpOMbq; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235076AbjEaH7B (ORCPT + 99 others); Wed, 31 May 2023 03:59:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59438 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234932AbjEaH6e (ORCPT ); Wed, 31 May 2023 03:58:34 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 11949E6A; Wed, 31 May 2023 00:58:11 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 709A8636A0; Wed, 31 May 2023 07:53:07 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0046AC4339E; Wed, 31 May 2023 07:53:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1685519586; bh=S0GisPmsqjyz7HCMTOJiz8ZWWhleMBu7VOEDA1PRQAQ=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=HNGpOMbqUyPbLn9cRXfHlKeQs9E2d3KUWh3P7F+bE3jatKI89Ph1ubaXGVb1Npi3g 1j/q4Rk6j2pLRdZ2gtoGMyaSD72BnTuQ35sm4PEfw1QNhdgjENObxBQC8ABwYokQ1p 0LTZiUGeuhzIKEgYG3+kV2kfaM/xyfy3tSf5lkiZfltOaLZ0Yf1a9SlZI+pasM9oTw O8+vqBAL9M3AwuT2PLokyn5H/6l5dNYBgalhf97LukxvciFG5dBeGG+uTuFGmZZzQJ zlfXOjRsSXRKunDt46Q7hF3dTt5RlWVThiAhMTnCeyapq2RYrwN/i2IScdxrBbTISQ IRRre9952mazA== Date: Wed, 31 May 2023 09:53:01 +0200 From: Christian Brauner To: Eric Biggers Cc: Benjamin Segall , Alexander Viro , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, stable@vger.kernel.org, Andrew Morton Subject: Re: [PATCH RESEND] epoll: ep_autoremove_wake_function should use list_del_init_careful Message-ID: <20230531-zupacken-laute-22564cd952f7@brauner> References: <20230531015748.GB1648@quark.localdomain> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20230531015748.GB1648@quark.localdomain> X-Spam-Status: No, score=-4.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham 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, May 30, 2023 at 06:57:48PM -0700, Eric Biggers wrote: > On Tue, May 30, 2023 at 11:32:28AM -0700, Benjamin Segall wrote: > > autoremove_wake_function uses list_del_init_careful, so should epoll's > > more aggressive variant. It only doesn't because it was copied from an > > older wait.c rather than the most recent. > > > > Fixes: a16ceb139610 ("epoll: autoremove wakers even more aggressively") > > Signed-off-by: Ben Segall > > Cc: stable@vger.kernel.org > > --- > > fs/eventpoll.c | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > diff --git a/fs/eventpoll.c b/fs/eventpoll.c > > index 52954d4637b5..081df056398a 100644 > > --- a/fs/eventpoll.c > > +++ b/fs/eventpoll.c > > @@ -1756,11 +1756,11 @@ static struct timespec64 *ep_timeout_to_timespec(struct timespec64 *to, long ms) > > static int ep_autoremove_wake_function(struct wait_queue_entry *wq_entry, > > unsigned int mode, int sync, void *key) > > { > > int ret = default_wake_function(wq_entry, mode, sync, key); > > > > - list_del_init(&wq_entry->entry); > > + list_del_init_careful(&wq_entry->entry); > > return ret; > > } > > Can you please provide a more detailed explanation about why > list_del_init_careful() is needed here? Yeah, this needs more explanation... Next time someone looks at this code and there's a *_careful() added they'll want to know why.