All of lore.kernel.org
 help / color / mirror / Atom feed
From: Gao Xiang <hsiangkao@redhat.com>
To: Chao Yu <yuchao0@huawei.com>
Cc: Gao Xiang <hsiangkao@aol.com>,
	linux-erofs@lists.ozlabs.org, Chao Yu <chao@kernel.org>,
	LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v2 4/4] erofs: add on-disk compression configurations
Date: Mon, 29 Mar 2021 14:55:49 +0800	[thread overview]
Message-ID: <20210329065549.GB3281654@xiangao.remote.csb> (raw)
In-Reply-To: <3c0bf7e5-0924-3d85-56db-35a2d39dbb8d@huawei.com>

On Mon, Mar 29, 2021 at 02:43:48PM +0800, Chao Yu wrote:

...

> > > > +
> > > > +static int erofs_load_compr_cfgs(struct super_block *sb,
> > > > +				 struct erofs_super_block *dsb)
> > > > +{
> > > > +	struct erofs_sb_info *sbi;
> > > > +	struct page *page;
> > > > +	unsigned int algs, alg;
> > > > +	erofs_off_t offset;
> > > > +	int size, ret;
> > > > +
> > > > +	sbi = EROFS_SB(sb);
> > > > +	sbi->available_compr_algs = le16_to_cpu(dsb->u1.available_compr_algs);
> > > > +
> > > > +	if (sbi->available_compr_algs & ~Z_EROFS_ALL_COMPR_ALGS) {
> > > > +		erofs_err(sb,
> > > > +"try to load compressed image with unsupported algorithms %x",
> > > 
> > > Minor style issue:
> > > 
> > > 			"try to load compressed image with unsupported "
> > > 			"algorithms %x",
> > > 			sbi->available_compr_algs & ~Z_EROFS_ALL_COMPR_ALGS);
> > 
> > If I remembered correctly, kernel code style suggests "don't break the print
> > message, it'd more easy to grep". Actually such style above is from XFS, and
> > can pass checkpatch.pl check, see:
> > 
> > (fs/xfs/xfs_log_recover.c) xlog_recover():
> > 		/*
> > 		 * Version 5 superblock log feature mask validation. We know the
> > 		 * log is dirty so check if there are any unknown log features
> > 		 * in what we need to recover. If there are unknown features
> > 		 * (e.g. unsupported transactions, then simply reject the
> > 		 * attempt at recovery before touching anything.
> > 		 */
> > 		if (XFS_SB_VERSION_NUM(&log->l_mp->m_sb) == XFS_SB_VERSION_5 &&
> > 		    xfs_sb_has_incompat_log_feature(&log->l_mp->m_sb,
> > 					XFS_SB_FEAT_INCOMPAT_LOG_UNKNOWN)) {
> > 			xfs_warn(log->l_mp,
> > "Superblock has unknown incompatible log features (0x%x) enabled.",
> > 				(log->l_mp->m_sb.sb_features_log_incompat &
> > 					XFS_SB_FEAT_INCOMPAT_LOG_UNKNOWN));
> > 			xfs_warn(log->l_mp,
> > "The log can not be fully and/or safely recovered by this kernel.");
> > 			xfs_warn(log->l_mp,
> > "Please recover the log on a kernel that supports the unknown features.");
> > 			return -EINVAL;
> > 		}
> > 
> > If that does't look ok for us, I could use > 80 line for this instead,
> > but I tend to not break the message ..
> 
> Xiang,
> 
> Ah, I didn't notice this is following above style, if it's fine to you,
> let's use some tabs in front of message line, though it will cause
> exceeding 80 line warning.
> 

I found a reference here,
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/process/coding-style.rst?h=v5.11#n99
also vaguely remembered some threads from Linus, but hard to find now :-(

ok, I will insert tabs instead, thanks for the suggestion!

Thanks,
Gao Xiang


> Thanks,


WARNING: multiple messages have this Message-ID (diff)
From: Gao Xiang <hsiangkao@redhat.com>
To: Chao Yu <yuchao0@huawei.com>
Cc: linux-erofs@lists.ozlabs.org, LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v2 4/4] erofs: add on-disk compression configurations
Date: Mon, 29 Mar 2021 14:55:49 +0800	[thread overview]
Message-ID: <20210329065549.GB3281654@xiangao.remote.csb> (raw)
In-Reply-To: <3c0bf7e5-0924-3d85-56db-35a2d39dbb8d@huawei.com>

On Mon, Mar 29, 2021 at 02:43:48PM +0800, Chao Yu wrote:

...

> > > > +
> > > > +static int erofs_load_compr_cfgs(struct super_block *sb,
> > > > +				 struct erofs_super_block *dsb)
> > > > +{
> > > > +	struct erofs_sb_info *sbi;
> > > > +	struct page *page;
> > > > +	unsigned int algs, alg;
> > > > +	erofs_off_t offset;
> > > > +	int size, ret;
> > > > +
> > > > +	sbi = EROFS_SB(sb);
> > > > +	sbi->available_compr_algs = le16_to_cpu(dsb->u1.available_compr_algs);
> > > > +
> > > > +	if (sbi->available_compr_algs & ~Z_EROFS_ALL_COMPR_ALGS) {
> > > > +		erofs_err(sb,
> > > > +"try to load compressed image with unsupported algorithms %x",
> > > 
> > > Minor style issue:
> > > 
> > > 			"try to load compressed image with unsupported "
> > > 			"algorithms %x",
> > > 			sbi->available_compr_algs & ~Z_EROFS_ALL_COMPR_ALGS);
> > 
> > If I remembered correctly, kernel code style suggests "don't break the print
> > message, it'd more easy to grep". Actually such style above is from XFS, and
> > can pass checkpatch.pl check, see:
> > 
> > (fs/xfs/xfs_log_recover.c) xlog_recover():
> > 		/*
> > 		 * Version 5 superblock log feature mask validation. We know the
> > 		 * log is dirty so check if there are any unknown log features
> > 		 * in what we need to recover. If there are unknown features
> > 		 * (e.g. unsupported transactions, then simply reject the
> > 		 * attempt at recovery before touching anything.
> > 		 */
> > 		if (XFS_SB_VERSION_NUM(&log->l_mp->m_sb) == XFS_SB_VERSION_5 &&
> > 		    xfs_sb_has_incompat_log_feature(&log->l_mp->m_sb,
> > 					XFS_SB_FEAT_INCOMPAT_LOG_UNKNOWN)) {
> > 			xfs_warn(log->l_mp,
> > "Superblock has unknown incompatible log features (0x%x) enabled.",
> > 				(log->l_mp->m_sb.sb_features_log_incompat &
> > 					XFS_SB_FEAT_INCOMPAT_LOG_UNKNOWN));
> > 			xfs_warn(log->l_mp,
> > "The log can not be fully and/or safely recovered by this kernel.");
> > 			xfs_warn(log->l_mp,
> > "Please recover the log on a kernel that supports the unknown features.");
> > 			return -EINVAL;
> > 		}
> > 
> > If that does't look ok for us, I could use > 80 line for this instead,
> > but I tend to not break the message ..
> 
> Xiang,
> 
> Ah, I didn't notice this is following above style, if it's fine to you,
> let's use some tabs in front of message line, though it will cause
> exceeding 80 line warning.
> 

I found a reference here,
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/process/coding-style.rst?h=v5.11#n99
also vaguely remembered some threads from Linus, but hard to find now :-(

ok, I will insert tabs instead, thanks for the suggestion!

Thanks,
Gao Xiang


> Thanks,


  reply	other threads:[~2021-03-29  6:56 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20210329012308.28743-1-hsiangkao.ref@aol.com>
2021-03-29  1:23 ` [PATCH v2 0/4] erofs: introduce on-disk compression configurations Gao Xiang
2021-03-29  1:23   ` Gao Xiang via Linux-erofs
2021-03-29  1:23   ` [PATCH v2 1/4] erofs: introduce erofs_sb_has_xxx() helpers Gao Xiang
2021-03-29  1:23     ` Gao Xiang via Linux-erofs
2021-03-29  1:23   ` [PATCH v2 2/4] erofs: support adjust lz4 history window size Gao Xiang
2021-03-29  1:23     ` Gao Xiang via Linux-erofs
2021-03-29  1:23   ` [PATCH v2 3/4] erofs: introduce on-disk lz4 fs configurations Gao Xiang
2021-03-29  1:23     ` Gao Xiang via Linux-erofs
2021-03-29  1:23   ` [PATCH v2 4/4] erofs: add on-disk compression configurations Gao Xiang
2021-03-29  1:23     ` Gao Xiang via Linux-erofs
2021-03-29  6:26     ` Chao Yu
2021-03-29  6:26       ` Chao Yu
2021-03-29  6:36       ` Gao Xiang
2021-03-29  6:36         ` Gao Xiang
2021-03-29  6:43         ` Chao Yu
2021-03-29  6:43           ` Chao Yu
2021-03-29  6:55           ` Gao Xiang [this message]
2021-03-29  6:55             ` Gao Xiang
2021-03-29  7:52             ` Chao Yu
2021-03-29  7:52               ` Chao Yu
2021-03-29 10:00     ` [PATCH v3 " Gao Xiang
2021-03-29 10:00       ` Gao Xiang via Linux-erofs

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210329065549.GB3281654@xiangao.remote.csb \
    --to=hsiangkao@redhat.com \
    --cc=chao@kernel.org \
    --cc=hsiangkao@aol.com \
    --cc=linux-erofs@lists.ozlabs.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=yuchao0@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.