Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp2225801ybv; Fri, 14 Feb 2020 14:06:37 -0800 (PST) X-Google-Smtp-Source: APXvYqyBIMj0pCEeSz/MmyudtYaggKdWGIBEhsVhcQAea4inwCGNQ7MTURtS4z0agoE2J4Lguoxp X-Received: by 2002:a9d:6181:: with SMTP id g1mr4155630otk.104.1581717997224; Fri, 14 Feb 2020 14:06:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581717997; cv=none; d=google.com; s=arc-20160816; b=Uru80bMkGUZiDlXm5gZgrDrkNhGi5xN8pleMmW+mc7F+i1vSEgVxDJ7dXyfflGCg2k PaPH6yCQ4UFu+dV0fe0AC8y3mQ7FtA/6rfpFsSnEE9PGN2vOY69Zm3hnwGtnV1TAKyF1 LxZTJ834zmSPuQks3dr9JImncOe/p04YX+SByFgmw9OOFcBqNVCXPfhE0VEfokqeJLZX WTCIVjnyWIz84X2pZW8u6GWCce0qtXk8UIhUnVTf3R/41hAMNxoRAu0E/cblBy1KeMyh xEmAHuYXhnRtLEJMnasQRkxAH9aACtgxaON86DdV68Dfa/zXN0IXCXKyPOs/602bZNzC TvUQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:message-id :in-reply-to:date:references:subject:cc:to:from:dkim-signature; bh=ED47G1L+n80TagZ7/QhjmhFUqcbeULxGEF5xm1xsbo0=; b=daqfUfnyIKoIit9y5zgik9n5smfP4zKNp/s3Aer63mCGih2h29IC9aR4GyBNpC5RQb 0dbd50AhOO1sB7Vt5+8IPjyMVlsq2KWZeS8p08t3tuwShgstDLdrkuTc+XYoYhqP5OuI G2XRrjfv1JbnlfKh0uoRfEC3To8rZEBI9/d0TMoH8yLXf2Gdd4SUmGJrP4n/o4dJsbti CNi6w34L9Q/eXTLcEK5E9K5bHb5/WRYmf+Y5ooznuD42QmvXsnZ+dOV9lob3WhRomrX8 rDC4Mzqf5flt/DnxZRVGY4v+GIYRY/5OBOAunjLEy4apgW7ZOiBbbOWz2UtLD3gzyvzH TjCg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=eG+BWXD1; spf=pass (google.com: best guess record for domain of linux-ext4-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e77si3599468ote.153.2020.02.14.14.06.23; Fri, 14 Feb 2020 14:06:37 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-ext4-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=eG+BWXD1; spf=pass (google.com: best guess record for domain of linux-ext4-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727573AbgBNWGV (ORCPT + 99 others); Fri, 14 Feb 2020 17:06:21 -0500 Received: from us-smtp-delivery-1.mimecast.com ([207.211.31.120]:53556 "EHLO us-smtp-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727528AbgBNWGV (ORCPT ); Fri, 14 Feb 2020 17:06:21 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1581717980; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=ED47G1L+n80TagZ7/QhjmhFUqcbeULxGEF5xm1xsbo0=; b=eG+BWXD1rTBrMNxX0aXPFhH0Bcr1Zb6Aakw9OWKmgo7QXfaujMrnKLdYCtu5jONF33yvtg eoR3Z/AXqvgTaALhHrGAu501NKf4bCYkjQ0Lagx9g9QT2H5UZaF6m9aFNn+AWok1h1DO4E PAvBDhUkwEJX/vWPFtfQtJjPYecw3rs= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-19-zchCvi3dOTeu5iY-2b37nw-1; Fri, 14 Feb 2020 17:06:16 -0500 X-MC-Unique: zchCvi3dOTeu5iY-2b37nw-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 01CC41B2C981; Fri, 14 Feb 2020 22:06:14 +0000 (UTC) Received: from segfault.boston.devel.redhat.com (segfault.boston.devel.redhat.com [10.19.60.26]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 409971001DC2; Fri, 14 Feb 2020 22:06:12 +0000 (UTC) From: Jeff Moyer To: Ira Weiny Cc: Dan Williams , "Darrick J. Wong" , Linux Kernel Mailing List , Alexander Viro , Dave Chinner , Christoph Hellwig , "Theodore Y. Ts'o" , Jan Kara , linux-ext4 , linux-xfs , linux-fsdevel Subject: Re: [PATCH v3 00/12] Enable per-file/directory DAX operations V3 References: <20200211201718.GF12866@iweiny-DESK2.sc.intel.com> <20200213190156.GA22854@iweiny-DESK2.sc.intel.com> <20200213190513.GB22854@iweiny-DESK2.sc.intel.com> <20200213195839.GG6870@magnolia> <20200213232923.GC22854@iweiny-DESK2.sc.intel.com> <20200214200607.GA18593@iweiny-DESK2.sc.intel.com> <20200214215759.GA20548@iweiny-DESK2.sc.intel.com> X-PGP-KeyID: 1F78E1B4 X-PGP-CertKey: F6FE 280D 8293 F72C 65FD 5A58 1FF8 A7CA 1F78 E1B4 Date: Fri, 14 Feb 2020 17:06:10 -0500 In-Reply-To: <20200214215759.GA20548@iweiny-DESK2.sc.intel.com> (Ira Weiny's message of "Fri, 14 Feb 2020 13:58:00 -0800") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 Sender: linux-ext4-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org Ira Weiny writes: > On Fri, Feb 14, 2020 at 04:23:19PM -0500, Jeff Moyer wrote: >> Ira Weiny writes: >> >> > [disclaimer: the following assumes the underlying 'device' (superblock) >> > supports DAX] >> > >> > ... which results in S_DAX == false when the file is opened without the mount >> > option. The key would be that all directories/files created under a root with >> > XFS_DIFLAG2_DAX == true would inherit their flag and be XFS_DIFLAG2_DAX == true >> > all the way down the tree. Any file not wanting DAX would need to set >> > XFS_DIFLAG2_DAX == false. And setting false could be used on a directory to >> > allow a user or group to not use dax on files in that sub-tree. >> > >> > Then without '-o dax' (XFS_MOUNT_DAX == false) all files when opened set S_DAX >> > equal to XFS_DIFLAG2_DAX value. (Directories, as of V4, never get S_DAX set.) >> > >> > If '-o dax' (XFS_MOUNT_DAX == true) then S_DAX is set on all files. >> >> One more clarifying question. Let's say I set XFS_DIFLAG2_DAX on an >> inode. I then open the file, and perform mmap/load/store/etc. I close >> the file, and I unset XFS_DIFLAG2_DAX. Will the next open treat the >> file as S_DAX or not? My guess is the inode won't be evicted, and so >> S_DAX will remain set. > > The inode will not be evicted, or even it happens to be xfs_io will reload it > to unset the XFS_DIFLAG2_DAX flag. And the S_DAX flag changes _with_ the > XFS_DIFLAG2_DAX change when it can (when the underlying storage supports > S_DAX). OK, so it will be possible to change the effective mode. I'll try to get some testing in on this series, now. Thanks! Jeff