lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Mon, 21 Apr 2008 12:29:54 -0500
From:	Josh Boyer <jwboyer@...il.com>
To:	Michael Trimarchi <trimarchimichael@...oo.it>
Cc:	dwmw2@...radead.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] Force remount read-only of jffs2 when the garbage
	collector dies

On Mon, 2008-04-21 at 16:31 +0000, Michael Trimarchi wrote:
> [PATCH] Force remount read-only of jffs2 when the garbage collector
> dies
> 
> Signed-off-by: Michael Trimarchi <michael@...dence.eu.com>

Why would you do this?  The garbage collect thread is an optimization,
not a requirement.  Garbage collection will occur as-needed on behalf of
whichever process forces the requirement.

josh

> 
> ---
>  fs/jffs2/background.c |   21 +++++++++++++++++++++
>  1 files changed, 21 insertions(+), 0 deletions(-)
> 
> diff --git a/fs/jffs2/background.c b/fs/jffs2/background.c
> index 8adebd3..669b35e 100644
> --- a/fs/jffs2/background.c
> +++ b/fs/jffs2/background.c
> @@ -70,6 +70,7 @@ void jffs2_stop_garbage_collect_thread(struct
> jffs2_sb_info *c)
>  static int jffs2_garbage_collect_thread(void *_c)
>  {
>         struct jffs2_sb_info *c = _c;
> +       struct super_block *sb;
>  
>         daemonize("jffs2_gcd_mtd%d", c->mtd->index);
>         allow_signal(SIGKILL);
> @@ -145,5 +146,25 @@ static int jffs2_garbage_collect_thread(void *_c)
>         spin_lock(&c->erase_completion_lock);
>         c->gc_task = NULL;
>         spin_unlock(&c->erase_completion_lock);
> +
> +       sb = c->os_priv;
> +       BUG_ON(sb == NULL);
> +
> +       /* The garbage collect is died. Try to remount the fs
> +        * read-only
> +        */
> +       down_read(&sb->s_umount);
> +       if (sb->s_root && sb->s_mtd && !(sb->s_flags & MS_RDONLY)) {
> +               /*
> +                * ->remount_fs needs lock_kernel().
> +                *
> +                * What lock protects sb->s_flags??
> +                */
> +               lock_kernel();
> +               do_remount_sb(sb, MS_RDONLY, NULL, 1);
> +               unlock_kernel();
> +       }
> +       drop_super(sb);
> +
>         complete_and_exit(&c->gc_thread_exit, 0);
>  }
> -- 
> 1.5.3.6
> 
> 

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ