* [PATCH] btrfs: fix memory leak during RAID 5/6 device replacement
@ 2016-05-09 13:14 Scott Talbert
2016-05-09 17:32 ` David Sterba
0 siblings, 1 reply; 4+ messages in thread
From: Scott Talbert @ 2016-05-09 13:14 UTC (permalink / raw)
To: linux-btrfs
A 'struct bio' is allocated in scrub_missing_raid56_pages(), but it was never
freed anywhere.
Signed-off-by: Scott Talbert <scott.talbert@hgst.com>
---
fs/btrfs/scrub.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/fs/btrfs/scrub.c b/fs/btrfs/scrub.c
index 82bedf9..607cc6e 100644
--- a/fs/btrfs/scrub.c
+++ b/fs/btrfs/scrub.c
@@ -2130,6 +2130,8 @@ static void scrub_missing_raid56_end_io(struct bio *bio)
if (bio->bi_error)
sblock->no_io_error_seen = 0;
+ bio_put(bio);
+
btrfs_queue_work(fs_info->scrub_workers, &sblock->work);
}
--
1.9.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] btrfs: fix memory leak during RAID 5/6 device replacement
2016-05-09 13:14 [PATCH] btrfs: fix memory leak during RAID 5/6 device replacement Scott Talbert
@ 2016-05-09 17:32 ` David Sterba
2016-05-13 10:31 ` Zhao Lei
2016-05-16 12:34 ` Zhao Lei
0 siblings, 2 replies; 4+ messages in thread
From: David Sterba @ 2016-05-09 17:32 UTC (permalink / raw)
To: Scott Talbert; +Cc: linux-btrfs, Zhao Lei
CC Zhao Lei <zhaolei@cn.fujitsu.com>
On Mon, May 09, 2016 at 09:14:28AM -0400, Scott Talbert wrote:
> A 'struct bio' is allocated in scrub_missing_raid56_pages(), but it was never
> freed anywhere.
>
> Signed-off-by: Scott Talbert <scott.talbert@hgst.com>
> ---
> fs/btrfs/scrub.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/fs/btrfs/scrub.c b/fs/btrfs/scrub.c
> index 82bedf9..607cc6e 100644
> --- a/fs/btrfs/scrub.c
> +++ b/fs/btrfs/scrub.c
> @@ -2130,6 +2130,8 @@ static void scrub_missing_raid56_end_io(struct bio *bio)
> if (bio->bi_error)
> sblock->no_io_error_seen = 0;
>
> + bio_put(bio);
> +
> btrfs_queue_work(fs_info->scrub_workers, &sblock->work);
> }
>
> --
> 1.9.1
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 4+ messages in thread
* RE: [PATCH] btrfs: fix memory leak during RAID 5/6 device replacement
2016-05-09 17:32 ` David Sterba
@ 2016-05-13 10:31 ` Zhao Lei
2016-05-16 12:34 ` Zhao Lei
1 sibling, 0 replies; 4+ messages in thread
From: Zhao Lei @ 2016-05-13 10:31 UTC (permalink / raw)
To: dsterba, 'Scott Talbert'; +Cc: linux-btrfs
Hi, Scott Talbert
* From: David Sterba [mailto:dsterba@suse.cz]
> Sent: Tuesday, May 10, 2016 1:32 AM
> To: Scott Talbert <scott.talbert@hgst.com>
> Cc: linux-btrfs@vger.kernel.org; Zhao Lei <zhaolei@cn.fujitsu.com>
> Subject: Re: [PATCH] btrfs: fix memory leak during RAID 5/6 device replacement
>
> CC Zhao Lei <zhaolei@cn.fujitsu.com>
>
> On Mon, May 09, 2016 at 09:14:28AM -0400, Scott Talbert wrote:
> > A 'struct bio' is allocated in scrub_missing_raid56_pages(), but it was never
> > freed anywhere.
> >
> > Signed-off-by: Scott Talbert <scott.talbert@hgst.com>
> > ---
> > fs/btrfs/scrub.c | 2 ++
> > 1 file changed, 2 insertions(+)
> >
> > diff --git a/fs/btrfs/scrub.c b/fs/btrfs/scrub.c
> > index 82bedf9..607cc6e 100644
> > --- a/fs/btrfs/scrub.c
> > +++ b/fs/btrfs/scrub.c
> > @@ -2130,6 +2130,8 @@ static void scrub_missing_raid56_end_io(struct
> bio *bio)
> > if (bio->bi_error)
> > sblock->no_io_error_seen = 0;
> >
> > + bio_put(bio);
> > +
Seems good by reviewing.
I'll add some debug code to test it more detailedly.
Thanks
Zhaolei
> > btrfs_queue_work(fs_info->scrub_workers, &sblock->work);
> > }
> >
> > --
> > 1.9.1
> >
> > --
> > To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
> > the body of a message to majordomo@vger.kernel.org
> > More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 4+ messages in thread
* RE: [PATCH] btrfs: fix memory leak during RAID 5/6 device replacement
2016-05-09 17:32 ` David Sterba
2016-05-13 10:31 ` Zhao Lei
@ 2016-05-16 12:34 ` Zhao Lei
1 sibling, 0 replies; 4+ messages in thread
From: Zhao Lei @ 2016-05-16 12:34 UTC (permalink / raw)
To: dsterba, 'Scott Talbert'; +Cc: linux-btrfs
Hi, Scott Talbert
> From: Zhao Lei [mailto:zhaolei@cn.fujitsu.com]
> Sent: Friday, May 13, 2016 6:31 PM
> To: 'dsterba@suse.cz' <dsterba@suse.cz>; 'Scott Talbert'
> <scott.talbert@hgst.com>
> Cc: 'linux-btrfs@vger.kernel.org' <linux-btrfs@vger.kernel.org>
> Subject: RE: [PATCH] btrfs: fix memory leak during RAID 5/6 device replacement
>
> Hi, Scott Talbert
>
> * From: David Sterba [mailto:dsterba@suse.cz]
> > Sent: Tuesday, May 10, 2016 1:32 AM
> > To: Scott Talbert <scott.talbert@hgst.com>
> > Cc: linux-btrfs@vger.kernel.org; Zhao Lei <zhaolei@cn.fujitsu.com>
> > Subject: Re: [PATCH] btrfs: fix memory leak during RAID 5/6 device
> replacement
> >
> > CC Zhao Lei <zhaolei@cn.fujitsu.com>
> >
> > On Mon, May 09, 2016 at 09:14:28AM -0400, Scott Talbert wrote:
> > > A 'struct bio' is allocated in scrub_missing_raid56_pages(), but it was never
> > > freed anywhere.
> > >
> > > Signed-off-by: Scott Talbert <scott.talbert@hgst.com>
> > > ---
> > > fs/btrfs/scrub.c | 2 ++
> > > 1 file changed, 2 insertions(+)
> > >
> > > diff --git a/fs/btrfs/scrub.c b/fs/btrfs/scrub.c
> > > index 82bedf9..607cc6e 100644
> > > --- a/fs/btrfs/scrub.c
> > > +++ b/fs/btrfs/scrub.c
> > > @@ -2130,6 +2130,8 @@ static void scrub_missing_raid56_end_io(struct
> > bio *bio)
> > > if (bio->bi_error)
> > > sblock->no_io_error_seen = 0;
> > >
> > > + bio_put(bio);
> > > +
> Seems good by reviewing.
> I'll add some debug code to test it more detailedly.
>
Signed-off-by: Zhao Lei <zhaolei@cn.fujitsu.com>
Test-by: Zhao Lei <zhaolei@cn.fujitsu.com>
Thanks
Zhaolei
> Thanks
> Zhaolei
>
> > > btrfs_queue_work(fs_info->scrub_workers, &sblock->work);
> > > }
> > >
> > > --
> > > 1.9.1
> > >
> > > --
> > > To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
> > > the body of a message to majordomo@vger.kernel.org
> > > More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2016-05-16 12:34 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-05-09 13:14 [PATCH] btrfs: fix memory leak during RAID 5/6 device replacement Scott Talbert
2016-05-09 17:32 ` David Sterba
2016-05-13 10:31 ` Zhao Lei
2016-05-16 12:34 ` Zhao Lei
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.