Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

ext2: fix unbalanced kmap()/kunmap()

In ext2_rename(), dir_page is acquired through ext2_dotdot(). It is
then released through ext2_set_link() but only if old_dir != new_dir.
Failing that, the pkmap reference count is never decremented and the
page remains pinned forever. Repeat that a couple times with highmem
pages and all pkmap slots get exhausted, and every further kmap() calls
end up stalling on the pkmap_map_wait queue at which point the whole
system comes to a halt.

Signed-off-by: Nicolas Pitre <nico@marvell.com>
Acked-by: Theodore Ts'o <tytso@mit.edu>
Cc: stable@kernel.org
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

Nicolas Pitre and committed by
Linus Torvalds
9de6886e ac7ac9f2

+4
+4
fs/ext2/namei.c
··· 362 362 if (dir_de) { 363 363 if (old_dir != new_dir) 364 364 ext2_set_link(old_inode, dir_de, dir_page, new_dir, 0); 365 + else { 366 + kunmap(dir_page); 367 + page_cache_release(dir_page); 368 + } 365 369 inode_dec_link_count(old_dir); 366 370 } 367 371 return 0;