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 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id AE633C77B7D for ; Mon, 15 May 2023 08:54:47 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 4BCDF900003; Mon, 15 May 2023 04:54:47 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 44569900002; Mon, 15 May 2023 04:54:47 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 2E797900003; Mon, 15 May 2023 04:54:47 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id 1EB20900002 for ; Mon, 15 May 2023 04:54:47 -0400 (EDT) Received: from smtpin24.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id DFE7C8136C for ; Mon, 15 May 2023 08:54:46 +0000 (UTC) X-FDA: 80791878972.24.CA418C1 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by imf23.hostedemail.com (Postfix) with ESMTP id 28000140012 for ; Mon, 15 May 2023 08:54:44 +0000 (UTC) Authentication-Results: imf23.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=Njm8OfWB; spf=pass (imf23.hostedemail.com: domain of cem@kernel.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=cem@kernel.org; dmarc=pass (policy=none) header.from=kernel.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1684140885; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=NX2CXIrc1cS15zYsnbGHwpNxx7d396tY8dvp6Ez7oFM=; b=JLiOgxqGQI/ganq29pe2nGTxIqdHxZl30aZrZDN9owTcwluVmQxZ+ILEwzMib5H8LaEx+k wbMYuAaFYuQHz8ZaVidnUNmKiAEWS9WTt8xs0njoi1Vrqo80cb4CcycRIojFUKYQU3lGtB tjUkc5ED81GPloaIDvvgIo1Y2P4/bUE= ARC-Authentication-Results: i=1; imf23.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=Njm8OfWB; spf=pass (imf23.hostedemail.com: domain of cem@kernel.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=cem@kernel.org; dmarc=pass (policy=none) header.from=kernel.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1684140885; a=rsa-sha256; cv=none; b=ANZTd3/y3+KBD0EmRgqICfEEjA8EZo9Y6+/ytBM6QPSd6vGmwktSgUsI1IdeQycVc5NMbB eVJLZFPXIgWviUF1sA1Js5QWGkUXtsNHM6yU7cvwLi3C0MpxDN2g0DyJyezeYxgT9W9+ah /xpX8dZGeNQ+uA4Lyy2Zf+ekfyGit5I= Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 2BCE2611AA; Mon, 15 May 2023 08:54:44 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5E653C433EF; Mon, 15 May 2023 08:54:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1684140883; bh=v+5nF/1DkkDDoVN+U8TQob4EWCEaBwMC/iQv9hCC1oQ=; h=Date:From:To:Subject:References:In-Reply-To:From; b=Njm8OfWBVpLM34hIqp0kC7RyVTINrPlKdsqrER5MufEN5+SHsNqF/YYkgt1P58KVM 2vKz/0hoKW/Kiiy55KGox8gOKTmx3d62dJpGES4tfueAzOI8GW2p7EyZwSOuzTirE9 gxJyu4uQ0F3ZDyuNcZaZwIy/fwub/5q0PdMG/tGOo11mv48E2HycANyrcML/IBrOp5 QOUsG7LNep7mcGwGb6c9nF3WSMDbueW3uOmgW86itKzoKyX+hz7xQCqArwTDONAaB9 skQ8dt85AgpLGE+BqLNVWhvGdEOWXY/HiMfTcnzjevQZEHBNSt7zaIU/aUwIPPmUTo WGgnjncS7IjnQ== Date: Mon, 15 May 2023 10:54:39 +0200 From: Carlos Maiolino To: hughd@google.com, jack@suse.cz, linux-mm@kvack.org, linux-fsdevel@vger.kernel.org, djwong@kernel.org Subject: Re: [PATCH V4 0/6] shmem: Add user and group quota support for tmpfs Message-ID: <20230515085439.5s5n4xxljgl6e5jl@andromeda> References: <20230426102008.2930932-1-cem@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230426102008.2930932-1-cem@kernel.org> X-Stat-Signature: zifw71eh43wqtxsfpa3th3euek3agrb3 X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: 28000140012 X-Rspam-User: X-HE-Tag: 1684140884-640996 X-HE-Meta: U2FsdGVkX19D4LpLG9QCOp8qHZhGmsmzKoLXDeJfrRp1/9o5GSD8JQ9YdIfHm+rXLblGGiJ3Ynz9OvfxDSUenCVmhDUw22RQnKfxSPtAx2h/9RXjFpRQ0JHFdORNlCHgbgjvaARmvKwW4yu+RZEoRhqzP3TQjjsvF49x6MAUoIYCiBYFwFvDOnMaj8dIpRdlOBDNliOkfP/50033Trmky2t3T5vUFYyRhHdT/S40461sP9hpEwHhyxWv8j1YafzyEYBILIFhjHw/XTYjcEfUC1DG0GRGnuiPCbkKL1RGfIhNdJGZo//MjCIf+kbhAz3QHA8T9i1Wt5CtNrP/JfP+4zN3A7hDEFQrV3808T6P83OjOIDLedOJyfMvo0B5KITzE2SZWUJkDLJRyrmue5wd/97ZpzSiRazVqpiCvJ8jqmDg5wQ6JhZve0UL6rFszeguNbLHR0vsVYxT7ajzHRkbgZ3gg8i5LKpWDthB7r432GQL2VbGgUS8S6rwbuRnD49kVCz5A6lt3dTrwZ7fFWuhg5iJo1NFkaxoTW4PgUDXnCqJxlQHCEFViN5m9zZx6E2dLUPgvyteA4rjsrNWb4mAPVl0Iw94Vo9PSEmLuEx0thwNzbqd354xJ+vJBRHmwLVgDBqHqArJ42mq+6fU+LrOvow0kSC5fw4d8XZsRnDbgG5HFu5hC+GfYwV05SAgkAYYp7eyBcSdJ1QQqXJ+x9sTqI5mFYrcE3XyssKQkrU70aKh5cQ1qnE2CcU+duMUspXdOOdpMUlivMh7NJhoiwbpufMwxz0nTy7el/eYSn+CCHMqv+R3ydLciRU0Zn8Kgkawe8LZxooohK3ajCEUBb87Kf3nYDmJHjyjXzy9l0DVaoytp+lAm5eVjVoj5zYD737kFP4ev0f+RZvHKP/Qk9y/DRUJ7JKbPNpMiSf0JsQ+/wzX9Qmort7BFqIM5iIYfIAZ117GMXXQ2ZhKblnnF+z F6tXqdDF o3CjEB4Fxkv30kY77BYyBzc3WKBjWguNqko5VSf7TI4R3oLyykMWiQWC4kNJFTLa7EdKw1SSFAoM6lk6UN3eNx73RrxOZssgXXp+y4F0XxxgbcWwuqLhcCpuOMiOdkaP1Xe1q14pboGeduTvXTzmWnHyf6s+6QxshEJNwK2pLIS5YE9HtkAHwnqmWW79sXoC0Q8ZGX0RJyTJIIF+b0HdYKQHNgMrr8ZHQbgkvGrTVJZWVyu4zc7Dhh+jQVlOJ4cL2yP2sKp0B26s6dsfXA3Y48gGlzNBRzS5SO6bWgk21pfPeO4yBDGvAaE3FNhfx5NHYGQ5NR4DuThM81u4d5OAsyLt4FhfhERWp4fjxebJBfxf7sg44Q1pbtNi/HjHzxpI19G/Dy3THFywA3Ew= X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Wed, Apr 26, 2023 at 12:20:02PM +0200, cem@kernel.org wrote: > From: Carlos Maiolino > > Hello folks. > > This is the final version of the quota support from tmpfs, with all the issues > addressed, and now including RwB tags on all patches, and should be ready for > merge. Details are within each patch, and the original cover-letter below. > Ping? Can somebody manage to pickup these patches? Thanks! > Hi folks. this work has been done originally by Lukas, but he left the company, > so I'm taking over his work from where he left it of. This series is virtually > done, and he had updated it with comments from the last version, but, I'm > initially posting it as a RFC because it's been a while since he posted the > last version. > Most of what I did here was rebase his last work on top of current Linus's tree. > > Honza, there is one patch from you in this series, which I believe you had it > suggested to Lukas on a previous version. > > The original cover-letter follows... > > people have been asking for quota support in tmpfs many times in the past > mostly to avoid one malicious user, or misbehaving user/program to consume > all of the system memory. This has been partially solved with the size > mount option, but some problems still prevail. > > One of the problems is the fact that /dev/shm is still generally unprotected > with this and another is administration overhead of managing multiple tmpfs > mounts and lack of more fine grained control. > > Quota support can solve all these problems in a somewhat standard way > people are already familiar with from regular file systems. It can give us > more fine grained control over how much memory user/groups can consume. > Additionally it can also control number of inodes and with special quota > mount options introduced with a second patch we can set global limits > allowing us to replace the size mount option with quota entirely. > > Currently the standard userspace quota tools (quota, xfs_quota) are only > using quotactl ioctl which is expecting a block device. I patched quota [1] > and xfs_quota [2] to use quotactl_fd in case we want to run the tools on > mount point directory to work nicely with tmpfs. > > The implementation was tested on patched version of xfstests [3]. > > [1] https://github.com/lczerner/quota/tree/quotactl_fd_support > [2] https://github.com/lczerner/xfsprogs/tree/quotactl_fd_support > [3] https://github.com/lczerner/xfstests/tree/tmpfs_quota_support > > > Jan Kara (1): > quota: Check presence of quota operation structures instead of > ->quota_read and ->quota_write callbacks > > Lukas Czerner (5): > shmem: make shmem_inode_acct_block() return error > shmem: make shmem_get_inode() return ERR_PTR instead of NULL > shmem: prepare shmem quota infrastructure > shmem: quota support > Add default quota limit mount options > > Documentation/filesystems/tmpfs.rst | 31 ++ > fs/Kconfig | 12 + > fs/quota/dquot.c | 2 +- > include/linux/shmem_fs.h | 28 ++ > include/uapi/linux/quota.h | 1 + > mm/Makefile | 2 +- > mm/shmem.c | 465 +++++++++++++++++++++------- > mm/shmem_quota.c | 350 +++++++++++++++++++++ > 8 files changed, 783 insertions(+), 108 deletions(-) > create mode 100644 mm/shmem_quota.c > > Signed-off-by: Carlos Maiolino > -- > 2.30.2 > -- Carlos Maiolino