All of lore.kernel.org
 help / color / mirror / Atom feed
From: Eric Dumazet <edumazet@google.com>
To: Daeho Jeong <daeho.jeong@samsung.com>
Cc: mguzik@redhat.com, Al Viro <viro@zeniv.linux.org.uk>,
	linux-fsdevel@vger.kernel.org
Subject: Re: [PATCH] fs: initialize resize_wait wait queue of init task
Date: Tue, 16 May 2017 07:10:47 -0700	[thread overview]
Message-ID: <CANn89iJkfLE_gLTG8mR49HBCHaz24WobEvvePGgFf0CdT7XCSA@mail.gmail.com> (raw)
In-Reply-To: <1494916832-9732-1-git-send-email-daeho.jeong@samsung.com>

On Mon, May 15, 2017 at 11:40 PM, Daeho Jeong <daeho.jeong@samsung.com> wrote:
> We don't initialize resize_wait of init task now and all the kernel
> threads share this uninitialized resize_wait wait queue because they
> are sharing the file table of init task. Therefore, when expanding
> this file table shared by the kernel threads, we encounter kernel panic
> by accessing the NULL resize_wait wait queue.
>
> Signed-off-by: Daeho Jeong <daeho.jeong@samsung.com>
> Tested-by: Youngjin Gil <youngjin.gil@samsung.com>
> ---
>  fs/file.c | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/fs/file.c b/fs/file.c
> index ad6f094f2eff..74748c32e07a 100644
> --- a/fs/file.c
> +++ b/fs/file.c
> @@ -475,6 +475,7 @@ struct files_struct init_files = {
>                 .full_fds_bits  = init_files.full_fds_bits_init,
>         },
>         .file_lock      = __SPIN_LOCK_UNLOCKED(init_files.file_lock),
> +       .resize_wait    = __WAIT_QUEUE_HEAD_INITIALIZER(init_files.resize_wait),
>  };
>
>  static unsigned int find_next_fd(struct fdtable *fdt, unsigned int start)
> --
> 2.11.0
>

Acked-by: Eric Dumazet <edumazet@google.com>
Fixes: 8a81252b774b ("fs/file.c: don't acquire files->file_lock in
fd_install()")

I am curious, what kind of kernel threads are using file table ?
Thanks.

  reply	other threads:[~2017-05-16 14:10 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20170516064030epcas1p238af57ce4223442c821948621897d780@epcas1p2.samsung.com>
2017-05-16  6:40 ` [PATCH] fs: initialize resize_wait wait queue of init task Daeho Jeong
2017-05-16 14:10   ` Eric Dumazet [this message]
     [not found]   ` <CGME20170516064030epcas1p238af57ce4223442c821948621897d780@epcms1p3>
2017-05-17  0:25     ` Daeho Jeong
2017-05-17  1:47       ` Al Viro
     [not found]       ` <CGME20170516064030epcas1p238af57ce4223442c821948621897d780@epcms1p8>
2017-05-17  1:52         ` Daeho Jeong
     [not found] <CGME20170614002719epcas5p3882aceef116f53781449010cc13f55e5@epcas5p3.samsung.com>
2017-06-14  0:27 ` Daeho Jeong
2017-06-15 11:16   ` Al Viro

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CANn89iJkfLE_gLTG8mR49HBCHaz24WobEvvePGgFf0CdT7XCSA@mail.gmail.com \
    --to=edumazet@google.com \
    --cc=daeho.jeong@samsung.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=mguzik@redhat.com \
    --cc=viro@zeniv.linux.org.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.