linux-erofs.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH -next] erofs: fix error return code in erofs_read_superblock()
@ 2021-05-19 14:16 Wei Yongjun
  2021-05-20  5:32 ` Dan Carpenter
  0 siblings, 1 reply; 5+ messages in thread
From: Wei Yongjun @ 2021-05-19 14:16 UTC (permalink / raw)
  To: weiyongjun1, Gao Xiang, Chao Yu
  Cc: kernel-janitors, linux-erofs, linux-kernel, Hulk Robot

'ret' will be overwritten to 0 if erofs_sb_has_sb_chksum() return true,
thus 0 will return in some error handling cases. Fix to return negative
error code -EINVAL instead of 0.

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
---
 fs/erofs/super.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/fs/erofs/super.c b/fs/erofs/super.c
index bbf3bbd908e0..22991d22af5a 100644
--- a/fs/erofs/super.c
+++ b/fs/erofs/super.c
@@ -285,6 +285,7 @@ static int erofs_read_superblock(struct super_block *sb)
 			goto out;
 	}
 
+	ret = -EINVAL;
 	blkszbits = dsb->blkszbits;
 	/* 9(512 bytes) + LOG_SECTORS_PER_BLOCK == LOG_BLOCK_SIZE */
 	if (blkszbits != LOG_BLOCK_SIZE) {


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

* Re: [PATCH -next] erofs: fix error return code in erofs_read_superblock()
  2021-05-19 14:16 [PATCH -next] erofs: fix error return code in erofs_read_superblock() Wei Yongjun
@ 2021-05-20  5:32 ` Dan Carpenter
  2021-05-20  8:40   ` Gao Xiang
  0 siblings, 1 reply; 5+ messages in thread
From: Dan Carpenter @ 2021-05-20  5:32 UTC (permalink / raw)
  To: Wei Yongjun, Pratik Shinde
  Cc: kernel-janitors, linux-kernel, Hulk Robot, Gao Xiang, linux-erofs

On Wed, May 19, 2021 at 02:16:57PM +0000, Wei Yongjun wrote:
> 'ret' will be overwritten to 0 if erofs_sb_has_sb_chksum() return true,
> thus 0 will return in some error handling cases. Fix to return negative
> error code -EINVAL instead of 0.
> 
> Reported-by: Hulk Robot <hulkci@huawei.com>
> Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>

You need to add Fixes tags to bug fix patches and you need to ensure
that the authors of the Fixes commit are CC'd so they can review your
fix.  get_maintainer.pl will add the author automatically, but normally
I like to put them in the To header to make sure they see it.

Fixes: b858a4844cfb ("erofs: support superblock checksum")

regards,
dan carpenter


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

* Re: [PATCH -next] erofs: fix error return code in erofs_read_superblock()
  2021-05-20  5:32 ` Dan Carpenter
@ 2021-05-20  8:40   ` Gao Xiang
  2021-05-21  1:14     ` Chao Yu
  0 siblings, 1 reply; 5+ messages in thread
From: Gao Xiang @ 2021-05-20  8:40 UTC (permalink / raw)
  To: Dan Carpenter, Wei Yongjun
  Cc: kernel-janitors, linux-kernel, Hulk Robot, Gao Xiang, linux-erofs

Hi Yongjun and Dan,

On Thu, May 20, 2021 at 08:32:26AM +0300, Dan Carpenter wrote:
> On Wed, May 19, 2021 at 02:16:57PM +0000, Wei Yongjun wrote:
> > 'ret' will be overwritten to 0 if erofs_sb_has_sb_chksum() return true,
> > thus 0 will return in some error handling cases. Fix to return negative
> > error code -EINVAL instead of 0.
> > 
> > Reported-by: Hulk Robot <hulkci@huawei.com>
> > Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
> 
> You need to add Fixes tags to bug fix patches and you need to ensure
> that the authors of the Fixes commit are CC'd so they can review your
> fix.  get_maintainer.pl will add the author automatically, but normally
> I like to put them in the To header to make sure they see it.
> 
> Fixes: b858a4844cfb ("erofs: support superblock checksum")

The commit and the tag look good to me (sorry for a bit delay on this),

Fixes: b858a4844cfb ("erofs: support superblock checksum")
Cc: stable <stable@vger.kernel.org> # 5.5+
Reviewed-by: Gao Xiang <xiang@kernel.org>

(will apply to dev-test for a while and then to -next.)

Thanks,
Gao Xiang


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

* Re: [PATCH -next] erofs: fix error return code in erofs_read_superblock()
  2021-05-20  8:40   ` Gao Xiang
@ 2021-05-21  1:14     ` Chao Yu
  2021-05-21  1:57       ` Gao Xiang
  0 siblings, 1 reply; 5+ messages in thread
From: Chao Yu @ 2021-05-21  1:14 UTC (permalink / raw)
  To: Gao Xiang, Dan Carpenter, Wei Yongjun
  Cc: Hulk Robot, linux-erofs, kernel-janitors, linux-kernel

On 2021/5/20 16:40, Gao Xiang wrote:
> Hi Yongjun and Dan,
> 
> On Thu, May 20, 2021 at 08:32:26AM +0300, Dan Carpenter wrote:
>> On Wed, May 19, 2021 at 02:16:57PM +0000, Wei Yongjun wrote:
>>> 'ret' will be overwritten to 0 if erofs_sb_has_sb_chksum() return true,
>>> thus 0 will return in some error handling cases. Fix to return negative
>>> error code -EINVAL instead of 0.
>>>
>>> Reported-by: Hulk Robot <hulkci@huawei.com>
>>> Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
>>
>> You need to add Fixes tags to bug fix patches and you need to ensure
>> that the authors of the Fixes commit are CC'd so they can review your
>> fix.  get_maintainer.pl will add the author automatically, but normally
>> I like to put them in the To header to make sure they see it.
>>
>> Fixes: b858a4844cfb ("erofs: support superblock checksum")
> 
> The commit and the tag look good to me (sorry for a bit delay on this),
> 
> Fixes: b858a4844cfb ("erofs: support superblock checksum")
> Cc: stable <stable@vger.kernel.org> # 5.5+
> Reviewed-by: Gao Xiang <xiang@kernel.org>

Reviewed-by: Chao Yu <yuchao0@huawei.com>

Thanks,

> 
> (will apply to dev-test for a while and then to -next.)
> 
> Thanks,
> Gao Xiang
> 
> .
> 

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

* Re: [PATCH -next] erofs: fix error return code in erofs_read_superblock()
  2021-05-21  1:14     ` Chao Yu
@ 2021-05-21  1:57       ` Gao Xiang
  0 siblings, 0 replies; 5+ messages in thread
From: Gao Xiang @ 2021-05-21  1:57 UTC (permalink / raw)
  To: Chao Yu
  Cc: kernel-janitors, linux-kernel, Hulk Robot, Wei Yongjun,
	Gao Xiang, linux-erofs, Dan Carpenter

On Fri, May 21, 2021 at 09:14:58AM +0800, Chao Yu wrote:
> On 2021/5/20 16:40, Gao Xiang wrote:
> > Hi Yongjun and Dan,
> > 
> > On Thu, May 20, 2021 at 08:32:26AM +0300, Dan Carpenter wrote:
> > > On Wed, May 19, 2021 at 02:16:57PM +0000, Wei Yongjun wrote:
> > > > 'ret' will be overwritten to 0 if erofs_sb_has_sb_chksum() return true,
> > > > thus 0 will return in some error handling cases. Fix to return negative
> > > > error code -EINVAL instead of 0.
> > > > 
> > > > Reported-by: Hulk Robot <hulkci@huawei.com>
> > > > Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
> > > 
> > > You need to add Fixes tags to bug fix patches and you need to ensure
> > > that the authors of the Fixes commit are CC'd so they can review your
> > > fix.  get_maintainer.pl will add the author automatically, but normally
> > > I like to put them in the To header to make sure they see it.
> > > 
> > > Fixes: b858a4844cfb ("erofs: support superblock checksum")
> > 
> > The commit and the tag look good to me (sorry for a bit delay on this),
> > 
> > Fixes: b858a4844cfb ("erofs: support superblock checksum")
> > Cc: stable <stable@vger.kernel.org> # 5.5+
> > Reviewed-by: Gao Xiang <xiang@kernel.org>
> 
> Reviewed-by: Chao Yu <yuchao0@huawei.com>

Thanks Chao, will add soon. :)

> 
> Thanks,
> 
> > 
> > (will apply to dev-test for a while and then to -next.)
> > 
> > Thanks,
> > Gao Xiang
> > 
> > .
> > 

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

end of thread, other threads:[~2021-05-21  1:57 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-19 14:16 [PATCH -next] erofs: fix error return code in erofs_read_superblock() Wei Yongjun
2021-05-20  5:32 ` Dan Carpenter
2021-05-20  8:40   ` Gao Xiang
2021-05-21  1:14     ` Chao Yu
2021-05-21  1:57       ` Gao Xiang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).