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
1a1e9095
Commit
1a1e9095
authored
Dec 01, 2002
by
Alan Cox
Committed by
James Bottomley
Dec 01, 2002
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[PATCH] report unzip errors on initrd
parent
6506be23
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
3 deletions
+16
-3
init/do_mounts.c
init/do_mounts.c
+16
-3
No files found.
init/do_mounts.c
View file @
1a1e9095
...
@@ -920,6 +920,7 @@ static unsigned insize; /* valid bytes in inbuf */
...
@@ -920,6 +920,7 @@ static unsigned insize; /* valid bytes in inbuf */
static
unsigned
inptr
;
/* index of next byte to be processed in inbuf */
static
unsigned
inptr
;
/* index of next byte to be processed in inbuf */
static
unsigned
outcnt
;
/* bytes in output buffer */
static
unsigned
outcnt
;
/* bytes in output buffer */
static
int
exit_code
;
static
int
exit_code
;
static
int
unzip_error
;
static
long
bytes_out
;
static
long
bytes_out
;
static
int
crd_infd
,
crd_outfd
;
static
int
crd_infd
,
crd_outfd
;
...
@@ -967,13 +968,17 @@ static void __init gzip_release(void **ptr)
...
@@ -967,13 +968,17 @@ static void __init gzip_release(void **ptr)
/* ===========================================================================
/* ===========================================================================
* Fill the input buffer. This is called only when the buffer is empty
* Fill the input buffer. This is called only when the buffer is empty
* and at least one byte is really needed.
* and at least one byte is really needed.
* Returning -1 does not guarantee that gunzip() will ever return.
*/
*/
static
int
__init
fill_inbuf
(
void
)
static
int
__init
fill_inbuf
(
void
)
{
{
if
(
exit_code
)
return
-
1
;
if
(
exit_code
)
return
-
1
;
insize
=
read
(
crd_infd
,
inbuf
,
INBUFSIZ
);
insize
=
read
(
crd_infd
,
inbuf
,
INBUFSIZ
);
if
(
insize
==
0
)
return
-
1
;
if
(
insize
==
0
)
{
error
(
"RAMDISK: ran out of compressed data
\n
"
);
return
-
1
;
}
inptr
=
1
;
inptr
=
1
;
...
@@ -987,10 +992,15 @@ static int __init fill_inbuf(void)
...
@@ -987,10 +992,15 @@ static int __init fill_inbuf(void)
static
void
__init
flush_window
(
void
)
static
void
__init
flush_window
(
void
)
{
{
ulg
c
=
crc
;
/* temporary variable */
ulg
c
=
crc
;
/* temporary variable */
unsigned
n
;
unsigned
n
,
written
;
uch
*
in
,
ch
;
uch
*
in
,
ch
;
write
(
crd_outfd
,
window
,
outcnt
);
written
=
write
(
crd_outfd
,
window
,
outcnt
);
if
(
written
!=
outcnt
&&
unzip_error
==
0
)
{
printk
(
KERN_ERR
"RAMDISK: incomplete write (%d != %d) %d
\n
"
,
written
,
outcnt
,
bytes_out
);
unzip_error
=
1
;
}
in
=
window
;
in
=
window
;
for
(
n
=
0
;
n
<
outcnt
;
n
++
)
{
for
(
n
=
0
;
n
<
outcnt
;
n
++
)
{
ch
=
*
in
++
;
ch
=
*
in
++
;
...
@@ -1005,6 +1015,7 @@ static void __init error(char *x)
...
@@ -1005,6 +1015,7 @@ static void __init error(char *x)
{
{
printk
(
KERN_ERR
"%s"
,
x
);
printk
(
KERN_ERR
"%s"
,
x
);
exit_code
=
1
;
exit_code
=
1
;
unzip_error
=
1
;
}
}
static
int
__init
crd_load
(
int
in_fd
,
int
out_fd
)
static
int
__init
crd_load
(
int
in_fd
,
int
out_fd
)
...
@@ -1033,6 +1044,8 @@ static int __init crd_load(int in_fd, int out_fd)
...
@@ -1033,6 +1044,8 @@ static int __init crd_load(int in_fd, int out_fd)
}
}
makecrc
();
makecrc
();
result
=
gunzip
();
result
=
gunzip
();
if
(
unzip_error
)
result
=
1
;
kfree
(
inbuf
);
kfree
(
inbuf
);
kfree
(
window
);
kfree
(
window
);
return
result
;
return
result
;
...
...
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