From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=szeredi.hu header.i=@szeredi.hu header.b="CMVTN9EI" Received: from mail-ej1-x633.google.com (mail-ej1-x633.google.com [IPv6:2a00:1450:4864:20::633]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 93644120 for ; Wed, 29 Nov 2023 08:55:49 -0800 (PST) Received: by mail-ej1-x633.google.com with SMTP id a640c23a62f3a-9fa2714e828so950454166b.1 for ; Wed, 29 Nov 2023 08:55:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=szeredi.hu; s=google; t=1701276948; x=1701881748; darn=vger.kernel.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=ptm4JtUTfofmY0LoPy3mJ1nVaZBmoaQzwua0Z7IZy20=; b=CMVTN9EI+Y3yvYtqHDv2+2RJ1+oY1JFQnVrQU+IGEMW5mWxUZqDcQKkbR4sJiJNvyX wausH23GT60+4eTNOm1rA6MZqSr3cw+m6p0uWFqRuZOsjVKLi9VKwOpoqu9DMgotEjLn vNYcktGIo92QYNEIWt5LTaRcFSml9GLBYlwpY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701276948; x=1701881748; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=ptm4JtUTfofmY0LoPy3mJ1nVaZBmoaQzwua0Z7IZy20=; b=etuVHKV3woAG7h1F5gAkiWS10YceTFlAxaT4Uqrv6YdPea6avInz+j1e6cpKu5zUmj Vazab6tRfOczUbwqXkyPL+lD/GJWf2OWP5BY+piimIVDGebdJCwQffWsOn94O/L/9FOX Q8rbLxvyLJ7pKb5HcvX3s0LcRPF3O7R4KnoM5PcqjTYQnDls+qEa1omZgKc0AtLCFqdN cJq/2VxZEM3LoIsFKzlXNydZWLAbNs16rNejiUl5Oi/w8k3COJdUzrzGvt1reu5Fl9PK qNK3SvdrSL6NBsWEnd28GeWWRHdLuZckzIEYL/fRry1gbn/AZAiIcdmumG52LcEMMMm4 Ttzg== X-Gm-Message-State: AOJu0YytDWiSX6dywwJut7JNWrFkIu9sbUsMIx4eDbDcF1zRP0XdIqHH v8dbTYcNS994FR9odMTdOU6bbztj6d19WQx5lQjDYw== X-Google-Smtp-Source: AGHT+IHLaKKNsy7FR6jLP7wXMYn0Z0M6sqcX0kvKToECrrZfhx36Ml0wAWdDu9QFfxJ91lna9WXfmLBjWOdNbcOgr3o= X-Received: by 2002:a17:906:2659:b0:9c6:9342:1459 with SMTP id i25-20020a170906265900b009c693421459mr13839776ejc.20.1701276948017; Wed, 29 Nov 2023 08:55:48 -0800 (PST) Precedence: bulk X-Mailing-List: linux-fsdevel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20231016160902.2316986-1-amir73il@gmail.com> In-Reply-To: From: Miklos Szeredi Date: Wed, 29 Nov 2023 17:55:36 +0100 Message-ID: Subject: Re: [PATCH v14 00/12] FUSE passthrough for file io To: Amir Goldstein Cc: Bernd Schubert , Daniel Rosenberg , Paul Lawrence , Alessio Balsini , Christian Brauner , fuse-devel@lists.sourceforge.net, linux-fsdevel@vger.kernel.org, Dave Chinner Content-Type: text/plain; charset="UTF-8" On Wed, 29 Nov 2023 at 16:52, Amir Goldstein wrote: > direct I/O read()/write() is never a problem. > > The question is whether mmap() on a file opened with FOPEN_DIRECT_IO > when the inode is in passthrough mode, also uses fuse_passthrough_mmap()? I think it should. > or denied, similar to how mmap with ff->open_flags & FOPEN_DIRECT_IO && > vma->vm_flags & VM_MAYSHARE) && !fc->direct_io_relax > is denied? What would be the use case for FOPEN_DIRECT_IO with passthrough mmap? > A bit more challenging, because we will need to track unmounts, or at > least track > "was_cached_mmaped" state per file, but doable. Tracking unmaps via fuse_vma_close() should not be difficult. > > > > > > > Therefore, my proposal is than when filesystem is FUSE_PASSTHROUGH capable, > > > only passthrough file and cached file may be mmaped, but never allow to > > > mmap a FOPEN_DIRECT_IO file. > > > > > > Does that make sense? > > > > I'm not sure I understand how this is supposed to work. Disallowing > > mmap will break applications. > > How is this different from existing -ENODEV in fuse_file_mmap() for > !fc->direct_io_relax? What am I missing? > Is it because VM_MAYSHARE is far less common for applications? Yes, MAP_SHARE is far less common than MAP_PRIVATE. Thanks, Miklos