Re: [PATCH] xfs: fix the warning message in xfs_validate_sb_common()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




On 5/11/20 10:27 AM, Darrick J. Wong wrote:
> On Sat, May 09, 2020 at 10:59:47PM +0800, xiakaixu1987@xxxxxxxxx wrote:
>> From: Kaixu Xia <kaixuxia@xxxxxxxxxxx>
>>
>> The warning message should be PQUOTA/GQUOTA_{ENFD|CHKD} can't along
>> with superblock earlier than version 5, so fix it.
> 
> Huh?
> 
> Oh, I see, you're trying to fix someone's shortcut in the logging
> messages.  This is clearer (to me, anyway):
> 
> “Fix this error message to complain about project and group quota flag
> bits instead of "PUOTA" and "QUOTA".”
> 
> I'll commit the patch with the above changelog if that's ok?

Honestly the other message is pretty terrible too, while we're fixing things
here:

        if (xfs_sb_version_has_pquotino(sbp)) {
                if (sbp->sb_qflags & (XFS_OQUOTA_ENFD | XFS_OQUOTA_CHKD)) {
                        xfs_notice(mp,
                           "Version 5 of Super block has XFS_OQUOTA bits.");
                        return -EFSCORRUPTED;
                }
        } else if (sbp->sb_qflags & (XFS_PQUOTA_ENFD | XFS_GQUOTA_ENFD |
                                XFS_PQUOTA_CHKD | XFS_GQUOTA_CHKD)) {
                        xfs_notice(mp,
"Superblock earlier than Version 5 has XFS_[PQ]UOTA_{ENFD|CHKD} bits.");
                        return -EFSCORRUPTED;
        }

maybe we can at least agree that superblock is 1 word and doesn't need to
be capitalized ;)

(and really, none of this information is going to be useful to the admin anyway,
so how about just):

        if (xfs_sb_version_has_pquotino(sbp)) {
                if (sbp->sb_qflags & (XFS_OQUOTA_ENFD | XFS_OQUOTA_CHKD)) {
                        xfs_notice(mp, "Quota flag sanity check failed");
                        return -EFSCORRUPTED;
                }
        } else if (sbp->sb_qflags & (XFS_PQUOTA_ENFD | XFS_GQUOTA_ENFD |
                                XFS_PQUOTA_CHKD | XFS_GQUOTA_CHKD)) {
                        xfs_notice(mp, "Quota flag sanity check failed");
                        return -EFSCORRUPTED;
        }

or some tidier version of that logic.

-Eric




[Index of Archives]     [XFS Filesystem Development (older mail)]     [Linux Filesystem Development]     [Linux Audio Users]     [Yosemite Trails]     [Linux Kernel]     [Linux RAID]     [Linux SCSI]


  Powered by Linux