All of lore.kernel.org
 help / color / mirror / Atom feed
* ubi_assert(list_empty(&used)) in ubi_attach_fastmap
@ 2015-05-22  0:31 Nikhilesh Reddy
  2015-05-22  7:05 ` Richard Weinberger
  0 siblings, 1 reply; 2+ messages in thread
From: Nikhilesh Reddy @ 2015-05-22  0:31 UTC (permalink / raw)
  To: linux-mtd

Hi

I am running kernel 3.10.

I recently saw an issue where ubi_assert(list_empty(&used)) in 
ubi_attach_fastmap always hits on a partition.

Searching this issue I found
http://git.infradead.org/linux-ubifs.git/commitdiff/a83832a7c8d023f446ec865926190951bd18a4b1?hp=36a87e44f642966442fd0d23f2ec536851e00236
diff --git a/drivers/mtd/ubi/fastmap.c b/drivers/mtd/ubi/fastmap.c
index 600c4f9..9858bfb 100644 (file)
--- a/drivers/mtd/ubi/fastmap.c
+++ b/drivers/mtd/ubi/fastmap.c
@@ -814,7 +814,9 @@ static int ubi_attach_fastmap(struct ubi_device *ubi,
         list_for_each_entry_safe(tmp_aeb, _tmp_aeb, &free, u.list)
                 list_move_tail(&tmp_aeb->u.list, &ai->free);

-       ubi_assert(list_empty(&used));
+       list_for_each_entry_safe(tmp_aeb, _tmp_aeb, &used, u.list)
+               list_move_tail(&tmp_aeb->u.list, &ai->erase);
+
         ubi_assert(list_empty(&eba_orphans));
         ubi_assert(list_empty(&free));


Can you please give me a background on this patch.
Is this safe to apply without any of patches in the list

http://lwn.net/Articles/618410/

Can this occur when trying to attach an empty partition?
i.e. one that doesn't contain a UBI image.

Please let me know.
I would really appreciate any help that you can give me.


-- 
Thanks
Nikhilesh Reddy

Qualcomm Innovation Center, Inc.
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project.

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

* Re: ubi_assert(list_empty(&used)) in ubi_attach_fastmap
  2015-05-22  0:31 ubi_assert(list_empty(&used)) in ubi_attach_fastmap Nikhilesh Reddy
@ 2015-05-22  7:05 ` Richard Weinberger
  0 siblings, 0 replies; 2+ messages in thread
From: Richard Weinberger @ 2015-05-22  7:05 UTC (permalink / raw)
  To: Nikhilesh Reddy; +Cc: linux-mtd

Hi!

On Fri, May 22, 2015 at 2:31 AM, Nikhilesh Reddy <reddyn@codeaurora.org> wrote:
> Hi
>
> I am running kernel 3.10.
>
> I recently saw an issue where ubi_assert(list_empty(&used)) in
> ubi_attach_fastmap always hits on a partition.
>
> Searching this issue I found
> http://git.infradead.org/linux-ubifs.git/commitdiff/a83832a7c8d023f446ec865926190951bd18a4b1?hp=36a87e44f642966442fd0d23f2ec536851e00236
> diff --git a/drivers/mtd/ubi/fastmap.c b/drivers/mtd/ubi/fastmap.c
> index 600c4f9..9858bfb 100644 (file)
> --- a/drivers/mtd/ubi/fastmap.c
> +++ b/drivers/mtd/ubi/fastmap.c
> @@ -814,7 +814,9 @@ static int ubi_attach_fastmap(struct ubi_device *ubi,
>         list_for_each_entry_safe(tmp_aeb, _tmp_aeb, &free, u.list)
>                 list_move_tail(&tmp_aeb->u.list, &ai->free);
>
> -       ubi_assert(list_empty(&used));
> +       list_for_each_entry_safe(tmp_aeb, _tmp_aeb, &used, u.list)
> +               list_move_tail(&tmp_aeb->u.list, &ai->erase);
> +
>         ubi_assert(list_empty(&eba_orphans));
>         ubi_assert(list_empty(&free));
>
>
> Can you please give me a background on this patch.
> Is this safe to apply without any of patches in the list
>
> http://lwn.net/Articles/618410/

This is a tricky question but I tend to say "no".
In my last fastmap series I've fixed a *lot* of issues.
You need all fixes and they depend on each other.

My plan was to backport them to stable but as I'm horrible
backlogged this plan hasn't materialized yet. ;-(

> Can this occur when trying to attach an empty partition?
> i.e. one that doesn't contain a UBI image.

s/image/volume?

As the commit message says, it can happen in the powercut case.
I don't think this is true for your case.
So, please backport all fixes to your custom kernel first.

-- 
Thanks,
//richard

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

end of thread, other threads:[~2015-05-22  7:05 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-05-22  0:31 ubi_assert(list_empty(&used)) in ubi_attach_fastmap Nikhilesh Reddy
2015-05-22  7:05 ` Richard Weinberger

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.