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=1796322675; b=tWET9B+9bUbbOEwClY6rc3DfFuN6tUArXh7Va403U2ovaXmq5skonqI8swiG+wARYqTK wlHe3dRKiSwyxfoBIs4iBkiQOB1Gg4y6Wh/JEm5CRBBgyuMXTLPGwOU0/zVEpd0uUrI/3 /KAhAwxdwk012O6jVBxz8dcyX9EjmgIN703jgMrEgesZRo7uH4z+wnwwAZVENyDopnzpZ eZ/kbXfYMTpLTGFfVE2t/5e5llDZKB2FQACWKmsVx+DW2h0/dbjh7fj+0OkhluGtaT5I6 Wma4+G/KSdXWvK+h5bqCz3nZwuFU95E51auxndfnbmKJUAAf8U0tJPI4lLC5KHdfvKg== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796322675; h=Received:DKIM-Signature:Message-ID:From:Subject:Reply-To:To:Cc: In-Reply-To:References:Content-Type:Content-Transfer-Encoding:Date; bh=dUONzxCctvTOfuzqHKoMkmC4mydfoULpuhyAl2ysfro=; b=tY+ZskUotEnZIoU+L+4Xok78NITqZESzJ0QJvBXoeOCnN/4G+BSPfBtpRVkqxE6JGMLJ kwT/z1GChuxkgl1rR7Ye+84Gn6XKcKAgoPyPVdQbFwmk5PEqhGFI7LsIuVmzvpWvsqFdh 7FbWJ/a1EWwZVf6P5SBmDXryZNrfS+xCvGeN/B9yeNt3dkGSnhWLhudtMBJ+SUYyckJfu Kg/s7N5xuUOjcjm6hEPfEA6A12GVx7mE080baj0+pTogWnAwgKdAMLcoa3b8/jLscX90I oMs+XOv8d+er4vsM/JzZsFCKIrnPg8FGTDJu/oZsu5IeFRo17PGGkzEYna15UgiYRhw== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=XItsbMBU; 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 62895606A322 for ; Thu, 3 Dec 2026 18:31:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=XItsbMBU Received: by smtp.kernel.org (Postfix) with ESMTPSA id CA8481F0089A; Thu, 3 Dec 2026 18:31:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796322674; bh=dUONzxCctvTOfuzqHKoMkmC4mydfoULpuhyAl2ysfro=; h=From:Subject:Reply-To:To:Cc:In-Reply-To:References:Date; b=XItsbMBUI03uVGJmZwWPVBoIandHHcimfaCWuoBLXZjgTtTrfCU/a2KYLg/lN6YyA hpNYQWcClxxcJ9VYFj8tQISNeLOEyLVNnHMq+52syb1OMDhR2/mAMj//ETlGKFxR8X B7IIe5rd7AC62rExoHYltECMyZgyJz5gUWjI89E6OjrbmxbFTj58QJdBncMejleh9L vyiDLKeZlmWg6eGvMST08CyWZVnr0ZmRgLqBB9fSYcckBJfWYuVaQSGzHkfdoa5saS m5QcLdwMygZbxsIQj1ViOo7WGK4iDeuWOq0Uoi1AMfpeLZLUcDp2pGKbJLY54wYQdZ rVLyIhfAWe/2g== Message-ID: From: sashiko-bot@kernel.org Subject: Re: [PATCH] ext4: do not toggle DQUOT_NOLIST_DIRTY with quotas already loaded Reply-To: sashiko-reviews@lists.linux.dev To: "Xingyuan Mo" Cc: =?utf-8?b?b3BlbiBsaXN0OkVYVDQgRklMRSBTWVNURU0=?= , tytso@mit.edu In-Reply-To: <20261203173240.2282734-1-hdthky0@gmail.com> References: <20261203173240.2282734-1-hdthky0@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Thu, 03 Dec 2026 18:31:14 +0000 X-Mailing-List: linux-ext4@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list Thank you for your contribution! Sashiko AI review found 1 potential issue to consider: - [Medium] ext4: ext4_quota_on() latches DQUOT_NOLIST_DIRTY from per-type s_qf_names -- commit 15c30d02158a729a4d149620cdc9f7757e4dce22 Author: Xingyuan Mo ext4: do not toggle DQUOT_NOLIST_DIRTY with quotas already loaded This commit guards updates to the superblock DQUOT_NOLIST_DIRTY flag in ext4_quota_on() with !sb_any_quota_loaded(sb) so the flag cannot be toggled while quotas are active. > diff --git a/fs/ext4/super.c b/fs/ext4/super.c > index 880f664d6c04b..22438d9f2bb3b 100644 > --- a/fs/ext4/super.c > +++ b/fs/ext4/super.c > @@ -7292,13 +7292,12 @@ static int ext4_quota_on(struct super_block *sb, = int type, int format_id, > ext4_msg(sb, KERN_WARNING, > "Quota file not on filesystem root. " > "Journaled quota will not work"); > - sb_dqopt(sb)->flags |=3D DQUOT_NOLIST_DIRTY; > - } else { > - /* > - * Clear the flag just in case mount options changed since > - * last time. > - */ > - sb_dqopt(sb)->flags &=3D ~DQUOT_NOLIST_DIRTY; > + } > + if (!sb_any_quota_loaded(sb)) { > + if (EXT4_SB(sb)->s_qf_names[type]) > + sb_dqopt(sb)->flags |=3D DQUOT_NOLIST_DIRTY; > + else > + sb_dqopt(sb)->flags &=3D ~DQUOT_NOLIST_DIRTY; > } [Severity: Medium] Should this check ext4_is_quota_journalled(sb) instead of EXT4_SB(sb)->s_qf_names[type]? When mounted with only usrjquota=3D, enabling GRPQUOTA before USRQUOTA clea= rs DQUOT_NOLIST_DIRTY on the first Q_QUOTAON. Once USRQUOTA is enabled, sb_any_quota_loaded(sb) is already true, so DQUOT_NOLIST_DIRTY stays clear until all quotas are turned off. ext4_mark_dquot_dirty() checks ext4_is_quota_journalled(sb) and still commi= ts dquots immediately via ext4_write_dquot(). With DQUOT_NOLIST_DIRTY clear, each update takes dq_list_lock twice (mark and clear), regressing 91389240a= 252 ("ext4: Disable dirty list tracking of dquots when journalling quotas"). Checking ext4_is_quota_journalled(sb) avoids the enablement-order dependence and matches ext4_mark_dquot_dirty(), and ext4_check_quota_consistency() already prevents remount from changing s_qf_names while any quota is loaded. --=20 Sashiko AI review =C2=B7 https://sashiko.dev/#/patchset/20261203173240.2282= 734-1-hdthky0@gmail.com?part=3D1