From 64349030114b6926f80b72f95b6fc17f653f16c3 Mon Sep 17 00:00:00 2001 From: Kaixu Xia Date: Wed, 22 Jun 2022 11:55:35 +0800 Subject: [PATCH] xfs: show the proper user quota options mainline inclusion from mainline-v5.11-rc6 commit 237d7887ae723af7d978e8b9a385fdff416f357b category: bugfix bugzilla: https://gitee.com/openeuler/kernel/issues/I5AG18 CVE: NA -------------------------------- The quota option 'usrquota' should be shown if both the XFS_UQUOTA_ACCT and XFS_UQUOTA_ENFD flags are set. The option 'uqnoenforce' should be shown when only the XFS_UQUOTA_ACCT flag is set. The current code logic seems wrong, Fix it and show proper options. Signed-off-by: Kaixu Xia Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong Signed-off-by: tangbin Reviewed-by: Xuenan Guo Signed-off-by: Laibin Qiu --- fs/xfs/xfs_super.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/fs/xfs/xfs_super.c b/fs/xfs/xfs_super.c index e126bc6cdeb8..5d8e3a4d2671 100644 --- a/fs/xfs/xfs_super.c +++ b/fs/xfs/xfs_super.c @@ -505,10 +505,12 @@ xfs_showargs( seq_printf(m, ",swidth=%d", (int)XFS_FSB_TO_BB(mp, mp->m_swidth)); - if (mp->m_qflags & (XFS_UQUOTA_ACCT|XFS_UQUOTA_ENFD)) - seq_puts(m, ",usrquota"); - else if (mp->m_qflags & XFS_UQUOTA_ACCT) - seq_puts(m, ",uqnoenforce"); + if (mp->m_qflags & XFS_UQUOTA_ACCT) { + if (mp->m_qflags & XFS_UQUOTA_ENFD) + seq_puts(m, ",usrquota"); + else + seq_puts(m, ",uqnoenforce"); + } if (mp->m_qflags & XFS_PQUOTA_ACCT) { if (mp->m_qflags & XFS_PQUOTA_ENFD) -- GitLab