linux_dsm_epyc7002/fs/bfs
Akinobu Mita 69b195be51 bfs: fix bitmap size argument to find_first_zero_bit()
The usage of find_first_zero_bit() in bfs_create() is wrong for two
reasons.

The bitmap size argument to find_first_zero_bit() is info->si_lasti but
the correct bitmap size is info->si_lasti + 1 as info->si_lasti is the
last valid index in info->si_imap bitmap.

Another problem is that it is impossible to detect that info->si_imap
bitmap is full because there is an off-by-one bug in the return value
check for find_first_zero_bit().  If no zero bits exist in info->si_imap,
find_first_zero_bit() returns info->si_lasti.  But the check can't catch
it due to the off-by-one.

Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Acked-by: "Tigran A. Aivazian" <tigran@aivazian.fsnet.co.uk>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2011-03-21 08:35:12 -04:00
..
bfs.h BFS: clean up the superblock usage 2010-08-09 16:48:53 -04:00
dir.c bfs: fix bitmap size argument to find_first_zero_bit() 2011-03-21 08:35:12 -04:00
file.c BFS: clean up the superblock usage 2010-08-09 16:48:53 -04:00
inode.c fs: icache RCU free inodes 2011-01-07 17:50:26 +11:00
Kconfig fs/Kconfig: move bfs out 2009-01-22 13:15:57 +03:00
Makefile Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00