1. 12 Mar, 2004 40 commits
    • Andrew Morton's avatar
      [PATCH] add nowarn to a few pte chain allocators · a4fc9e26
      Andrew Morton authored
      From: Arjan van de Ven <arjanv@redhat.com>
      
      Several of the pte_chain_alloc() allocators that use GFP_ATOMIC have a
      fallback for failure that sleeps; they thus need to not warn on failure..
      Seen during a big fork on a busy system.
      a4fc9e26
    • Andrew Morton's avatar
      [PATCH] cciss: init section fix · 6edcc434
      Andrew Morton authored
      From: "Randy.Dunlap" <rddunlap@osdl.org>
      
      cciss_scsi_detect() can be called after init (for TAPE support).
      6edcc434
    • Andrew Morton's avatar
      [PATCH] EDD: Get Legacy Parameters · 66b61a5c
      Andrew Morton authored
      From: Matt Domsch <Matt_Domsch@dell.com>
      
      Patch below from Patrick J. LoPresti and myself.  Patrick describes:
      
      Why this patch?  The problem is that the legacy BIOS interface
      (INT13/AH=3D08) for querying the disk geometry returns different values
      than the extended INT13 interface which the EDD code currently uses.  This
      is because the legacy interface only provides a 10-bit cylinder field, so
      modern BIOSes "lie" about the head/sector counts in order to make more of
      the disk visible within the first 1024 cylinders.
      
      Many non-Linux applications, including the stock Windows boot loader, DOS
      fdisk, etc., rely upon the legacy interface and geometry.  So it is useful
      to be able to obtain the legacy values from a running Linux kernel.
      
      What this patch does is to add new entries under
      /sys/firmware/edd/int13_devXX named "legacy_cylinders", "legacy_heads", and
      "legacy_sectors".  These provide the geometry given by the legacy
      INT13/AH=3D08 BIOS interface, just like the current "default_cylinders"
      etc.  provide the the geometry given by the INT13/AH=3D48 interface.
      
      Without this patch, I cannot use Linux to partition a drive and install
      Windows, which happens to be my application.
      
       - Pat
         http://unattended.sourceforge.net/
      
      In addition, this adds two buggy BIOS workarounds  in the EDD int13
      calls as suggested by Ralf Brown's interrupt list.
      
      I'm also interested in moving this code out of arch/i386/kernel/edd.c and
      include/asm-i386/edd.h, as I believe it is applicable on x86-64 as well.
      However, there's no good place under drivers/ to put edd.c when it's not
      tied to a bus, but to several CPU architectures and their firmwares...
      Maybe a new directory drivers/firmware?
      66b61a5c
    • Andrew Morton's avatar
      [PATCH] wavfront.c needs syscalls.h · e0ed9d75
      Andrew Morton authored
      sound/oss/wavfront.c: In function `wavefront_download_firmware':
      sound/oss/wavfront.c:2524: warning: implicit declaration of function `sys_open'
      sound/oss/wavfront.c:2533: warning: implicit declaration of function `sys_read'
      sound/oss/wavfront.c:2582: warning: implicit declaration of function `sys_close
      e0ed9d75
    • Andrew Morton's avatar
      [PATCH] Fix reading the last block on a bdev · f8ccec6c
      Andrew Morton authored
      From: Chris Mason <mason@suse.com>
      
      This patch fixes a problem we're hitting on ia64 with page sizes > 4k.
      
      When the page size is greater than the block size, and parts of the page
      fall past the end of the device, readpage will fail because
      blkdev_get_block returns -EIO for blocks past i_size.
      
      The attached patch changes blkdev_get_block to return holes when reading
      past the end of the device, which allows us to read that last valid 4k
      block and then fill the rest of the page with zeros.  Writes will still
      fail with -EIO.
      f8ccec6c
    • Andrew Morton's avatar
      [PATCH] Fix rootfs on ramdisk · 6def6a58
      Andrew Morton authored
      From: vda <vda@port.imtp.ilyichevsk.odessa.ua>
      
      Add a missing test for the "root=/dev/ram" kernel boot option.  It's just an
      alias for /dev/ram0, but it worked in 2.4...
      6def6a58
    • Andrew Morton's avatar
      [PATCH] current_is_keventd() speedup · 6551f0aa
      Andrew Morton authored
      From: Srivatsa Vaddagiri <vatsa@in.ibm.com>
      
      current_is_keventd() doesn't need to search across all the CPUs to identify
      itself.
      6551f0aa
    • Andrew Morton's avatar
      [PATCH] Fix and harden validate_mm · 127419b1
      Andrew Morton authored
      From: Andi Kleen <ak@muc.de>
      
      I was debugging some code that corrupted the vma rb lists and for that I
      fixed validate_mm to not be recursive and do some more checks.
      
      It's slower now, but that shouldn't be a problem.
      
      Also make it non static to allow easier checks elsewhere.
      127419b1
    • Andrew Morton's avatar
      [PATCH] fadvise(POSIX_FADV_DONTNEED) fixups · 3745aa40
      Andrew Morton authored
      From: WU Fengguang <wfg@mail.ustc.edu.cn>
      
      - In sys_fadvise64_64(): if the start and/or end offsets do not fall on
        page boundaries, preserve the partial pages.  The thinking here is that it
        is better to preserve needed memory than to not shoot down unneeded memory.
      
      - In invalidate_mapping_pages(): we were invalidating an entire pagevec's
        worth of pages each time around, even if that went beyond the part of the
        file which the caller asked to be invalidated.  Fix that up.
      3745aa40
    • Andrew Morton's avatar
      [PATCH] AMD ELAN Kconfig fix · ddfd8f8d
      Andrew Morton authored
      From: Adrian Bunk <bunk@fs.tum.de>
      
      - remove an MELAN entry that was forgotten in the i386 processor
        selection menu
      
      - s/CONFIG_MELAN/CONFIG_X86_ELAN/ was missing in module.h
      ddfd8f8d
    • Andrew Morton's avatar
      [PATCH] watchdog: moduleparam-patches · 1c272552
      Andrew Morton authored
      From: Wim Van Sebroeck <wim@iguana.be>
      
      Convert last set of watchdog drivers to new moduleparam system.
      1c272552
    • Andrew Morton's avatar
      [PATCH] Remove arbitrary #acl entries limits on ext[23] when reading · 10658a35
      Andrew Morton authored
      From: Andreas Gruenbacher <agruen@suse.de>
      
      Remove the arbitrary limit of 32 ACL entries on ext[23] when reading from
      disk.  This change is backward compatible; we need to have this change in
      to be able to also allow writing big ACLs.
      
      The second patch that removes the ACL entry limit for writes is not
      included.  I don't want to push that patch now, because large ACLs would
      cause 2.4 and current 2.6 kernels to fail.  My plan is to remove the second
      limit later, in a half-year or year or so.
      10658a35
    • Andrew Morton's avatar
      [PATCH] Enable i810 fb on x86-64 · c833cc5a
      Andrew Morton authored
      From: Andi Kleen <ak@suse.de>
      
      i810fb most likely is needed on x86-64 too because there are Intel chipsets
      for it now.  So far it only linked on i386, fix this.
      c833cc5a
    • Andrew Morton's avatar
      [PATCH] /proc data corruption check · 08194fb2
      Andrew Morton authored
      From: Arjan van de Ven <arjanv@redhat.com>
      
      If someone removes a /proc directory which still has subdirectories it will
      lead to very nasty things (dentries remaining on hash chains etc etc etc).
      The BUG_ON in the patch below will catch this nasty situation.
      08194fb2
    • Andrew Morton's avatar
      [PATCH] Remove unneeded unlock in ipc/sem.c · 644a73eb
      Andrew Morton authored
      From: Manfred Spraul <manfred@colorfullife.com>
      
      sem_revalidate checks that a semaphore array didn't disappear while the
      code was running without the semaphore array spinlock.  If the array
      disappeared, then it will return without holding a lock.  find_undo calls
      sem_revalidate and then sem_unlock, even if sem_revalidate failed.  The
      sem_unlock call must be removed.
      
      Mingming Cao reported a spinlock deadlock with sysv semaphores.  A
      superflous unlock doesn't explain the deadlock, but it's obviously a bug.
      644a73eb
    • Andrew Morton's avatar
      [PATCH] kbuild: fix usage with directories containing '.o' · 2e83d38a
      Andrew Morton authored
      From: Sam Ravnborg <sam@ravnborg.org>
      
      From: Daniel Mack <daniel@zonque.org>, me
      
      modpost unconditionally searched for ".o" assuming this is always the
      suffix of the module.  This fails in two cases:
      
      a) when building external modules where any directory include ".o" in
         the name.  One example is a directory named: .../cvs.alsa.org/...
      
      b) when someone names a kernel directory so it contains ".o".  One
         example is drivers/scsi/aic.ok/...
      
      case b) was triggered by renaming the directory for aic7xxx, and modifying
      Makefile and Kconfig.  This caused make modules to fail.
      2e83d38a
    • Andrew Morton's avatar
      [PATCH] loop setup race fix · 238a43a0
      Andrew Morton authored
      From: Chris Mason <mason@suse.com>
      
      There's a race in loopback setup, it's easiest to trigger with one or more
      procs doing loopback mounts at the same time.  The problem is that
      fs/block_dev.c:do_open() only calls bdev_set_size on the first open.
      Picture two procs:
      
      proc1: mount -o loop file1 mnt1
      proc2: mount -o loop file2 mnt2
      
      proc1                   proc2
      open /dev/loop0                         # bd_openers now 1
      do_open
       bd_set_size(bdev, 0)                   # loop unbound, so bdev size is 0
                              open /dev/loop0 # bd_openers now 2
      loop_set_fd                             # disk capacity now correct, but
      				        # bdev not updated
      mount /dev/loop0 /mnt
      do_open
      
      Because bd_openers != 0 for the last do_open, bd_set_size is not called
      again and a size of 0 is used.  This eventually leads to an oops when the
      loop device is unmounted, because fsync_bdev calls block_write_full_page
      who decides every page on the block device is outside i_size and unmaps
      them.
      
      When ext2 or reiserfs try to sync a metadata buffer, we get an oops on
      because the buffers are no longer mapped.
      
      The patch below changes loop_set_fd and loop_clr_fd to also manipulate the
      size of the block device, which fixes things for me.
      238a43a0
    • Andrew Morton's avatar
      [PATCH] LOOP_CHANGE_FD ioctl · 275da6a3
      Andrew Morton authored
      From: Arjan van de Ven <arjanv@redhat.com>
      
      The patch below (written by Al Viro) solves a nasty chicken-and-egg issue
      for operating system installers (well at least anaconda but the problem
      domain is not exclusive to that)
      
      The basic problem is this:
      
      - The small first stage installer locates the image file of the second
        stage installer (which has X and all the graphical stuff); this image can
        be on the same CD, but it can come via NFS, http or ftp or ...  as well.
      
      - The first stage installer loop-back mounts this image and gives control
        to the second stage installer by calling some binary there.
      
      - The graphical installer then asks the user all those questions and
        starts installing packages.  Again the packages can come from the CD but
        also from NFS or http or ...
      
      Now in case of a CD install, once all requested packages from the first CD
      are installed, the installer wants to unmount and eject the CD and prompt
      the user to put CD 2 in.......  EXCEPT that the unmount can't work since
      the installer is actually running from a loopback mount of this cd.
      
      The solution is a "LOOP_CHANGE_FD" ioctl, where basically the installer
      copies the image to the harddisk (which can only be done late since only
      late the target harddisk is mkfs'd) and then magically switches the backing
      store FD from underneath the loop device to the one on the target harddisk
      (and thus unbusying the CD mount).
      
      This is obviously only allowed if the size of the new image is identical
      and if the loop image is read-only in the first place.  It's the
      responsibility of root to make sure the contents is the same (but that's of
      the give-root-enough-rope kind)
      275da6a3
    • Andrew Morton's avatar
      [PATCH] kbuild: Cause `make clean' to remove more files · 0c8846a5
      Andrew Morton authored
      From: Sam Ravnborg <sam@ravnborg.org>
      
      Make the difference between 'make clean' and 'make distclean/mrproper' more
      explicit.
      
      make clean now removes all generated files except .config* and .version.
      The result is much easier to understand now.
      
      make clean deletes all generated files (except .config* and .version).
      make mrproper deletes configuration and all temporary files left by patch,
      editors and the like.
      
      Example output:
      > make mrproper
        CLEAN   init
        CLEAN   usr
        CLEAN   scripts/kconfig
        CLEAN   scripts
        CLEAN   .tmp_versions include/config
        CLEAN   include/asm-i386/asm_offsets.h include/linux/autoconf.h include/linux/version.h include/asm .tmp_versions
        CLEAN   .version .config
      
      Form the list of files/directories deleted during make clean, removed all
      references that is no longer relevant for the current kernel.
      0c8846a5
    • Andrew Morton's avatar
      [PATCH] Fix elf mapping of the zero page · 22a5dad8
      Andrew Morton authored
      From: William Lee Irwin III <wli@holomorphy.com>
      
      Using PAGE_SIZE rather than 4096 so that mmap() granularity is honored by
      whatever non-i386 architectures use MMAP_PAGE_ZERO.
      22a5dad8
    • Andrew Morton's avatar
      [PATCH] compiler.h scoping fixes · d398efb9
      Andrew Morton authored
      From: Ville Nuorvala <vnuorval@tcs.hut.fi>
      
      There are a few kernel-only things in compiler.h which should have been
      placed inside __KERNEL__.
      d398efb9
    • Andrew Morton's avatar
      [PATCH] Redundant unplug_timer deletion · 3b704d3f
      Andrew Morton authored
      From: "Chen, Kenneth W" <kenneth.w.chen@intel.com>
      
      The only path to get to del_timer call in __generic_unplug_device() is when
      blk_remove_plug() returns 1, and in that case it already removed the
      unplug_timer.
      
      Patch to remove this redundant call.
      3b704d3f
    • Andrew Morton's avatar
      [PATCH] NUMA-aware zonelist builder · 0eaf393b
      Andrew Morton authored
      From: <j-nomura@ce.jp.nec.com>
      
      The attached patch is NUMA-aware zonelist builder patch, which sorts
      zonelist in the order that near-node first, far-node last.  In lse-tech and
      linux-ia64, where most of NUMA people resides, no objections are raised so
      far.
      
      The patch adds NUMA-specific version of build_zonelists which calls
      find_next_best_node to select the next-nearest node to add to zonelist.
      
      The patch has no effect on flat NUMA platform.
      0eaf393b
    • Andrew Morton's avatar
      [PATCH] kbuild: Remove CFLAGS assignment in i386/mach-*/Makefile · 290d11d8
      Andrew Morton authored
      From: Sam Ravnborg <sam@ravnborg.org>
      
      The EXTRA_CFLAGS assignments in the following files are a left-over from
      the early 2.5 days where the source was not compiled from the root of the
      source tree.
      
      Removing these wrong assignments fixes
      http://bugme.osdl.org/show_bug.cgi?id=2210
      
      A script named 'kernel' in the .. directory no longer halt compilation.
      290d11d8
    • Andrew Morton's avatar
      [PATCH] UDF filesystem update · 5cc6e01a
      Andrew Morton authored
      From: Ben Fennema <bfennema@falcon.csc.calpoly.edu>
      
      - added udf 2.5 #defines
      
      - fixed prealloc discard race
      
      - fixed several bugs in inode_getblk
      
      - added S_IFSOCK support
      
      - fix unicode encoding bug
      
      - change partition allocation from kmalloc to vmalloc for large
        allocations
      5cc6e01a
    • Andrew Morton's avatar
      [PATCH] selinux: clean up binary mount data · 5289ba41
      Andrew Morton authored
      From: James Morris <jmorris@redhat.com>
      
      selinux is currently inspecting the filesystem name ("nfs" vs "coda" vs
      watever) to work out whether it needs to hanbdle binary mount data.
      
      Eliminate all that by adding a flag to file_system_type.fs_flags.
      5289ba41
    • Andrew Morton's avatar
      [PATCH] dm: stripe width fix · ef01bd3f
      Andrew Morton authored
      dm-stripe.c: The stripe width must be at least the page size.
      ef01bd3f
    • Andrew Morton's avatar
      [PATCH] dm: list targets cmd · c0ffbd19
      Andrew Morton authored
      From: Joe Thornber <thornber@redhat.com>
      
      List targets ioctl.  [Patrick Caulfield]
      c0ffbd19
    • Andrew Morton's avatar
      [PATCH] dm: default queue limits · eafc59ae
      Andrew Morton authored
      From: Joe Thornber <thornber@redhat.com>
      
      Fill in missing queue limitations when table is complete instead of enforcing
      the "default" limits on every dm device.  Problem noticed by Mike Christie.
      
      [Christophe Saout]
      eafc59ae
    • Andrew Morton's avatar
      [PATCH] dm: list_for_each_entry audit · 2c99d295
      Andrew Morton authored
      From: Joe Thornber <thornber@redhat.com>
      
      Audit for list_for_each_*entry*
      2c99d295
    • Andrew Morton's avatar
      [PATCH] dm: endio method · ba657cf7
      Andrew Morton authored
      From: Joe Thornber <thornber@redhat.com>
      
      Add an endio method to targets.  This method is allowed to request another
      shot at failed ios (think multipath).  Context can be passed between the map
      method and the endio method.
      ba657cf7
    • Andrew Morton's avatar
      [PATCH] Allow X86_MCE_NONFATAL to be a module · e8c8fab4
      Andrew Morton authored
      From: Herbert Xu <herbert@gondor.apana.org.au>
      
      By allowing X86_MCE_NONFATAL to be a module, it can be included in
      distribution kernels without upsetting those with strange hardware.
      e8c8fab4
    • Andrew Morton's avatar
      [PATCH] i386 very early memory detection cleanup patch · 973adfc0
      Andrew Morton authored
      From: "H. Peter Anvin" <hpa@zytor.com>
      
      This patch cleans up the very early memory setup on the i386 platform.  In
      particular, it removes the hard-coded 8 MB limit completely by dynamically
      creating the early-boot pagetables rather than having them hard coded.
      
      While I was at it, I changed head.S so that it always sets up a local GDT;
      this means among other things that SMP and VISWS are no longer special
      cases, and is conceptually cleaner to boot.  The VISWS people have
      confirmed it works on VISWS.
      
      It also uses a separate entrypoint for non-boot processors since this is
      completely kernel-internal anyway.  This eliminates the need to set %bx on
      boot.  (If you think this is a bad idea I can eliminate this change; it
      just seemed cleaner to me to do it this way.)
      
      Additionally, zero bss with rep;stosl rather that rep;stosb.
      973adfc0
    • Andrew Morton's avatar
      [PATCH] genrtc: cleanups · e47d860c
      Andrew Morton authored
      From: "Randy.Dunlap" <rddunlap@osdl.org>
      
      From: Luiz Fernando Capitulino <lcapitulino@prefeitura.sp.gov.br>
      
      remove ifdef/endif in rtc_generic_init().
      use returned error code;
      e47d860c
    • Andrew Morton's avatar
      [PATCH] remove __io_virt_debug · a1d75429
      Andrew Morton authored
      From: Brian Gerst <bgerst@didntduck.org>
      
      Drivers should all be converted to use ioremap() or isa_*() by now.
      a1d75429
    • Andrew Morton's avatar
      [PATCH] teach /proc/kmsg about O_NONBLOCK · 48c26153
      Andrew Morton authored
      If there's nothing available and the file is O_NONBLOCK, return -EAGAIN.
      
      This is a bit grubby - really we should push the file* down into do_syslog()
      and handle it inside the spinlock.
      48c26153
    • Andrew Morton's avatar
      [PATCH] time interpolator fix · 40aaa9b3
      Andrew Morton authored
      From: john stultz <johnstul@us.ibm.com>
      
      In developing the ia64-cyclone patch, which implements a cyclone based time
      interpolator, I found the following bug which could cause time
      inconsistencies.
      
      In update_wall_time_one_tick(), which is called each timer interrupt, we
      call time_interpolator_update(delta_nsec) where delta_nsec is approximately
      NSEC_PER_SEC/HZ.  This directly correlates with the changes to xtime which
      occurs in update_wall_time_one_tick().
      
      However in update_wall_time(), on a second overflow, we again call
      time_interpolator_update(NSEC_PER_SEC).  However while the components of
      xtime are being changed, the overall value of xtime does not (nsec is
      decremented NSEC_PER_SEC and sec is incremented).  Thus this call to
      time_interpolator_update is incorrect.
      
      This patch removes the incorrect call to time_interpolator_update and was
      found to resolve the time inconsistencies I had seen while developing the
      ia64-cyclone patch.
      40aaa9b3
    • Andrew Morton's avatar
      [PATCH] fb_console_init fix · 688466a4
      Andrew Morton authored
      From: James Simmons <jsimmons@infradead.org>
      
      This patch fixes fb_console_init from being called twice.  I still need to
      fix set_con2fb but this helps but this is still important to get in.
      688466a4
    • Andrew Morton's avatar
      [PATCH] read-only support for UFS2 · e3459dfb
      Andrew Morton authored
      From: Niraj Kumar <niraj17@iitbombay.org>
      
      This patch adds read-only support for ufs2 (used in FreeBSD 5.x) variant of
      ufs filesystem.  For filesystem specific tools, see
      http://ufs-linux.sourceforge.com .
      e3459dfb
    • Andrew Morton's avatar
      [PATCH] adaptive lazy readahead · 202775d6
      Andrew Morton authored
      From: Suparna Bhattacharya <suparna@in.ibm.com>
      
      From: Ram Pai <linuxram@us.ibm.com>
      
      Pipelined readahead behaviour is suitable for sequential reads, but not for
      large random reads (typical of database workloads), where lazy readahead
      provides a big performance boost.
      
      One option (suggested by Andrew Morton) would be to have the application
      pass hints to turn off readahead by setting the readahead window to zero
      using posix_fadvise64(POSIX_FADV_RANDOM), and to special-case that in
      do_generic_mapping_read to completely bypass the readahead logic and
      instead read in all the pages needed directly.
      
      This was the idea I started with.  But then I thought, we can do a still
      better job ?  How about adapting the readahead algorithm to lazy-read or
      non-lazy-read based on the past i/o patterns ?
      
      The overall idea is to keep track of average number of contiguous pages
      accessed in a file.  If the average at any given time is above ra->pages
      the pattern is sequential.  If not the pattern is random.  If pattern is
      sequential do non-lazy-readahead( read as soon as the first page in the
      active window is touched) else do lazy-readahead.
      
      I have studied the behaviour of this patch using my user-level simulator.
      It adapts pretty well.
      
      Note from Suparna: This appears to bring streaming AIO read performance for
      large (64KB) random AIO reads back to sane values (since the lazy readahead
      backout in the mainline).
      202775d6