From: Richard Weinberger <richard@nod.at>
To: Akshay Bhat <abhat@lutron.com>
Cc: linux-mtd <linux-mtd@lists.infradead.org>,
hujianyang <hujianyang@huawei.com>
Subject: Re: UBIFS Panic
Date: Fri, 11 Jul 2014 22:45:54 +0200 [thread overview]
Message-ID: <53C04D02.9080002@nod.at> (raw)
In-Reply-To: <53BF07E4.4010302@lutron.com>
[-- Attachment #1: Type: text/plain, Size: 1548 bytes --]
Am 10.07.2014 23:38, schrieb Akshay Bhat:
>
>
> On Tue 01 Jul 2014 10:56:06 AM EDT, Richard Weinberger wrote:
>> Am 01.07.2014 16:46, schrieb Akshay Bhat:
>>>
>>>
>>> On Tue 01 Jul 2014 10:32:34 AM EDT, Richard Weinberger wrote:
>>>> Am 01.07.2014 16:18, schrieb Akshay Bhat:
>>>>>
>>>>>
>>>>> On Tue 01 Jul 2014 03:48:54 AM EDT, Richard Weinberger wrote:
>>>>>> Am 01.07.2014 03:09, schrieb hujianyang:
>>>>>>>>
>>>>>>>> Is enabling UBI_FASTMAP the cause for the panic? If so I can disabled the
>>>>>>>> feature and re-test. Do you see any compatibility issue going from:
>>>>>>>> Current config -> New config -> Failsafe config
>>>>>>>>
>>>>>>>
>>>>>>> I don't know. But I found func ubi_wl_get_peb() in drivers/mtd/ubi/wl.c
>>>>>>> will return an error ENOSPC without any error messages. And this func
>>>>>>> seems related with fastmap feature.
>>>>>>
>>>>>> I have sort of an idea what could going on.
>>>>>> Akshay, can you please confirm that you face the issue only with UBI_FASTMAP=y?
>>>>>
>>>>> I have not been able to recreate the issue with UBI_FASTMAP=n
>>>>
>>>> Okay, you test case basically fills the filesystem over and over?
>>>> And after some time you face the said issue.
>>>> Is this correct?
>>>
>>> Yes. From testing, the "some time" is typically after crossing the WL threshold.
>>
>> Good. I'll dig into that by the end of the week.
>
> Hi Richard, wanted to check if you got a chance to dig into this? Thanks.
Can you please rerun with the attached patch applied?
Maybe it can give use a hint. :)
Thanks,
//richard
[-- Attachment #2: debug.diff --]
[-- Type: text/x-patch, Size: 1637 bytes --]
diff --git a/drivers/mtd/ubi/wl.c b/drivers/mtd/ubi/wl.c
index 0f3425d..90588d4 100644
--- a/drivers/mtd/ubi/wl.c
+++ b/drivers/mtd/ubi/wl.c
@@ -575,8 +575,10 @@ static void refill_wl_pool(struct ubi_device *ubi)
for (pool->size = 0; pool->size < pool->max_size; pool->size++) {
if (!ubi->free.rb_node ||
- (ubi->free_count - ubi->beb_rsvd_pebs < 5))
+ (ubi->free_count - ubi->beb_rsvd_pebs < 5)) {
+ ubi_err("didn't get all pebs I wanted!");
break;
+ }
e = find_wl_entry(ubi, &ubi->free, WL_FREE_MAX_DIFF);
self_check_in_wl_tree(ubi, e, &ubi->free);
@@ -600,8 +602,10 @@ static void refill_wl_user_pool(struct ubi_device *ubi)
for (pool->size = 0; pool->size < pool->max_size; pool->size++) {
pool->pebs[pool->size] = __wl_get_peb(ubi);
- if (pool->pebs[pool->size] < 0)
+ if (pool->pebs[pool->size] < 0) {
+ ubi_err("didn't get all pebs I wanted!");
break;
+ }
}
pool->used = 0;
}
@@ -632,9 +636,10 @@ int ubi_wl_get_peb(struct ubi_device *ubi)
ubi_update_fastmap(ubi);
/* we got not a single free PEB */
- if (!pool->size)
+ if (!pool->size) {
+ ubi_err("User WL pool is empty!");
ret = -ENOSPC;
- else {
+ } else {
spin_lock(&ubi->wl_lock);
ret = pool->pebs[pool->used++];
prot_queue_add(ubi, ubi->lookuptbl[ret]);
@@ -654,6 +659,7 @@ static struct ubi_wl_entry *get_peb_for_wl(struct ubi_device *ubi)
int pnum;
if (pool->used == pool->size || !pool->size) {
+ ubi_err("WL pool is empty!");
/* We cannot update the fastmap here because this
* function is called in atomic context.
* Let's fail here and refill/update it as soon as possible. */
next prev parent reply other threads:[~2014-07-11 20:46 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-06-26 20:28 UBIFS Panic Akshay Bhat
2014-06-27 2:36 ` hujianyang
2014-06-30 13:01 ` Akshay Bhat
2014-06-30 14:48 ` Richard Weinberger
2014-06-30 17:23 ` Akshay Bhat
2014-06-30 17:34 ` Richard Weinberger
2014-07-01 1:09 ` hujianyang
2014-07-01 7:48 ` Richard Weinberger
2014-07-01 14:18 ` Akshay Bhat
2014-07-01 14:32 ` Richard Weinberger
2014-07-01 14:46 ` Akshay Bhat
2014-07-01 14:56 ` Richard Weinberger
2014-07-10 21:38 ` Akshay Bhat
2014-07-10 21:42 ` Richard Weinberger
2014-07-11 20:45 ` Richard Weinberger [this message]
2014-07-16 17:31 ` Akshay Bhat
2014-07-16 21:00 ` Richard Weinberger
2014-07-22 18:39 ` Akshay Bhat
2014-07-01 0:58 ` hujianyang
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=53C04D02.9080002@nod.at \
--to=richard@nod.at \
--cc=abhat@lutron.com \
--cc=hujianyang@huawei.com \
--cc=linux-mtd@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).