This is a note to let you know that I've just added the patch titled Revert "block: rescan partitions on invalidated devices on -ENOMEDIA
to the 2.6.33-longterm tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/longterm/longterm-queue-2.6.33.git;a=summary The filename of the patch is: revert-block-rescan-partitions-on-invalidated-devices-on-enomedia.patch and it can be found in the queue-2.6.33 subdirectory. If you, or anyone else, feels it should not be added to the 2.6.33 longterm tree, please let <sta...@kernel.org> know about it. >From a68753aa46dad44915db20f715d9bfbc5815fb8d Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman <gre...@suse.de> Date: Tue, 2 Aug 2011 14:45:26 -0700 Subject: Revert "block: rescan partitions on invalidated devices on -ENOMEDIA too" This reverts commit 6f31747bfeb8c74e6d0a10ecef0abe2a04c5a6cb (commit 02e352287a40bd456eb78df705bf888bc3161d3f upstream) This should have only been commited on .38 and newer, not older kernels like this one, sorry. Cc: Tejun Heo <t...@kernel.org> Cc: David Zeuthen <zeut...@gmail.com> Cc: Martin Pitt <martin.p...@ubuntu.com> Cc: Kay Sievers <kay.siev...@vrfy.org> Cc: Alan Cox <a...@lxorguk.ukuu.org.uk> Cc: Jens Axboe <jax...@fusionio.com> Cc: Andi Kleen <a...@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gre...@suse.de> --- fs/block_dev.c | 27 +++++++++------------------ 1 file changed, 9 insertions(+), 18 deletions(-) --- a/fs/block_dev.c +++ b/fs/block_dev.c @@ -1211,7 +1211,6 @@ static int __blkdev_get(struct block_dev if (!bdev->bd_part) goto out_clear; - ret = 0; if (disk->fops->open) { ret = disk->fops->open(bdev, mode); if (ret == -ERESTARTSYS) { @@ -1227,18 +1226,9 @@ static int __blkdev_get(struct block_dev mutex_unlock(&bdev->bd_mutex); goto restart; } + if (ret) + goto out_clear; } - /* - * If the device is invalidated, rescan partition - * if open succeeded or failed with -ENOMEDIUM. - * The latter is necessary to prevent ghost - * partitions on a removed medium. - */ - if (bdev->bd_invalidated && (!ret || ret == -ENOMEDIUM)) - rescan_partitions(disk, bdev); - if (ret) - goto out_clear; - if (!bdev->bd_openers) { bd_set_size(bdev,(loff_t)get_capacity(disk)<<9); bdi = blk_get_backing_dev_info(bdev); @@ -1246,6 +1236,8 @@ static int __blkdev_get(struct block_dev bdi = &default_backing_dev_info; bdev->bd_inode->i_data.backing_dev_info = bdi; } + if (bdev->bd_invalidated) + rescan_partitions(disk, bdev); } else { struct block_device *whole; whole = bdget_disk(disk, 0); @@ -1272,14 +1264,13 @@ static int __blkdev_get(struct block_dev put_disk(disk); disk = NULL; if (bdev->bd_contains == bdev) { - ret = 0; - if (bdev->bd_disk->fops->open) + 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)) + if (ret) + goto out_unlock_bdev; + } + if (bdev->bd_invalidated) rescan_partitions(bdev->bd_disk, bdev); - if (ret) - goto out_unlock_bdev; } } bdev->bd_openers++; Patches currently in longterm-queue-2.6.33 which might be from gre...@suse.de are /home/gregkh/linux/longterm/longterm-queue-2.6.33/queue-2.6.33/cciss-do-not-attempt-to-read-from-a-write-only-register.patch /home/gregkh/linux/longterm/longterm-queue-2.6.33/queue-2.6.33/sunrpc-fix-use-of-static-variable-in-rpcb_getport_async.patch /home/gregkh/linux/longterm/longterm-queue-2.6.33/queue-2.6.33/powerpc-pseries-hvconsole-fix-dropped-console-output.patch /home/gregkh/linux/longterm/longterm-queue-2.6.33/queue-2.6.33/ext3-fix-oops-in-ext3_try_to_allocate_with_rsv.patch /home/gregkh/linux/longterm/longterm-queue-2.6.33/queue-2.6.33/revert-block-rescan-partitions-on-invalidated-devices-on-enomedia.patch /home/gregkh/linux/longterm/longterm-queue-2.6.33/queue-2.6.33/powerpc-kdump-fix-timeout-in-crash_kexec_wait_realmode.patch /home/gregkh/linux/longterm/longterm-queue-2.6.33/queue-2.6.33/ehci-fix-direction-handling-for-interrupt-data-toggles.patch /home/gregkh/linux/longterm/longterm-queue-2.6.33/queue-2.6.33/kexec-x86-fix-incorrect-jump-back-address-if-not.patch /home/gregkh/linux/longterm/longterm-queue-2.6.33/queue-2.6.33/svcrpc-fix-list-corrupting-race-on-nfsd-shutdown.patch /home/gregkh/linux/longterm/longterm-queue-2.6.33/queue-2.6.33/libata-fix-unexpectedly-frozen-port-after-ata_eh_reset.patch /home/gregkh/linux/longterm/longterm-queue-2.6.33/queue-2.6.33/gre-fix-netns-vs-proto-registration-ordering.patch /home/gregkh/linux/longterm/longterm-queue-2.6.33/queue-2.6.33/gro-only-reset-frag0-when-skb-can-be-pulled.patch /home/gregkh/linux/longterm/longterm-queue-2.6.33/queue-2.6.33/pvrusb2-fix-g-s_tuner-support.patch /home/gregkh/linux/longterm/longterm-queue-2.6.33/queue-2.6.33/v4l2-ioctl.c-prefill-tuner-type-for-g_frequency-and.patch /home/gregkh/linux/longterm/longterm-queue-2.6.33/queue-2.6.33/mac80211-restart-sta-timers-only-on-associated-state.patch /home/gregkh/linux/longterm/longterm-queue-2.6.33/queue-2.6.33/x86-hpet-chose-a-paranoid-safe-value-for-the-etime-check.patch /home/gregkh/linux/longterm/longterm-queue-2.6.33/queue-2.6.33/pmcraid-reject-negative-request-size.patch /home/gregkh/linux/longterm/longterm-queue-2.6.33/queue-2.6.33/sunrpc-fix-a-race-between-work-queue-and-rpc_killall_tasks.patch /home/gregkh/linux/longterm/longterm-queue-2.6.33/queue-2.6.33/netns-xfrm-fixup-xfrm6_tunnel-error-propagation.patch /home/gregkh/linux/longterm/longterm-queue-2.6.33/queue-2.6.33/x86-hpet-avoid-the-comparator-readback-penalty.patch /home/gregkh/linux/longterm/longterm-queue-2.6.33/queue-2.6.33/alpha-fix-several-security-issues.patch /home/gregkh/linux/longterm/longterm-queue-2.6.33/queue-2.6.33/usb-pl2303-add-adlink-nd-6530-usb-ids.patch /home/gregkh/linux/longterm/longterm-queue-2.6.33/queue-2.6.33/libsas-remove-expander-from-dev-list-on-error.patch /home/gregkh/linux/longterm/longterm-queue-2.6.33/queue-2.6.33/x86-make-dell-latitude-e5420-use-reboot-pci.patch /home/gregkh/linux/longterm/longterm-queue-2.6.33/queue-2.6.33/ses-requesting-a-fault-indication.patch /home/gregkh/linux/longterm/longterm-queue-2.6.33/queue-2.6.33/fix-crash-in-scsi_dispatch_cmd.patch /home/gregkh/linux/longterm/longterm-queue-2.6.33/queue-2.6.33/pci-ari-is-a-pcie-v2-feature.patch /home/gregkh/linux/longterm/longterm-queue-2.6.33/queue-2.6.33/geode-reflect-mfgpt-dependency-on-mfd.patch /home/gregkh/linux/longterm/longterm-queue-2.6.33/queue-2.6.33/usb-musb-restore-index-register-in-resume-path.patch /home/gregkh/linux/longterm/longterm-queue-2.6.33/queue-2.6.33/usb-serial-add-ids-for-winchiphead-usb-rs232-adapter.patch /home/gregkh/linux/longterm/longterm-queue-2.6.33/queue-2.6.33/arm-pxa-cm-x300-fix-v3020-rtc-functionality.patch /home/gregkh/linux/longterm/longterm-queue-2.6.33/queue-2.6.33/si4713-i2c-avoid-potential-buffer-overflow-on-si4713.patch /home/gregkh/linux/longterm/longterm-queue-2.6.33/queue-2.6.33/proc-restrict-access-to-proc-pid-io.patch /home/gregkh/linux/longterm/longterm-queue-2.6.33/queue-2.6.33/blacklist-traxdata-cdr4120-and-iomega-zip-drive-to-avoid-lock-ups.patch /home/gregkh/linux/longterm/longterm-queue-2.6.33/queue-2.6.33/asoc-fix-blackfin-i2s-_pointer-implementation-return-in.patch /home/gregkh/linux/longterm/longterm-queue-2.6.33/queue-2.6.33/staging-comedi-fix-infoleak-to-userspace.patch /home/gregkh/linux/longterm/longterm-queue-2.6.33/queue-2.6.33/bridge-send-proper-message_age-in-config-bpdu.patch /home/gregkh/linux/longterm/longterm-queue-2.6.33/queue-2.6.33/bttv-fix-s_tuner-for-radio.patch /home/gregkh/linux/longterm/longterm-queue-2.6.33/queue-2.6.33/jme-fix-unmap-error-causing-system-freeze.patch /home/gregkh/linux/longterm/longterm-queue-2.6.33/queue-2.6.33/ehci-only-power-off-port-if-over-current-is-active.patch /home/gregkh/linux/longterm/longterm-queue-2.6.33/queue-2.6.33/davinci-dm365-evm-fix-video-input-mux-bits.patch /home/gregkh/linux/longterm/longterm-queue-2.6.33/queue-2.6.33/usb-dummy-hcd-needs-the-has_tt-flag.patch /home/gregkh/linux/longterm/longterm-queue-2.6.33/queue-2.6.33/hwmon-max1111-fix-race-condition-causing-null-pointer-exception.patch /home/gregkh/linux/longterm/longterm-queue-2.6.33/queue-2.6.33/xtensa-prevent-arbitrary-read-in-ptrace.patch /home/gregkh/linux/longterm/longterm-queue-2.6.33/queue-2.6.33/hwmon-asus_atk0110-fix-memory-leak.patch /home/gregkh/linux/longterm/longterm-queue-2.6.33/queue-2.6.33/usb-pl2303.h-checkpatch-cleanups.patch _______________________________________________ stable mailing list stable@linux.kernel.org http://linux.kernel.org/mailman/listinfo/stable