]> git.karo-electronics.de Git - karo-tx-linux.git/commit
tmpfs: fix kernel BUG in shmem_delete_inode
authorHugh Dickins <hugh@veritas.com>
Tue, 29 Jul 2008 02:50:18 +0000 (02:50 +0000)
committerGreg Kroah-Hartman <gregkh@suse.de>
Fri, 1 Aug 2008 19:43:11 +0000 (12:43 -0700)
commita3676137382ae2dbc6a469ead4cd37ccf970aede
tree92131e6476e5e4675e115755b7af3a9795745d6a
parent9bbba9277a48a49ae9212558ee7656e6016bca4d
tmpfs: fix kernel BUG in shmem_delete_inode

commit 14fcc23fdc78e9d32372553ccf21758a9bd56fa1 upstream

SuSE's insserve initscript ordering program hits kernel BUG at mm/shmem.c:814
on 2.6.26.  It's using posix_fadvise on directories, and the shmem_readpage
method added in 2.6.23 is letting POSIX_FADV_WILLNEED allocate useless pages
to a tmpfs directory, incrementing i_blocks count but never decrementing it.

Fix this by assigning shmem_aops (pointing to readpage and writepage and
set_page_dirty) only when it's needed, on a regular file or a long symlink.

Many thanks to Kel for outstanding bugreport and steps to reproduce it.

Reported-by: Kel Modderman <kel@otaku42.de>
Tested-by: Kel Modderman <kel@otaku42.de>
Signed-off-by: Hugh Dickins <hugh@veritas.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
mm/shmem.c