Received: by 2002:ab2:6c55:0:b0:1fd:c486:4f03 with SMTP id v21csp242912lqp; Tue, 11 Jun 2024 23:16:58 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWp6RZo+IKuWyyaxrh20kU4L0u0Z/p4e0iAP5aUFo4fx6q0K5tGi40EM/E5V6OGZDqpQSoCxNeTvfux1qlOcTduEh6F93VtIs7psvXtYA== X-Google-Smtp-Source: AGHT+IHlt1OocSMz1rkTqjJWYGQPrxXgc2xpURNLZRgW6xu02qRjuQ/K0+cuYaZGEF/PTU5/m75C X-Received: by 2002:a05:6808:3196:b0:3d2:2577:89b7 with SMTP id 5614622812f47-3d23dfb6cf3mr1127997b6e.5.1718173017726; Tue, 11 Jun 2024 23:16:57 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1718173017; cv=pass; d=google.com; s=arc-20160816; b=UqekORK4u8631c8nzuHPRR37DBJio/4pQZkR5saBoPpesQLDW9dVsqGE8Vqo6L3v6M aj0bTvq9oD/M01P+Wk6h982QP9HPv3zcy3juvZC2qDwQQnZEo5WaBxNmTQIK14ToexuI qje0h3cb6oAV6daZDfcH1CSFeZ3edu2n5UCNOP7KvXzfxJGFNDwcgVUzy0uqoq9k4O5Y n7mV0/dqF1Z34r19e5KH0mRdmhLdBwWOAsy68nM624n8RIeq30OPBJZ1cgymJUC7YENp lJCPSnhEPFf0m9ALyZhfN795NClZvrOoYZO76YP2FLQECBdyh7Yq7IO9t2F8vhXirGLh 0/fw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender: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=TcipHWc8SNr6o/D0UUcsakyzLLgeKSo+R3zQgMvpZ6g=; fh=SMkzHToxY+iVYWj2TtFGhZzFiLR3lXI9dQGa1bwCqg0=; b=ewxZ0PcRGGPh49A/Gm/B0HHh0nFUMx18nrHWt+v1WP4M6z+N26uQ71b6Ht+4h1V1SX ErhKldb8f7V7pO4R7mbsjOPxqoXTlMCUxoY/BQHU6xEGtvCjwQjsC1W+jIQhFZ9Pc+qg BX+tf7kHKEvAJ/GQDG7xsbglj0emnMZdscCaWqIQqPvhzJtEXew4NN8rFf0UvWVro307 r2ogZRiPlLdgJGq7fWBvbpseRx/exqLSj4ECZazyiTKUigyjzPsQXnVBDsYnmGMcYtd+ JkuuhD3FBuGT79GtQ754PtVdOySukNLm9F1260ut9DJQVvlg8zTolW9qspyoS70YzFYp a7gA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linux.org.uk header.s=zeniv-20220401 header.b=aHkoDEj2; arc=pass (i=1 dkim=pass dkdomain=linux.org.uk dmarc=pass fromdomain=zeniv.linux.org.uk); spf=pass (google.com: domain of linux-nfs+bounces-3654-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-nfs+bounces-3654-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=zeniv.linux.org.uk Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id 41be03b00d2f7-6eb106d1482si6276595a12.109.2024.06.11.23.16.57 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 Jun 2024 23:16:57 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-nfs+bounces-3654-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=@linux.org.uk header.s=zeniv-20220401 header.b=aHkoDEj2; arc=pass (i=1 dkim=pass dkdomain=linux.org.uk dmarc=pass fromdomain=zeniv.linux.org.uk); spf=pass (google.com: domain of linux-nfs+bounces-3654-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-nfs+bounces-3654-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=zeniv.linux.org.uk 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 D17DA286EAD for ; Wed, 12 Jun 2024 02:37:58 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 2E7F9B667; Wed, 12 Jun 2024 02:37:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linux.org.uk header.i=@linux.org.uk header.b="aHkoDEj2" X-Original-To: linux-nfs@vger.kernel.org Received: from zeniv.linux.org.uk (zeniv.linux.org.uk [62.89.141.173]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E655BB651; Wed, 12 Jun 2024 02:37:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=62.89.141.173 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718159878; cv=none; b=I+gx4J/aCGLIdfIqRmzH7IqihU8Uw7y2HJuLAACsikuR36NnBI346tyb5YtOWCjIY0bNhjuoupHTKChA2QHmmpIQURFWk7UT4aNG7R22g0ywZx25JzZXLUwCLXnidwXrqKaqd+/4rCtSzZZIWrqnr3jLME6LfIlnyy7+O/b/BFU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718159878; c=relaxed/simple; bh=8TJSDF91JPEtpNQOYKshQofYbHPrOws3DuqRwzONNcc=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=ROwBt1oL2+naOvg8XItj+GAPueL+012M/U+dX+500FS/toQHHvQrT4YuVJePkcL77ts4E8PgJY7Zn4XjjsGXQrahP/+8F2uH81x+80aoZVcYOenjtsmrVveb36RFMc9ZTUoyo6MWOqUszbidbyswufeW1WMI6TFh7tZL6r5Pthk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=zeniv.linux.org.uk; spf=none smtp.mailfrom=ftp.linux.org.uk; dkim=pass (2048-bit key) header.d=linux.org.uk header.i=@linux.org.uk header.b=aHkoDEj2; arc=none smtp.client-ip=62.89.141.173 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=zeniv.linux.org.uk Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=ftp.linux.org.uk DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=linux.org.uk; s=zeniv-20220401; h=Sender:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=TcipHWc8SNr6o/D0UUcsakyzLLgeKSo+R3zQgMvpZ6g=; b=aHkoDEj2pEFv5B+kORwT+xARb1 7ojPndYqAPP0qEKlaiN5OvqLYJFt0mpT3kD8LnvHBlikn/acRUowlNIgUMLp9BP/ivOZyjD86+dr+ ZpCCnNnrhQs5rHEE3kDFCkZXvYS6i6RSAzLXB593+4ApI/LXNZaSLIGV6fKYBkCTbs15y877Kn84b htT8nYHxoXT/0WlW0GvarFCi1Xc1sAtngV6VVi0lCceXt6cAPlz1rHOepnv+rJoNb5NKMcG9JaGjh CZ9vnNHIVzqFN9eIYz6lR/Q6Kbwmux2pRJ1Um+q1VnSFn9iVkv4hrYEUgdJiI9D664wRS/2eV7yYM ZdXs942Q==; Received: from viro by zeniv.linux.org.uk with local (Exim 4.96 #2 (Red Hat Linux)) id 1sHDrw-00Ee2t-1o; Wed, 12 Jun 2024 02:37:48 +0000 Date: Wed, 12 Jun 2024 03:37:48 +0100 From: Al Viro To: NeilBrown Cc: Christian Brauner , Jan Kara , Amir Goldstein , James Clark , ltp@lists.linux.it, linux-nfs@vger.kernel.org, LKML , linux-fsdevel@vger.kernel.org Subject: Re: [PATCH] VFS: generate FS_CREATE before FS_OPEN when ->atomic_open used. Message-ID: <20240612023748.GG1629371@ZenIV> References: <171815791109.14261.10223988071271993465@noble.neil.brown.name> 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: <171815791109.14261.10223988071271993465@noble.neil.brown.name> Sender: Al Viro On Wed, Jun 12, 2024 at 12:05:11PM +1000, NeilBrown wrote: > For finish_open() there are three cases: > - finish_open is used in ->atomic_open handlers. For these we add a > call to fsnotify_open() in do_open() if FMODE_OPENED is set - which > means do_dentry_open() has been called. This happens after fsnotify_create(). Hummm.... There's a bit of behaviour change; in case we fail in may_open(), we used to get fsnotify_open()+fsnotify_close() and with that patch we's get fsnotify_close() alone. IF we don't care about that, we might as well take fsnotify_open() out of vfs_open() and, for do_open()/do_tmpfile()/do_o_path(), into path_openat() itself. I mean, having if (likely(!error)) { if (likely(file->f_mode & FMODE_OPENED)) { fsnotify_open(file); return file; } in there would be a lot easier to follow... It would lose fsnotify_open() in a few more failure exits, but if we don't give a damn about having it paired with fsnotify_close()...