Messages in this thread Patch in this message | | | Subject | [PATCH] Fix alloc_fdtable() | From | OGAWA Hirofumi <> | Date | Wed, 12 Jul 2006 01:47:57 +0900 |
| |
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 <hirofumi@mail.parknet.co.jp> ---
fs/file.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff -puN fs/file.c~alloc_fdtable-fix fs/file.c --- linux-2.6/fs/file.c~alloc_fdtable-fix 2006-07-12 01:03:40.000000000 +0900 +++ linux-2.6-hirofumi/fs/file.c 2006-07-12 01:17:29.000000000 +0900 @@ -240,7 +240,7 @@ static struct fdtable *alloc_fdtable(int if (!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; _ -- OGAWA Hirofumi <hirofumi@mail.parknet.co.jp> - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
| |