All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dave Hansen <dave.hansen@intel.com>
To: Josef Bacik <jbacik@fb.com>,
	linux-mm@kvack.org, linux-fsdevel@vger.kernel.org
Subject: Re: [PATCH] shmem: init on stack vmas
Date: Mon, 13 Jan 2014 12:32:21 -0800	[thread overview]
Message-ID: <52D44D55.2090709@intel.com> (raw)
In-Reply-To: <1389638777-31891-1-git-send-email-jbacik@fb.com>

On 01/13/2014 10:46 AM, Josef Bacik wrote:
> We were hitting a weird bug with our cgroup stuff because shmem uses on stack
> vmas.  These aren't properly init'ed so we'd have garbage in vma->mm and bad
> things would happen.  Fix this by just init'ing to empty structs.  Thanks,
...
>  static struct page *shmem_swapin(swp_entry_t swap, gfp_t gfp,
>  			struct shmem_inode_info *info, pgoff_t index)
>  {
> -	struct vm_area_struct pvma;
> +	struct vm_area_struct pvma = {};

What does that code do if it needs an mm and doesn't find one?

WARNING: multiple messages have this Message-ID (diff)
From: Dave Hansen <dave.hansen@intel.com>
To: Josef Bacik <jbacik@fb.com>,
	linux-mm@kvack.org, linux-fsdevel@vger.kernel.org
Subject: Re: [PATCH] shmem: init on stack vmas
Date: Mon, 13 Jan 2014 12:32:21 -0800	[thread overview]
Message-ID: <52D44D55.2090709@intel.com> (raw)
In-Reply-To: <1389638777-31891-1-git-send-email-jbacik@fb.com>

On 01/13/2014 10:46 AM, Josef Bacik wrote:
> We were hitting a weird bug with our cgroup stuff because shmem uses on stack
> vmas.  These aren't properly init'ed so we'd have garbage in vma->mm and bad
> things would happen.  Fix this by just init'ing to empty structs.  Thanks,
...
>  static struct page *shmem_swapin(swp_entry_t swap, gfp_t gfp,
>  			struct shmem_inode_info *info, pgoff_t index)
>  {
> -	struct vm_area_struct pvma;
> +	struct vm_area_struct pvma = {};

What does that code do if it needs an mm and doesn't find one?

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

  reply	other threads:[~2014-01-13 20:33 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-13 18:46 [PATCH] shmem: init on stack vmas Josef Bacik
2014-01-13 18:46 ` Josef Bacik
2014-01-13 20:32 ` Dave Hansen [this message]
2014-01-13 20:32   ` Dave Hansen
2014-01-13 20:35   ` Josef Bacik
2014-01-13 20:35     ` Josef Bacik

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=52D44D55.2090709@intel.com \
    --to=dave.hansen@intel.com \
    --cc=jbacik@fb.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    /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.