From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.openvz.org (mail.openvz.org [69.168.225.77]) by lore.virtuozzo.com (Postfix) with ESMTPS id CDE0C8002A for ; Thu, 19 Nov 2026 12:05:00 +0000 (UTC) Received: from mail.openvz.org (localhost [127.0.0.1]) by mail.openvz.org (8.14.4/8.14.4) with ESMTP id 6AJC3e6E023638; Thu, 19 Nov 2026 15:03:40 +0300 DKIM-Filter: OpenDKIM Filter v2.11.0 mail.openvz.org 6AJC3e6E023638 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=openvz.org; s=default; t=1795089822; bh=O1Va2kw1TsgKjOecuJCHlTHIlIGqMDivTrdbEbpctC0=; h=From:To:Date:In-Reply-To:References:Cc:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe; b=UbkaC2cM07OPTjthiM5zBGyJOCm1JY5DeC7wDew8lnRwj9AO2NhFQbn0GDGB6zVSh p8Xv4/7m8klGIiIzv2+IswdA+DmsGNc/bKWFbK8tfnR8T4h+BYoEOdmW202Y8TL2Cz A7ZTZBp3tF678+xQzA3t4JyVe3ZL5NiDUJkHj4pgb+yMqiyj5OZhouu6/3joG6LELn EBU4lK67XFp5tTD0zn2bBeYR09BmEUhPvqqu2fMwWXtfDM09fa94B8dzSwCSbQYJbm AgJgvH1v8i7at1Ng4gSHtd3jQDN5StLvltZzl05O+XxeZ/fkg7xIZJUOI6bkY+vgxc e8kVotV8/MEzw== Received: from mail-wr1-f71.google.com (mail-wr1-f71.google.com [209.85.221.71]) by mail.openvz.org (8.14.4/8.14.4) with ESMTP id 6AJC3XS4023585 (version=TLSv1/SSLv3 cipher=AES128-GCM-SHA256 bits=128 verify=FAIL) for ; Thu, 19 Nov 2026 15:03:33 +0300 DKIM-Filter: OpenDKIM Filter v2.11.0 mail.openvz.org 6AJC3XS4023585 Authentication-Results: mail.openvz.org; dkim=pass (2048-bit key) header.d=openvz.org header.i=@openvz.org header.b="J8+sSwUw" Received: by mail-wr1-f71.google.com with SMTP id ffacd0b85a97d-4925ef75fc4so1645884f8f.1 for ; Thu, 19 Nov 2026 04:03:33 -0800 (PST) X-Forwarded-Encrypted: i=2; AL+hErEJN3bOWwscGNXqfMjUP+I7BA3TcJOu0utEIdN94SoGBqn+1gOML6btJQlFFqv28BwjrSXczg==@openvz.org X-Gm-Message-State: APuU4Z9cVq70aCNSk+Z/Hy/6QgHD7m8Aga7jSRgGsoE2ISEeViLwnphR rzs7fnXV2+IdQBzkkUryuVBSmgPT0NIEVX82+bcpmzoiRG0Vn0BFu4/3GAgDOFLqYUg3+mEgQti YxHY3hCJZownZNJ8MNAGfR76qhb4PWH9WnXchTEBwI16wk3y+g9RPIw== X-Gm-Gg: AZFdTZf7FG1/WJb4sOcy0gkVvjwxSL7RD2hCicxwLAQw1qL03+u+ORPPGOdql6VY0ce b/of47cnIHwoKcbeJE+lGbEJtdGwvLqixNrT/YYAD+V46lyDmVXKQ1n7UUCE/E60xqLQMswD/PT ggMStHUjj9z384WO01V1ty88S2vDiY+mbm90op17D16qgoQql62Ezth5o8Dxt6fq/ia7QJImbhV cGRtajkpAAwTVgzWyMfJQL88ynha5gQIJouT2Jzy7eZsTMq79mC08DBLhVwdHfzWLDlUo+FHGyn r8lvBSDXlA== X-Received: by 2002:a05:6000:1a85:b0:4a7:ed95:7c9f with SMTP id ffacd0b85a97d-4a7ed957d61mr8282290f8f.22.1795089813178; Thu, 19 Nov 2026 04:03:33 -0800 (PST) X-Received: by 2002:a05:6000:1a85:b0:4a7:ed95:7c9f with SMTP id ffacd0b85a97d-4a7ed957d61mr8282231f8f.22.1795089812625; Thu, 19 Nov 2026 04:03:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1795089812; cv=none; d=google.com; s=arc-20260327; b=hK/CW+V9clmbBcv8GVFRiw6wjZ/1CUYpFQTu/1sMwMQ5s4N07cLy30sqwIKUR+u55R oMUO7YaBU62yo/srMlzuCojFvB2mZ84B6WpHsPjRaPOwnPcKqooKyxa0fQxPDSWniQ3o VpO+cM8c3FetpVXFzkrss9EsDO8x2E51kFT0NvfnYIAOFQ89bRo7IkV0xhHqz/HrkxWo t4ZrCivcOxCpg2MWW/kXFEbZC4buxQbCxiO6xaAv/7Gx3hsKijh+YOSqJ4RQT1kTGLaJ S4FJwwgl/OubsfP1Oxx1aphGGmbWiomilwnmBIeEnpmt8NjiEjaC3MeYliDlRQDzeEMq 6bTw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20260327; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=Jmfw1eqf+xWm3/Djsx0pCfrCd7mfkx8jMhhiJQ9tu/0=; fh=9YJ17h4I5v+d/ppl++u/HS/jQfvJ7uqqboVYI1y8WxY=; b=J0aHNekYCOBi9HXN8EjAAXZlBpOUVt86/vKXImdoQgzwDflrP3jn3QaS17GDKWtpdN X8g78EpDS4Aiqxoh88a3pyl32KzytxvyqvUS1mSzeG5F1Q7evPdb8uo0Zz/fYRZZk8Pz XL8gHqQpqg00fjhthM3ZJV2ebXiUByrb6YHa/JnwOrbHE52dpaaTwl9y4ORBs6MNSBdR GX0uZ3kIUJqr2B4R/+9LIzJIhL3zeczuKVe4/hpChNECwpjgNn259NvZ0JCdKS51Mq/s KBQCXRR/Tfuayzbc0tdPhk+mqzlAJex5njpp2Qe7AK0UCOmjrRC+xUwWZc99muBFjzsw nhXw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@openvz.org header.s=google header.b=J8+sSwUw; spf=softfail (google.com: domain of transitioning den@openvz.org does not designate 2a06:5b06:b600:300:989f:a206:d03d:c3d5 as permitted sender) smtp.mailfrom=den@openvz.org; dara=neutral header.i=@openvz.org Received: from mail-sor-f41.google.com (mail-sor-f41.google.com. [209.85.220.41]) by mx.google.com with SMTPS id ffacd0b85a97d-4a8b2563b83sor430776f8f.16.2026.11.19.04.03.32 for (Google Transport Security); Thu, 19 Nov 2026 04:03:32 -0800 (PST) Received-SPF: softfail (google.com: domain of transitioning den@openvz.org does not designate 2a06:5b06:b600:300:989f:a206:d03d:c3d5 as permitted sender) client-ip=2a06:5b06:b600:300:989f:a206:d03d:c3d5; Authentication-Results: mx.google.com; dkim=pass header.i=@openvz.org header.s=google header.b=J8+sSwUw; spf=softfail (google.com: domain of transitioning den@openvz.org does not designate 2a06:5b06:b600:300:989f:a206:d03d:c3d5 as permitted sender) smtp.mailfrom=den@openvz.org; dara=neutral header.i=@openvz.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=openvz.org; s=google; t=1795089812; x=1795694612; darn=openvz.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=Jmfw1eqf+xWm3/Djsx0pCfrCd7mfkx8jMhhiJQ9tu/0=; b=J8+sSwUwjqmzSFrCTCIr0kCyVnidtuKDf4WZvhNYVGBXiyv84nokB8OQKkTLCky3ni SEqhVtR+lqbD1HLWDMXfP4wWi5uYw/7FG1w/bWt61eVca2bcuvzVU2v61R9gSThOvbke ah+XbchmanDk8ON88UOJ0/cs2WjoWjJ5CC0fvz2183LwYZp1stm1GUFvlgGSn98/6R2Y GCZOvC8KNBOnds2v9A3Xf5sG/GZIz4gJfim2H3EtzbAr6Wxy/dhO9XL/zDSDNNZD1OwO o6nHL0yBXdUKOOs+D88uU+aimATz6/r5456RFc9Ztzni1NOQgdT8AjiTAAgd1zCMXyWK qdAQ== X-Forwarded-Encrypted: i=1; AL+hErE6Qh0283U04rJbuGdbmZBfr7gaJK2f4ct6NQlt9extK5bWMQnWZJTSp2SB7EcUAAlGAJkLLA==@openvz.org X-Received: by 2002:a05:6000:4919:b0:4a6:5086:2df4 with SMTP id ffacd0b85a97d-4a6508631b5mr10147438f8f.36.1795089811966; Thu, 19 Nov 2026 04:03:31 -0800 (PST) Received: from artemis.sw.ru ([2a06:5b06:b600:300:989f:a206:d03d:c3d5]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-4a65541f3f7sm11036112f8f.24.2026.11.19.04.03.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Nov 2026 04:03:31 -0800 (PST) From: "Denis V. Lunev" To: ptikhomirov@virtuozzo.com, vasileios.almpanis@virtuozzo.com Date: Thu, 19 Nov 2026 13:03:20 +0100 Message-ID: <20261119120325.792064-4-den@openvz.org> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20261119120325.792064-1-den@openvz.org> References: <20261119120325.792064-1-den@openvz.org> MIME-Version: 1.0 X-OZ-Fwd: true Cc: devel@openvz.org Subject: [Devel] [PATCH hci-8.2 3/8] ms/ext4: add support for 32-bit default reserved uid and gid values X-BeenThere: devel@openvz.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: OpenVZ development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: devel-bounces@openvz.org Errors-To: devel-bounces@openvz.org From: Theodore Ts'o Support for specifying the default user id and group id that is allowed to use the reserved block space was added way back when Linux only supported 16-bit uid's and gid's. (Yeah, that long ago.) It's not a commonly used feature, but let's add support for 32-bit user and group id's. Signed-off-by: Theodore Ts'o Message-ID: <20250916-tune2fs-v2-2-d594dc7486f0@mit.edu> Signed-off-by: Theodore Ts'o (cherry picked from commit 12c84dd4d308551568d85203fd6ed2685e861fda) https://virtuozzo.atlassian.net/browse/VSTOR-155988 Feature: fix ms/ext4 Signed-off-by: Denis V. Lunev --- fs/ext4/ext4.h | 16 +++++++++++++++- fs/ext4/super.c | 8 ++++---- 2 files changed, 19 insertions(+), 5 deletions(-) diff --git a/fs/ext4/ext4.h b/fs/ext4/ext4.h index 3de0fc6e77f2..e9d1b471a8cc 100644 --- a/fs/ext4/ext4.h +++ b/fs/ext4/ext4.h @@ -1447,7 +1447,9 @@ struct ext4_super_block { __le16 s_encoding; /* Filename charset encoding */ __le16 s_encoding_flags; /* Filename charset encoding flags */ __le32 s_orphan_file_inum; /* Inode for tracking orphan inodes */ - __le32 s_reserved[94]; /* Padding to the end of the block */ + __le16 s_def_resuid_hi; + __le16 s_def_resgid_hi; + __le32 s_reserved[93]; /* Padding to the end of the block */ __le32 s_checksum; /* crc32c(superblock) */ }; @@ -1821,6 +1823,18 @@ static inline int ext4_valid_inum(struct super_block *sb, unsigned long ino) ino <= le32_to_cpu(EXT4_SB(sb)->s_es->s_inodes_count)); } +static inline int ext4_get_resuid(struct ext4_super_block *es) +{ + return le16_to_cpu(es->s_def_resuid) | + le16_to_cpu(es->s_def_resuid_hi) << 16; +} + +static inline int ext4_get_resgid(struct ext4_super_block *es) +{ + return le16_to_cpu(es->s_def_resgid) | + le16_to_cpu(es->s_def_resgid_hi) << 16; +} + /* * Returns: sbi->field[index] * Used to access an array element from the following sbi fields which require diff --git a/fs/ext4/super.c b/fs/ext4/super.c index bf42593efcea..a6581dee49ed 100644 --- a/fs/ext4/super.c +++ b/fs/ext4/super.c @@ -2986,11 +2986,11 @@ static int _ext4_show_options(struct seq_file *seq, struct super_block *sb, } if (nodefs || !uid_eq(sbi->s_resuid, make_kuid(&init_user_ns, EXT4_DEF_RESUID)) || - le16_to_cpu(es->s_def_resuid) != EXT4_DEF_RESUID) + ext4_get_resuid(es) != EXT4_DEF_RESUID) SEQ_OPTS_PRINT("resuid=%u", from_kuid_munged(&init_user_ns, sbi->s_resuid)); if (nodefs || !gid_eq(sbi->s_resgid, make_kgid(&init_user_ns, EXT4_DEF_RESGID)) || - le16_to_cpu(es->s_def_resgid) != EXT4_DEF_RESGID) + ext4_get_resgid(es) != EXT4_DEF_RESGID) SEQ_OPTS_PRINT("resgid=%u", from_kgid_munged(&init_user_ns, sbi->s_resgid)); def_errors = nodefs ? -1 : le16_to_cpu(es->s_errors); @@ -5366,8 +5366,8 @@ static int __ext4_fill_super(struct fs_context *fc, struct super_block *sb) ext4_set_def_opts(sb, es); - sbi->s_resuid = make_kuid(&init_user_ns, le16_to_cpu(es->s_def_resuid)); - sbi->s_resgid = make_kgid(&init_user_ns, le16_to_cpu(es->s_def_resgid)); + sbi->s_resuid = make_kuid(&init_user_ns, ext4_get_resuid(es)); + sbi->s_resgid = make_kgid(&init_user_ns, ext4_get_resuid(es)); sbi->s_commit_interval = JBD2_DEFAULT_MAX_COMMIT_AGE * HZ; sbi->s_min_batch_time = EXT4_DEF_MIN_BATCH_TIME; sbi->s_max_batch_time = EXT4_DEF_MAX_BATCH_TIME; -- 2.55.0 _______________________________________________ Devel mailing list Devel@openvz.org https://lists.openvz.org/mailman/listinfo/devel