1. 09 10月, 2008 1 次提交
    • T
      block: allow deleting zero length partition · ec2cdedf
      Tejun Heo 提交于
      delete_partition() was noop for zero length partition.  As the
      addition code allows creating zero lenght partition and deletion is
      assumed to always succeed, this causes memory leak for zero length
      partitions.  Allow zero length partitions to end their meaningless
      lives.
      
      While at it, allow deleting zero lenght partition via
      BLKPG_DEL_PARTITION ioctl too.
      Signed-off-by: NTejun Heo <tj@kernel.org>
      Signed-off-by: NJens Axboe <jens.axboe@oracle.com>
      ec2cdedf
  2. 14 9月, 2008 1 次提交
  3. 26 7月, 2008 2 次提交
  4. 22 7月, 2008 1 次提交
  5. 20 4月, 2008 1 次提交
  6. 08 2月, 2008 4 次提交
  7. 25 1月, 2008 4 次提交
    • G
      Kobject: convert fs/* from kobject_unregister() to kobject_put() · 197b12d6
      Greg Kroah-Hartman 提交于
      There is no need for kobject_unregister() anymore, thanks to Kay's
      kobject cleanup changes, so replace all instances of it with
      kobject_put().
      
      
      Cc: Kay Sievers <kay.sievers@vrfy.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      197b12d6
    • K
      Driver core: convert block from raw kobjects to core devices · edfaa7c3
      Kay Sievers 提交于
      This moves the block devices to /sys/class/block. It will create a
      flat list of all block devices, with the disks and partitions in one
      directory. For compatibility /sys/block is created and contains symlinks
      to the disks.
      
        /sys/class/block
        |-- sda -> ../../devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda
        |-- sda1 -> ../../devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda/sda1
        |-- sda10 -> ../../devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda/sda10
        |-- sda5 -> ../../devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda/sda5
        |-- sda6 -> ../../devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda/sda6
        |-- sda7 -> ../../devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda/sda7
        |-- sda8 -> ../../devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda/sda8
        |-- sda9 -> ../../devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda/sda9
        `-- sr0 -> ../../devices/pci0000:00/0000:00:1f.2/host1/target1:0:0/1:0:0:0/block/sr0
      
        /sys/block/
        |-- sda -> ../devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda
        `-- sr0 -> ../devices/pci0000:00/0000:00:1f.2/host1/target1:0:0/1:0:0:0/block/sr0
      Signed-off-by: NKay Sievers <kay.sievers@vrfy.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      edfaa7c3
    • G
      kset: convert block_subsys to use kset_create · 830d3cfb
      Greg Kroah-Hartman 提交于
      Dynamically create the kset instead of declaring it statically.  We also
      rename block_subsys to block_kset to catch all users of this symbol
      with a build error instead of an easy-to-ignore build warning.
      
      Cc: Kay Sievers <kay.sievers@vrfy.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      830d3cfb
    • G
      kobject: get rid of kobject_add_dir · 4ff6abff
      Greg Kroah-Hartman 提交于
      kobject_create_and_add is the same as kobject_add_dir, so drop
      kobject_add_dir.
      
      
      Cc: Kay Sievers <kay.sievers@vrfy.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      4ff6abff
  8. 13 10月, 2007 1 次提交
  9. 20 7月, 2007 1 次提交
  10. 12 7月, 2007 1 次提交
    • T
      sysfs: kill unnecessary attribute->owner · 7b595756
      Tejun Heo 提交于
      sysfs is now completely out of driver/module lifetime game.  After
      deletion, a sysfs node doesn't access anything outside sysfs proper,
      so there's no reason to hold onto the attribute owners.  Note that
      often the wrong modules were accounted for as owners leading to
      accessing removed modules.
      
      This patch kills now unnecessary attribute->owner.  Note that with
      this change, userland holding a sysfs node does not prevent the
      backing module from being unloaded.
      
      For more info regarding lifetime rule cleanup, please read the
      following message.
      
        http://article.gmane.org/gmane.linux.kernel/510293
      
      (tweaked by Greg to not delete the field just yet, to make it easier to
      merge things properly.)
      Signed-off-by: NTejun Heo <htejun@gmail.com>
      Cc: Cornelia Huck <cornelia.huck@de.ibm.com>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      7b595756
  11. 09 5月, 2007 1 次提交
  12. 08 5月, 2007 1 次提交
  13. 03 5月, 2007 1 次提交
  14. 17 3月, 2007 1 次提交
  15. 08 3月, 2007 1 次提交
  16. 17 2月, 2007 1 次提交
  17. 11 2月, 2007 1 次提交
    • F
      [PARTITION]: Add whole_disk attribute. · d18d7682
      Fabio Massimo Di Nitto 提交于
      Some partitioning systems create special partitions that
      span the entire disk.  One example are Sun partitions, and
      this whole-disk partition exists to tell the firmware the
      extent of the entire device so it can load the boot block
      and do other things.
      
      Such partitions should not be treated as normal partitions,
      because all the other partitions overlap this whole-disk one.
      So we'd see multiple instances of the same UUID etc. which
      we do not want.  udev and friends can thus search for this
      'whole_disk' attribute and use it to decide to ignore the
      partition.
      Signed-off-by: NFabio Massimo Di Nitto <fabbione@ubuntu.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      d18d7682
  18. 09 12月, 2006 1 次提交
    • A
      [PATCH] fault-injection capability for disk IO · c17bb495
      Akinobu Mita 提交于
      This patch provides fault-injection capability for disk IO.
      
      Boot option:
      
      fail_make_request=<probability>,<interval>,<space>,<times>
      
      	<interval> -- specifies the interval of failures.
      
      	<probability> -- specifies how often it should fail in percent.
      
      	<space> -- specifies the size of free space where disk IO can be issued
      		   safely in bytes.
      
      	<times> -- specifies how many times failures may happen at most.
      
      Debugfs:
      
      /debug/fail_make_request/interval
      /debug/fail_make_request/probability
      /debug/fail_make_request/specifies
      /debug/fail_make_request/times
      
      Example:
      
      	fail_make_request=10,100,0,-1
      	echo 1 > /sys/blocks/hda/hda1/make-it-fail
      
      generic_make_request() on /dev/hda1 fails once per 10 times.
      
      Cc: Jens Axboe <axboe@suse.de>
      Signed-off-by: NAkinobu Mita <akinobu.mita@gmail.com>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      c17bb495
  19. 08 12月, 2006 2 次提交
    • S
      [PATCH] Fix check_partition routines · 57881dd9
      Suzuki K P 提交于
      check_partition() stops its probe once it hits an I/O error from the
      partition checkers.  This would prevent the actual partition checker
      getting a chance to verify the partition.
      
      So this patch lets check_partition() continue probing untill it hits a
      success while recording the I/O error which might have been reported by the
      checking routines.
      
      Also, it does some cleanup of the partition methods for ibm, atari and
      amiga to return -1 upon hitting an I/O error.
      Signed-off-by: NSuzuki K P <suzuki@in.ibm.com>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      57881dd9
    • S
      [PATCH] fix rescan_partitions to return errors properly · 5127d002
      Suzuki Kp 提交于
      The current rescan_partition implementation ignores the errors that comes from
      the lower layer.  It reports success for unknown partitions as well as I/O
      error cases while reading the partition information.
      
      The unknown partition is not (and will not be) considered as an error in the
      kernel, since there are legal users of it (e.g, members of a RAID5 MD Device
      or a new disk which is not partitioned at all ).  Changing this behaviour
      would scare the user about a serious problem with their disk and is not
      recommended.  Thus for both "unknown partitions" to the Linux (eg., DEC
      VMS,Novell Netware) and the legal users of NULL partition, would still be
      reported as "SUCCESS".
      
      The patch attached here, scares the user about something which he does need to
      worry about.  i.e, returning -EIO on disk I/O errors while reading the
      partition information.
      Signed-off-by: NSuzuki K P <suzuki@in.ibm.com>
      Cc: Erik Mouw <erik@harddisk-recovery.com>
      Cc: Christoph Hellwig <hch@lst.de>
      Cc: Al Viro <viro@zeniv.linux.org.uk>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      5127d002
  20. 17 10月, 2006 1 次提交
  21. 11 7月, 2006 1 次提交
  22. 27 6月, 2006 4 次提交
  23. 23 6月, 2006 2 次提交
    • M
      [PATCH] make kernel warn about incorrectly sized partitions · 98bd34ea
      Mike Miller 提交于
      Sometimes partitions claim to be larger than the reported capacity of a
      disk device.  This patch makes the kernel warn about those partitions.
      
      We still permit these patitions to be used.  Quoting Andries Brouwer
      <Andries.Brouwer@cwi.nl>:
      
       Case 1: The kernel is mistaken about the size of the disk.  (There are
       commands to clip a disk to a certain capacity, there are jumpers to tell a
       disk that it should report a certain capacity etc.  Usually this is because
       of BIOS bugs.  In bad cases the machine will crash in the BIOS and hence fail
       to boot if the disk reports full capacity.) In such cases actually accessing
       the blocks of the partition may work fine, or may work fine after running an
       unclip utility.  I wrote "setmax" some years ago precisely for this reason.
      
       Case 2: There was a messy partition table (maybe just a rounding error) but
       the actual filesystem on the partition is contained in the physical disk.
       Now using the filesystem goes without problem.
      
       Case 3: Both partition and filesystem extend beyond the end of the disk.  In
       forensic or debugging situations one often uses a copy of the start of a
       disk.  Now access beyond the end gives an expected I/O error.
      Signed-off-by: NMike Miller <mike.miller@hp.com>
      Signed-off-by: NStephen Cameron <steve.cameron@hp.com>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      98bd34ea
    • P
      [PATCH] read_mapping_page for address space · 090d2b18
      Pekka Enberg 提交于
      Add read_mapping_page() which is used for callers that pass
      mapping->a_ops->readpage as the filler for read_cache_page.  This removes
      some duplication from filesystem code.
      Signed-off-by: NPekka Enberg <penberg@cs.helsinki.fi>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      090d2b18
  24. 22 6月, 2006 1 次提交
  25. 13 5月, 2006 1 次提交
    • L
      Alternative fix for MMC oops on unmount after removal · 032ebf26
      Linus Torvalds 提交于
      Make sure to clear the driverfs_dev pointer when we do del_gendisk() (on
      disk removal), so that other users that may still have a ref to the disk
      won't try to use the stale pointer.
      
      Also move the KOBJ_REMOVE uevent handler up, so that the uevent still
      has access to the driverfs_dev data.
      
      This all should hopefully fix the problems with MMC umounts after device
      removals that caused commit 56cf6504 and
      its reversal (1a2acc9e).
      
      Original problem reported by Todd Blumer and others.
      Acked-by: NGreg KH <gregkh@suse.de>
      Cc: Russell King <rmk+lkml@arm.linux.org.uk>
      Cc: James Bottomley <James.Bottomley@SteelEye.com>
      Cc: Erik Mouw <erik@harddisk-recovery.com>
      Cc: Andrew Vasquez <andrew.vasquez@qlogic.com>
      Cc: Todd Blumer <todd@sdgsystems.com>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      032ebf26
  26. 18 4月, 2006 1 次提交
  27. 15 4月, 2006 1 次提交
    • K
      [PATCH] BLOCK: delay all uevents until partition table is scanned · d4d7e5df
      Kay Sievers 提交于
      [BLOCK] delay all uevents until partition table is scanned
      
      Here we delay the annoucement of all block device events until the
      disk's partition table is scanned and all partition devices are already
      created and sysfs is populated.
      
      We have a bunch of old bugs for removable storage handling where we
      probe successfully for a filesystem on the raw disk, but at the
      same time the kernel recognizes a partition table and creates partition
      devices.
      Currently there is no sane way to tell if partitions will show up or not
      at the time the disk device is announced to userspace. With the delayed
      events we can simply skip any probe for a filesystem on the raw disk when
      we find already present partitions.
      Signed-off-by: NKay Sievers <kay.sievers@suse.de>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      d4d7e5df
  28. 28 3月, 2006 1 次提交