[PATCH] Fix alloc_fdtable()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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(-)

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 <[email protected]>
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux