From: Jan Kara Subject: Re: [PATCH v2] xfstests, generic: add project quota attribute tests Date: Tue, 12 Jul 2016 12:59:08 +0200 Message-ID: <20160712105908.GE16460@quack2.suse.cz> References: <1467786171-21127-1-git-send-email-wangshilong1991@gmail.com> <20160706233533.GK27480@dastard> <20160708005127.GK12670@dastard> <20160708024654.GE19871@thunk.org> <77863b4a-95e6-4100-79c2-5cbcaf0872e7@sandeen.net> <20160708050228.GH19871@thunk.org> <20160711161556.GB9334@quack2.suse.cz> <20160711171242.GA21285@thunk.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Jan Kara , Eric Sandeen , Dave Chinner , Wang Shilong , fstests@vger.kernel.org, linux-ext4@vger.kernel.org, sihara@ddn.com, lixi@ddn.com, Wang Shilong To: Theodore Ts'o Return-path: Received: from mx2.suse.de ([195.135.220.15]:60566 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750816AbcGLK7M (ORCPT ); Tue, 12 Jul 2016 06:59:12 -0400 Content-Disposition: inline In-Reply-To: <20160711171242.GA21285@thunk.org> Sender: linux-ext4-owner@vger.kernel.org List-ID: On Mon 11-07-16 13:12:42, Ted Tso wrote: > On Mon, Jul 11, 2016 at 06:15:56PM +0200, Jan Kara wrote: > > > > What would you like to achieve with this? There is 'QF_META' format which > > is different from 'QF_XFS' format basically only in the set of quotactls > > used. As I said above it might be nice to separate kernel-api from the > > underlying-quota-format but in reality these two were bound together in > > older kernels so they are not really independent. > > The main reason why I noticed is with the new (err, "latest") ext4 > quota (enabled via mke2fs -t ext4 -O quota) implementation, we enable > quota tracking at mount time. (This may be true with journalled quota > as well, actually). But we don't actually enable quota *enforcement* > until quotaon is given. Yes. > The problem is that quotaon -p prints the status of whether or not > quota *tracking* is enabled, and with the new ext4 quota, quota > tracking is *always* enabled. So quota -p doesn't report anything > useful for new ext4 quota systems, and when I started to look at how > to change things, that's when I noticed that we weren't using the new > quotactl commands with ext4 even though they worked, and that the new > quotactl implementation had more functionality than the older ones. OK. But with XFS you'd notice that quotaon -p also returns 'on' whenever the accounting is turned on. So ext4 and xfs behave in the same way. Arguably it would be more useful if quotaon -p reported 'off', 'accounting', 'enforcement'. Maybe I'll do that. > BTW, I've seriously been thinking about changing the default so that > if you use mke2fs -O quota, quota enforcement is also enabled by > default at mount time, and we use a mount option to disable quota > enforcement. If we then added a way of selectively enabling and > disabling quota enforcement via quota-tools, then we would be bringing > behaivour of how ext4 quota works to like how xfs treats quota. The > question I have is how to do this in a way that isn't surprising for > people who are used to the old behaviour --- but mke2fs -O quota is > still relatively new, so maybe we could get away with it without > having to add more superblock flags. So currently if you use quotaon(8) it will turn on/off only enforcement in ext4 (accounting is always on when the feature is enabled) - don't get confused with 'quotaon -p' output - that tests something different. Speaking of automatic enabling of quota enforcement: I wanted to keep the old behavior where no enforcement happens until you run quotaon(8) which is how things traditionally worked for ext2/3/4. That's why things default to having enforcement off. If we want to make things more consistent with XFS, one option I can see is that when e.g. 'usrquota' mount option is set, then user quota enforcement will be turned on. That is essentially how XFS works (including the mount option name). What do you think? Honza -- Jan Kara SUSE Labs, CR