Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
linux
Commits
9629d799
Commit
9629d799
authored
Jan 14, 2003
by
Eric Sandeen
Committed by
Nathan Scott
Jan 14, 2003
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[XFS] Make sure we don't walk off the end of the err_level array
SGI Modid: 2.5.x-xfs:slinx:135827a
parent
9552d6bc
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
1 deletion
+7
-1
fs/xfs/support/debug.c
fs/xfs/support/debug.c
+7
-1
No files found.
fs/xfs/support/debug.c
View file @
9629d799
...
...
@@ -41,7 +41,9 @@ static char message[256]; /* keep it off the stack */
static
spinlock_t
xfs_err_lock
=
SPIN_LOCK_UNLOCKED
;
/* Translate from CE_FOO to KERN_FOO, err_level(CE_FOO) == KERN_FOO */
static
char
*
err_level
[
8
]
=
{
KERN_EMERG
,
KERN_ALERT
,
KERN_CRIT
,
#define MAX_XFS_ERR_LEVEL 7
static
char
*
err_level
[
XFS_MAX_ERR_LEVEL
+
1
]
=
{
KERN_EMERG
,
KERN_ALERT
,
KERN_CRIT
,
KERN_ERR
,
KERN_WARNING
,
KERN_NOTICE
,
KERN_INFO
,
KERN_DEBUG
};
...
...
@@ -84,6 +86,8 @@ cmn_err(register int level, char *fmt, ...)
char
*
fp
=
fmt
;
va_list
ap
;
if
(
level
>
XFS_MAX_ERR_LEVEL
)
level
=
XFS_MAX_ERR_LEVEL
;
spin_lock
(
&
xfs_err_lock
);
va_start
(
ap
,
fmt
);
if
(
*
fmt
==
'!'
)
fp
++
;
...
...
@@ -100,6 +104,8 @@ cmn_err(register int level, char *fmt, ...)
void
icmn_err
(
register
int
level
,
char
*
fmt
,
va_list
ap
)
{
if
(
level
>
XFS_MAX_ERR_LEVEL
)
level
=
XFS_MAX_ERR_LEVEL
;
spin_lock
(
&
xfs_err_lock
);
vsprintf
(
message
,
fmt
,
ap
);
spin_unlock
(
&
xfs_err_lock
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment