[PATCH] mm/fs: Remove redundant code

Jiapeng Chong posted 1 patch 4 years, 4 months ago
fs/nilfs2/segbuf.c | 4 ----
1 file changed, 4 deletions(-)
[PATCH] mm/fs: Remove redundant code
Posted by Jiapeng Chong 4 years, 4 months ago
Clean up the following smatch warning:

fs/nilfs2/segbuf.c:358 nilfs_segbuf_submit_bio() warn: ignoring
unreachable code.

Reported-by: Abaci Robot <abaci@linux.alibaba.com>
Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
---
 fs/nilfs2/segbuf.c | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/fs/nilfs2/segbuf.c b/fs/nilfs2/segbuf.c
index 9e5dd6324ea1..50d7e2e4daed 100644
--- a/fs/nilfs2/segbuf.c
+++ b/fs/nilfs2/segbuf.c
@@ -341,7 +341,6 @@ static int nilfs_segbuf_submit_bio(struct nilfs_segment_buffer *segbuf,
 				   int mode_flags)
 {
 	struct bio *bio = wi->bio;
-	int err;
 
 	bio->bi_end_io = nilfs_end_bio_write;
 	bio->bi_private = segbuf;
@@ -354,9 +353,6 @@ static int nilfs_segbuf_submit_bio(struct nilfs_segment_buffer *segbuf,
 	wi->nr_vecs = min(wi->max_pages, wi->rest_blocks);
 	wi->start = wi->end;
 	return 0;
-
-	wi->bio = NULL;
-	return err;
 }
 
 static void nilfs_segbuf_prepare_write(struct nilfs_segment_buffer *segbuf,
-- 
2.20.1.7.g153144c

Re: [PATCH] mm/fs: Remove redundant code
Posted by Ryusuke Konishi 4 years, 4 months ago
Hi Jiapeng,

On Mon, Feb 7, 2022 at 7:37 PM Jiapeng Chong
<jiapeng.chong@linux.alibaba.com> wrote:
>
> Clean up the following smatch warning:
>
> fs/nilfs2/segbuf.c:358 nilfs_segbuf_submit_bio() warn: ignoring
> unreachable code.
>
> Reported-by: Abaci Robot <abaci@linux.alibaba.com>
> Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
> ---
>  fs/nilfs2/segbuf.c | 4 ----
>  1 file changed, 4 deletions(-)
>
> diff --git a/fs/nilfs2/segbuf.c b/fs/nilfs2/segbuf.c
> index 9e5dd6324ea1..50d7e2e4daed 100644
> --- a/fs/nilfs2/segbuf.c
> +++ b/fs/nilfs2/segbuf.c
> @@ -341,7 +341,6 @@ static int nilfs_segbuf_submit_bio(struct nilfs_segment_buffer *segbuf,
>                                    int mode_flags)
>  {
>         struct bio *bio = wi->bio;
> -       int err;
>
>         bio->bi_end_io = nilfs_end_bio_write;
>         bio->bi_private = segbuf;
> @@ -354,9 +353,6 @@ static int nilfs_segbuf_submit_bio(struct nilfs_segment_buffer *segbuf,
>         wi->nr_vecs = min(wi->max_pages, wi->rest_blocks);
>         wi->start = wi->end;
>         return 0;
> -
> -       wi->bio = NULL;
> -       return err;
>  }

Sorry for my late reply.

I will send this to Andrew to report and fix the regression on the -mm
patch series.

I'd like to change the patch title to something like "nilfs2: Remove
redundant code"
since the "mm/fs" prefix does not properly represent what it applies to.
(this patch may be folded into the patch that is causing the warning)

Regards,
Ryusuke Konishi
Re: [PATCH] mm/fs: Remove redundant code
Posted by Ryusuke Konishi 4 years, 4 months ago
Hi,

On Fri, Feb 25, 2022 at 2:30 AM Ryusuke Konishi
<konishi.ryusuke@gmail.com> wrote:
>
> Hi Jiapeng,
>
> On Mon, Feb 7, 2022 at 7:37 PM Jiapeng Chong
> <jiapeng.chong@linux.alibaba.com> wrote:
> >
> > Clean up the following smatch warning:
> >
> > fs/nilfs2/segbuf.c:358 nilfs_segbuf_submit_bio() warn: ignoring
> > unreachable code.
> >
> > Reported-by: Abaci Robot <abaci@linux.alibaba.com>
> > Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
> > ---
> >  fs/nilfs2/segbuf.c | 4 ----
> >  1 file changed, 4 deletions(-)
> >
> > diff --git a/fs/nilfs2/segbuf.c b/fs/nilfs2/segbuf.c
> > index 9e5dd6324ea1..50d7e2e4daed 100644
> > --- a/fs/nilfs2/segbuf.c
> > +++ b/fs/nilfs2/segbuf.c
> > @@ -341,7 +341,6 @@ static int nilfs_segbuf_submit_bio(struct nilfs_segment_buffer *segbuf,
> >                                    int mode_flags)
> >  {
> >         struct bio *bio = wi->bio;
> > -       int err;
> >
> >         bio->bi_end_io = nilfs_end_bio_write;
> >         bio->bi_private = segbuf;
> > @@ -354,9 +353,6 @@ static int nilfs_segbuf_submit_bio(struct nilfs_segment_buffer *segbuf,
> >         wi->nr_vecs = min(wi->max_pages, wi->rest_blocks);
> >         wi->start = wi->end;
> >         return 0;
> > -
> > -       wi->bio = NULL;
> > -       return err;
> >  }
>
> Sorry for my late reply.
>
> I will send this to Andrew to report and fix the regression on the -mm
> patch series.
>
> I'd like to change the patch title to something like "nilfs2: Remove
> redundant code"
> since the "mm/fs" prefix does not properly represent what it applies to.
> (this patch may be folded into the patch that is causing the warning)
>
> Regards,
> Ryusuke Konishi

Sorry again.

The reported issue was already corrected in NeilBrown's revised patch set, so I
will suspend this.

Thanks,
Ryusuke Konishi