Fix alloc_fdtable()
PATCH 1/1 Fix alloc_fdtable()
Current logic seems wrong, the result is always "8 * L1_CACHE_BYTES". It's probably typo, we should use nr + 1' instead of nfds' here.
Signed-off-by OGAWA Hirofumi <[email protected]>
---
fs/file.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
fs/file.c renamed from fs/file.c~alloc_fdtable-fix +1 -1
@@ -240,7 +240,7 @@ static struct fdtable *alloc_fdtable(intif (!fdt) goto out; - nfds =max_t (int,8 *L1_CACHE_BYTES ,roundup_pow_of_two (nfds)); + nfds =max_t (int,8 *L1_CACHE_BYTES ,roundup_pow_of_two (nr +1 ));if (nfds >NR_OPEN ) nfds =NR_OPEN ;
_
Signature · 1 line
OGAWA Hirofumi <[email protected]>