Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
FPGA Configuration Space
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
1
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Projects
FPGA Configuration Space
Commits
ea38fb22
Commit
ea38fb22
authored
12 years ago
by
Alessandro Rubini
Browse files
Options
Downloads
Patches
Plain Diff
sdbfs/kernel/sdbfs-core: be more tolerant on unknown record types
Signed-off-by:
Alessandro Rubini
<
rubini@gnudd.com
>
parent
9aa6bba6
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
sdbfs/kernel/sdbfs-core.c
+16
-2
16 additions, 2 deletions
sdbfs/kernel/sdbfs-core.c
with
16 additions
and
2 deletions
sdbfs/kernel/sdbfs-core.c
+
16
−
2
View file @
ea38fb22
...
@@ -175,6 +175,7 @@ static struct inode *sdbfs_iget(struct super_block *sb, int inum)
...
@@ -175,6 +175,7 @@ static struct inode *sdbfs_iget(struct super_block *sb, int inum)
uint32_t
offset
;
uint32_t
offset
;
int
i
,
j
,
n
,
len
;
int
i
,
j
,
n
,
len
;
uint8_t
*
s
;
uint8_t
*
s
;
int
type
;
printk
(
"%s: inum %i
\n
"
,
__func__
,
inum
);
printk
(
"%s: inum %i
\n
"
,
__func__
,
inum
);
ino
=
iget_locked
(
sb
,
inum
);
ino
=
iget_locked
(
sb
,
inum
);
...
@@ -196,7 +197,8 @@ static struct inode *sdbfs_iget(struct super_block *sb, int inum)
...
@@ -196,7 +197,8 @@ static struct inode *sdbfs_iget(struct super_block *sb, int inum)
ino
->
i_mtime
.
tv_sec
=
ino
->
i_atime
.
tv_sec
=
ino
->
i_ctime
.
tv_sec
=
0
;
ino
->
i_mtime
.
tv_sec
=
ino
->
i_atime
.
tv_sec
=
ino
->
i_ctime
.
tv_sec
=
0
;
ino
->
i_mtime
.
tv_nsec
=
ino
->
i_atime
.
tv_nsec
=
ino
->
i_ctime
.
tv_nsec
=
0
;
ino
->
i_mtime
.
tv_nsec
=
ino
->
i_atime
.
tv_nsec
=
ino
->
i_ctime
.
tv_nsec
=
0
;
switch
(
inode
->
s_d
.
sdb_component
.
product
.
record_type
)
{
type
=
inode
->
s_d
.
sdb_component
.
product
.
record_type
;
switch
(
type
)
{
case
sdb_type_interconnect
:
case
sdb_type_interconnect
:
printk
(
"%s: interconnect
\n
"
,
__func__
);
printk
(
"%s: interconnect
\n
"
,
__func__
);
ino
->
i_mode
=
S_IFDIR
|
0555
;
ino
->
i_mode
=
S_IFDIR
|
0555
;
...
@@ -226,8 +228,20 @@ static struct inode *sdbfs_iget(struct super_block *sb, int inum)
...
@@ -226,8 +228,20 @@ static struct inode *sdbfs_iget(struct super_block *sb, int inum)
ino
->
i_mode
=
S_IFREG
|
0444
;
ino
->
i_mode
=
S_IFREG
|
0444
;
ino
->
i_fop
=
&
sdbfs_fops
;
ino
->
i_fop
=
&
sdbfs_fops
;
break
;
break
;
case
sdb_type_bridge
:
printk
(
"%s: bridge to %llx (unsupported yet)
\n
"
,
__func__
,
ntohll
(
inode
->
s_b
.
sdb_child
));
break
;
default:
default:
BUG
();
if
(
type
&
0x80
)
/* informative only */
pr_info
(
"%s: ignoring unknown record 0x%02x
\n
"
,
__func__
,
type
);
else
pr_err
(
"%s: unsupported record 0x%02x
\n
"
,
__func__
,
type
);
break
;
}
}
unlock_new_inode
(
ino
);
unlock_new_inode
(
ino
);
return
ino
;
return
ino
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment