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
nexedi
linux
Commits
89e49671
Commit
89e49671
authored
Jan 14, 2003
by
Russell Cattelan
Committed by
Christoph Hellwig
Jan 14, 2003
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[XFS] Fix the cmn_err stuff to mask the error level before it checks for max value
SGI Modid: 2.5.x-xfs:slinx:135869a
parent
9cc92e3e
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
6 deletions
+16
-6
fs/xfs/support/debug.c
fs/xfs/support/debug.c
+16
-6
No files found.
fs/xfs/support/debug.c
View file @
89e49671
...
@@ -42,6 +42,7 @@ static spinlock_t xfs_err_lock = SPIN_LOCK_UNLOCKED;
...
@@ -42,6 +42,7 @@ static spinlock_t xfs_err_lock = SPIN_LOCK_UNLOCKED;
/* Translate from CE_FOO to KERN_FOO, err_level(CE_FOO) == KERN_FOO */
/* Translate from CE_FOO to KERN_FOO, err_level(CE_FOO) == KERN_FOO */
#define XFS_MAX_ERR_LEVEL 7
#define XFS_MAX_ERR_LEVEL 7
#define XFS_ERR_MASK ((1 << 3) - 1)
static
char
*
err_level
[
XFS_MAX_ERR_LEVEL
+
1
]
=
static
char
*
err_level
[
XFS_MAX_ERR_LEVEL
+
1
]
=
{
KERN_EMERG
,
KERN_ALERT
,
KERN_CRIT
,
{
KERN_EMERG
,
KERN_ALERT
,
KERN_CRIT
,
KERN_ERR
,
KERN_WARNING
,
KERN_NOTICE
,
KERN_ERR
,
KERN_WARNING
,
KERN_NOTICE
,
...
@@ -84,15 +85,19 @@ void
...
@@ -84,15 +85,19 @@ void
cmn_err
(
register
int
level
,
char
*
fmt
,
...)
cmn_err
(
register
int
level
,
char
*
fmt
,
...)
{
{
char
*
fp
=
fmt
;
char
*
fp
=
fmt
;
int
len
;
va_list
ap
;
va_list
ap
;
level
&=
XFS_ERR_MASK
;
if
(
level
>
XFS_MAX_ERR_LEVEL
)
if
(
level
>
XFS_MAX_ERR_LEVEL
)
level
=
XFS_MAX_ERR_LEVEL
;
level
=
XFS_MAX_ERR_LEVEL
;
spin_lock
(
&
xfs_err_lock
);
spin_lock
(
&
xfs_err_lock
);
va_start
(
ap
,
fmt
);
va_start
(
ap
,
fmt
);
if
(
*
fmt
==
'!'
)
fp
++
;
if
(
*
fmt
==
'!'
)
fp
++
;
vsprintf
(
message
,
fp
,
ap
);
len
=
vsprintf
(
message
,
fp
,
ap
);
printk
(
"%s%s
\n
"
,
err_level
[
level
],
message
);
if
(
message
[
len
-
1
]
!=
'\n'
)
strcat
(
message
,
"
\n
"
);
printk
(
"%s%s"
,
err_level
[
level
],
message
);
va_end
(
ap
);
va_end
(
ap
);
spin_unlock
(
&
xfs_err_lock
);
spin_unlock
(
&
xfs_err_lock
);
...
@@ -104,12 +109,17 @@ cmn_err(register int level, char *fmt, ...)
...
@@ -104,12 +109,17 @@ cmn_err(register int level, char *fmt, ...)
void
void
icmn_err
(
register
int
level
,
char
*
fmt
,
va_list
ap
)
icmn_err
(
register
int
level
,
char
*
fmt
,
va_list
ap
)
{
{
if
(
level
>
XFS_MAX_ERR_LEVEL
)
int
len
;
level
&=
XFS_ERR_MASK
;
if
(
level
>
XFS_MAX_ERR_LEVEL
)
level
=
XFS_MAX_ERR_LEVEL
;
level
=
XFS_MAX_ERR_LEVEL
;
spin_lock
(
&
xfs_err_lock
);
spin_lock
(
&
xfs_err_lock
);
vsprintf
(
message
,
fmt
,
ap
);
len
=
vsprintf
(
message
,
fmt
,
ap
);
if
(
message
[
len
-
1
]
!=
'\n'
)
strcat
(
message
,
"
\n
"
);
spin_unlock
(
&
xfs_err_lock
);
spin_unlock
(
&
xfs_err_lock
);
printk
(
"%s%s
\n
"
,
err_level
[
level
],
message
);
printk
(
"%s%s"
,
err_level
[
level
],
message
);
if
(
level
==
CE_PANIC
)
if
(
level
==
CE_PANIC
)
BUG
();
BUG
();
}
}
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