Received: by 2002:ab2:6c55:0:b0:1fd:c486:4f03 with SMTP id v21csp183594lqp; Tue, 11 Jun 2024 20:14:17 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVEpwMRqjbgAw/d06DP/fnOr2VbjCNIDw5Gr3v+5ZF/RyqBFJKRD0F4D5r/7DjWznZgn4p21d7PYAjyqxO2JsHSbytDZyD8IqBmFl8kxA== X-Google-Smtp-Source: AGHT+IElp9PHbrmFqwsMpXo4W0EEHuwTSGqfqeve710iISbRwSIIp3L26sNvutzdzXJ03o09XM8R X-Received: by 2002:ac8:5d4f:0:b0:441:788:908 with SMTP id d75a77b69052e-4415ac7223cmr5165211cf.66.1718162057021; Tue, 11 Jun 2024 20:14:17 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1718162057; cv=pass; d=google.com; s=arc-20160816; b=tRJtwgE8b3cI5Mp8nab14AMLwlIzS5eImEfDfS7KOyPp2fRj1qcpDpII8ae08coq7s wpx5e2XLz7jAbMW6EIE+t0oTQzPua1KvOSCexXeZtyCPaRzF+r5ptQZ6eZc+E4Gqrc+y wMpoihcHrpt4rM2FPg8H6S/Ctcdpu1ztrUHe3+XNm709M7ep7vuIKGNFHtLy+d0Lb6Vf hK+GzPPvUKL3UpMyxOm1/QBM4nlYn0Ojk7oaQEYva+HmEeChUmw+jiuF425wT6ofB3ao NaosvYciIqjqWU7Tv/SQKvHAJHaGV9HQs0Z8wHlxlbHSgWfLdz1JVpDI7XGS2+D0c8Qe d/dw== 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=FIjGGRABJCKKFF6YXfYjcpA9fG0vbhL8bpLfh5T2c90=; fh=SMkzHToxY+iVYWj2TtFGhZzFiLR3lXI9dQGa1bwCqg0=; b=KVo9TFKZijqt2y8GgpgEsRwrG0c2b7xLNT6o1mwdZPPLKVGtd1mSDhXFF2LOKUvyy6 D/ttIByNblyf7FfUuoSzoAlsEYRFUVmdZm09sqxqnm1tsmD4BcYiT99Iaq0Dtt4/IW3K nmKeRoI3BhEWdoZ3UT/0UVGY3nM+Wg7BV5mts5p3voqwsfdz6HWL2AjUxOJjP7A/A3uH I57NmGnxMXOjXy2NcKwU8y78a8j76oema/djsVVpAPWkif5xsLionrkLQg9+ofJSellm RHrCQrORXSL/Ly5k3qRsJq/Kw58HaxTrS5Ja/Vaj1WyUF8c9mg+wagN6KZ16BlVzW4fp ibTQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linux.org.uk header.s=zeniv-20220401 header.b=X4IPrzcW; 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-3673-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-nfs+bounces-3673-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 ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id d75a77b69052e-44038b7998asi149954241cf.691.2024.06.11.20.14.16 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 Jun 2024 20:14:17 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-nfs+bounces-3673-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.org.uk header.s=zeniv-20220401 header.b=X4IPrzcW; 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-3673-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-nfs+bounces-3673-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id A7C4D1C21312 for ; Wed, 12 Jun 2024 03:14:16 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A909F168A8; Wed, 12 Jun 2024 03:14:13 +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="X4IPrzcW" 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 74C68320D; Wed, 12 Jun 2024 03:14:11 +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=1718162053; cv=none; b=ctQyKcxMKVl/jY8+PlmyMq9Nkd5smBvr/ZawAlwTDdVlu9tq2AXxnVHMd9fmG2y88SRNVPq6SnjwJlx2hlcipr3eZ7xAfIJQlQCaP7HPZRUHSoyMvVw39JATGwmjrOH4wXJ3UkDnD1HJmrDr0SoZN/9m65pusO65CilXOiFYAww= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718162053; c=relaxed/simple; bh=9NodQQT4LqtoSA5lSFjpkb5Utm0D00B3WBolnHe8GMY=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=lRHaTc7q+/IW8MsiMsK0XP1J0LaJOIKvOSTw2+vgdonkMJB0Jh8POQGPKu4CwapZO2MLkHrqod/Zku/l6xAV+ZPkoX2x2TFxv6hCSfnITO8pOGiqqeZJ10t6NsgHper2+e4rrjO6UgTKYy9+HJaputQkTP/eNbLPjqSb0utX4SA= 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=X4IPrzcW; 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=FIjGGRABJCKKFF6YXfYjcpA9fG0vbhL8bpLfh5T2c90=; b=X4IPrzcWTALi93DkoznpTOtARS je5oPERYb9xGG9pTKd/dsMWBTNe2+JZ2gw4ZLFbIx1fGxzcTItnJ3tyLc3JUGIzvjGZSZlw1dLQMt 1dDHbBbLiSFCk664b2MFZRnjz6P3OI/k5VIJqkz6t63mZKXZDXHWNiQqt3Zd6ucIplqJERbTjCSF8 Kx0SEwVhAFWsHi1km9OEsrHDPTGT5Kc8n8WPH4dgY7JfAoW29QGavz74h3Ip0zEDMt33l0+v4KS8Y b60QRZ1B7j/npy/BhcxWRhUJMTK3OZ1k/uyg5H7wWhb7AqhjWZUCYuDcCc5qrU0ShX8EFnoUNxfGe oSY5IZoQ==; Received: from viro by zeniv.linux.org.uk with local (Exim 4.96 #2 (Red Hat Linux)) id 1sHER2-00Eioe-0n; Wed, 12 Jun 2024 03:14:04 +0000 Date: Wed, 12 Jun 2024 04:14:04 +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: <20240612031404.GH1629371@ZenIV> References: <171815791109.14261.10223988071271993465@noble.neil.brown.name> <20240612023748.GG1629371@ZenIV> <171816094008.14261.10304380583720747013@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: <171816094008.14261.10304380583720747013@noble.neil.brown.name> Sender: Al Viro On Wed, Jun 12, 2024 at 12:55:40PM +1000, NeilBrown wrote: > > 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()... > > > > Should we have fsnotify_open() set a new ->f_mode flag, and > fsnotify_close() abort if it isn't set (and clear it if it is)? > Then we would be guaranteed a balance - which does seem like a good > idea. Umm... In that case, I would rather have FMODE_NONOTIFY set just before the fput() in path_openat() - no need to grab another flag from ->f_mode (not a lot of unused ones there) and no need to add any overhead on the fast path.