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
efdf60b6
Commit
efdf60b6
authored
Nov 23, 2007
by
Linus Torvalds
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Import 1.0.2
parent
5eb4898b
Changes
17
Show whitespace changes
Inline
Side-by-side
Showing
17 changed files
with
48 additions
and
30 deletions
+48
-30
Makefile
Makefile
+1
-1
drivers/scsi/scsi.c
drivers/scsi/scsi.c
+1
-0
drivers/scsi/scsi_ioctl.c
drivers/scsi/scsi_ioctl.c
+1
-1
drivers/scsi/sd.c
drivers/scsi/sd.c
+1
-1
drivers/scsi/sg.c
drivers/scsi/sg.c
+2
-2
drivers/scsi/sr.c
drivers/scsi/sr.c
+1
-1
drivers/scsi/sr_ioctl.c
drivers/scsi/sr_ioctl.c
+1
-1
drivers/scsi/st.c
drivers/scsi/st.c
+1
-1
include/linux/in.h
include/linux/in.h
+8
-8
include/linux/kernel.h
include/linux/kernel.h
+2
-0
kernel/exit.c
kernel/exit.c
+5
-3
kernel/fork.c
kernel/fork.c
+2
-1
kernel/sched.c
kernel/sched.c
+8
-4
kernel/traps.c
kernel/traps.c
+4
-1
mm/kmalloc.c
mm/kmalloc.c
+0
-1
net/inet/sock.c
net/inet/sock.c
+5
-2
net/unix/sock.c
net/unix/sock.c
+5
-2
No files found.
Makefile
View file @
efdf60b6
VERSION
=
1
PATCHLEVEL
=
0
SUBLEVEL
=
1
SUBLEVEL
=
2
all
:
Version zImage
...
...
drivers/scsi/scsi.c
View file @
efdf60b6
...
...
@@ -126,6 +126,7 @@ static unsigned char generic_sense[6] = {REQUEST_SENSE, 0,0,0, 255, 0};
static
struct
blist
blacklist
[]
=
{
{
"CHINON"
,
"CD-ROM CDS-431"
,
"H42"
},
/* Locks up if polled for lun != 0 */
{
"DENON"
,
"DRD-25X"
,
"V"
},
/* A cdrom that locks up when probed at lun != 0 */
{
"IMS"
,
"CDD521/10"
,
"2.06"
},
/* Locks-up when LUN>0 polled. */
{
"MAXTOR"
,
"XT-3280"
,
"PR02"
},
/* Locks-up when LUN>0 polled. */
...
...
drivers/scsi/scsi_ioctl.c
View file @
efdf60b6
...
...
@@ -235,7 +235,7 @@ int scsi_ioctl (Scsi_Device *dev, int cmd, void *arg)
char
scsi_cmd
[
12
];
if
((
cmd
!=
0
&&
dev
->
index
>
NR_SCSI_DEVICES
))
return
-
EN
ODEV
;
return
-
EN
XIO
;
switch
(
cmd
)
{
case
SCSI_IOCTL_GET_IDLUN
:
...
...
drivers/scsi/sd.c
View file @
efdf60b6
...
...
@@ -59,7 +59,7 @@ static int sd_open(struct inode * inode, struct file * filp)
target
=
DEVICE_NR
(
MINOR
(
inode
->
i_rdev
));
if
(
target
>=
NR_SD
||
!
rscsi_disks
[
target
].
device
)
return
-
EN
ODEV
;
/* No such device */
return
-
EN
XIO
;
/* No such device */
/* Make sure that only one process can do a check_change_disk at one time.
This is also used to lock out further access when the partition table is being re-read. */
...
...
drivers/scsi/sg.c
View file @
efdf60b6
...
...
@@ -56,7 +56,7 @@ static int sg_ioctl(struct inode * inode,struct file * file,
{
int
dev
=
MINOR
(
inode
->
i_rdev
);
if
((
dev
<
0
)
||
(
dev
>=
NR_SG
))
return
-
EN
ODEV
;
return
-
EN
XIO
switch
(
cmd_in
)
{
case
SG_SET_TIMEOUT
:
...
...
@@ -74,7 +74,7 @@ static int sg_open(struct inode * inode, struct file * filp)
int
dev
=
MINOR
(
inode
->
i_rdev
);
int
flags
=
filp
->
f_flags
;
if
(
dev
>=
NR_SG
)
return
-
EN
ODEV
;
return
-
EN
XIO
;
if
(
O_RDWR
!=
(
flags
&
O_ACCMODE
))
return
-
EACCES
;
if
(
flags
&
O_EXCL
)
...
...
drivers/scsi/sr.c
View file @
efdf60b6
...
...
@@ -260,7 +260,7 @@ static void rw_intr (Scsi_Cmnd * SCpnt)
static
int
sr_open
(
struct
inode
*
inode
,
struct
file
*
filp
)
{
if
(
MINOR
(
inode
->
i_rdev
)
>=
NR_SR
||
!
scsi_CDs
[
MINOR
(
inode
->
i_rdev
)].
device
)
return
-
EN
ODEV
;
/* No such device */
!
scsi_CDs
[
MINOR
(
inode
->
i_rdev
)].
device
)
return
-
EN
XIO
;
/* No such device */
check_disk_change
(
inode
->
i_rdev
);
...
...
drivers/scsi/sr_ioctl.c
View file @
efdf60b6
...
...
@@ -98,7 +98,7 @@ int sr_ioctl(struct inode * inode, struct file * file, unsigned int cmd, unsigne
int
result
,
target
;
target
=
MINOR
(
dev
);
if
(
target
>=
NR_SR
)
return
-
EN
ODEV
;
if
(
target
>=
NR_SR
)
return
-
EN
XIO
;
switch
(
cmd
)
{
...
...
drivers/scsi/st.c
View file @
efdf60b6
...
...
@@ -359,7 +359,7 @@ scsi_tape_open(struct inode * inode, struct file * filp)
dev
=
MINOR
(
inode
->
i_rdev
)
&
127
;
if
(
dev
>=
NR_ST
)
return
(
-
EN
ODEV
);
return
(
-
EN
XIO
);
STp
=
&
(
scsi_tapes
[
dev
]);
if
(
STp
->
in_use
)
{
printk
(
"st%d: Device already in use.
\n
"
,
dev
);
...
...
include/linux/in.h
View file @
efdf60b6
...
...
@@ -135,10 +135,10 @@ __ntohl(unsigned long int x)
static
__inline__
unsigned
long
int
__constant_ntohl
(
unsigned
long
int
x
)
{
return
(((
x
&
0x000000ff
)
<<
24
)
|
((
x
&
0x0000ff00
)
<<
8
)
|
((
x
&
0x00ff0000
)
>>
8
)
|
((
x
&
0xff000000
)
>>
24
));
return
(((
x
&
0x000000ff
U
)
<<
24
)
|
((
x
&
0x0000ff00
U
)
<<
8
)
|
((
x
&
0x00ff0000
U
)
>>
8
)
|
((
x
&
0xff000000
U
)
>>
24
));
}
static
__inline__
unsigned
short
int
...
...
@@ -164,19 +164,19 @@ __constant_ntohs(unsigned short int x)
#ifdef __OPTIMIZE__
# define ntohl(x) \
(__builtin_constant_p((x)) ? \
(__builtin_constant_p((
long)(
x)) ? \
__constant_ntohl((x)) : \
__ntohl((x)))
# define ntohs(x) \
(__builtin_constant_p((x)) ? \
(__builtin_constant_p((
short)(
x)) ? \
__constant_ntohs((x)) : \
__ntohs((x)))
# define htonl(x) \
(__builtin_constant_p((x)) ? \
(__builtin_constant_p((
long)(
x)) ? \
__constant_htonl((x)) : \
__htonl((x)))
# define htons(x) \
(__builtin_constant_p((x)) ? \
(__builtin_constant_p((
short)(
x)) ? \
__constant_htons((x)) : \
__htons((x)))
#endif
...
...
include/linux/kernel.h
View file @
efdf60b6
...
...
@@ -14,6 +14,8 @@
#define LONG_MAX ((long)(~0UL>>1))
#define ULONG_MAX (~0UL)
#define STACK_MAGIC 0xdeadbeef
#define KERN_EMERG "<0>"
/* system is unusable */
#define KERN_ALERT "<1>"
/* action must be taken immediately */
#define KERN_CRIT "<2>"
/* critical conditions */
...
...
kernel/exit.c
View file @
efdf60b6
...
...
@@ -89,6 +89,8 @@ void release(struct task_struct * p)
if
(
task
[
i
]
==
p
)
{
task
[
i
]
=
NULL
;
REMOVE_LINKS
(
p
);
if
(
STACK_MAGIC
!=
*
(
unsigned
long
*
)
p
->
kernel_stack_page
)
printk
(
KERN_ALERT
"release: %s kernel stack corruption. Aiee
\n
"
,
p
->
comm
);
free_page
(
p
->
kernel_stack_page
);
free_page
((
long
)
p
);
return
;
...
...
@@ -395,9 +397,6 @@ NORET_TYPE void do_exit(long code)
}
}
current
->
state
=
TASK_ZOMBIE
;
current
->
exit_code
=
code
;
current
->
rss
=
0
;
/*
* Check to see if any process groups have become orphaned
* as a result of our exiting, and if they have any stopped
...
...
@@ -456,6 +455,9 @@ NORET_TYPE void do_exit(long code)
disassociate_ctty
(
1
);
if
(
last_task_used_math
==
current
)
last_task_used_math
=
NULL
;
current
->
state
=
TASK_ZOMBIE
;
current
->
exit_code
=
code
;
current
->
rss
=
0
;
#ifdef DEBUG_PROC_TREE
audit_ptree
();
#endif
...
...
kernel/fork.c
View file @
efdf60b6
...
...
@@ -157,8 +157,9 @@ asmlinkage int sys_fork(struct pt_regs regs)
/*
* set up new TSS and kernel stack
*/
if
(
!
(
p
->
kernel_stack_page
=
__
get_free_page
(
GFP_KERNEL
)))
if
(
!
(
p
->
kernel_stack_page
=
get_free_page
(
GFP_KERNEL
)))
goto
bad_fork_cleanup
;
*
(
unsigned
long
*
)
p
->
kernel_stack_page
=
STACK_MAGIC
;
p
->
tss
.
es
=
KERNEL_DS
;
p
->
tss
.
cs
=
KERNEL_CS
;
p
->
tss
.
ss
=
KERNEL_DS
;
...
...
kernel/sched.c
View file @
efdf60b6
...
...
@@ -85,7 +85,7 @@ extern void mem_use(void);
extern
int
timer_interrupt
(
void
);
asmlinkage
int
system_call
(
void
);
static
unsigned
long
init_kernel_stack
[
1024
];
static
unsigned
long
init_kernel_stack
[
1024
]
=
{
STACK_MAGIC
,
}
;
struct
task_struct
init_task
=
INIT_TASK
;
unsigned
long
volatile
jiffies
=
0
;
...
...
@@ -95,7 +95,7 @@ struct task_struct *last_task_used_math = NULL;
struct
task_struct
*
task
[
NR_TASKS
]
=
{
&
init_task
,
};
long
user_stack
[
PAGE_SIZE
>>
2
]
;
long
user_stack
[
PAGE_SIZE
>>
2
]
=
{
STACK_MAGIC
,
}
;
struct
{
long
*
a
;
...
...
@@ -772,6 +772,7 @@ asmlinkage int sys_nice(long increment)
static
void
show_task
(
int
nr
,
struct
task_struct
*
p
)
{
int
free
;
static
char
*
stat_nam
[]
=
{
"R"
,
"S"
,
"D"
,
"Z"
,
"T"
,
"W"
};
printk
(
"%-8s %3d "
,
p
->
comm
,
(
p
==
current
)
?
-
nr
:
nr
);
...
...
@@ -783,8 +784,11 @@ static void show_task(int nr,struct task_struct * p)
printk
(
" current "
);
else
printk
(
" %08lX "
,
((
unsigned
long
*
)
p
->
tss
.
esp
)[
3
]);
printk
(
"%5lu %5d %6d "
,
p
->
tss
.
esp
-
p
->
kernel_stack_page
,
p
->
pid
,
p
->
p_pptr
->
pid
);
for
(
free
=
1
;
free
<
1024
;
free
++
)
{
if
(((
unsigned
long
*
)
p
->
kernel_stack_page
)[
free
])
break
;
}
printk
(
"%5lu %5d %6d "
,
free
<<
2
,
p
->
pid
,
p
->
p_pptr
->
pid
);
if
(
p
->
p_cptr
)
printk
(
"%5d "
,
p
->
p_cptr
->
pid
);
else
...
...
kernel/traps.c
View file @
efdf60b6
...
...
@@ -101,7 +101,10 @@ asmlinkage void alignment_check(void);
printk
(
"ds: %04x es: %04x fs: %04x gs: %04x ss: %04x
\n
"
,
regs
->
ds
,
regs
->
es
,
regs
->
fs
,
regs
->
gs
,
ss
);
store_TR
(
i
);
printk
(
"Pid: %d, process nr: %d (%s)
\n
Stack: "
,
current
->
pid
,
0xffff
&
i
,
current
->
comm
);
if
(
STACK_MAGIC
!=
*
(
unsigned
long
*
)
current
->
kernel_stack_page
)
printk
(
"Corrupted stack page
\n
"
);
printk
(
"Process %s (pid: %d, process nr: %d, stackpage=%08lx)
\n
Stack: "
,
current
->
comm
,
current
->
pid
,
0xffff
&
i
,
current
->
kernel_stack_page
);
for
(
i
=
0
;
i
<
5
;
i
++
)
printk
(
"%08lx "
,
get_seg_long
(
ss
,(
i
+
(
unsigned
long
*
)
esp
)));
printk
(
"
\n
Code: "
);
...
...
mm/kmalloc.c
View file @
efdf60b6
...
...
@@ -300,7 +300,6 @@ if (size &&
}
size
=
p
->
bh_length
;
p
->
bh_flags
=
MF_FREE
;
/* As of now this block is officially free */
save_flags
(
flags
);
cli
();
p
->
bh_next
=
page
->
firstfree
;
...
...
net/inet/sock.c
View file @
efdf60b6
...
...
@@ -1194,8 +1194,11 @@ inet_accept(struct socket *sock, struct socket *newsock, int flags)
* We need to free it up because the tcp module creates
* it's own when it accepts one.
*/
if
(
newsock
->
data
)
kfree_s
(
newsock
->
data
,
sizeof
(
struct
sock
));
if
(
newsock
->
data
)
{
struct
sock
*
sk
=
(
struct
sock
*
)
newsock
->
data
;
newsock
->
data
=
NULL
;
kfree_s
(
sk
,
sizeof
(
struct
sock
));
}
if
(
sk1
->
prot
->
accept
==
NULL
)
return
(
-
EOPNOTSUPP
);
...
...
net/unix/sock.c
View file @
efdf60b6
...
...
@@ -413,10 +413,13 @@ unix_proto_bind(struct socket *sock, struct sockaddr *umyaddr,
old_fs
=
get_fs
();
set_fs
(
get_ds
());
i
=
do_mknod
(
fname
,
S_IFSOCK
|
S_IRWXUGO
,
0
);
if
(
i
==
0
)
i
=
open_namei
(
fname
,
0
,
S_IFSOCK
,
&
upd
->
inode
,
NULL
);
if
(
i
==
-
EEXIST
)
i
=
-
EADDRINUSE
;
if
(
i
==
0
)
i
=
open_namei
(
fname
,
0
,
S_IFSOCK
,
&
upd
->
inode
,
NULL
);
set_fs
(
old_fs
);
if
(
i
<
0
)
{
printk
(
"UNIX: bind: can't open socket %s
\n
"
,
fname
);
dprintf
(
1
,
"UNIX: bind: can't open socket %s
\n
"
,
fname
);
return
(
i
);
}
upd
->
sockaddr_len
=
sockaddr_len
;
/* now its legal */
...
...
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