lkml.org 
[lkml]   [2006]   [Jul]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Subject[PATCH] Fix alloc_fdtable()
From
Date
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/

\
 
 \ /
  Last update: 2006-07-11 18:51    [W:0.027 / U:0.044 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site