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
bab73009
Commit
bab73009
authored
Aug 06, 2003
by
Bartlomiej Zolnierkiewicz
Committed by
Linus Torvalds
Aug 06, 2003
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[PATCH] do not scan partitions twice for removable devices
fixes kobject_register() oops
parent
fc8183c1
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
1 deletion
+15
-1
drivers/ide/ide-disk.c
drivers/ide/ide-disk.c
+7
-0
drivers/ide/ide-floppy.c
drivers/ide/ide-floppy.c
+7
-1
include/linux/ide.h
include/linux/ide.h
+1
-0
No files found.
drivers/ide/ide-disk.c
View file @
bab73009
...
@@ -1790,6 +1790,12 @@ static int idedisk_ioctl(struct inode *inode, struct file *file,
...
@@ -1790,6 +1790,12 @@ static int idedisk_ioctl(struct inode *inode, struct file *file,
static
int
idedisk_media_changed
(
struct
gendisk
*
disk
)
static
int
idedisk_media_changed
(
struct
gendisk
*
disk
)
{
{
ide_drive_t
*
drive
=
disk
->
private_data
;
ide_drive_t
*
drive
=
disk
->
private_data
;
/* do not scan partitions twice if this is a removable device */
if
(
drive
->
attach
)
{
drive
->
attach
=
0
;
return
0
;
}
/* if removable, always assume it was changed */
/* if removable, always assume it was changed */
return
drive
->
removable
;
return
drive
->
removable
;
}
}
...
@@ -1848,6 +1854,7 @@ static int idedisk_attach(ide_drive_t *drive)
...
@@ -1848,6 +1854,7 @@ static int idedisk_attach(ide_drive_t *drive)
g
->
flags
=
drive
->
removable
?
GENHD_FL_REMOVABLE
:
0
;
g
->
flags
=
drive
->
removable
?
GENHD_FL_REMOVABLE
:
0
;
set_capacity
(
g
,
current_capacity
(
drive
));
set_capacity
(
g
,
current_capacity
(
drive
));
g
->
fops
=
&
idedisk_ops
;
g
->
fops
=
&
idedisk_ops
;
drive
->
attach
=
1
;
add_disk
(
g
);
add_disk
(
g
);
return
0
;
return
0
;
failed:
failed:
...
...
drivers/ide/ide-floppy.c
View file @
bab73009
...
@@ -2006,7 +2006,12 @@ static int idefloppy_media_changed(struct gendisk *disk)
...
@@ -2006,7 +2006,12 @@ static int idefloppy_media_changed(struct gendisk *disk)
{
{
ide_drive_t
*
drive
=
disk
->
private_data
;
ide_drive_t
*
drive
=
disk
->
private_data
;
idefloppy_floppy_t
*
floppy
=
drive
->
driver_data
;
idefloppy_floppy_t
*
floppy
=
drive
->
driver_data
;
/* do not scan partitions twice if this is a removable device */
if
(
drive
->
attach
)
{
drive
->
attach
=
0
;
return
0
;
}
return
test_and_clear_bit
(
IDEFLOPPY_MEDIA_CHANGED
,
&
floppy
->
flags
);
return
test_and_clear_bit
(
IDEFLOPPY_MEDIA_CHANGED
,
&
floppy
->
flags
);
}
}
...
@@ -2061,6 +2066,7 @@ static int idefloppy_attach (ide_drive_t *drive)
...
@@ -2061,6 +2066,7 @@ static int idefloppy_attach (ide_drive_t *drive)
strcpy
(
g
->
devfs_name
,
drive
->
devfs_name
);
strcpy
(
g
->
devfs_name
,
drive
->
devfs_name
);
g
->
flags
=
drive
->
removable
?
GENHD_FL_REMOVABLE
:
0
;
g
->
flags
=
drive
->
removable
?
GENHD_FL_REMOVABLE
:
0
;
g
->
fops
=
&
idefloppy_ops
;
g
->
fops
=
&
idefloppy_ops
;
drive
->
attach
=
1
;
add_disk
(
g
);
add_disk
(
g
);
return
0
;
return
0
;
failed:
failed:
...
...
include/linux/ide.h
View file @
bab73009
...
@@ -711,6 +711,7 @@ typedef struct ide_drive_s {
...
@@ -711,6 +711,7 @@ typedef struct ide_drive_s {
unsigned
id_read
:
1
;
/* 1=id read from disk 0 = synthetic */
unsigned
id_read
:
1
;
/* 1=id read from disk 0 = synthetic */
unsigned
noprobe
:
1
;
/* from: hdx=noprobe */
unsigned
noprobe
:
1
;
/* from: hdx=noprobe */
unsigned
removable
:
1
;
/* 1 if need to do check_media_change */
unsigned
removable
:
1
;
/* 1 if need to do check_media_change */
unsigned
attach
:
1
;
/* needed for removable devices */
unsigned
is_flash
:
1
;
/* 1 if probed as flash */
unsigned
is_flash
:
1
;
/* 1 if probed as flash */
unsigned
forced_geom
:
1
;
/* 1 if hdx=c,h,s was given at boot */
unsigned
forced_geom
:
1
;
/* 1 if hdx=c,h,s was given at boot */
unsigned
no_unmask
:
1
;
/* disallow setting unmask bit */
unsigned
no_unmask
:
1
;
/* disallow setting unmask bit */
...
...
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