From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-yw0-f179.google.com ([209.85.161.179]:33200 "EHLO mail-yw0-f179.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750774AbdHLEoF (ORCPT ); Sat, 12 Aug 2017 00:44:05 -0400 Received: by mail-yw0-f179.google.com with SMTP id p68so32539558ywg.0 for ; Fri, 11 Aug 2017 21:44:05 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: References: <150181368442.32119.13336247800141074356.stgit@dwillia2-desk3.amr.corp.intel.com> <20170805095013.GC14930@lst.de> <20170811104429.GA13736@lst.de> From: Dan Williams Date: Fri, 11 Aug 2017 21:44:04 -0700 Message-ID: Subject: Re: [PATCH v2 0/5] fs, xfs: block map immutable files for dax, dma-to-storage, and swap To: Andy Lutomirski Cc: Christoph Hellwig , "Darrick J. Wong" , Jan Kara , "linux-nvdimm@lists.01.org" , Dave Chinner , "linux-kernel@vger.kernel.org" , linux-xfs@vger.kernel.org, Jeff Moyer , Alexander Viro , linux-fsdevel , Ross Zwisler , Linux API Content-Type: text/plain; charset="UTF-8" Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On Fri, Aug 11, 2017 at 8:57 PM, Andy Lutomirski wrote: > On Fri, Aug 11, 2017 at 3:26 PM, Dan Williams wrote: >> On Fri, Aug 11, 2017 at 3:44 AM, Christoph Hellwig wrote: >>> Please explain how this interface allows for any sort of safe userspace >>> DMA. >> >> So this is where I continue to see S_IOMAP_IMMUTABLE being able to >> support applications that MAP_SYNC does not. Dave mentioned userspace >> pNFS4 servers, but there's also Samba and other protocols that want to >> negotiate a direct path to pmem outside the kernel. Xen support has >> thus far not been able to follow in the footsteps of KVM enabling due >> to a dependence on static M2P tables that assume a static >> guest-physical to host-physical relationship [1]. Immutable files >> would allow Xen to follow the same "mmap a file" semantic as KVM. > > One thing that makes me quite nervous about S_IOMAP_IMMUTABLE is the > degree to which things go badly if one program relies on it while > another program clears the flag: you risk corrupting unrelated > filesystem metadata. I think a userspace interface to pin the extent > mapping of a file really wants a way to reliably keep it pinned (or to > reliably zap the userspace application if it gets unpinned). In the current patches, mapping_mapped() pins the immutable state.