[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v3] Fix race condition in ext2fs when remounting
From: |
Justus Winter |
Subject: |
Re: [PATCH v3] Fix race condition in ext2fs when remounting |
Date: |
Sat, 25 Jul 2015 03:54:59 +0200 |
User-agent: |
alot/0.3.5 |
Hi James :)
Quoting James Clarke (2015-07-23 19:33:42)
> On some systems, ext2fs.static would regularly hang at startup, as a
> race condition meant it would process paging requests while remounting.
> To fix this, libpager has been altered to allow inhibiting and resuming
> its worker threads, and ext2fs uses this to inhibit paging while
> remounting.
I believe this is the correct solution. It's nicely written, and well
documented. Good work :)
I'm merely wondering...
> diff --git a/ext2fs/ext2fs.c b/ext2fs/ext2fs.c
> index d0fdfe7..03c9eed 100644
> --- a/ext2fs/ext2fs.c
> +++ b/ext2fs/ext2fs.c
> @@ -207,10 +207,20 @@ main (int argc, char **argv)
> error_t
> diskfs_reload_global_state ()
> {
... whether we shouldn't protect this function with a lock. I'm not
sure if concurrent remounts are a problem, but they could very well
be.
Justus
> + error_t err;
> +
> pokel_flush (&global_pokel);
> pager_flush (diskfs_disk_pager, 1);
> - sblock = NULL;
> +
> + /* libdiskfs is not responsible for inhibiting paging. */
> + err = inhibit_ext2_pager ();
> + if (err)
> + return err;
> +
> get_hypermetadata ();
> map_hypermetadata ();
> +
> + resume_ext2_pager ();
> +
> return 0;
> }