All of lore.kernel.org
 help / color / mirror / Atom feed
* [RFC/PATCH] mtd: ubi: Fix ubi free PEBs count calculation
@ 2014-04-01  8:02 ` Tanya Brokhman
  0 siblings, 0 replies; 7+ messages in thread
From: Tanya Brokhman @ 2014-04-01  8:02 UTC (permalink / raw)
  To: dedekind1; +Cc: linux-mtd, Tanya Brokhman, open list

The ubi->free_count should be updated with every insert/remove to/from
the ubi->free list.

Signed-off-by: Tanya Brokhman <tlinder@codeaurora.org>

diff --git a/drivers/mtd/ubi/wl.c b/drivers/mtd/ubi/wl.c
index 9a36f78..ca74d19 100644
--- a/drivers/mtd/ubi/wl.c
+++ b/drivers/mtd/ubi/wl.c
@@ -690,6 +690,8 @@ static struct ubi_wl_entry *get_peb_for_wl(struct ubi_device *ubi)
 
 	e = find_wl_entry(ubi, &ubi->free, WL_FREE_MAX_DIFF);
 	self_check_in_wl_tree(ubi, e, &ubi->free);
+	ubi->free_count--;
+	ubi_assert(ubi->free_count >= 0);
 	rb_erase(&e->u.rb, &ubi->free);
 
 	return e;
@@ -1090,6 +1092,7 @@ static int wear_leveling_worker(struct ubi_device *ubi, struct ubi_work *wrk,
 
 			/* Give the unused PEB back */
 			wl_tree_add(e2, &ubi->free);
+			ubi->free_count++;
 			goto out_cancel;
 		}
 		self_check_in_wl_tree(ubi, e1, &ubi->used);
-- 
1.7.6
-- 
QUALCOMM ISRAEL, on behalf of Qualcomm Innovation Center, Inc. is a member
of Code Aurora Forum, hosted by The Linux Foundat


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

* [RFC/PATCH] mtd: ubi: Fix ubi free PEBs count calculation
@ 2014-04-01  8:02 ` Tanya Brokhman
  0 siblings, 0 replies; 7+ messages in thread
From: Tanya Brokhman @ 2014-04-01  8:02 UTC (permalink / raw)
  To: dedekind1; +Cc: linux-mtd, open list, Tanya Brokhman

The ubi->free_count should be updated with every insert/remove to/from
the ubi->free list.

Signed-off-by: Tanya Brokhman <tlinder@codeaurora.org>

diff --git a/drivers/mtd/ubi/wl.c b/drivers/mtd/ubi/wl.c
index 9a36f78..ca74d19 100644
--- a/drivers/mtd/ubi/wl.c
+++ b/drivers/mtd/ubi/wl.c
@@ -690,6 +690,8 @@ static struct ubi_wl_entry *get_peb_for_wl(struct ubi_device *ubi)
 
 	e = find_wl_entry(ubi, &ubi->free, WL_FREE_MAX_DIFF);
 	self_check_in_wl_tree(ubi, e, &ubi->free);
+	ubi->free_count--;
+	ubi_assert(ubi->free_count >= 0);
 	rb_erase(&e->u.rb, &ubi->free);
 
 	return e;
@@ -1090,6 +1092,7 @@ static int wear_leveling_worker(struct ubi_device *ubi, struct ubi_work *wrk,
 
 			/* Give the unused PEB back */
 			wl_tree_add(e2, &ubi->free);
+			ubi->free_count++;
 			goto out_cancel;
 		}
 		self_check_in_wl_tree(ubi, e1, &ubi->used);
-- 
1.7.6
-- 
QUALCOMM ISRAEL, on behalf of Qualcomm Innovation Center, Inc. is a member
of Code Aurora Forum, hosted by The Linux Foundat

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

* RE: [RFC/PATCH] mtd: ubi: Fix ubi free PEBs count calculation
  2014-04-01  8:02 ` Tanya Brokhman
@ 2014-04-07  5:21   ` Dolev Raviv
  -1 siblings, 0 replies; 7+ messages in thread
From: Dolev Raviv @ 2014-04-07  5:21 UTC (permalink / raw)
  To: 'Tanya Brokhman', dedekind1; +Cc: linux-mtd, 'open list'

Reviewed-by: Dolev Raviv <draviv@codeaurora.org>

Thanks,
Dolev
-- 
QUALCOMM ISRAEL, on behalf of Qualcomm Innovation Center, Inc. is a member
of Code Aurora Forum, hosted by The Linux Foundation

-----Original Message-----
From: linux-mtd [mailto:linux-mtd-bounces@lists.infradead.org] On Behalf Of
Tanya Brokhman
Sent: Tuesday, April 01, 2014 11:02 AM
To: dedekind1@gmail.com
Cc: linux-mtd@lists.infradead.org; open list; Tanya Brokhman
Subject: [RFC/PATCH] mtd: ubi: Fix ubi free PEBs count calculation

The ubi->free_count should be updated with every insert/remove to/from the
ubi->free list.

Signed-off-by: Tanya Brokhman <tlinder@codeaurora.org>

diff --git a/drivers/mtd/ubi/wl.c b/drivers/mtd/ubi/wl.c index
9a36f78..ca74d19 100644
--- a/drivers/mtd/ubi/wl.c
+++ b/drivers/mtd/ubi/wl.c
@@ -690,6 +690,8 @@ static struct ubi_wl_entry *get_peb_for_wl(struct
ubi_device *ubi)
 
 	e = find_wl_entry(ubi, &ubi->free, WL_FREE_MAX_DIFF);
 	self_check_in_wl_tree(ubi, e, &ubi->free);
+	ubi->free_count--;
+	ubi_assert(ubi->free_count >= 0);
 	rb_erase(&e->u.rb, &ubi->free);
 
 	return e;
@@ -1090,6 +1092,7 @@ static int wear_leveling_worker(struct ubi_device
*ubi, struct ubi_work *wrk,
 
 			/* Give the unused PEB back */
 			wl_tree_add(e2, &ubi->free);
+			ubi->free_count++;
 			goto out_cancel;
 		}
 		self_check_in_wl_tree(ubi, e1, &ubi->used);
--
1.7.6
--
QUALCOMM ISRAEL, on behalf of Qualcomm Innovation Center, Inc. is a member
of Code Aurora Forum, hosted by The Linux Foundat


______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/


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

* RE: [RFC/PATCH] mtd: ubi: Fix ubi free PEBs count calculation
@ 2014-04-07  5:21   ` Dolev Raviv
  0 siblings, 0 replies; 7+ messages in thread
From: Dolev Raviv @ 2014-04-07  5:21 UTC (permalink / raw)
  To: 'Tanya Brokhman', dedekind1; +Cc: linux-mtd, 'open list'

Reviewed-by: Dolev Raviv <draviv@codeaurora.org>

Thanks,
Dolev
-- 
QUALCOMM ISRAEL, on behalf of Qualcomm Innovation Center, Inc. is a member
of Code Aurora Forum, hosted by The Linux Foundation

-----Original Message-----
From: linux-mtd [mailto:linux-mtd-bounces@lists.infradead.org] On Behalf Of
Tanya Brokhman
Sent: Tuesday, April 01, 2014 11:02 AM
To: dedekind1@gmail.com
Cc: linux-mtd@lists.infradead.org; open list; Tanya Brokhman
Subject: [RFC/PATCH] mtd: ubi: Fix ubi free PEBs count calculation

The ubi->free_count should be updated with every insert/remove to/from the
ubi->free list.

Signed-off-by: Tanya Brokhman <tlinder@codeaurora.org>

diff --git a/drivers/mtd/ubi/wl.c b/drivers/mtd/ubi/wl.c index
9a36f78..ca74d19 100644
--- a/drivers/mtd/ubi/wl.c
+++ b/drivers/mtd/ubi/wl.c
@@ -690,6 +690,8 @@ static struct ubi_wl_entry *get_peb_for_wl(struct
ubi_device *ubi)
 
 	e = find_wl_entry(ubi, &ubi->free, WL_FREE_MAX_DIFF);
 	self_check_in_wl_tree(ubi, e, &ubi->free);
+	ubi->free_count--;
+	ubi_assert(ubi->free_count >= 0);
 	rb_erase(&e->u.rb, &ubi->free);
 
 	return e;
@@ -1090,6 +1092,7 @@ static int wear_leveling_worker(struct ubi_device
*ubi, struct ubi_work *wrk,
 
 			/* Give the unused PEB back */
 			wl_tree_add(e2, &ubi->free);
+			ubi->free_count++;
 			goto out_cancel;
 		}
 		self_check_in_wl_tree(ubi, e1, &ubi->used);
--
1.7.6
--
QUALCOMM ISRAEL, on behalf of Qualcomm Innovation Center, Inc. is a member
of Code Aurora Forum, hosted by The Linux Foundat


______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

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

* Re: [RFC/PATCH] mtd: ubi: Fix ubi free PEBs count calculation
  2014-04-01  8:02 ` Tanya Brokhman
@ 2014-04-07 13:18   ` Richard Weinberger
  -1 siblings, 0 replies; 7+ messages in thread
From: Richard Weinberger @ 2014-04-07 13:18 UTC (permalink / raw)
  To: Tanya Brokhman; +Cc: Artem Bityutskiy, linux-mtd, open list

On Tue, Apr 1, 2014 at 10:02 AM, Tanya Brokhman <tlinder@codeaurora.org> wrote:
> The ubi->free_count should be updated with every insert/remove to/from
> the ubi->free list.
>
> Signed-off-by: Tanya Brokhman <tlinder@codeaurora.org>
>
> diff --git a/drivers/mtd/ubi/wl.c b/drivers/mtd/ubi/wl.c
> index 9a36f78..ca74d19 100644
> --- a/drivers/mtd/ubi/wl.c
> +++ b/drivers/mtd/ubi/wl.c
> @@ -690,6 +690,8 @@ static struct ubi_wl_entry *get_peb_for_wl(struct ubi_device *ubi)
>
>         e = find_wl_entry(ubi, &ubi->free, WL_FREE_MAX_DIFF);
>         self_check_in_wl_tree(ubi, e, &ubi->free);
> +       ubi->free_count--;
> +       ubi_assert(ubi->free_count >= 0);
>         rb_erase(&e->u.rb, &ubi->free);
>
>         return e;
> @@ -1090,6 +1092,7 @@ static int wear_leveling_worker(struct ubi_device *ubi, struct ubi_work *wrk,
>
>                         /* Give the unused PEB back */
>                         wl_tree_add(e2, &ubi->free);
> +                       ubi->free_count++;
>                         goto out_cancel;
>                 }
>                 self_check_in_wl_tree(ubi, e1, &ubi->used);
> --

Acked-by: Richard Weinberger <richard@nod.at>

-- 
Thanks,
//richard

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

* Re: [RFC/PATCH] mtd: ubi: Fix ubi free PEBs count calculation
@ 2014-04-07 13:18   ` Richard Weinberger
  0 siblings, 0 replies; 7+ messages in thread
From: Richard Weinberger @ 2014-04-07 13:18 UTC (permalink / raw)
  To: Tanya Brokhman; +Cc: linux-mtd, open list, Artem Bityutskiy

On Tue, Apr 1, 2014 at 10:02 AM, Tanya Brokhman <tlinder@codeaurora.org> wrote:
> The ubi->free_count should be updated with every insert/remove to/from
> the ubi->free list.
>
> Signed-off-by: Tanya Brokhman <tlinder@codeaurora.org>
>
> diff --git a/drivers/mtd/ubi/wl.c b/drivers/mtd/ubi/wl.c
> index 9a36f78..ca74d19 100644
> --- a/drivers/mtd/ubi/wl.c
> +++ b/drivers/mtd/ubi/wl.c
> @@ -690,6 +690,8 @@ static struct ubi_wl_entry *get_peb_for_wl(struct ubi_device *ubi)
>
>         e = find_wl_entry(ubi, &ubi->free, WL_FREE_MAX_DIFF);
>         self_check_in_wl_tree(ubi, e, &ubi->free);
> +       ubi->free_count--;
> +       ubi_assert(ubi->free_count >= 0);
>         rb_erase(&e->u.rb, &ubi->free);
>
>         return e;
> @@ -1090,6 +1092,7 @@ static int wear_leveling_worker(struct ubi_device *ubi, struct ubi_work *wrk,
>
>                         /* Give the unused PEB back */
>                         wl_tree_add(e2, &ubi->free);
> +                       ubi->free_count++;
>                         goto out_cancel;
>                 }
>                 self_check_in_wl_tree(ubi, e1, &ubi->used);
> --

Acked-by: Richard Weinberger <richard@nod.at>

-- 
Thanks,
//richard

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

* Re: [RFC/PATCH] mtd: ubi: Fix ubi free PEBs count calculation
  2014-04-01  8:02 ` Tanya Brokhman
                   ` (2 preceding siblings ...)
  (?)
@ 2014-04-08 13:44 ` Artem Bityutskiy
  -1 siblings, 0 replies; 7+ messages in thread
From: Artem Bityutskiy @ 2014-04-08 13:44 UTC (permalink / raw)
  To: Tanya Brokhman; +Cc: linux-mtd, open list

On Tue, 2014-04-01 at 11:02 +0300, Tanya Brokhman wrote:
> The ubi->free_count should be updated with every insert/remove to/from
> the ubi->free list.
> 
> Signed-off-by: Tanya Brokhman <tlinder@codeaurora.org>

Pushed to linux-ubifs.git / master, thanks!

-- 
Best Regards,
Artem Bityutskiy


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

end of thread, other threads:[~2014-04-08 14:11 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-04-01  8:02 [RFC/PATCH] mtd: ubi: Fix ubi free PEBs count calculation Tanya Brokhman
2014-04-01  8:02 ` Tanya Brokhman
2014-04-07  5:21 ` Dolev Raviv
2014-04-07  5:21   ` Dolev Raviv
2014-04-07 13:18 ` Richard Weinberger
2014-04-07 13:18   ` Richard Weinberger
2014-04-08 13:44 ` Artem Bityutskiy

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.