The patch titled fs/partitions/check: add sysfs error handling has been removed from the -mm tree. Its filename is fs-partitions-check-add-sysfs-error-handling.patch This patch was dropped because it was merged into mainline or a subsystem tree ------------------------------------------------------ Subject: fs/partitions/check: add sysfs error handling From: Jeff Garzik <jeff@xxxxxxxxxx> Handle errors thrown in disk_sysfs_symlinks(), and propagate back to caller. The callers and associated functions don't do a real good job of handling kobject errors anyway (add_partition, register_disk, rescan_partitions), so this should do until something better comes along. Signed-off-by: Jeff Garzik <jeff@xxxxxxxxxx> Cc: Greg KH <greg@xxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxx> --- fs/partitions/check.c | 50 +++++++++++++++++++++++++++++++++------- 1 file changed, 42 insertions(+), 8 deletions(-) diff -puN fs/partitions/check.c~fs-partitions-check-add-sysfs-error-handling fs/partitions/check.c --- a/fs/partitions/check.c~fs-partitions-check-add-sysfs-error-handling +++ a/fs/partitions/check.c @@ -376,18 +376,48 @@ static char *make_block_name(struct gend return name; } -static void disk_sysfs_symlinks(struct gendisk *disk) +static int disk_sysfs_symlinks(struct gendisk *disk) { struct device *target = get_device(disk->driverfs_dev); + int err; + char *disk_name = NULL; + if (target) { - char *disk_name = make_block_name(disk); - sysfs_create_link(&disk->kobj,&target->kobj,"device"); - if (disk_name) { - sysfs_create_link(&target->kobj,&disk->kobj,disk_name); - kfree(disk_name); + disk_name = make_block_name(disk); + if (!disk_name) { + err = -ENOMEM; + goto err_out; } + + err = sysfs_create_link(&disk->kobj, &target->kobj, "device"); + if (err) + goto err_out_disk_name; + + err = sysfs_create_link(&target->kobj, &disk->kobj, disk_name); + if (err) + goto err_out_dev_link; } - sysfs_create_link(&disk->kobj, &block_subsys.kset.kobj, "subsystem"); + + err = sysfs_create_link(&disk->kobj, &block_subsys.kset.kobj, + "subsystem"); + if (err) + goto err_out_disk_name_lnk; + + kfree(disk_name); + + return 0; + +err_out_disk_name_lnk: + if (target) { + sysfs_remove_link(&target->kobj, disk_name); +err_out_dev_link: + sysfs_remove_link(&disk->kobj, "device"); +err_out_disk_name: + kfree(disk_name); +err_out: + put_device(target); + } + return err; } /* Not exported, helper to add_disk(). */ @@ -406,7 +436,11 @@ void register_disk(struct gendisk *disk) *s = '!'; if ((err = kobject_add(&disk->kobj))) return; - disk_sysfs_symlinks(disk); + err = disk_sysfs_symlinks(disk); + if (err) { + kobject_del(&disk->kobj); + return; + } disk_sysfs_add_subdirs(disk); /* No minors to use for partitions */ _ Patches currently in -mm which might be from jeff@xxxxxxxxxx are origin.patch e100-fix-reboot-f-with-netconsole-enabled.patch fix-up-a-multitude-of-acpi-compiler-warnings-on-x86_64.patch cpufreq-handle-sysfs-errors.patch drm-fix-error-returns-sysfs-error-handling.patch git-dvb.patch input-handle-sysfs-errors.patch input-drivers-handle-sysfs-errors.patch git-libata-all.patch ata-must-depend-on-block.patch ahci-readability-tweak.patch libata-sff-allow-for-wacky-systems.patch libata-revamp-blacklist-support-to-allow-multiple-kinds.patch pata_marvell-marvell-6101-6145-pata-driver.patch via-pata-controller-xfer-fixes.patch ahci-ati-sb600-sata-support-for-various-modes.patch drivers-mmcmisc-handle-pci-errors-on-resume.patch git-mtd.patch git-netdev-all.patch libphy-dont-do-that.patch update-smc91x-driver-with-arm-versatile-board-info.patch 8139too-force-media-setting-fix.patch tulip-fix-shutdown-dma-irq-race.patch drivers-dma-handle-sysfs-errors.patch atm-firestream-handle-thrown-error.patch wan-pc300-handle-propagate-minor-errors.patch net-atm-handle-sysfs-errors.patch pcmcia-handle-sysfs-pci-errors.patch r8169-driver-corega-support-patch.patch serial-handle-pci_enable_device-failure-upon-resume.patch git-pciseg.patch scsi-minor-bug-fixes-and-cleanups.patch mpt-fusion-handle-pci-layer-error-on-resume.patch scsi-aha1740-handle-scsi-api-errors.patch scsi-qla2xxx-handle-sysfs-errors.patch usb-gadget-net2280-handle-sysfs-errors-fix.patch git-watchdog.patch airo-suspend-fix.patch i2o-more-error-checking.patch pnp-handle-sysfs-errors.patch rtc-handle-sysfs-errors.patch sound-oss-emu10k1-handle-userspace-copy-errors.patch spi-improve-sysfs-compiler-complaint-handling.patch remove-double-cast-to-same-type.patch atyfb-rivafb-minor-fixes.patch md-conditionalize-some-code.patch user-of-the-jiffies-rounding-patch-ata-subsystem.patch git-gccbug.patch - To unsubscribe from this list: send the line "unsubscribe mm-commits" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html