From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 451D7C4167B for ; Tue, 28 Nov 2023 14:21:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346172AbjK1OVZ (ORCPT ); Tue, 28 Nov 2023 09:21:25 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52304 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346072AbjK1OVX (ORCPT ); Tue, 28 Nov 2023 09:21:23 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E55A81B5 for ; Tue, 28 Nov 2023 06:21:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1701181289; 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=6PBOG7uTuPrKERcez1Y3MMxHTda3oU4ZYJf1T2X8ASo=; b=XvuxHCy+TcgAe4LyHA8vGqbjNSBR625pXASXwgmTRVT448Kzdi68S21bz6+KaZ2UYRFjOZ PxrJrY5qB+uskGYfkz2ZoTEhmxm5Gy+R/Q5+OXC4x5GvWlcW0/7WS6bQEXk2wSFYkYCRpq s/m0O/AxQbOj3TKYiwJ/txjUSH783MQ= Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-249-u32DRhyoNDeiqwLc2n0fEg-1; Tue, 28 Nov 2023 09:21:27 -0500 X-MC-Unique: u32DRhyoNDeiqwLc2n0fEg-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id C48511C060D1; Tue, 28 Nov 2023 14:21:26 +0000 (UTC) Received: from dhcp-27-174.brq.redhat.com (unknown [10.45.224.14]) by smtp.corp.redhat.com (Postfix) with SMTP id E36FD5028; Tue, 28 Nov 2023 14:21:23 +0000 (UTC) Received: by dhcp-27-174.brq.redhat.com (nbSMTP-1.00) for uid 1000 oleg@redhat.com; Tue, 28 Nov 2023 15:20:21 +0100 (CET) Date: Tue, 28 Nov 2023 15:20:18 +0100 From: Oleg Nesterov To: NeilBrown , Al Viro Cc: Christian Brauner , Jens Axboe , Chuck Lever , Jeff Layton , Ingo Molnar , Peter Zijlstra , Juri Lelli , Vincent Guittot , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-nfs@vger.kernel.org Subject: Re: [PATCH/RFC] core/nfsd: allow kernel threads to use task_work. Message-ID: <20231128142018.GA24108@redhat.com> References: <170112272125.7109.6245462722883333440@noble.neil.brown.name> <20231128140156.GC22743@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231128140156.GC22743@redhat.com> User-Agent: Mutt/1.5.24 (2015-08-30) X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.5 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 11/28, Oleg Nesterov wrote: > > On a related note... Neil, Al, et al, can you look at > > [PATCH 1/3] fput: don't abuse task_work_add() when possible > https://lore.kernel.org/all/20150908171446.GA14589@redhat.com/ Cough... Now that I look at this 8 years old patch again I think it is wrong, fput() can race with task_work_cancel() so it is not safe to dereference the first pending work in theory :/ Oleg.