summaryrefslogtreecommitdiffstats
path: root/fs/ocfs2/stack_o2cb.c
diff options
context:
space:
mode:
authorRoel Kluin <roel.kluin@gmail.com>2009-08-07 01:07:50 +0200
committerJoel Becker <joel.becker@oracle.com>2009-08-07 22:16:50 +0200
commit8a57a9dda760ea7845390f1cd36f3eb2a49391d8 (patch)
tree67c6566851787cd5836e763d63b069144743e4da /fs/ocfs2/stack_o2cb.c
parentocfs2: Initialize the cluster we're writing to in a non-sparse extend (diff)
downloadlinux-8a57a9dda760ea7845390f1cd36f3eb2a49391d8.tar.xz
linux-8a57a9dda760ea7845390f1cd36f3eb2a49391d8.zip
ocfs2: keep index within status_map[]
Do not exceed array status_map[] Signed-off-by: Roel Kluin <roel.kluin@gmail.com> Cc: Mark Fasheh <mfasheh@suse.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Joel Becker <joel.becker@oracle.com>
Diffstat (limited to 'fs/ocfs2/stack_o2cb.c')
-rw-r--r--fs/ocfs2/stack_o2cb.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/ocfs2/stack_o2cb.c b/fs/ocfs2/stack_o2cb.c
index 3f661376a2de..e49c41050264 100644
--- a/fs/ocfs2/stack_o2cb.c
+++ b/fs/ocfs2/stack_o2cb.c
@@ -17,6 +17,7 @@
* General Public License for more details.
*/
+#include <linux/kernel.h>
#include <linux/crc32.h>
#include <linux/module.h>
@@ -153,7 +154,7 @@ static int status_map[] = {
static int dlm_status_to_errno(enum dlm_status status)
{
- BUG_ON(status > (sizeof(status_map) / sizeof(status_map[0])));
+ BUG_ON(status < 0 || status >= ARRAY_SIZE(status_map));
return status_map[status];
}