Linux v3.3-rc7-103-g0c4d067
This commit is contained in:
parent
4cffa5f488
commit
d0ee9bb8b3
@ -187,10 +187,12 @@ CONFIG_HW_RANDOM_VIA=m
|
|||||||
|
|
||||||
CONFIG_X86_PLATFORM_DEVICES=y
|
CONFIG_X86_PLATFORM_DEVICES=y
|
||||||
|
|
||||||
|
CONFIG_AMILO_RFKILL=m
|
||||||
CONFIG_ASUS_LAPTOP=m
|
CONFIG_ASUS_LAPTOP=m
|
||||||
CONFIG_COMPAL_LAPTOP=m
|
CONFIG_COMPAL_LAPTOP=m
|
||||||
CONFIG_DELL_LAPTOP=m
|
CONFIG_DELL_LAPTOP=m
|
||||||
CONFIG_EEEPC_LAPTOP=m
|
CONFIG_EEEPC_LAPTOP=m
|
||||||
|
CONFIG_FUJITSU_TABLET=m
|
||||||
CONFIG_FUJITSU_LAPTOP=m
|
CONFIG_FUJITSU_LAPTOP=m
|
||||||
# CONFIG_FUJITSU_LAPTOP_DEBUG is not set
|
# CONFIG_FUJITSU_LAPTOP_DEBUG is not set
|
||||||
CONFIG_IDEAPAD_LAPTOP=m
|
CONFIG_IDEAPAD_LAPTOP=m
|
||||||
@ -200,6 +202,7 @@ CONFIG_SAMSUNG_LAPTOP=m
|
|||||||
CONFIG_SONY_LAPTOP=m
|
CONFIG_SONY_LAPTOP=m
|
||||||
CONFIG_TOPSTAR_LAPTOP=m
|
CONFIG_TOPSTAR_LAPTOP=m
|
||||||
|
|
||||||
|
|
||||||
CONFIG_ACPI_WMI=m
|
CONFIG_ACPI_WMI=m
|
||||||
CONFIG_ACER_WMI=m
|
CONFIG_ACER_WMI=m
|
||||||
CONFIG_ACERHDF=m
|
CONFIG_ACERHDF=m
|
||||||
|
@ -62,7 +62,7 @@ Summary: The Linux kernel
|
|||||||
# For non-released -rc kernels, this will be appended after the rcX and
|
# For non-released -rc kernels, this will be appended after the rcX and
|
||||||
# gitX tags, so a 3 here would become part of release "0.rcX.gitX.3"
|
# gitX tags, so a 3 here would become part of release "0.rcX.gitX.3"
|
||||||
#
|
#
|
||||||
%global baserelease 6
|
%global baserelease 1
|
||||||
%global fedora_build %{baserelease}
|
%global fedora_build %{baserelease}
|
||||||
|
|
||||||
# base_sublevel is the kernel version we're starting with and patching
|
# base_sublevel is the kernel version we're starting with and patching
|
||||||
@ -95,7 +95,7 @@ Summary: The Linux kernel
|
|||||||
# The rc snapshot level
|
# The rc snapshot level
|
||||||
%define rcrev 7
|
%define rcrev 7
|
||||||
# The git snapshot level
|
# The git snapshot level
|
||||||
%define gitrev 0
|
%define gitrev 1
|
||||||
# Set rpm version accordingly
|
# Set rpm version accordingly
|
||||||
%define rpmversion 3.%{upstream_sublevel}.0
|
%define rpmversion 3.%{upstream_sublevel}.0
|
||||||
%endif
|
%endif
|
||||||
@ -758,7 +758,6 @@ Patch21233: jbd2-clear-BH_Delay-and-BH_Unwritten-in-journal_unmap_buf.patch
|
|||||||
|
|
||||||
#rhbz 754518
|
#rhbz 754518
|
||||||
Patch21235: scsi-sd_revalidate_disk-prevent-NULL-ptr-deref.patch
|
Patch21235: scsi-sd_revalidate_disk-prevent-NULL-ptr-deref.patch
|
||||||
Patch21236: scsi-fix-sd_revalidate_disk-oops.patch
|
|
||||||
|
|
||||||
Patch21250: mcelog-rcu-splat.patch
|
Patch21250: mcelog-rcu-splat.patch
|
||||||
Patch21260: x86-Avoid-invoking-RCU-when-CPU-is-idle.patch
|
Patch21260: x86-Avoid-invoking-RCU-when-CPU-is-idle.patch
|
||||||
@ -1466,7 +1465,6 @@ ApplyPatch jbd2-clear-BH_Delay-and-BH_Unwritten-in-journal_unmap_buf.patch
|
|||||||
|
|
||||||
#rhbz 754518
|
#rhbz 754518
|
||||||
ApplyPatch scsi-sd_revalidate_disk-prevent-NULL-ptr-deref.patch
|
ApplyPatch scsi-sd_revalidate_disk-prevent-NULL-ptr-deref.patch
|
||||||
ApplyPatch scsi-fix-sd_revalidate_disk-oops.patch
|
|
||||||
|
|
||||||
ApplyPatch mcelog-rcu-splat.patch
|
ApplyPatch mcelog-rcu-splat.patch
|
||||||
|
|
||||||
@ -2344,6 +2342,9 @@ fi
|
|||||||
# ||----w |
|
# ||----w |
|
||||||
# || ||
|
# || ||
|
||||||
%changelog
|
%changelog
|
||||||
|
* Fri Mar 16 2012 Dave Jones <davej@redhat.com> - 3.3.0-0.rc7.git1.1
|
||||||
|
- Linux v3.3-rc7-103-g0c4d067
|
||||||
|
|
||||||
* Fri Mar 16 2012 Justin M. Forbes <jforbes@redhat.com>
|
* Fri Mar 16 2012 Justin M. Forbes <jforbes@redhat.com>
|
||||||
- re-enable threading on hibernate compression/decompression
|
- re-enable threading on hibernate compression/decompression
|
||||||
|
|
||||||
|
@ -1,187 +0,0 @@
|
|||||||
Hi,
|
|
||||||
|
|
||||||
Thank you for review and comments.
|
|
||||||
|
|
||||||
On 02/16/12 02:26, Tejun Heo wrote:
|
|
||||||
> On Wed, Feb 15, 2012 at 11:56:19AM +0900, Jun'ichi Nomura wrote:
|
|
||||||
>> +int invalidate_partitions(struct gendisk *disk, struct block_device *bdev)
|
|
||||||
>> +{
|
|
||||||
>> + int res;
|
|
||||||
>> +
|
|
||||||
>> + res = drop_partitions(disk, bdev);
|
|
||||||
>> + if (res)
|
|
||||||
>> + return res;
|
|
||||||
>> +
|
|
||||||
>
|
|
||||||
> Hmmm... shouldn't we have set_capacity(disk, 0) here?
|
|
||||||
|
|
||||||
Added.
|
|
||||||
I wasn't sure whether I should leave it to drivers.
|
|
||||||
But it seems capacity 0 for ENOMEDIUM device is reasonable.
|
|
||||||
|
|
||||||
>> + check_disk_size_change(disk, bdev);
|
|
||||||
>> + bdev->bd_invalidated = 0;
|
|
||||||
>> + /* tell userspace that the media / partition table may have changed */
|
|
||||||
>> + kobject_uevent(&disk_to_dev(disk)->kobj, KOBJ_CHANGE);
|
|
||||||
>
|
|
||||||
> Also, we really shouldn't be generating KOBJ_CHANGE after every
|
|
||||||
> -ENOMEDIUM open. This can easily lead to infinite loop. We should
|
|
||||||
> generate this iff we actually dropped partitions && modified the size.
|
|
||||||
|
|
||||||
invalidate_partitions() is called only when bd_invalidated is set.
|
|
||||||
So KOBJ_CHANGE is not raised for every ENOMEDIUM open.
|
|
||||||
|
|
||||||
I put it explicit in the function to make it safer for
|
|
||||||
possible misuse.
|
|
||||||
|
|
||||||
How about this?
|
|
||||||
|
|
||||||
---------------------------------------------------------
|
|
||||||
Do not call drivers when invalidating partitions for -ENOMEDIUM
|
|
||||||
|
|
||||||
When a scsi driver returns -ENOMEDIUM for open(),
|
|
||||||
__blkdev_get() calls rescan_partitions(), which ends up calling
|
|
||||||
sd_revalidate_disk() without getting a refcount of scsi_device.
|
|
||||||
|
|
||||||
That could lead to oops like this:
|
|
||||||
|
|
||||||
process A process B
|
|
||||||
----------------------------------------------
|
|
||||||
sys_open
|
|
||||||
__blkdev_get
|
|
||||||
sd_open
|
|
||||||
returns -ENOMEDIUM
|
|
||||||
scsi_remove_device
|
|
||||||
<scsi_device torn down>
|
|
||||||
rescan_partitions
|
|
||||||
sd_revalidate_disk
|
|
||||||
<oops>
|
|
||||||
|
|
||||||
Oopses are reported here:
|
|
||||||
http://marc.info/?l=linux-scsi&m=132388619710052
|
|
||||||
|
|
||||||
This patch separates the partition invalidation from rescan_partitions()
|
|
||||||
and use it for -ENOMEDIUM case.
|
|
||||||
|
|
||||||
Index: linux-3.3/block/partition-generic.c
|
|
||||||
===================================================================
|
|
||||||
--- linux-3.3.orig/block/partition-generic.c 2012-02-15 09:00:25.147293790 +0900
|
|
||||||
+++ linux-3.3/block/partition-generic.c 2012-02-16 10:48:22.257680685 +0900
|
|
||||||
@@ -389,17 +389,11 @@ static bool disk_unlock_native_capacity(
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
-int rescan_partitions(struct gendisk *disk, struct block_device *bdev)
|
|
||||||
+static int drop_partitions(struct gendisk *disk, struct block_device *bdev)
|
|
||||||
{
|
|
||||||
- struct parsed_partitions *state = NULL;
|
|
||||||
struct disk_part_iter piter;
|
|
||||||
struct hd_struct *part;
|
|
||||||
- int p, highest, res;
|
|
||||||
-rescan:
|
|
||||||
- if (state && !IS_ERR(state)) {
|
|
||||||
- kfree(state);
|
|
||||||
- state = NULL;
|
|
||||||
- }
|
|
||||||
+ int res;
|
|
||||||
|
|
||||||
if (bdev->bd_part_count)
|
|
||||||
return -EBUSY;
|
|
||||||
@@ -412,6 +406,24 @@ rescan:
|
|
||||||
delete_partition(disk, part->partno);
|
|
||||||
disk_part_iter_exit(&piter);
|
|
||||||
|
|
||||||
+ return 0;
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
+int rescan_partitions(struct gendisk *disk, struct block_device *bdev)
|
|
||||||
+{
|
|
||||||
+ struct parsed_partitions *state = NULL;
|
|
||||||
+ struct hd_struct *part;
|
|
||||||
+ int p, highest, res;
|
|
||||||
+rescan:
|
|
||||||
+ if (state && !IS_ERR(state)) {
|
|
||||||
+ kfree(state);
|
|
||||||
+ state = NULL;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ res = drop_partitions(disk, bdev);
|
|
||||||
+ if (res)
|
|
||||||
+ return res;
|
|
||||||
+
|
|
||||||
if (disk->fops->revalidate_disk)
|
|
||||||
disk->fops->revalidate_disk(disk);
|
|
||||||
check_disk_size_change(disk, bdev);
|
|
||||||
@@ -515,6 +527,26 @@ rescan:
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
+int invalidate_partitions(struct gendisk *disk, struct block_device *bdev)
|
|
||||||
+{
|
|
||||||
+ int res;
|
|
||||||
+
|
|
||||||
+ if (!bdev->bd_invalidated)
|
|
||||||
+ return 0;
|
|
||||||
+
|
|
||||||
+ res = drop_partitions(disk, bdev);
|
|
||||||
+ if (res)
|
|
||||||
+ return res;
|
|
||||||
+
|
|
||||||
+ set_capacity(disk, 0);
|
|
||||||
+ check_disk_size_change(disk, bdev);
|
|
||||||
+ bdev->bd_invalidated = 0;
|
|
||||||
+ /* tell userspace that the media / partition table may have changed */
|
|
||||||
+ kobject_uevent(&disk_to_dev(disk)->kobj, KOBJ_CHANGE);
|
|
||||||
+
|
|
||||||
+ return 0;
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
unsigned char *read_dev_sector(struct block_device *bdev, sector_t n, Sector *p)
|
|
||||||
{
|
|
||||||
struct address_space *mapping = bdev->bd_inode->i_mapping;
|
|
||||||
Index: linux-3.3/include/linux/genhd.h
|
|
||||||
===================================================================
|
|
||||||
--- linux-3.3.orig/include/linux/genhd.h 2012-02-09 12:21:53.000000000 +0900
|
|
||||||
+++ linux-3.3/include/linux/genhd.h 2012-02-16 10:47:43.783681813 +0900
|
|
||||||
@@ -596,6 +596,7 @@ extern char *disk_name (struct gendisk *
|
|
||||||
|
|
||||||
extern int disk_expand_part_tbl(struct gendisk *disk, int target);
|
|
||||||
extern int rescan_partitions(struct gendisk *disk, struct block_device *bdev);
|
|
||||||
+extern int invalidate_partitions(struct gendisk *disk, struct block_device *bdev);
|
|
||||||
extern struct hd_struct * __must_check add_partition(struct gendisk *disk,
|
|
||||||
int partno, sector_t start,
|
|
||||||
sector_t len, int flags,
|
|
||||||
Index: linux-3.3/fs/block_dev.c
|
|
||||||
===================================================================
|
|
||||||
--- linux-3.3.orig/fs/block_dev.c 2012-02-09 12:21:53.000000000 +0900
|
|
||||||
+++ linux-3.3/fs/block_dev.c 2012-02-16 10:47:52.602681441 +0900
|
|
||||||
@@ -1183,8 +1183,12 @@ static int __blkdev_get(struct block_dev
|
|
||||||
* The latter is necessary to prevent ghost
|
|
||||||
* partitions on a removed medium.
|
|
||||||
*/
|
|
||||||
- if (bdev->bd_invalidated && (!ret || ret == -ENOMEDIUM))
|
|
||||||
- rescan_partitions(disk, bdev);
|
|
||||||
+ if (bdev->bd_invalidated) {
|
|
||||||
+ if (!ret)
|
|
||||||
+ rescan_partitions(disk, bdev);
|
|
||||||
+ else if (ret == -ENOMEDIUM)
|
|
||||||
+ invalidate_partitions(disk, bdev);
|
|
||||||
+ }
|
|
||||||
if (ret)
|
|
||||||
goto out_clear;
|
|
||||||
} else {
|
|
||||||
@@ -1214,8 +1218,12 @@ static int __blkdev_get(struct block_dev
|
|
||||||
if (bdev->bd_disk->fops->open)
|
|
||||||
ret = bdev->bd_disk->fops->open(bdev, mode);
|
|
||||||
/* the same as first opener case, read comment there */
|
|
||||||
- if (bdev->bd_invalidated && (!ret || ret == -ENOMEDIUM))
|
|
||||||
- rescan_partitions(bdev->bd_disk, bdev);
|
|
||||||
+ if (bdev->bd_invalidated) {
|
|
||||||
+ if (!ret)
|
|
||||||
+ rescan_partitions(bdev->bd_disk, bdev);
|
|
||||||
+ else if (ret == -ENOMEDIUM)
|
|
||||||
+ invalidate_partitions(bdev->bd_disk, bdev);
|
|
||||||
+ }
|
|
||||||
if (ret)
|
|
||||||
goto out_unlock_bdev;
|
|
||||||
}
|
|
Loading…
Reference in New Issue
Block a user