From mboxrd@z Thu Jan 1 00:00:00 1970 From: Richard Weinberger Date: Tue, 16 Jan 2018 14:22:57 +0100 Subject: [U-Boot] [PATCH] ubi: Fix filesystem corruption on detach when fastmap enabled In-Reply-To: References: <2306db96-4988-dfa3-c1d3-d830fa03ada5@denx.de> Message-ID: <8925017.tvIN1CM1GY@blindfold> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Heiko, Martin, Am Dienstag, 16. Januar 2018, 10:11:41 CET schrieb Martin Townsend: > Ah. Must be the mail client. Sorry about that I'll setup git send-mail > for v2. I'll wait to see what Richard has to say in case there is a > better fix. Thanks for letting me know! Indeed, there is a problem. I'm a little astonished that nobody noticed so far. Most likely because while detaching UBI in Linux mostly no Fastmap work is scheduled, and therefore in most cases flush_work(&ubi->fm_work) does nothing. As you noticed in U-Boot the story is different, you always update the Fastmap upon detach. Martin, can you please explain what corruption you see? >From reading the code I'd assume that you miss volumes but a full scan would recover everything. For Linux I suggest this fix: