20 Jul, 2007

1 commit

  • Transform some calls to kmalloc/memset to a single kzalloc (or kcalloc).

    Here is a short excerpt of the semantic patch performing
    this transformation:

    @@
    type T2;
    expression x;
    identifier f,fld;
    expression E;
    expression E1,E2;
    expression e1,e2,e3,y;
    statement S;
    @@

    x =
    - kmalloc
    + kzalloc
    (E1,E2)
    ... when != \(x->fld=E;\|y=f(...,x,...);\|f(...,x,...);\|x=E;\|while(...) S\|for(e1;e2;e3) S\)
    - memset((T2)x,0,E1);

    @@
    expression E1,E2,E3;
    @@

    - kzalloc(E1 * E2,E3)
    + kcalloc(E1,E2,E3)

    [akpm@linux-foundation.org: get kcalloc args the right way around]
    Signed-off-by: Yoann Padioleau
    Cc: Richard Henderson
    Cc: Ivan Kokshaysky
    Acked-by: Russell King
    Cc: Bryan Wu
    Acked-by: Jiri Slaby
    Cc: Dave Airlie
    Acked-by: Roland Dreier
    Cc: Jiri Kosina
    Acked-by: Dmitry Torokhov
    Cc: Benjamin Herrenschmidt
    Acked-by: Mauro Carvalho Chehab
    Acked-by: Pierre Ossman
    Cc: Jeff Garzik
    Cc: "David S. Miller"
    Acked-by: Greg KH
    Cc: James Bottomley
    Cc: "Antonino A. Daplas"
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Yoann Padioleau
     

12 Jul, 2007

1 commit

  • 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: Tejun Heo
    Cc: Cornelia Huck
    Cc: Andrew Morton
    Signed-off-by: Greg Kroah-Hartman

    Tejun Heo
     

09 May, 2007

1 commit


08 May, 2007

1 commit

  • Ensure pages are uptodate after returning from read_cache_page, which allows
    us to cut out most of the filesystem-internal PageUptodate calls.

    I didn't have a great look down the call chains, but this appears to fixes 7
    possible use-before uptodate in hfs, 2 in hfsplus, 1 in jfs, a few in
    ecryptfs, 1 in jffs2, and a possible cleared data overwritten with readpage in
    block2mtd. All depending on whether the filler is async and/or can return
    with a !uptodate page.

    Signed-off-by: Nick Piggin
    Cc: Hugh Dickins
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Nick Piggin
     

03 May, 2007

1 commit


17 Mar, 2007

1 commit

  • The only error code which comes from the partition checkers is -1, when
    they finds an EIO. As per the discussion, ENOMEM values were ignored,
    as they might scare the users.

    So, with the current code, we end up returning -1 and not EIO for the
    ioctl() calls. Which doesn't give any clue to the user of what went
    wrong.

    Signed-off-by: Suzuki K P
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    suzuki
     

08 Mar, 2007

1 commit


17 Feb, 2007

1 commit


11 Feb, 2007

1 commit

  • 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: Fabio Massimo Di Nitto
    Signed-off-by: David S. Miller

    Fabio Massimo Di Nitto
     

09 Dec, 2006

1 commit

  • This patch provides fault-injection capability for disk IO.

    Boot option:

    fail_make_request=,,,

    -- specifies the interval of failures.

    -- specifies how often it should fail in percent.

    -- specifies the size of free space where disk IO can be issued
    safely in bytes.

    -- 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
    Signed-off-by: Akinobu Mita
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Akinobu Mita
     

08 Dec, 2006

2 commits

  • 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: Suzuki K P
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Suzuki K P
     
  • 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: Suzuki K P
    Cc: Erik Mouw
    Cc: Christoph Hellwig
    Cc: Al Viro
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Suzuki Kp
     

17 Oct, 2006

1 commit

  • 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
    Cc: Greg KH
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jeff Garzik
     

11 Jul, 2006

1 commit

  • Change the partition code in fs/partitions/check.c to initialize a newly
    detected partition's policy field with that of the containing block device
    (see patch below).

    My reasoning is that function set_disk_ro() in block/genhd.c modifies the
    policy field (read-only indicator) of a disk and all contained partitions.
    When a partition is detected after the call to set_disk_ro(), the policy
    field of this partition will currently not inherit the disk's policy field.
    This behavior poses a problem in cases where a block device can be
    'logically de- and reactivated' like e.g. the s390 DASD driver because
    partition detection may run after the policy field has been modified.

    Signed-off-by: Peter Oberparleiter
    Acked-by: Al Viro
    Makes-sense-to: Jens Axboe
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Peter Oberparleiter
     

27 Jun, 2006

4 commits


23 Jun, 2006

2 commits

  • 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
    :

    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: Mike Miller
    Signed-off-by: Stephen Cameron
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Mike Miller
     
  • 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: Pekka Enberg
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Pekka Enberg
     

22 Jun, 2006

1 commit

  • Like the SUBSYTEM= key we find in the environment of the uevent, this
    creates a generic "subsystem" link in sysfs for every device. Userspace
    usually doesn't care at all if its a "class" or a "bus" device. This
    provides an unified way to determine the subsytem of a device, regardless
    of the way the driver core has created it.

    Signed-off-by: Kay Sievers
    Signed-off-by: Greg Kroah-Hartman

    Kay Sievers
     

13 May, 2006

1 commit

  • 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 56cf6504fc1c0c221b82cebc16a444b684140fb7 and
    its reversal (1a2acc9e9214699a99389e323e6686e9e0e2ca67).

    Original problem reported by Todd Blumer and others.

    Acked-by: Greg KH
    Cc: Russell King
    Cc: James Bottomley
    Cc: Erik Mouw
    Cc: Andrew Vasquez
    Cc: Todd Blumer
    Signed-off-by: Linus Torvalds

    Linus Torvalds
     

18 Apr, 2006

1 commit

  • As noted further on the this file, some block devices have a / in their
    name, so fix the "block:..." symlink name the same as the /sys/block name.

    Signed-off-by: Stephen Rothwell
    Cc: Al Viro
    Cc: Christoph Hellwig
    Signed-off-by: Andrew Morton
    Signed-off-by: Greg Kroah-Hartman

    Stephen Rothwell
     

15 Apr, 2006

1 commit

  • [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: Kay Sievers
    Signed-off-by: Greg Kroah-Hartman

    Kay Sievers
     

28 Mar, 2006

2 commits


17 Jan, 2006

1 commit

  • The Rio Karma portable MP3 player has its own proprietary partition table.

    The partition layout is similar to a DOS boot sector but it begins at a
    different offset and uses a different magic number (0xAB56 instead of
    0xAA55). Add support for it to enable mounting the device.

    Signed-off-by: Bob Copeland
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Bob Copeland
     

05 Jan, 2006

2 commits


01 Nov, 2005

1 commit

  • Instead of having ->read_sectors and ->write_sectors, combine the two
    into ->sectors[2] and similar for the other fields. This saves a branch
    several places in the io path, since we don't have to care for what the
    actual io direction is. On my x86-64 box, that's 200 bytes less text in
    just the core (not counting the various drivers).

    Signed-off-by: Jens Axboe

    Jens Axboe
     

29 Oct, 2005

2 commits


28 Oct, 2005

1 commit

  • struct gendisk has these two fields: stamp, stamp_idle. Update to
    stamp_idle is always in sync with stamp and they are always the same.
    Therefore, it does not add any value in having two fields tracking
    same timestamp. Suggest to remove it.

    Also, we should only update gendisk stats with non-zero value.
    Advantage is that we don't have to needlessly calculate memory address,
    and then add zero to the content.

    Signed-off-by: Ken Chen
    Signed-off-by: Jens Axboe

    Chen, Kenneth W
     

26 Jun, 2005

1 commit

  • This patch makes the following changes to the msdos partition code:
    - remove CONFIG_NEC98_PARTITION leftovers
    - make parse_bsd static

    This patch was already ACK'ed by Andries Brouwer.

    Signed-off-by: Adrian Bunk
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Adrian Bunk
     

19 Apr, 2005

1 commit


17 Apr, 2005

1 commit

  • Initial git repository build. I'm not bothering with the full history,
    even though we have it. We can create a separate "historical" git
    archive of that later if we want to, and in the meantime it's about
    3.2GB when imported into git - space that would just make the early
    git days unnecessarily complicated, when we don't have a lot of good
    infrastructure for it.

    Let it rip!

    Linus Torvalds