diff options
author | Dimitri Sivanich <sivanich@sgi.com> | 2012-02-08 15:39:07 -0500 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2012-02-13 20:45:38 -0500 |
commit | 074b85175a43a23fdbde60f55feea636e0bf0f85 (patch) | |
tree | e6f6fdd82854b2bf25ea5b404cee010806a8fced /fs/inode.c | |
parent | 1d6f2097865e64963e90cce04980dce2f9fc023f (diff) |
vfs: fix panic in __d_lookup() with high dentry hashtable counts
When the number of dentry cache hash table entries gets too high
(2147483648 entries), as happens by default on a 16TB system, use of a
signed integer in the dcache_init() initialization loop prevents the
dentry_hashtable from getting initialized, causing a panic in
__d_lookup(). Fix this in dcache_init() and similar areas.
Signed-off-by: Dimitri Sivanich <sivanich@sgi.com>
Acked-by: David S. Miller <davem@davemloft.net>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/inode.c')
-rw-r--r-- | fs/inode.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/fs/inode.c b/fs/inode.c index fb10d86ffad7..d3ebdbe723d0 100644 --- a/fs/inode.c +++ b/fs/inode.c | |||
@@ -1651,7 +1651,7 @@ __setup("ihash_entries=", set_ihash_entries); | |||
1651 | */ | 1651 | */ |
1652 | void __init inode_init_early(void) | 1652 | void __init inode_init_early(void) |
1653 | { | 1653 | { |
1654 | int loop; | 1654 | unsigned int loop; |
1655 | 1655 | ||
1656 | /* If hashes are distributed across NUMA nodes, defer | 1656 | /* If hashes are distributed across NUMA nodes, defer |
1657 | * hash allocation until vmalloc space is available. | 1657 | * hash allocation until vmalloc space is available. |
@@ -1669,13 +1669,13 @@ void __init inode_init_early(void) | |||
1669 | &i_hash_mask, | 1669 | &i_hash_mask, |
1670 | 0); | 1670 | 0); |
1671 | 1671 | ||
1672 | for (loop = 0; loop < (1 << i_hash_shift); loop++) | 1672 | for (loop = 0; loop < (1U << i_hash_shift); loop++) |
1673 | INIT_HLIST_HEAD(&inode_hashtable[loop]); | 1673 | INIT_HLIST_HEAD(&inode_hashtable[loop]); |
1674 | } | 1674 | } |
1675 | 1675 | ||
1676 | void __init inode_init(void) | 1676 | void __init inode_init(void) |
1677 | { | 1677 | { |
1678 | int loop; | 1678 | unsigned int loop; |
1679 | 1679 | ||
1680 | /* inode slab cache */ | 1680 | /* inode slab cache */ |
1681 | inode_cachep = kmem_cache_create("inode_cache", | 1681 | inode_cachep = kmem_cache_create("inode_cache", |
@@ -1699,7 +1699,7 @@ void __init inode_init(void) | |||
1699 | &i_hash_mask, | 1699 | &i_hash_mask, |
1700 | 0); | 1700 | 0); |
1701 | 1701 | ||
1702 | for (loop = 0; loop < (1 << i_hash_shift); loop++) | 1702 | for (loop = 0; loop < (1U << i_hash_shift); loop++) |
1703 | INIT_HLIST_HEAD(&inode_hashtable[loop]); | 1703 | INIT_HLIST_HEAD(&inode_hashtable[loop]); |
1704 | } | 1704 | } |
1705 | 1705 | ||