From: Josef Bacik Subject: Re: [PATCH] shmem: init on stack vmas Date: Mon, 13 Jan 2014 15:35:05 -0500 Message-ID: <52D44DF9.3060903@fb.com> References: <1389638777-31891-1-git-send-email-jbacik@fb.com> <52D44D55.2090709@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1"; format=flowed Content-Transfer-Encoding: 7bit To: Dave Hansen , , Return-path: Received: from mx0a-00082601.pphosted.com ([67.231.145.42]:48623 "EHLO mx0a-00082601.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751317AbaAMUfL (ORCPT ); Mon, 13 Jan 2014 15:35:11 -0500 In-Reply-To: <52D44D55.2090709@intel.com> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On 01/13/2014 03:32 PM, Dave Hansen wrote: > 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? We have checks for if (vma->mm && some other shit) so we expect NULLs for stuff we don't care about. Thanks, Josef