25 Mar, 2011

1 commit

  • * 'for-2.6.39/core' of git://git.kernel.dk/linux-2.6-block: (65 commits)
    Documentation/iostats.txt: bit-size reference etc.
    cfq-iosched: removing unnecessary think time checking
    cfq-iosched: Don't clear queue stats when preempt.
    blk-throttle: Reset group slice when limits are changed
    blk-cgroup: Only give unaccounted_time under debug
    cfq-iosched: Don't set active queue in preempt
    block: fix non-atomic access to genhd inflight structures
    block: attempt to merge with existing requests on plug flush
    block: NULL dereference on error path in __blkdev_get()
    cfq-iosched: Don't update group weights when on service tree
    fs: assign sb->s_bdi to default_backing_dev_info if the bdi is going away
    block: Require subsystems to explicitly allocate bio_set integrity mempool
    jbd2: finish conversion from WRITE_SYNC_PLUG to WRITE_SYNC and explicit plugging
    jbd: finish conversion from WRITE_SYNC_PLUG to WRITE_SYNC and explicit plugging
    fs: make fsync_buffers_list() plug
    mm: make generic_writepages() use plugging
    blk-cgroup: Add unaccounted time to timeslice_used.
    block: fixup plugging stubs for !CONFIG_BLOCK
    block: remove obsolete comments for blkdev_issue_zeroout.
    blktrace: Use rq->cmd_flags directly in blk_add_trace_rq.
    ...

    Fix up conflicts in fs/{aio.c,super.c}

    Linus Torvalds
     

22 Mar, 2011

1 commit


16 Mar, 2011

1 commit

  • It turns out that while a maximum of 8 partitions may be what people
    "should" have had, you can actually fit up to 18 entries(*) in a sector.

    And some people clearly were taking advantage of that, like Michael
    Cree, who had ten partitions on one of his OSF disks.

    (*) The OSF partition data starts at byte offset 64 in the first sector,
    and the array of 16-byte partition entries start at offset 148 in
    the on-disk partition structure.

    Reported-by: Michael Cree
    Cc: stable@kernel.org (v2.6.38)
    Signed-off-by: Linus Torvalds

    Linus Torvalds
     

15 Mar, 2011

1 commit

  • The kernel automatically evaluates partition tables of storage devices.
    The code for evaluating OSF partitions contains a bug that leaks data
    from kernel heap memory to userspace for certain corrupted OSF
    partitions.

    In more detail:

    for (i = 0 ; i < le16_to_cpu(label->d_npartitions); i++, partition++) {

    iterates from 0 to d_npartitions - 1, where d_npartitions is read from
    the partition table without validation and partition is a pointer to an
    array of at most 8 d_partitions.

    Add the proper and obvious validation.

    Signed-off-by: Timo Warns
    Cc: stable@kernel.org
    [ Changed the patch trivially to not repeat the whole le16_to_cpu()
    thing, and to use an explicit constant for the magic value '8' ]
    Signed-off-by: Linus Torvalds

    Timo Warns
     

26 Feb, 2011

1 commit

  • The kernel automatically evaluates partition tables of storage devices.
    The code for evaluating LDM partitions (in fs/partitions/ldm.c) contains
    a bug that causes a kernel oops on certain corrupted LDM partitions. A
    kernel subsystem seems to crash, because, after the oops, the kernel no
    longer recognizes newly connected storage devices.

    The patch changes ldm_parse_vmdb() to Validate the value of vblk_size.

    Signed-off-by: Timo Warns
    Cc: Eugene Teo
    Acked-by: Richard Russon
    Cc: Harvey Harrison
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Timo Warns
     

18 Feb, 2011

1 commit


13 Jan, 2011

1 commit


07 Jan, 2011

1 commit


05 Jan, 2011

1 commit

  • /proc/diskstats would display a strange output as follows.

    $ cat /proc/diskstats |grep sda
    8 0 sda 90524 7579 102154 20464 0 0 0 0 0 14096 20089
    8 1 sda1 19085 1352 21841 4209 0 0 0 0 4294967064 15689 4293424691
    ~~~~~~~~~~
    8 2 sda2 71252 3624 74891 15950 0 0 0 0 232 23995 1562390
    8 3 sda3 54 487 2188 92 0 0 0 0 0 88 92
    8 4 sda4 4 0 8 0 0 0 0 0 0 0 0
    8 5 sda5 81 2027 2130 138 0 0 0 0 0 87 137

    Its reason is the wrong way of accounting hd_struct->in_flight. When a bio is
    merged into a request belongs to different partition by ELEVATOR_FRONT_MERGE.

    The detailed root cause is as follows.

    Assuming that there are two partition, sda1 and sda2.

    1. A request for sda2 is in request_queue. Hence sda1's hd_struct->in_flight
    is 0 and sda2's one is 1.

    | hd_struct->in_flight
    ---------------------------
    sda1 | 0
    sda2 | 1
    ---------------------------

    2. A bio belongs to sda1 is issued and is merged into the request mentioned on
    step1 by ELEVATOR_BACK_MERGE. The first sector of the request is changed
    from sda2 region to sda1 region. However the two partition's
    hd_struct->in_flight are not changed.

    | hd_struct->in_flight
    ---------------------------
    sda1 | 0
    sda2 | 1
    ---------------------------

    3. The request is finished and blk_account_io_done() is called. In this case,
    sda2's hd_struct->in_flight, not a sda1's one, is decremented.

    | hd_struct->in_flight
    ---------------------------
    sda1 | -1
    sda2 | 1
    ---------------------------

    The patch fixes the problem by caching the partition lookup
    inside the request structure, hence making sure that the increment
    and decrement will always happen on the same partition struct. This
    also speeds up IO with accounting enabled, since it cuts down on
    the number of lookups we have to do.

    Also add a refcount to struct hd_struct to keep the partition in
    memory as long as users exist. We use kref_test_and_get() to ensure
    we don't add a reference to a partition which is going away.

    Signed-off-by: Jerome Marchand
    Signed-off-by: Yasuaki Ishimatsu
    Cc: stable@kernel.org
    Signed-off-by: Jens Axboe

    Jerome Marchand
     

17 Dec, 2010

1 commit


28 Nov, 2010

1 commit


16 Nov, 2010

1 commit


13 Nov, 2010

1 commit

  • Over time, block layer has accumulated a set of APIs dealing with bdev
    open, close, claim and release.

    * blkdev_get/put() are the primary open and close functions.

    * bd_claim/release() deal with exclusive open.

    * open/close_bdev_exclusive() are combination of open and claim and
    the other way around, respectively.

    * bd_link/unlink_disk_holder() to create and remove holder/slave
    symlinks.

    * open_by_devnum() wraps bdget() + blkdev_get().

    The interface is a bit confusing and the decoupling of open and claim
    makes it impossible to properly guarantee exclusive access as
    in-kernel open + claim sequence can disturb the existing exclusive
    open even before the block layer knows the current open if for another
    exclusive access. Reorganize the interface such that,

    * blkdev_get() is extended to include exclusive access management.
    @holder argument is added and, if is @FMODE_EXCL specified, it will
    gain exclusive access atomically w.r.t. other exclusive accesses.

    * blkdev_put() is similarly extended. It now takes @mode argument and
    if @FMODE_EXCL is set, it releases an exclusive access. Also, when
    the last exclusive claim is released, the holder/slave symlinks are
    removed automatically.

    * bd_claim/release() and close_bdev_exclusive() are no longer
    necessary and either made static or removed.

    * bd_link_disk_holder() remains the same but bd_unlink_disk_holder()
    is no longer necessary and removed.

    * open_bdev_exclusive() becomes a simple wrapper around lookup_bdev()
    and blkdev_get(). It also has an unexpected extra bdev_read_only()
    test which probably should be moved into blkdev_get().

    * open_by_devnum() is modified to take @holder argument and pass it to
    blkdev_get().

    Most of bdev open/close operations are unified into blkdev_get/put()
    and most exclusive accesses are tested atomically at the open time (as
    it should). This cleans up code and removes some, both valid and
    invalid, but unnecessary all the same, corner cases.

    open_bdev_exclusive() and open_by_devnum() can use further cleanup -
    rename to blkdev_get_by_path() and blkdev_get_by_devt() and drop
    special features. Well, let's leave them for another day.

    Most conversions are straight-forward. drbd conversion is a bit more
    involved as there was some reordering, but the logic should stay the
    same.

    Signed-off-by: Tejun Heo
    Acked-by: Neil Brown
    Acked-by: Ryusuke Konishi
    Acked-by: Mike Snitzer
    Acked-by: Philipp Reisner
    Cc: Peter Osterlund
    Cc: Martin Schwidefsky
    Cc: Heiko Carstens
    Cc: Jan Kara
    Cc: Andrew Morton
    Cc: Andreas Dilger
    Cc: "Theodore Ts'o"
    Cc: Mark Fasheh
    Cc: Joel Becker
    Cc: Alex Elder
    Cc: Christoph Hellwig
    Cc: dm-devel@redhat.com
    Cc: drbd-dev@lists.linbit.com
    Cc: Leo Chen
    Cc: Scott Branden
    Cc: Chris Mason
    Cc: Steven Whitehouse
    Cc: Dave Kleikamp
    Cc: Joern Engel
    Cc: reiserfs-devel@vger.kernel.org
    Cc: Alexander Viro

    Tejun Heo
     

11 Nov, 2010

1 commit


25 Oct, 2010

3 commits

  • * 'for-linus' of git://git.kernel.dk/linux-2.6-block:
    Revert "block: fix accounting bug on cross partition merges"

    Linus Torvalds
     
  • * 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial: (39 commits)
    Update broken web addresses in arch directory.
    Update broken web addresses in the kernel.
    Revert "drivers/usb: Remove unnecessary return's from void functions" for musb gadget
    Revert "Fix typo: configuation => configuration" partially
    ida: document IDA_BITMAP_LONGS calculation
    ext2: fix a typo on comment in ext2/inode.c
    drivers/scsi: Remove unnecessary casts of private_data
    drivers/s390: Remove unnecessary casts of private_data
    net/sunrpc/rpc_pipe.c: Remove unnecessary casts of private_data
    drivers/infiniband: Remove unnecessary casts of private_data
    drivers/gpu/drm: Remove unnecessary casts of private_data
    kernel/pm_qos_params.c: Remove unnecessary casts of private_data
    fs/ecryptfs: Remove unnecessary casts of private_data
    fs/seq_file.c: Remove unnecessary casts of private_data
    arm: uengine.c: remove C99 comments
    arm: scoop.c: remove C99 comments
    Fix typo configue => configure in comments
    Fix typo: configuation => configuration
    Fix typo interrest[ing|ed] => interest[ing|ed]
    Fix various typos of valid in comments
    ...

    Fix up trivial conflicts in:
    drivers/char/ipmi/ipmi_si_intf.c
    drivers/usb/gadget/rndis.c
    net/irda/irnet/irnet_ppp.c

    Linus Torvalds
     
  • This reverts commit 7681bfeeccff5efa9eb29bf09249a3c400b15327.

    Conflicts:

    include/linux/genhd.h

    It has numerous issues with the cleanup path and non-elevator
    devices. Revert it for now so we can come up with a clean
    version without rushing things.

    Signed-off-by: Jens Axboe

    Jens Axboe
     

23 Oct, 2010

2 commits

  • * git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core-2.6: (31 commits)
    driver core: Display error codes when class suspend fails
    Driver core: Add section count to memory_block struct
    Driver core: Add mutex for adding/removing memory blocks
    Driver core: Move find_memory_block routine
    hpilo: Despecificate driver from iLO generation
    driver core: Convert link_mem_sections to use find_memory_block_hinted.
    driver core: Introduce find_memory_block_hinted which utilizes kset_find_obj_hinted.
    kobject: Introduce kset_find_obj_hinted.
    driver core: fix build for CONFIG_BLOCK not enabled
    driver-core: base: change to new flag variable
    sysfs: only access bin file vm_ops with the active lock
    sysfs: Fail bin file mmap if vma close is implemented.
    FW_LOADER: fix kconfig dependency warning on HOTPLUG
    uio: Statically allocate uio_class and use class .dev_attrs.
    uio: Support 2^MINOR_BITS minors
    uio: Cleanup irq handling.
    uio: Don't clear driver data
    uio: Fix lack of locking in init_uio_class
    SYSFS: Allow boot time switching between deprecated and modern sysfs layout
    driver core: remove CONFIG_SYSFS_DEPRECATED_V2 but keep it for block devices
    ...

    Linus Torvalds
     
  • I have some systems which need legacy sysfs due to old tools that are
    making assumptions that a directory can never be a symlink to another
    directory, and it's a big hazzle to compile separate kernels for them.

    This patch turns CONFIG_SYSFS_DEPRECATED into a run time option
    that can be switched on/off the kernel command line. This way
    the same binary can be used in both cases with just a option
    on the command line.

    The old CONFIG_SYSFS_DEPRECATED_V2 option is still there to set
    the default. I kept the weird name to not break existing
    config files.

    Also the compat code can be still completely disabled by undefining
    CONFIG_SYSFS_DEPRECATED_SWITCH -- just the optimizer takes
    care of this now instead of lots of ifdefs. This makes the code
    look nicer.

    v2: This is an updated version on top of Kay's patch to only
    handle the block devices. I tested it on my old systems
    and that seems to work.

    Cc: axboe@kernel.dk
    Signed-off-by: Andi Kleen
    Cc: Kay Sievers
    Signed-off-by: Greg Kroah-Hartman

    Andi Kleen
     

19 Oct, 2010

1 commit

  • /proc/diskstats would display a strange output as follows.

    $ cat /proc/diskstats |grep sda
    8 0 sda 90524 7579 102154 20464 0 0 0 0 0 14096 20089
    8 1 sda1 19085 1352 21841 4209 0 0 0 0 4294967064 15689 4293424691
    ~~~~~~~~~~
    8 2 sda2 71252 3624 74891 15950 0 0 0 0 232 23995 1562390
    8 3 sda3 54 487 2188 92 0 0 0 0 0 88 92
    8 4 sda4 4 0 8 0 0 0 0 0 0 0 0
    8 5 sda5 81 2027 2130 138 0 0 0 0 0 87 137

    Its reason is the wrong way of accounting hd_struct->in_flight. When a bio is
    merged into a request belongs to different partition by ELEVATOR_FRONT_MERGE.

    The detailed root cause is as follows.

    Assuming that there are two partition, sda1 and sda2.

    1. A request for sda2 is in request_queue. Hence sda1's hd_struct->in_flight
    is 0 and sda2's one is 1.

    | hd_struct->in_flight
    ---------------------------
    sda1 | 0
    sda2 | 1
    ---------------------------

    2. A bio belongs to sda1 is issued and is merged into the request mentioned on
    step1 by ELEVATOR_BACK_MERGE. The first sector of the request is changed
    from sda2 region to sda1 region. However the two partition's
    hd_struct->in_flight are not changed.

    | hd_struct->in_flight
    ---------------------------
    sda1 | 0
    sda2 | 1
    ---------------------------

    3. The request is finished and blk_account_io_done() is called. In this case,
    sda2's hd_struct->in_flight, not a sda1's one, is decremented.

    | hd_struct->in_flight
    ---------------------------
    sda1 | -1
    sda2 | 1
    ---------------------------

    The patch fixes the problem by caching the partition lookup
    inside the request structure, hence making sure that the increment
    and decrement will always happen on the same partition struct. This
    also speeds up IO with accounting enabled, since it cuts down on
    the number of lookups we have to do.

    When reloading partition tables, quiesce IO to ensure that no
    request references to the partition struct exists. When it is safe
    to free the partition table, the IO for that device is restarted
    again.

    Signed-off-by: Yasuaki Ishimatsu
    Cc: stable@kernel.org
    Signed-off-by: Jens Axboe

    Yasuaki Ishimatsu
     

18 Oct, 2010

1 commit

  • The patch below updates broken web addresses in the kernel

    Signed-off-by: Justin P. Mattock
    Cc: Maciej W. Rozycki
    Cc: Geert Uytterhoeven
    Cc: Finn Thain
    Cc: Randy Dunlap
    Cc: Matt Turner
    Cc: Dimitry Torokhov
    Cc: Mike Frysinger
    Acked-by: Ben Pfaff
    Acked-by: Hans J. Koch
    Reviewed-by: Finn Thain
    Signed-off-by: Jiri Kosina

    Justin P. Mattock
     

15 Sep, 2010

2 commits

  • This change extends the partition_meta_info structure to
    support EFI GPT-specific metadata and ensures that data
    is copied in on partition scanning.

    Signed-off-by: Will Drewry
    Signed-off-by: Jens Axboe

    Will Drewry
     
  • I'm reposting this patch series as v4 since there have been no additional
    comments, and I cleaned up one extra bit of unneeded code (in 3/3). The patches
    are against Linus's tree: 2bfc96a127bc1cc94d26bfaa40159966064f9c8c
    (2.6.36-rc3).

    Would this patchset be suitable for inclusion in an mm branch?

    This changes adds a partition_meta_info struct which itself contains a
    union of structures that provide partition table specific metadata.

    This change leaves the union empty. The subsequent patch includes an
    implementation for CONFIG_EFI_PARTITION-based metadata.

    Signed-off-by: Will Drewry
    Signed-off-by: Jens Axboe

    Will Drewry
     

13 Aug, 2010

1 commit

  • 9c867fbe "partitions: fix sometimes unreadable partition strings" coverted
    one line within the ibm partition code incorrectly. Fix this to get rid of
    a build error.

    fs/partitions/ibm.c: In function 'ibm_partition':
    [...]
    fs/partitions/ibm.c:185: error: too many arguments to function 'strlcat'

    Cc: Alexey Dobriyan
    Signed-off-by: Heiko Carstens
    Signed-off-by: Martin Schwidefsky

    Heiko Carstens
     

11 Aug, 2010

1 commit


07 Aug, 2010

1 commit

  • * 'core-rcu-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
    Revert "net: Make accesses to ->br_port safe for sparse RCU"
    mce: convert to rcu_dereference_index_check()
    net: Make accesses to ->br_port safe for sparse RCU
    vfs: add fs.h to define struct file
    lockdep: Add an in_workqueue_context() lockdep-based test function
    rcu: add __rcu API for later sparse checking
    rcu: add an rcu_dereference_index_check()
    tree/tiny rcu: Add debug RCU head objects
    mm: remove all rcu head initializations
    fs: remove all rcu head initializations, except on_stack initializations
    powerpc: remove all rcu head initializations

    Linus Torvalds
     

19 Jul, 2010

1 commit

  • Partition boundary calculation fails for DASD FBA disks under the
    following conditions:
    - disk is formatted with CMS FORMAT with a blocksize of more than
    512 bytes
    - all of the disk is reserved to a single CMS file using CMS RESERVE
    - the disk is accessed using the DIAG mode of the DASD driver

    Under these circumstances, the partition detection code tries to
    read the CMS label block containing partition-relevant information
    from logical block offset 1, while it is in fact located at physical
    block offset 1.

    Fix this problem by using the correct CMS label block location
    depending on the device type as determined by the DASD SENSE ID
    information.

    Signed-off-by: Peter Oberparleiter
    Signed-off-by: Martin Schwidefsky

    Peter Oberparleiter
     

15 Jun, 2010

1 commit


25 May, 2010

1 commit


22 May, 2010

6 commits

  • * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs-2.6: (69 commits)
    fix handling of offsets in cris eeprom.c, get rid of fake on-stack files
    get rid of home-grown mutex in cris eeprom.c
    switch ecryptfs_write() to struct inode *, kill on-stack fake files
    switch ecryptfs_get_locked_page() to struct inode *
    simplify access to ecryptfs inodes in ->readpage() and friends
    AFS: Don't put struct file on the stack
    Ban ecryptfs over ecryptfs
    logfs: replace inode uid,gid,mode initialization with helper function
    ufs: replace inode uid,gid,mode initialization with helper function
    udf: replace inode uid,gid,mode init with helper
    ubifs: replace inode uid,gid,mode initialization with helper function
    sysv: replace inode uid,gid,mode initialization with helper function
    reiserfs: replace inode uid,gid,mode initialization with helper function
    ramfs: replace inode uid,gid,mode initialization with helper function
    omfs: replace inode uid,gid,mode initialization with helper function
    bfs: replace inode uid,gid,mode initialization with helper function
    ocfs2: replace inode uid,gid,mode initialization with helper function
    nilfs2: replace inode uid,gid,mode initialization with helper function
    minix: replace inode uid,gid,mode init with helper
    ext4: replace inode uid,gid,mode init with helper
    ...

    Trivial conflict in fs/fs-writeback.c (mark bitfields unsigned)

    Linus Torvalds
     
  • ADDPART_FLAG_RAID was introduced in commit d18d768, and most places were
    converted to use it instead of a hardcoded value. However, some places seem
    to have been missed.

    Change all of them to the symbolic names via the following semantic patch:

    @@
    struct parsed_partitions *state;
    expression E;
    @@
    (
    - state->parts[E].flags = 1
    + state->parts[E].flags = ADDPART_FLAG_RAID
    |
    - state->parts[E].flags |= 1
    + state->parts[E].flags |= ADDPART_FLAG_RAID
    |
    - state->parts[E].flags = 2
    + state->parts[E].flags = ADDPART_FLAG_WHOLEDISK
    |
    - state->parts[E].flags |= 2
    + state->parts[E].flags |= ADDPART_FLAG_WHOLEDISK
    )

    Signed-off-by: Cesar Eduardo Barros
    Signed-off-by: Al Viro

    Cesar Eduardo Barros
     
  • Currently, native capacity unlocking is initiated only when a
    recognized partition extends beyond the end of the disk. However,
    there are several other unhandled cases where truncated capacity can
    lead to misdetection of partitions.

    * Partition table is fully beyond EOD.

    * Partition table is partially beyond EOD (daisy chained ones).

    * Recognized partition starts beyond EOD.

    This patch updates generic partition check code such that all the
    above three cases are handled too. For the first two, @state tracks
    whether low level partition check code tried to read beyond EOD during
    partition scan and triggers native capacity unlocking accordingly.
    The third is now handled similarly to the original unlocking case.

    Signed-off-by: Tejun Heo
    Cc: Ben Hutchings
    Acked-by: David S. Miller
    Signed-off-by: Jens Axboe

    Tejun Heo
     
  • Make the following changes to partition check code.

    * Add ->bdev to struct parsed_partitions.

    * Introduce read_part_sector() which is a simple wrapper around
    read_dev_sector() which takes struct parsed_partitions *state
    instead of @bdev.

    * For functions which used to take @state and @bdev, drop @bdev. For
    functions which used to take @bdev, replace it with @state.

    * While updating, drop superflous checks on NULL state/bdev in ldm.c.

    This cleans up the API a bit and enables better handling of IO errors
    during partition check as the generic partition check code now has
    much better visibility into what went wrong in the low level code
    paths.

    Signed-off-by: Tejun Heo
    Cc: Ben Hutchings
    Acked-by: David S. Miller
    Signed-off-by: Jens Axboe

    Tejun Heo
     
  • bdops->set_capacity() is unnecessarily generic. All that's required
    is a simple one way notification to lower level driver telling it to
    try to unlock native capacity. There's no reason to pass in target
    capacity or return the new capacity. The former is always the
    inherent native capacity and the latter can be handled via the usual
    device resize / revalidation path. In fact, the current API is always
    used that way.

    Replace ->set_capacity() with ->unlock_native_capacity() which take
    only @disk and doesn't return anything. IDE which is the only current
    user of the API is converted accordingly.

    Signed-off-by: Tejun Heo
    Cc: Ben Hutchings
    Cc: Bartlomiej Zolnierkiewicz
    Acked-by: David S. Miller
    Signed-off-by: Jens Axboe

    Tejun Heo
     
  • Device resize via ->set_capacity() can reveal new partitions (e.g. in
    chained partition table formats such as dos extended parts). Restart
    partition scan from the beginning after resizing a device. This
    change also makes libata always revalidate the disk after resize which
    makes lower layer native capacity unlocking implementation simpler and
    more robust as resize can be handled in the usual path.

    Signed-off-by: Tejun Heo
    Reported-by: Ben Hutchings
    Acked-by: David S. Miller
    Signed-off-by: Jens Axboe

    Tejun Heo
     

30 Mar, 2010

1 commit

  • …it slab.h inclusion from percpu.h

    percpu.h is included by sched.h and module.h and thus ends up being
    included when building most .c files. percpu.h includes slab.h which
    in turn includes gfp.h making everything defined by the two files
    universally available and complicating inclusion dependencies.

    percpu.h -> slab.h dependency is about to be removed. Prepare for
    this change by updating users of gfp and slab facilities include those
    headers directly instead of assuming availability. As this conversion
    needs to touch large number of source files, the following script is
    used as the basis of conversion.

    http://userweb.kernel.org/~tj/misc/slabh-sweep.py

    The script does the followings.

    * Scan files for gfp and slab usages and update includes such that
    only the necessary includes are there. ie. if only gfp is used,
    gfp.h, if slab is used, slab.h.

    * When the script inserts a new include, it looks at the include
    blocks and try to put the new include such that its order conforms
    to its surrounding. It's put in the include block which contains
    core kernel includes, in the same order that the rest are ordered -
    alphabetical, Christmas tree, rev-Xmas-tree or at the end if there
    doesn't seem to be any matching order.

    * If the script can't find a place to put a new include (mostly
    because the file doesn't have fitting include block), it prints out
    an error message indicating which .h file needs to be added to the
    file.

    The conversion was done in the following steps.

    1. The initial automatic conversion of all .c files updated slightly
    over 4000 files, deleting around 700 includes and adding ~480 gfp.h
    and ~3000 slab.h inclusions. The script emitted errors for ~400
    files.

    2. Each error was manually checked. Some didn't need the inclusion,
    some needed manual addition while adding it to implementation .h or
    embedding .c file was more appropriate for others. This step added
    inclusions to around 150 files.

    3. The script was run again and the output was compared to the edits
    from #2 to make sure no file was left behind.

    4. Several build tests were done and a couple of problems were fixed.
    e.g. lib/decompress_*.c used malloc/free() wrappers around slab
    APIs requiring slab.h to be added manually.

    5. The script was run on all .h files but without automatically
    editing them as sprinkling gfp.h and slab.h inclusions around .h
    files could easily lead to inclusion dependency hell. Most gfp.h
    inclusion directives were ignored as stuff from gfp.h was usually
    wildly available and often used in preprocessor macros. Each
    slab.h inclusion directive was examined and added manually as
    necessary.

    6. percpu.h was updated not to include slab.h.

    7. Build test were done on the following configurations and failures
    were fixed. CONFIG_GCOV_KERNEL was turned off for all tests (as my
    distributed build env didn't work with gcov compiles) and a few
    more options had to be turned off depending on archs to make things
    build (like ipr on powerpc/64 which failed due to missing writeq).

    * x86 and x86_64 UP and SMP allmodconfig and a custom test config.
    * powerpc and powerpc64 SMP allmodconfig
    * sparc and sparc64 SMP allmodconfig
    * ia64 SMP allmodconfig
    * s390 SMP allmodconfig
    * alpha SMP allmodconfig
    * um on x86_64 SMP allmodconfig

    8. percpu.h modifications were reverted so that it could be applied as
    a separate patch and serve as bisection point.

    Given the fact that I had only a couple of failures from tests on step
    6, I'm fairly confident about the coverage of this conversion patch.
    If there is a breakage, it's likely to be something in one of the arch
    headers which should be easily discoverable easily on most builds of
    the specific arch.

    Signed-off-by: Tejun Heo <tj@kernel.org>
    Guess-its-ok-by: Christoph Lameter <cl@linux-foundation.org>
    Cc: Ingo Molnar <mingo@redhat.com>
    Cc: Lee Schermerhorn <Lee.Schermerhorn@hp.com>

    Tejun Heo
     

25 Mar, 2010

2 commits

  • Smaller size than a minimum blocksize can't be used, after all it's
    handled like 0 size.

    For extended partition itself, this makes sure to use bigger size than one
    logical sector size at least.

    Signed-off-by: OGAWA Hirofumi
    Cc: Daniel Taylor
    Cc: "H. Peter Anvin"
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    OGAWA Hirofumi
     
  • In order to use disks larger than 2TiB on Windows XP, it is necessary to
    use 4096-byte logical sectors in an MBR.

    Although the kernel storage and functions called from msdos.c used
    "sector_t" internally, msdos.c still used u32 variables, which results in
    the ability to handle XP-compatible large disks.

    This patch changes the internal variables to "sector_t".

    Daniel said: "In the near future, WD will be releasing products that need
    this patch".

    [hirofumi@mail.parknet.co.jp: tweaks and fix]
    Signed-off-by: Daniel Taylor
    Signed-off-by: OGAWA Hirofumi
    Cc: "H. Peter Anvin"
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Daniel Taylor
     

11 Jan, 2010

1 commit

  • All callers of the stacking functions use 512-byte sector units rather
    than byte offsets. Simplify the code so the stacking functions take
    sectors when specifying data offsets.

    Signed-off-by: Martin K. Petersen
    Signed-off-by: Jens Axboe

    Martin K. Petersen
     

23 Nov, 2009

1 commit

  • The size of EFI GPT header is not static, but whole sector is
    allocated for the header. The HeaderSize field must be greater
    than 92 (= sizeof(struct gpt_header) and must be less than or
    equal to the logical block size.

    It means we have to read whole sector with the header, because the
    header crc32 checksum is calculated according to HeaderSize.

    For more details see UEFI standard (version 2.3, May 2009):
    - 5.3.1 GUID Format overview, page 93
    - Table 13. GUID Partition Table Header, page 96

    Signed-off-by: Karel Zak
    Signed-off-by: Jens Axboe

    Karel Zak