From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1793124582; b=VX2CTAAxqCVlZBX/gB38LwH7EBpm9PCaqso6CisyV1yxK938FrrFOATJoRSEuvG0Rno1 rA3sHXsiOHH/wjIG3lILMj0jT4Xw17GaL4oAera2vf8ESbgXDaW0z9IQlDlr3ySuRX95u +8Uvl5zUYFsLpFFMLQjOEV9QKIzIYE4lTW/9SaYQfCv7BCngMQ7b48prpfaLUA1Mlk1zO h5CMyive4q9slmY2WNj7PrPHmHRQugeL4hBUExlTEilOSx+rPUHut+osTK7mcOw+rYe6R kItv1Qyx2oyAIsuDNKeha4ThzHoPPjcgQ3JjBIXIPnalxrswpTeXQR1BTW/ygoUzENA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1793124582; h=Received:DKIM-Signature:Date:To:From:Subject:Message-Id; bh=OucgfQLtUbW6S6JCw/gVXycG1f7KNsTeeVyKPwNs89k=; b=Aph/iAEaGZoyHrzJJNq9f0vhL3qFr0rPBJFR2VoKyZZEIdrBMdITkLmgBlC1uATd5X6I PPZdjZAESlxXjD+P02X9DKpy7Ri7+VPGKmyObRAL/3jQNpiJHSr8frflca8OBSw8XZPoA PLq34EURc2qpOLcM7Jr3G0axaLeqnsLeqYLPzys0rtGx68zGyKmkScEmnsQqPgK4XHn3M rvxb9OphADWbLDvBhdp8Z+K+w6SKUJrU/qJ7FH7RiyIt6VAkKFAI/BaPfXvaFjW45cvlX 7+T4wjUJgH7UTSELrEf5ihSiSVZpr4iF0PALPYO/FwKFIbHJQouHMhYkZ4sjuohP5lw== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=linux-foundation.org header.i=@linux-foundation.org header.a=rsa-sha256 header.s=korg header.b=jL6ufu9s; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 846EE606A32A for ; Tue, 27 Oct 2026 18:09:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key, unprotected) header.d=linux-foundation.org header.i=@linux-foundation.org header.a=rsa-sha256 header.s=korg header.b=jL6ufu9s Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0504C1F01829; Tue, 27 Oct 2026 18:09:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=korg; t=1793124582; bh=OucgfQLtUbW6S6JCw/gVXycG1f7KNsTeeVyKPwNs89k=; h=Date:To:From:Subject; b=jL6ufu9s3FAA20v8KgHs0MwMxDdstCefO7U2lYx43IQBXBr2BR7CeU6gQgYp7/Ton VS6lPrAOwHj6+4y8jIIgMt/7jKQ/pCQJ6Gg2Oq+lyteVaJbujKRyi0PW4k4u6SdUUb X0dNrrbF+vzrYI9o1aPyq9uMhqHWcU7sRvrZw/5U= Date: Tue, 27 Oct 2026 11:09:41 -0700 To: mm-commits@vger.kernel.org,josef@toxicpanda.com,akpm@linux-foundation.org From: Andrew Morton Subject: [to-be-updated] tmpfs-preserve-explicitly-disabled-quota-limits.patch removed from -mm tree Message-Id: <20261027180942.0504C1F01829@smtp.kernel.org> X-Mailing-List: mm-commits@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list The quilt patch titled Subject: tmpfs: preserve explicitly disabled quota limits has been removed from the -mm tree. Its filename was tmpfs-preserve-explicitly-disabled-quota-limits.patch This patch was dropped because an updated version will be issued ------------------------------------------------------ From: Josef Bacik Subject: tmpfs: preserve explicitly disabled quota limits Date: Mon, 26 Oct 2026 10:40:36 +0100 An administrator's decision to disable a user's or group's quota limits can be silently lost when tmpfs restores the mount defaults after releasing and reacquiring the quota record. This can cause later file creation or writes to fail with EDQUOT, even though the administrator has explicitly disabled quota limits for the user or group. do_set_dqblk() sets DQ_FAKE_B when all block and inode limits are zero. This means quota enforcement is disabled for that user or group. shmem_is_empty_dquot() treats the flag as a reason to discard the entry from the mount's quota tree. The next shmem_acquire_dquot() finds no saved entry and recreates it with the mount's default hard limits. If the cached dquot is reused, DQ_FAKE_B remains set: Q_GETQUOTA reports the restored defaults, but enforcement is still disabled. Once that dquot has been reclaimed, a new dquot enforces the restored defaults. Remove the DQ_FAKE_B test. Only discard entries with zero usage, zero soft limits and hard limits equal to the mount defaults. Explicitly disabled limits are then preserved whenever the mount defaults are nonzero. Explicitly disabled limits now retain a quota-tree entry, just like other limits that differ from the mount defaults. Rename shmem_is_empty_dquot() to shmem_is_default_dquot() to describe the check for default values. Fix generated by an LLM and sent by Josef Bacik in private. [david@kernel.org: code cleanups; rewrite description] Link: https://lore.kernel.org/20261026-fixes_shmem-v1-3-703206d5fa0c@kernel.org Fixes: de4c0e7ca8b5 ("shmem: Add default quota limit mount options") Signed-off-by: Josef Bacik Signed-off-by: David Hildenbrand (Arm) Reviewed-by: Jan Kara Tested-by: Gregory Price (Meta) Cc: Zi Yan Cc: Joshua Hahn Cc: Rakie Kim Cc: Ying Huang Cc: Johannes Weiner Cc: Vladimir Davydov Cc: Michal Hocko Cc: Hugh Dickins Cc: Baolin Wang Cc: Lukas Czerner Cc: Carlos Maiolino Cc: Christian Brauner Cc: Daniel Verkamp Cc: Jeff Xu Cc: Muchun Song Cc: Oscar Salvador Cc: David Stevens Cc: Matthew Wilcox (Oracle) Cc: William Kucharski Cc: Chris Li Cc: Kairui Song Cc: Nhat Pham Cc: Miaohe Lin Cc: Naoya Horiguchi Cc: Chris Mason Cc: Eva Kurchatova Cc: Kairui Song Cc: Pedro Falcato Cc: "Kiryl Shutsemau (Meta)" Cc: Cc: --- mm/shmem_quota.c | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/mm/shmem_quota.c b/mm/shmem_quota.c index 43d3b4fd6cb1b..d191ebda3f00e 100644 --- a/mm/shmem_quota.c +++ b/mm/shmem_quota.c @@ -239,7 +239,7 @@ static int shmem_acquire_dquot(struct dquot *dquot) return ret; } -static bool shmem_is_empty_dquot(struct dquot *dquot) +static bool shmem_is_default_dquot(struct dquot *dquot) { struct shmem_sb_info *sbinfo = dquot->dq_sb->s_fs_info; qsize_t bhardlimit; @@ -253,21 +253,21 @@ static bool shmem_is_empty_dquot(struct dquot *dquot) ihardlimit = sbinfo->qlimits.grpquota_ihardlimit; } - if (test_bit(DQ_FAKE_B, &dquot->dq_flags) || - (dquot->dq_dqb.dqb_curspace == 0 && - dquot->dq_dqb.dqb_curinodes == 0 && - dquot->dq_dqb.dqb_bsoftlimit == 0 && - dquot->dq_dqb.dqb_isoftlimit == 0 && - dquot->dq_dqb.dqb_bhardlimit == bhardlimit && - dquot->dq_dqb.dqb_ihardlimit == ihardlimit)) - return true; - - return false; + /* + * Defaults are zero usage and soft limits, and the mount's hard limits. + * DQ_FAKE_B only means that *all* limits are zero, which need not match + * the mount defaults. + */ + return dquot->dq_dqb.dqb_curspace == 0 && + dquot->dq_dqb.dqb_curinodes == 0 && + dquot->dq_dqb.dqb_bsoftlimit == 0 && + dquot->dq_dqb.dqb_isoftlimit == 0 && + dquot->dq_dqb.dqb_bhardlimit == bhardlimit && + dquot->dq_dqb.dqb_ihardlimit == ihardlimit; } /* - * Store limits from dquot in the tree unless it's fake. If it is fake - * remove the id from the tree since there is no useful information in - * there. + * Remove the ID from the tree if it has no usage and its limits match + * the mount defaults. Otherwise, save its limits for the next acquire. */ static int shmem_release_dquot(struct dquot *dquot) { @@ -302,7 +302,7 @@ static int shmem_release_dquot(struct dquot *dquot) return -ENOENT; found: - if (shmem_is_empty_dquot(dquot)) { + if (shmem_is_default_dquot(dquot)) { /* Remove entry from the tree */ rb_erase(&entry->node, info->dqi_priv); kfree(entry); Patches currently in -mm which might be from josef@toxicpanda.com are mm-shmem-hold-off-eviction-in-shmem_writeout.patch