Received: by 2002:a05:7412:419a:b0:f3:1519:9f41 with SMTP id i26csp3879512rdh; Tue, 28 Nov 2023 06:21:38 -0800 (PST) X-Google-Smtp-Source: AGHT+IGkusrUgfcpkCciDUS8szdKqRZrfgSYhM7SQAy7iRFEpPQVV9YQ50zSOc5laqRHPknfLW+q X-Received: by 2002:a05:6808:294:b0:3b5:64cd:6559 with SMTP id z20-20020a056808029400b003b564cd6559mr15667720oic.17.1701181298293; Tue, 28 Nov 2023 06:21:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701181298; cv=none; d=google.com; s=arc-20160816; b=ksSu02OBn9RPGojRKhroU4qIguAU2yWbe94vb2+VmQaYYY+lN7oQE+QOlNOEis7Syy A8na8PQSoG+JxwFgfh9sV5VsDRbu79+eTN3c8165YjidBBAWLMF6odEgEHBHi7QLwIlr Meor8Mz91vlgTkNViC8V9dlAY8l7iW+UxgRvVCzMNf2t4TmrqMb2hg7vyIV9NtCeWRuC RJ76fqrgH5R5/dbSQ5LSP5T0YfI0FwL8a0zdzN0RpFj7zpCxxtU99uYvFGsOLZSYxVCl XnP1Lsewhie1HiO9YtTR3wFw+QO1Nngs8eNY6AuV5wuHNQtHXfl/s/W35A4bzYLzyb2A a72Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=user-agent:in-reply-to:content-disposition:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:references :message-id:subject:cc:to:from:date:dkim-signature; bh=6PBOG7uTuPrKERcez1Y3MMxHTda3oU4ZYJf1T2X8ASo=; fh=OdVpqGWUDKgIcqBVoIEPbRVlH+LIm/AXzYaQmtslALA=; b=ghga/0QGFYVQSed1Tqh71ky/cG5T90IkydbWSl5Xlvp+IJcENTE49QY6CdfeAN7zHf 3YBC5nmKun6p/QhtI7wpJvyTjRiNpuZDnWCJUzx1SlTcSvTIXaKC8jyToX9EaxxUv7rr CXz7OSgdI2r/vKM1TM4R9LVrOBTE9hjGUah1Wc3YKSzMniW3ABhQo1vUrj+sIuYxuBR4 7Mod+Cg+wnv3KbikQYd54h1JLLCbv1y47MdCol4SN2iowCBFTr18duWxD5zZ0qVBmOBU 2rrK2wQD9b+Nu20BfKQe+1vgaeBJ5j+mSASBgDWiBfsa1nwvMGf4Jz4nFTF1wNFrHVlZ ezow== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=M9AKXn6o; spf=pass (google.com: domain of linux-nfs+bounces-129-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-nfs+bounces-129-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id 14-20020a63174e000000b005c5e2455a98si2148267pgx.389.2023.11.28.06.21.38 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Nov 2023 06:21:38 -0800 (PST) Received-SPF: pass (google.com: domain of linux-nfs+bounces-129-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=M9AKXn6o; spf=pass (google.com: domain of linux-nfs+bounces-129-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-nfs+bounces-129-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.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 sv.mirrors.kernel.org (Postfix) with ESMTPS id B998E282B4A for ; Tue, 28 Nov 2023 14:21:37 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 547285ABBD; Tue, 28 Nov 2023 14:21:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="M9AKXn6o" X-Original-To: linux-nfs@vger.kernel.org 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 9EFB210C1 for ; Tue, 28 Nov 2023 06:21:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1701181290; 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=M9AKXn6oN9G6Shwvb5XjvMb7Op/AXru5KurKTbGXILdIgCDTltuha/7WdLLuUZfMPMgPhW j5PMYywUtSuZqHSdhNiRk+5xhPyR3rH9HXdjxgLKaZzLunViWRvhNN1E5wXs+FrxWspkYp y7qNeKBYVaPWDBAewMmeDzWC5DjxSMo= 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> Precedence: bulk X-Mailing-List: linux-nfs@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: 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 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.