Re: [PATCH 2/2] jffs2: Add sync to underlying mtd device when file system is synced

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

 



On Fri, May 3, 2019 at 10:14 PM Clayton Shotwell
<clayton.shotwell@xxxxxxxxxxxxxxxxxxx> wrote:
>
> Need to ensure the underlying flash does not cache anything even though
> the file system thinks it's synced back.
>
> Signed-off-by: Clayton Shotwell <clayton.shotwell@xxxxxxxxxxxxxxxxxxx>
> ---
>  fs/jffs2/super.c | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/fs/jffs2/super.c b/fs/jffs2/super.c
> index 05d892c..4341565 100644
> --- a/fs/jffs2/super.c
> +++ b/fs/jffs2/super.c
> @@ -111,6 +111,7 @@ static int jffs2_sync_fs(struct super_block *sb, int wait)
>         mutex_lock(&c->alloc_sem);
>         jffs2_flush_wbuf_pad(c);
>         mutex_unlock(&c->alloc_sem);
> +       mtd_sync(c->mtd);

This needs a more detailed explanation.
mtd_sync() is not cheap, so you make syncfs() more expensive.

Please explain what failure you are facing without mtd_sync().
jffs2 is supposed to recover from a power failure at any time, just like ubifs.

-- 
Thanks,
//richard

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



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

  Powered by Linux