From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.0 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_PASS,USER_AGENT_NEOMUTT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 56010C282C2 for ; Wed, 23 Jan 2019 09:55:39 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 2EC4720861 for ; Wed, 23 Jan 2019 09:55:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727098AbfAWJzi (ORCPT ); Wed, 23 Jan 2019 04:55:38 -0500 Received: from metis.ext.pengutronix.de ([85.220.165.71]:60941 "EHLO metis.ext.pengutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726804AbfAWJzi (ORCPT ); Wed, 23 Jan 2019 04:55:38 -0500 Received: from ptx.hi.pengutronix.de ([2001:67c:670:100:1d::c0]) by metis.ext.pengutronix.de with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1gmFFw-0002kP-4P; Wed, 23 Jan 2019 10:55:36 +0100 Received: from sha by ptx.hi.pengutronix.de with local (Exim 4.89) (envelope-from ) id 1gmFFv-0001M0-O0; Wed, 23 Jan 2019 10:55:35 +0100 Date: Wed, 23 Jan 2019 10:55:35 +0100 From: Sascha Hauer To: Richard Weinberger Cc: Richard Weinberger , Jan Kara , Christoph Hellwig , linux-fsdevel , Dongsheng Yang , linux-mtd@lists.infradead.org, kernel@pengutronix.de Subject: Re: UBIFS quota support Message-ID: <20190123095535.itwduropd2moqs3n@pengutronix.de> References: <20190110114448.vcx6w76ibmxwvlh3@pengutronix.de> <20190123094305.7owpfwzgtzz2snat@pengutronix.de> <3682938.yUD6jHpT9R@blindfold> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3682938.yUD6jHpT9R@blindfold> X-Sent-From: Pengutronix Hildesheim X-URL: http://www.pengutronix.de/ X-IRC: #ptxdist @freenode X-Accept-Language: de,en X-Accept-Content-Type: text/plain X-Uptime: 10:50:51 up 1 day, 21:03, 73 users, load average: 0.34, 0.23, 0.20 User-Agent: NeoMutt/20170113 (1.7.2) X-SA-Exim-Connect-IP: 2001:67c:670:100:1d::c0 X-SA-Exim-Mail-From: sha@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-fsdevel@vger.kernel.org Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org On Wed, Jan 23, 2019 at 10:46:24AM +0100, Richard Weinberger wrote: > Sascha, > > Am Mittwoch, 23. Januar 2019, 10:43:05 CET schrieb Sascha Hauer: > > On Wed, Jan 23, 2019 at 12:07:12AM +0100, Richard Weinberger wrote: > > > On Thu, Jan 10, 2019 at 12:45 PM Sascha Hauer wrote: > > > > > > > > Hi all, > > > > > > > > I'm currently working on resurrecting the UBIFS quota patches posted back in > > > > 2015 by Dongsheng Yang, last posted here: > > > > > > > > http://lists.infradead.org/pipermail/linux-mtd/2015-September/061812.html > > > > > > > > First of all I think work stopped there, there is no newer UBIFS quota > > > > support I am missing, right? > > > > > > > > One problem with this series was that the quotactl systemcall expects a > > > > path to a block device. UBIFS doesn't work on a block device but on a > > > > character device instead. > > > > The solution in this series was to pass the path to the cdev in > > > > quotactl. A struct cdev * member was added to struct super_block which > > > > was used to identify the superblock for a given cdev. This approach was > > > > rejected by Christoph ("I don't think the cdev has any business in core > > > > VFS code."). Apart from that UBIFS can not only be mounted with a path > > > > to the character device (mount -t ubifs /dev/ubix_y /mnt) but also in > > > > the form ubix:volname (mount -t ubifs ubix:volname /mnt) in which case > > > > userspace doesn't have any valid path it could pass in quotactl. > > > > > > > > An idea out of this would be to allow to pass the mountpoint instead of > > > > the path to the block device in quotactl which would work with nfs or > > > > even tmpfs aswell. Would that be acceptable? Any other ideas? > > > > > > *kind ping* > > > > > > Jan, another thing Sascha and I are not sure about, what are the consistency > > > constraints of the quota file? > > > If I read the code correctly, quota just writes to the quota file and > > > assumes that > > > the file system makes sure about consistency. Either by fsckfixing the quota > > > file or having a data journal for the quota file. > > > In case of UBIFS where we have a data journal this should be doable. > > > Is it okay when the quota file has S_SYNC set? > > > > S_SYNC won't help us. We need to make sure that a change of an inode and > > the corresponding update to the quota file is done atomically. Otherwise > > it may happen that we only change the size of an inode, but miss the > > corresponding quota updates, or depending on the implementation, maybe > > the other way round. > > This is why I said yesterday you need to touch the UBIFS journal replay code too. > So, S_SYNC is not to keep the quota file consistent with UBIFS' state, it is > to make sure we don't lose quota updates. But how we handle a power cut between the update to the quota file and the actual inode change then? During replay we'll find quota updates and inode updates, but we do not have any information which quota update belongs to which inode change. Sascha -- Pengutronix e.K. | | Industrial Linux Solutions | http://www.pengutronix.de/ | Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |