lkml.org 
[lkml]   [2010]   [Aug]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: [2.6.36-rc1] List corruption when using initrd.
On Tue, 17 Aug 2010, Tetsuo Handa wrote:
> Tetsuo Handa wrote:
> > I get list_add corruption message when booting with initrd on Debian Sarge.
>
> Bisection completed.
>
> commit 7e496299d4d2ad8083effed6c5a18313a919edc6
> tmpfs: make tmpfs scalable with percpu_counter for used blocks

Thanks for reporting and bisecting. Certainly there's a bug in shmem
(that we ought to have caught long before it reached 36-rc1: sorry),
and it is probably the cause of your crashes; but it's possible there's
a similar bug elsewhere too, something else messing up the percpu_counters
list - so please check if the patch below really does fix it for you.

I notice your dmesg also showed fs/inode.c:692 unlock_new_inode()
warnings from get_cramfs_inode(): those would be unrelated, and
probably from Al Viro's recent changes in cramfs/inode.c - Cc'ed.

Thanks,
Hugh


[PATCH] shmem: put_super must percpu_counter_destroy

list_add() corruption messages reported from shmem_fill_super()'s recently
introduced percpu_counter_init(): shmem_put_super() needs to remember to
percpu_counter_destroy(). And also check error from percpu_counter_init().

Reported-and-bisected-by: Tetsuo Handa <penguin-kernel@i-love.sakura.ne.jp>
Signed-off-by: Hugh Dickins <hughd@google.com>
---

mm/shmem.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)

--- 2.6.36-rc1/mm/shmem.c 2010-08-16 00:18:01.000000000 -0700
+++ linux/mm/shmem.c 2010-08-17 14:42:56.000000000 -0700
@@ -2325,7 +2325,10 @@ static int shmem_show_options(struct seq

static void shmem_put_super(struct super_block *sb)
{
- kfree(sb->s_fs_info);
+ struct shmem_sb_info *sbinfo = SHMEM_SB(sb);
+
+ percpu_counter_destroy(&sbinfo->used_blocks);
+ kfree(sbinfo);
sb->s_fs_info = NULL;
}

@@ -2367,7 +2370,8 @@ int shmem_fill_super(struct super_block
#endif

spin_lock_init(&sbinfo->stat_lock);
- percpu_counter_init(&sbinfo->used_blocks, 0);
+ if (percpu_counter_init(&sbinfo->used_blocks, 0))
+ goto failed;
sbinfo->free_inodes = sbinfo->max_inodes;

sb->s_maxbytes = SHMEM_MAX_BYTES;

\
 
 \ /
  Last update: 2010-08-18 00:27    [W:0.184 / U:0.040 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site