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.32-longterm tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/longterm/longterm-queue-2.6.32.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.32 subdirectory. If you, or anyone else, feels it should not be added to the 2.6.32 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 5b2745db12a3f97a9ec9efd4ffa077da707d3e4c (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 @@ -1203,7 +1203,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) { @@ -1219,18 +1218,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); @@ -1238,6 +1228,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); @@ -1264,14 +1256,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.32 which might be from gre...@suse.de are /home/gregkh/linux/longterm/longterm-queue-2.6.32/queue-2.6.32/cciss-do-not-attempt-to-read-from-a-write-only-register.patch /home/gregkh/linux/longterm/longterm-queue-2.6.32/queue-2.6.32/sunrpc-fix-use-of-static-variable-in-rpcb_getport_async.patch /home/gregkh/linux/longterm/longterm-queue-2.6.32/queue-2.6.32/powerpc-pseries-hvconsole-fix-dropped-console-output.patch /home/gregkh/linux/longterm/longterm-queue-2.6.32/queue-2.6.32/ext3-fix-oops-in-ext3_try_to_allocate_with_rsv.patch /home/gregkh/linux/longterm/longterm-queue-2.6.32/queue-2.6.32/revert-block-rescan-partitions-on-invalidated-devices-on-enomedia.patch /home/gregkh/linux/longterm/longterm-queue-2.6.32/queue-2.6.32/powerpc-kdump-fix-timeout-in-crash_kexec_wait_realmode.patch /home/gregkh/linux/longterm/longterm-queue-2.6.32/queue-2.6.32/ehci-fix-direction-handling-for-interrupt-data-toggles.patch /home/gregkh/linux/longterm/longterm-queue-2.6.32/queue-2.6.32/kexec-x86-fix-incorrect-jump-back-address-if-not.patch /home/gregkh/linux/longterm/longterm-queue-2.6.32/queue-2.6.32/svcrpc-fix-list-corrupting-race-on-nfsd-shutdown.patch /home/gregkh/linux/longterm/longterm-queue-2.6.32/queue-2.6.32/libata-fix-unexpectedly-frozen-port-after-ata_eh_reset.patch /home/gregkh/linux/longterm/longterm-queue-2.6.32/queue-2.6.32/gre-fix-netns-vs-proto-registration-ordering.patch /home/gregkh/linux/longterm/longterm-queue-2.6.32/queue-2.6.32/gro-only-reset-frag0-when-skb-can-be-pulled.patch /home/gregkh/linux/longterm/longterm-queue-2.6.32/queue-2.6.32/pvrusb2-fix-g-s_tuner-support.patch /home/gregkh/linux/longterm/longterm-queue-2.6.32/queue-2.6.32/v4l2-ioctl.c-prefill-tuner-type-for-g_frequency-and.patch /home/gregkh/linux/longterm/longterm-queue-2.6.32/queue-2.6.32/mac80211-restart-sta-timers-only-on-associated-state.patch /home/gregkh/linux/longterm/longterm-queue-2.6.32/queue-2.6.32/x86-hpet-chose-a-paranoid-safe-value-for-the-etime-check.patch /home/gregkh/linux/longterm/longterm-queue-2.6.32/queue-2.6.32/pmcraid-reject-negative-request-size.patch /home/gregkh/linux/longterm/longterm-queue-2.6.32/queue-2.6.32/sunrpc-fix-a-race-between-work-queue-and-rpc_killall_tasks.patch /home/gregkh/linux/longterm/longterm-queue-2.6.32/queue-2.6.32/netns-xfrm-fixup-xfrm6_tunnel-error-propagation.patch /home/gregkh/linux/longterm/longterm-queue-2.6.32/queue-2.6.32/x86-hpet-avoid-the-comparator-readback-penalty.patch /home/gregkh/linux/longterm/longterm-queue-2.6.32/queue-2.6.32/alpha-fix-several-security-issues.patch /home/gregkh/linux/longterm/longterm-queue-2.6.32/queue-2.6.32/tunnels-fix-netns-vs-proto-registration-ordering.patch /home/gregkh/linux/longterm/longterm-queue-2.6.32/queue-2.6.32/usb-pl2303-add-adlink-nd-6530-usb-ids.patch /home/gregkh/linux/longterm/longterm-queue-2.6.32/queue-2.6.32/libsas-remove-expander-from-dev-list-on-error.patch /home/gregkh/linux/longterm/longterm-queue-2.6.32/queue-2.6.32/x86-make-dell-latitude-e5420-use-reboot-pci.patch /home/gregkh/linux/longterm/longterm-queue-2.6.32/queue-2.6.32/nfsv4.1-update-nfs4_fattr_bitmap_maxsz.patch /home/gregkh/linux/longterm/longterm-queue-2.6.32/queue-2.6.32/ses-requesting-a-fault-indication.patch /home/gregkh/linux/longterm/longterm-queue-2.6.32/queue-2.6.32/usb-ohci-fix-another-regression-for-nvidia-controllers.patch /home/gregkh/linux/longterm/longterm-queue-2.6.32/queue-2.6.32/cifs-fix-null-pointer-dereference-in-cifs_find_smb_ses.patch /home/gregkh/linux/longterm/longterm-queue-2.6.32/queue-2.6.32/fix-crash-in-scsi_dispatch_cmd.patch /home/gregkh/linux/longterm/longterm-queue-2.6.32/queue-2.6.32/pci-ari-is-a-pcie-v2-feature.patch /home/gregkh/linux/longterm/longterm-queue-2.6.32/queue-2.6.32/usb-musb-restore-index-register-in-resume-path.patch /home/gregkh/linux/longterm/longterm-queue-2.6.32/queue-2.6.32/usb-serial-add-ids-for-winchiphead-usb-rs232-adapter.patch /home/gregkh/linux/longterm/longterm-queue-2.6.32/queue-2.6.32/arm-pxa-cm-x300-fix-v3020-rtc-functionality.patch /home/gregkh/linux/longterm/longterm-queue-2.6.32/queue-2.6.32/si4713-i2c-avoid-potential-buffer-overflow-on-si4713.patch /home/gregkh/linux/longterm/longterm-queue-2.6.32/queue-2.6.32/proc-restrict-access-to-proc-pid-io.patch /home/gregkh/linux/longterm/longterm-queue-2.6.32/queue-2.6.32/blacklist-traxdata-cdr4120-and-iomega-zip-drive-to-avoid-lock-ups.patch /home/gregkh/linux/longterm/longterm-queue-2.6.32/queue-2.6.32/cifs-clean-up-cifs_find_smb_ses-try-2.patch /home/gregkh/linux/longterm/longterm-queue-2.6.32/queue-2.6.32/asoc-fix-blackfin-i2s-_pointer-implementation-return-in.patch /home/gregkh/linux/longterm/longterm-queue-2.6.32/queue-2.6.32/staging-comedi-fix-infoleak-to-userspace.patch /home/gregkh/linux/longterm/longterm-queue-2.6.32/queue-2.6.32/bridge-send-proper-message_age-in-config-bpdu.patch /home/gregkh/linux/longterm/longterm-queue-2.6.32/queue-2.6.32/bttv-fix-s_tuner-for-radio.patch /home/gregkh/linux/longterm/longterm-queue-2.6.32/queue-2.6.32/jme-fix-unmap-error-causing-system-freeze.patch /home/gregkh/linux/longterm/longterm-queue-2.6.32/queue-2.6.32/ehci-only-power-off-port-if-over-current-is-active.patch /home/gregkh/linux/longterm/longterm-queue-2.6.32/queue-2.6.32/davinci-dm365-evm-fix-video-input-mux-bits.patch /home/gregkh/linux/longterm/longterm-queue-2.6.32/queue-2.6.32/cifs-check-for-null-session-password.patch /home/gregkh/linux/longterm/longterm-queue-2.6.32/queue-2.6.32/usb-dummy-hcd-needs-the-has_tt-flag.patch /home/gregkh/linux/longterm/longterm-queue-2.6.32/queue-2.6.32/hwmon-max1111-fix-race-condition-causing-null-pointer-exception.patch /home/gregkh/linux/longterm/longterm-queue-2.6.32/queue-2.6.32/xtensa-prevent-arbitrary-read-in-ptrace.patch /home/gregkh/linux/longterm/longterm-queue-2.6.32/queue-2.6.32/usb-pl2303.h-checkpatch-cleanups.patch _______________________________________________ stable mailing list stable@linux.kernel.org http://linux.kernel.org/mailman/listinfo/stable