All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] xfs: fix the warning message in xfs_validate_sb_common()
@ 2020-05-09 14:59 xiakaixu1987
  2020-05-09 16:35 ` Christoph Hellwig
  2020-05-11 15:27 ` Darrick J. Wong
  0 siblings, 2 replies; 6+ messages in thread
From: xiakaixu1987 @ 2020-05-09 14:59 UTC (permalink / raw)
  To: linux-xfs; +Cc: darrick.wong, Kaixu Xia

From: Kaixu Xia <kaixuxia@tencent.com>

The warning message should be PQUOTA/GQUOTA_{ENFD|CHKD} can't along
with superblock earlier than version 5, so fix it.

Signed-off-by: Kaixu Xia <kaixuxia@tencent.com>
---
 fs/xfs/libxfs/xfs_sb.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/xfs/libxfs/xfs_sb.c b/fs/xfs/libxfs/xfs_sb.c
index c526c5e5ab76..4df87546bd40 100644
--- a/fs/xfs/libxfs/xfs_sb.c
+++ b/fs/xfs/libxfs/xfs_sb.c
@@ -243,7 +243,7 @@ xfs_validate_sb_common(
 	} 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.");
+"Superblock earlier than Version 5 has XFS_{P|G}QUOTA_{ENFD|CHKD} bits.");
 			return -EFSCORRUPTED;
 	}
 
-- 
2.20.0


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH] xfs: fix the warning message in xfs_validate_sb_common()
  2020-05-09 14:59 [PATCH] xfs: fix the warning message in xfs_validate_sb_common() xiakaixu1987
@ 2020-05-09 16:35 ` Christoph Hellwig
  2020-05-11 15:27 ` Darrick J. Wong
  1 sibling, 0 replies; 6+ messages in thread
From: Christoph Hellwig @ 2020-05-09 16:35 UTC (permalink / raw)
  To: xiakaixu1987; +Cc: linux-xfs, darrick.wong, Kaixu Xia

On Sat, May 09, 2020 at 10:59:47PM +0800, xiakaixu1987@gmail.com wrote:
> From: Kaixu Xia <kaixuxia@tencent.com>
> 
> The warning message should be PQUOTA/GQUOTA_{ENFD|CHKD} can't along
> with superblock earlier than version 5, so fix it.

Looks good,

Reviewed-by: Christoph Hellwig <hch@lst.de>

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] xfs: fix the warning message in xfs_validate_sb_common()
  2020-05-09 14:59 [PATCH] xfs: fix the warning message in xfs_validate_sb_common() xiakaixu1987
  2020-05-09 16:35 ` Christoph Hellwig
@ 2020-05-11 15:27 ` Darrick J. Wong
  2020-05-11 19:39   ` Eric Sandeen
  2020-05-12  2:17   ` kaixuxia
  1 sibling, 2 replies; 6+ messages in thread
From: Darrick J. Wong @ 2020-05-11 15:27 UTC (permalink / raw)
  To: xiakaixu1987; +Cc: linux-xfs, Kaixu Xia

On Sat, May 09, 2020 at 10:59:47PM +0800, xiakaixu1987@gmail.com wrote:
> From: Kaixu Xia <kaixuxia@tencent.com>
> 
> 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?

Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>

--D

> Signed-off-by: Kaixu Xia <kaixuxia@tencent.com>
> ---
>  fs/xfs/libxfs/xfs_sb.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/fs/xfs/libxfs/xfs_sb.c b/fs/xfs/libxfs/xfs_sb.c
> index c526c5e5ab76..4df87546bd40 100644
> --- a/fs/xfs/libxfs/xfs_sb.c
> +++ b/fs/xfs/libxfs/xfs_sb.c
> @@ -243,7 +243,7 @@ xfs_validate_sb_common(
>  	} 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.");
> +"Superblock earlier than Version 5 has XFS_{P|G}QUOTA_{ENFD|CHKD} bits.");
>  			return -EFSCORRUPTED;
>  	}
>  
> -- 
> 2.20.0
> 

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] xfs: fix the warning message in xfs_validate_sb_common()
  2020-05-11 15:27 ` Darrick J. Wong
@ 2020-05-11 19:39   ` Eric Sandeen
  2020-05-12  2:27     ` kaixuxia
  2020-05-12  2:17   ` kaixuxia
  1 sibling, 1 reply; 6+ messages in thread
From: Eric Sandeen @ 2020-05-11 19:39 UTC (permalink / raw)
  To: Darrick J. Wong, xiakaixu1987; +Cc: linux-xfs, Kaixu Xia



On 5/11/20 10:27 AM, Darrick J. Wong wrote:
> On Sat, May 09, 2020 at 10:59:47PM +0800, xiakaixu1987@gmail.com wrote:
>> From: Kaixu Xia <kaixuxia@tencent.com>
>>
>> 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


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] xfs: fix the warning message in xfs_validate_sb_common()
  2020-05-11 15:27 ` Darrick J. Wong
  2020-05-11 19:39   ` Eric Sandeen
@ 2020-05-12  2:17   ` kaixuxia
  1 sibling, 0 replies; 6+ messages in thread
From: kaixuxia @ 2020-05-12  2:17 UTC (permalink / raw)
  To: Darrick J. Wong; +Cc: linux-xfs, Kaixu Xia


On 2020/5/11 23:27, Darrick J. Wong wrote:
> On Sat, May 09, 2020 at 10:59:47PM +0800, xiakaixu1987@gmail.com wrote:
>> From: Kaixu Xia <kaixuxia@tencent.com>
>>
>> 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?

Thanks for your comments! Yes, please. This changelog is more cleaer.
> 
> Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
> 
> --D
> 
>> Signed-off-by: Kaixu Xia <kaixuxia@tencent.com>
>> ---
>>  fs/xfs/libxfs/xfs_sb.c | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/fs/xfs/libxfs/xfs_sb.c b/fs/xfs/libxfs/xfs_sb.c
>> index c526c5e5ab76..4df87546bd40 100644
>> --- a/fs/xfs/libxfs/xfs_sb.c
>> +++ b/fs/xfs/libxfs/xfs_sb.c
>> @@ -243,7 +243,7 @@ xfs_validate_sb_common(
>>  	} 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.");
>> +"Superblock earlier than Version 5 has XFS_{P|G}QUOTA_{ENFD|CHKD} bits.");
>>  			return -EFSCORRUPTED;
>>  	}
>>  
>> -- 
>> 2.20.0
>>

-- 
kaixuxia

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] xfs: fix the warning message in xfs_validate_sb_common()
  2020-05-11 19:39   ` Eric Sandeen
@ 2020-05-12  2:27     ` kaixuxia
  0 siblings, 0 replies; 6+ messages in thread
From: kaixuxia @ 2020-05-12  2:27 UTC (permalink / raw)
  To: Eric Sandeen, Darrick J. Wong; +Cc: linux-xfs, Kaixu Xia



On 2020/5/12 3:39, Eric Sandeen wrote:
> 
> 
> On 5/11/20 10:27 AM, Darrick J. Wong wrote:
>> On Sat, May 09, 2020 at 10:59:47PM +0800, xiakaixu1987@gmail.com wrote:
>>> From: Kaixu Xia <kaixuxia@tencent.com>
>>>
>>> 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;
>         }
>
Yeah, this message is simple and clear, but maybe the original message can
give more information why superblock validate failed. 
 
> or some tidier version of that logic.
> -Eric
> 

-- 
kaixuxia

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2020-05-12  2:27 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-09 14:59 [PATCH] xfs: fix the warning message in xfs_validate_sb_common() xiakaixu1987
2020-05-09 16:35 ` Christoph Hellwig
2020-05-11 15:27 ` Darrick J. Wong
2020-05-11 19:39   ` Eric Sandeen
2020-05-12  2:27     ` kaixuxia
2020-05-12  2:17   ` kaixuxia

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.