Re: ubiupdatevol breaks ubi?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello Richard,

On Sun, Jul 21, 2019 at 10:03:50PM +0200, Richard Weinberger wrote:
> ----- Ursprüngliche Mail -----
> >	[   57.807978] UBIFS error (ubi0:0 pid 262): ubifs_assert_failed: UBIFS assert
> >	failed: c->lhead_lnum != c->ltail_lnum, in fs/ubifs/log.c:412
> 
> It took me a while to understand what is going on and why you are facing this.
> The assert seems to trigger only if you mount a filesystem where both log heads
> point to UBIFS_LOG_LNUM, hence empty log area in initial state, and you change
> more filesystem contents than the log can hold at once.
> 
> After reviewing UBIFS log code I found something odd.
> UBIFS does not initialize c->min_log_bytes, it is by default 0.
> 
> c->min_log_bytes can have two values:
> - 0: commit in progress, remaining log area may be used
> - leb_size: no commit in progress, keep leb_size bytes reserved
>   for a future commit.
> 
> So having it 0 after a mount seems wrong to me because after mounting
> UBIFS there is no commit in progress.
> 
> Can you please give this change a try?
> With this applied I can no longer trigger the assert.

Same for me, with that change my machine boots fine without hitting an
assert.

> I'm still not entirely sure whether the assert is correct at all,
> review in progress... :-) 

I assume you will be able to work that out.

Thanks for your time looking into my report,
Uwe

> diff --git a/fs/ubifs/super.c b/fs/ubifs/super.c
> index 6cfc494050be..b4984da44251 100644
> --- a/fs/ubifs/super.c
> +++ b/fs/ubifs/super.c
> @@ -607,6 +607,9 @@ static int init_constants_early(struct ubifs_info *c)
>  	c->max_bu_buf_len = UBIFS_MAX_BULK_READ * UBIFS_MAX_DATA_NODE_SZ;
>  	if (c->max_bu_buf_len > c->leb_size)
>  		c->max_bu_buf_len = c->leb_size;
> +
> +	c->min_log_bytes = c->leb_size;
> +
>  	return 0;
>  }
> 
> Thanks,
> //richard
> 

-- 
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |

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




[Index of Archives]     [LARTC]     [Bugtraq]     [Yosemite Forum]     [Photo]

  Powered by Linux