Received: by 2002:ab2:6c55:0:b0:1fd:c486:4f03 with SMTP id v21csp267903lqp; Wed, 12 Jun 2024 00:24:17 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCW8iaaScyEiUjgwy+wpiHqVEdu/1GXav8kL4KRgR79cWpgNAMOqOlB62D5eDz6uxGEHbCDRtb9OeOLf1jorQ8zvtfBpn/ITlWnrRz70PA== X-Google-Smtp-Source: AGHT+IFjA5Qb2Ls8DvR8dcV5VKIdp1R5vP6ZE9dyimb+Uo///xMDRQU/QcSdyhe2peR61m3Km7lI X-Received: by 2002:a05:6808:3845:b0:3d2:21a5:d3ba with SMTP id 5614622812f47-3d23e00a4bamr1402061b6e.15.1718177057598; Wed, 12 Jun 2024 00:24:17 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1718177057; cv=pass; d=google.com; s=arc-20160816; b=CUDkcnSR9Xmf33FFXBwhsVyrKmkM85cg7a9c052RY6AvJKNNVAYS4Vh4MMJs0jrFi/ C6W++vohsgPBem9oBOhxG8cKbkuTyIUAOBekSElPNRL14pA3s6fnWNtIrAjCwY0BSPu5 vqGvgVUtDFqWodj3ZQUVom1XvxFstWiJDkI+V5C4jRhdnbnowe3o4ChtkJGPHv0DP4ff OFC4Wc7QF8jw5EMqTTUCNauEY82U3opRAWEDVc9ElxnQNyGkRFJX3K2L0bMmCGoaCbOi 4LZWGOopRdly8eCdJ5E9kCOCGc4KrtQhmbxSrYfqMAAtPSK114KCop4hNO7YXfsJWgKF rRsw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :references:reply-to:message-id:subject:cc:to:from:date; bh=wtyeMbpIlRX1oWvpFtfjS+AXubuFGDTFXfVH5YiyjXA=; fh=8rmOoF0dM7IF18xYpHP/YDhqBPBIhLyJeWONDwpR0KA=; b=mf00178tbhGmG0TrgPbMGb1EIqKiy4JOwaVyY4urYM6nJ2wUbJzwPe6KOhO8axdyHh nz5SW48cZJV0esUOheLoRQYM/Db2Rpj9O0FJYQmzhkP2idjM6IytTrWGFeygGYahyhIg y00FQNvuexPC6/0ILPb1sFz3gg2s1W95KZ4qlaML7S18MnRWApzf/69b1OBHFCgV9c+T q+iYMS2MH3cvDb95EdH1J9fbjhDarr040QODBt0WyugQ4GCejqB1gQANgJGGzGbSrxez dWqlTNXcxXjYvDGB5jh+s5krsOGGbYy/f9V/WhlyL+gGpUx44HXWIUXBP3/eLbzSzrrO 4sTQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=suse.cz); spf=pass (google.com: domain of linux-nfs+bounces-3691-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-nfs+bounces-3691-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id 41be03b00d2f7-6de2073c944si11239696a12.140.2024.06.12.00.24.17 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 12 Jun 2024 00:24:17 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-nfs+bounces-3691-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=suse.cz); spf=pass (google.com: domain of linux-nfs+bounces-3691-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-nfs+bounces-3691-linux.lists.archive=gmail.com@vger.kernel.org" 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 sy.mirrors.kernel.org (Postfix) with ESMTPS id B1F6AB21B86 for ; Wed, 12 Jun 2024 07:13:45 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5565F16C859; Wed, 12 Jun 2024 07:13:02 +0000 (UTC) X-Original-To: linux-nfs@vger.kernel.org Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.223.130]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 94E0F16C84C for ; Wed, 12 Jun 2024 07:13:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=195.135.223.130 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718176382; cv=none; b=CNsrpjrOMCSMWV6wn4gLDILOZIY47mUqk4BAhchyuWKYI26iiTNkVIa02vzENVSfPklyuyp6ChpKV8G5OoxMhcrnympYpA/RN+KPcObhvVzYW/wDp4NFxEwInKux0P+JzdIIJKdVCj+TleLPVEH/4ffS+RKIU0oSgcW8OUuxU2g= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718176382; c=relaxed/simple; bh=oefK0prUp9ZDgjET0rnByZCSaYJI0kchlhsoN1Y3384=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=KDNI3oeo1igdHs4fKHRAXQ9ooIAnhpT88BdKTGiHXGDKgwvxjW0Erm2T22GA7gsPwQQ5k37U86BSmRAyWd8GipCLj/NRqQw7lmCcf4auRiZZb77EPIl05w3Cbh9XKFUFEHkmHChtn9k32o5tjzOYqWJcVgmAnyATpbarJwhf64A= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=suse.cz; spf=pass smtp.mailfrom=suse.cz; arc=none smtp.client-ip=195.135.223.130 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=suse.cz Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.cz Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org [IPv6:2a07:de40:b281:104:10:150:64:97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id C43A433FC7; Wed, 12 Jun 2024 07:12:58 +0000 (UTC) Authentication-Results: smtp-out1.suse.de; none Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id 85308137DF; Wed, 12 Jun 2024 07:12:58 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id U3GPH3pKaWboRQAAD6G6ig (envelope-from ); Wed, 12 Jun 2024 07:12:58 +0000 Date: Wed, 12 Jun 2024 09:12:52 +0200 From: Petr Vorel To: NeilBrown Cc: Amir Goldstein , James Clark , linux-nfs@vger.kernel.org, broonie@kernel.org, Aishwarya.TCV@arm.com, ltp@lists.linux.it, Jan Kara Subject: Re: [LTP] [PATCH] NFS: add atomic_open for NFSv3 to handle O_TRUNC correctly. Message-ID: <20240612071252.GA98398@pevik> Reply-To: Petr Vorel References: <> <171815759406.14261.8092450471234028375@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=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <171815759406.14261.8092450471234028375@noble.neil.brown.name> X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 50.00]; REPLY(-4.00)[] X-Rspamd-Queue-Id: C43A433FC7 X-Rspamd-Server: rspamd2.dmz-prg2.suse.org X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Rspamd-Action: no action X-Spam-Flag: NO X-Spam-Score: -4.00 X-Spam-Level: > On Tue, 11 Jun 2024, Amir Goldstein wrote: > > On Tue, Jun 11, 2024 at 5:30 AM NeilBrown wrote: > > > On Fri, 07 Jun 2024, James Clark wrote: > > > > Hi Neil, > > > > Now that your fix is in linux-next the statvfs01 test is passing again. > > > > However inotify02 is still failing. > > > > This is because the test expects the IN_CREATE and IN_OPEN events to > > > > come in that order after calling creat(), but now they are reversed. To > > > > me it seems like it could be a test issue and the test should handle > > > > them in either order? Or maybe there should be a single inotify event > > > > with both flags set for the atomic open? > > > Interesting.... I don't see how any filesystem that uses ->atomic_open > > > would get these in the "right" order - and I do think IN_CREATE should > > > come before IN_OPEN. > > Correct. > > > Does NFSv4 pass this test? > > Probably not. > > > IN_OPEN is generated (by fsnotify_open()) when finish_open() is called, > > > which must be (and is) called by all atomic_open functions. > > > IN_CREATE is generated (by fsnotify_create()) when open_last_lookups() > > > detects that FMODE_CREATE was set and that happens *after* lookup_open() > > > is called, which calls atomic_open(). > > > For filesystems that don't use atomic_open, the IN_OPEN is generated by > > > the call to do_open() which happens *after* open_last_lookups(), not > > > inside it. > > Correct. > > > So the ltp test must already fail for NFSv4, 9p ceph fuse gfs2 ntfs3 > > > overlayfs smb. > > inotify02 does not run on all_filesystems, only on the main test fs, > > which is not very often one of the above. > > This is how I averted the problem in fanotify16 (which does run on > > all_filesystems): > > commit 9062824a70b8da74aa5b1db08710d0018b48072e > > Author: Amir Goldstein > > Date: Tue Nov 21 12:52:47 2023 +0200 > > fanotify16: Fix test failure on FUSE > > Split SAFE_CREAT() into explicit SAFE_MKNOD() and SAFE_OPEN(), > > because with atomic open (e.g. fuse), SAFE_CREAT() generates FAN_OPEN > > before FAN_CREATE (tested with ntfs-3g), which is inconsistent with > > the order of events expected from other filesystems. > > inotify02 should be fixed similarly. > Alternately - maybe the kernel should be fixed to always get the order > right. > I have a patch. I'll post it separately. @Amir, if later Neil's branch get merged, maybe we should use on fanotify16 creat() on the old kernels (as it was in before your fix 9062824a7 ("fanotify16: Fix test failure on FUSE")), based on kernel check. Kind regards, Petr > Thanks for your confirmation that my understanding is correct! > NeilBrown > > I did not find any other inotify test that watches IN_CREATE. > > I did not find any other fanotify test that watches both FAN_CREATE > > and FAN_OPEN. > > Thanks, > > Amir.