Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp6767868ybl; Wed, 15 Jan 2020 09:53:44 -0800 (PST) X-Google-Smtp-Source: APXvYqwC0x4lzwD5RkVtI6q/KPRhJ39GQ3QIJDVa1NEGYSoOfGvmh2LNdnnF+ABimjTGwvL2lUWO X-Received: by 2002:a05:6830:147:: with SMTP id j7mr3624977otp.44.1579110824196; Wed, 15 Jan 2020 09:53:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579110824; cv=none; d=google.com; s=arc-20160816; b=KBeWmAxLmyDl023wRFfmBa+WzUAYyfQp1Sp5EfAhzBsBeHWDQ7uCuJob6FHY/QUh3J 3VvJccEdQyvT7KA4LRrdQDn+SOtLGLwdstCxPd8hCUJR2ZI8BA8Gn2LvUpYLwmgB58q0 1biSRdMrQfMXzHylXxX9uMI3HclUvUIHP7+DRI64tfAEnXLO37E+azZns9ogFPy5Xp5p IlZLLxO76PlZ0TYGzJ0UmysF7eEwGriqAs6jT/ZBL0UKi2PdredHYlpnJC9UwCHC3dTL pKjp9gaGK6mVocRWdDl9un1cRvJXmaYj45nUYi51nuv08fSC2MMyPMgnqmmOJEPPfyOj IRxg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=Tm4tfFquk+Y5uX05AEP/vVVR0hs3jKaCLnHYTrqjEW8=; b=y0Ew2Os8ogQdh6cX7TX7SCvpYDmbCDVqCV5joLeFK8+Smgq8S3m9T2aN8yY9SkjWHU ymad+OLq32AlEKpWglXCVmMWM0vxnMuPs/lt2MQxeh6o2+Z2KHT7RFgCDorJo49cACeO LNDkt6ruR/GiPgkd3qNJBTYIsd2N7ceYlJsHG+iAiToyXUSrYGYAuEj+1GKx8/0IZrMj xCcBG7et1QRWSeVibrm7hSkwKvgd8Qk1VEWm7ESqTfZ6/gRQkbMpekihOnPJXX225sju I7K+sdpnqSBGfsUi93t/4Ss8whyv9XhD1/pvC+/HOpSLCdAmQ+F11yivIszzVjzot41F DP+w== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l189si10146918oih.166.2020.01.15.09.53.28; Wed, 15 Jan 2020 09:53:44 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729072AbgAORxR (ORCPT + 99 others); Wed, 15 Jan 2020 12:53:17 -0500 Received: from mga14.intel.com ([192.55.52.115]:43844 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726418AbgAORxQ (ORCPT ); Wed, 15 Jan 2020 12:53:16 -0500 X-Amp-Result: UNSCANNABLE X-Amp-File-Uploaded: False Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 15 Jan 2020 09:53:16 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.70,323,1574150400"; d="scan'208";a="256860679" Received: from iweiny-desk2.sc.intel.com ([10.3.52.157]) by fmsmga002.fm.intel.com with ESMTP; 15 Jan 2020 09:53:16 -0800 Date: Wed, 15 Jan 2020 09:53:15 -0800 From: Ira Weiny To: David Laight Cc: "linux-kernel@vger.kernel.org" , Alexander Viro , "Darrick J. Wong" , Dan Williams , Dave Chinner , Christoph Hellwig , "Theodore Y. Ts'o" , Jan Kara , "linux-ext4@vger.kernel.org" , "linux-xfs@vger.kernel.org" , "linux-fsdevel@vger.kernel.org" Subject: Re: [RFC PATCH V2 09/12] fs: Prevent mode change if file is mmap'ed Message-ID: <20200115175315.GC23311@iweiny-DESK2.sc.intel.com> References: <20200110192942.25021-1-ira.weiny@intel.com> <20200110192942.25021-10-ira.weiny@intel.com> <06258747f6824a35adfaa999ab4c2261@AcuMS.aculab.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <06258747f6824a35adfaa999ab4c2261@AcuMS.aculab.com> User-Agent: Mutt/1.11.1 (2018-12-01) Sender: linux-ext4-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org On Wed, Jan 15, 2020 at 10:21:45AM +0000, David Laight wrote: > From ira.weiny@intel.com > > Sent: 10 January 2020 19:30 > > > > Page faults need to ensure the inode mode is correct and consistent with > > the vmf information at the time of the fault. There is no easy way to > > ensure the vmf information is correct if a mode change is in progress. > > Furthermore, there is no good use case to require a mode change while > > the file is mmap'ed. > > > > Track mmap's of the file and fail the mode change if the file is > > mmap'ed. > > This seems wrong to me. > I presume the 'mode changes' are from things like 'chmod -w ...'. No... Sorry... "mode" was a _very_ bad name. In this context "mode" was the "DAX mode" not the file mode. > mmap() should be no different to open(). > Only the permissions set when the file is opened count. > > Next you'll be stopping unlink() when a file is open :-) hehehe :-D no ... sorry that was not the meaning. To be clear what this is preventing is a change from non-DAX to DAX or vice versa while a file is mmap'ed. I'm looking at a better name for this. For this commit message is this more clear? fs: Prevent DAX change if file is mmap'ed Page faults need to ensure the inode DAX configuration is correct and consistent with the vmf information at the time of the fault. There is no easy way to ensure the vmf information is correct if a DAX change is in progress. Furthermore, there is no good use case to require changing DAX configs while the file is mmap'ed. Track mmap's of the file and fail the DAX change if the file is mmap'ed. Sorry for the confusion, Ira > > David > > - > Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK > Registration No: 1397386 (Wales) >