1. 14 Aug, 2003 40 commits
    • Andrew Morton's avatar
      [PATCH] fix [un]likely(), add ptr support · 2e0623e3
      Andrew Morton authored
      From: Albert Cahalan <albert@users.sourceforge.net>
      
      1. allows likely() and unlikely() to work for pointers
      
      2. fixes likely() (in C, any non-zero value is true)
      2e0623e3
    • Andrew Morton's avatar
      [PATCH] keyboard.c warning fix · ca5c021c
      Andrew Morton authored
      drivers/char/keyboard.c: In function `k_fn':
      drivers/char/keyboard.c:665: warning: comparison is always true due
      to limited range of data type
      
      I didn't want to just delete the code because one day the size of func_table
      may get smaller, or the type of `value' may get larger.  When that happens,
      the test becomes valid again.
      ca5c021c
    • Andrew Morton's avatar
      [PATCH] kill warning in jbd/revoke.c · 1c6e67fc
      Andrew Morton authored
      From: Peter Chubb <peterc@gelato.unsw.edu.au>
      
      If you need a long long format, then cast to long long, not u64.  u64 is
      long on 64-bit architectures.
      1c6e67fc
    • Andrew Morton's avatar
      [PATCH] Kill warning in drivers/input/misc/uinput.c on IA64 · 02cb6f3d
      Andrew Morton authored
      From: Peter Chubb <peterc@gelato.unsw.edu.au>
      
      Attached patch kills a warning when compiling on a 64-bit architecture
      (ssize_t is long, not int)
      02cb6f3d
    • Andrew Morton's avatar
      [PATCH] request_firmware fix · ef628dc9
      Andrew Morton authored
      From: Manuel Estrada Sainz <ranty@debian.org>
      
      - undo recent change, made in the believe that "buffer" was the size of
        the whole file, it is just PAGE_SIZE in size.  This was causing kernel
        memory corruption.
      
        - Since files are allowed to have unknown sizes, by setting their
          size to 0, we can't preallocate a buffer of their size on open.
      
      - Adapt request_firmware() to the sysfs change.
      
      - Adapt drivers/pci/pci-sysfs.c to the sysfs change.
      ef628dc9
    • Andrew Morton's avatar
      [PATCH] loop oops fix · 534d8695
      Andrew Morton authored
      loop-on-file oopses during unmount.  This is because lo_queue is now freed
      during lo_ioctl(LOOP_CLR_FD).  I think the scenario is:
      
      1: umount(8) opens /dev/loop0
      
      2: umount(8) runs lo_ioctl(LOOP_CLR_FD) (this frees the queue)
      
      3: umount(8) closes the /dev/loop0 handle.  The blockdev layer syncs the
         blockdev, but its mapping->backing_dev_info now points into la-la-land.
      
      We shouldn't be freeing the queue until all refs to it have gone away.  This
      patch gives the queue the same lifetime as the controlling loop_device
      itself.  It also makes the loop driver's queue appear in sysfs again.
      
      It would be better to free the queue when the device is not in use, but I'm
      not sure how we can hook into the blockdev layer to do that.
      534d8695
    • Andrew Morton's avatar
      [PATCH] Kill warning in minix filesystem on 64-bit archs · 2afe8ba3
      Andrew Morton authored
      From: Peter Chubb <peterc@gelato.unsw.edu.au>
      
      On 64-bit architectures, ino_t is int, not long, so the attached patch
      is needed to prevent a warning.
      2afe8ba3
    • Andrew Morton's avatar
      [PATCH] fix hugetlbfs slab corruption on umount · 1befd7a5
      Andrew Morton authored
      From: Zwane Mwaikambo <zwane@linuxpower.ca>
      
      hugetlbfs was accessing super_block->s_fs_info after free'ing it.  This was
      because it was being free'd prematurely.  I have deferred free until
      ->put_super().  I have also removed hugetlbfs_kill_super since it now is
      simply a kill_litter_super.
      1befd7a5
    • Andrew Morton's avatar
      [PATCH] fix typo in hd.c · 3b30d2b3
      Andrew Morton authored
      From: Adrian Bunk <bunk@fs.tum.de>
      
      hd.c contains a typo
      3b30d2b3
    • Andrew Morton's avatar
      [PATCH] Make MTRR init conform with recommended procedure · 8bc25c76
      Andrew Morton authored
      From: Zwane Mwaikambo <zwane@linuxpower.ca>
      
      This is a patch to make the MTRR initialisation more conformant with what
      is stated in volume 3 of (10-36 Memory Cache Control).  The most notable
      change is entering the no-fill cache mode before clearing the PGE bit in
      cr4.  Intel also states that we should do the cache flush via the cr3
      register shuffle.  If there is a problem with the patch please don't
      hesitate to beat me vigorously with a clue-by-four.
      
      It has been tested on a 3x Pentium 133, 8x PIII Xeon 700, 1x Celeron 550 and 32x
      PIII 500 NUMAQ (hardware courtesy of OSDL)
      8bc25c76
    • Andrew Morton's avatar
      [PATCH] floppy_init fix · 66c37726
      Andrew Morton authored
      From: Andrey Borzenkov <arvidjaar@mail.ru>
      
      The floppy driver doesn't remove /dev/floppy when floppy_init fails.
      66c37726
    • Andrew Morton's avatar
      [PATCH] _devfs_walk_path fix · 63d5d4f1
      Andrew Morton authored
      From: Andrey Borzenkov <arvidjaar@mail.ru>
      
      _devfs_walk_path does not check if de it is about to scan is a directory.
      Next step is spinlock on non-spinlock memory.  It requires either artificial
      setup or really broken driver but fairly easy to reproduce once you know how.
      
      It is likely to exist in 2.4 as well.
      63d5d4f1
    • Andrew Morton's avatar
      [PATCH] devfs_mk_dir fix · f82c2338
      Andrew Morton authored
      From: Andrey Borzenkov <arvidjaar@mail.ru>
      
      devfs_mk_dir freed wrong de and incorrectly passed to devfsd already freed
      de.  Besides it did not even check if entry found was actually directory.
      f82c2338
    • Andrew Morton's avatar
      [PATCH] firmware loader requires hotplug · 312e2e7b
      Andrew Morton authored
      From: Ramn Rey Vicente <ramon.rey@hispalinux.es>
      
      Fix the config issue with the hotplug firmware loader.  The firmware loader
      use hotplug, so this must be included as a dependency.
      312e2e7b
    • Andrew Morton's avatar
      [PATCH] handle old-style "root=" arguments · 11257180
      Andrew Morton authored
      When we changed try_name() to handle new-style printable dev_t formatting we
      broke lots of people's setups.  Lilo, grub, etc.
      
      Fix that by trying new-style formatting first, then fall back to old-style.
      
      People should generally use new-style %u:%u major:minor formatting in the
      future.
      11257180
    • Andrew Morton's avatar
      [PATCH] BUG fix for drivers/bluetooth/hci_usb.c · ba093cdd
      Andrew Morton authored
      From: Vinay K Nallamothu <vinay-rc@naturesoft.net>
      
      The patch below fixes two pointer reference bugs (shows up as compile
      time warnings given below) which wrongly take the address of "struct
      usb_interface*".
      
      	drivers/bluetooth/hci_usb.c: In function `hci_usb_probe':
      	drivers/bluetooth/hci_usb.c:786: warning: assignment from incompatible pointer type
      	drivers/bluetooth/hci_usb.c:810: warning: assignment from incompatible pointer type
      ba093cdd
    • Andrew Morton's avatar
      [PATCH] fix ide-scsi for ide_drive_t->queue change · 83415795
      Andrew Morton authored
      From: Mikael Pettersson <mikpe@csd.uu.se>
      
      This patch fixes ide-scsi.c for the ide_drive_t->queue type change
      in 2.6.0-test3.
      
      Without the patch you'll get these new warnings in -test3:
      
      drivers/scsi/ide-scsi.c: In function `idescsi_abort':
      drivers/scsi/ide-scsi.c:875: warning: passing arg 1 of `elv_queue_empty' from incompatible pointer type
      drivers/scsi/ide-scsi.c: In function `idescsi_reset':
      drivers/scsi/ide-scsi.c:902: warning: passing arg 1 of `elv_next_request' from incompatible pointer type
      83415795
    • Andrew Morton's avatar
      [PATCH] probe UDF after reiserfs · ae5a8df7
      Andrew Morton authored
      Bug 1065 (http://bugme.osdl.org/show_bug.cgi?id=1065) points out that there
      is a risk that UDF will accidentally mount a reiserfs partition, which would
      prevent a successful boot.
      
      Andries points out that probing is unreliable and that users/admins should
      always specify the root filesystem type on the kernel boot command line with
      "rootfstype=resierfs".
      
      But nobody does that, so we should be trying reiserfs before UDF.
      ae5a8df7
    • Andrew Morton's avatar
      [PATCH] fix task struct refcount bug · 4c0d7322
      Andrew Morton authored
      From: Manfred Spraul <manfred@colorfullife.com>
      
      (We think this might be the mystery bug which has been hanging about for
      months)
      
      
      We found a [the?] task struct refcount error: A task that dies sets
      tsk->state to TASK_ZOMBIE.  The next scheduled task checks prev->state, and
      if it's ZOMBIE, then it decrements the reference count of prev.  The
      prev->state & _ZOMBIE test is not atomic with schedule, thus if prev is
      scheduled again and dies between dropping the runqueue lock and checking
      prev->state, then the reference it dropped twice.
      
      This is possible with either preemption [schedule_tail is called by
      ret_from_fork with preemption count 1, finish_arch_switch drops it to 0] or
      profiling [profile_exit_mmap can sleep on profile_rwsem, called by
      mmdrop()] enabled.
      4c0d7322
    • Andrew Morton's avatar
      [PATCH] vt_ioctl warning fixes · 45ec9b9a
      Andrew Morton authored
      Several comparisons which can never be true because they're comparing u8's
      with numbers which are greater than 255.
      45ec9b9a
    • Andrew Morton's avatar
      [PATCH] /proc/net/pnp oops fix · 9dbe10bd
      Andrew Morton authored
      ic_servaddr is accessible after boot via /proc/net/pnp.  So it cannot be
      __initdata.
      
      davej says that other varibles there are treated the same way, so move them
      all into the regular data section.
      9dbe10bd
    • Andrew Morton's avatar
      [PATCH] nbd: fix send/receive/shutdown/disconnect races · e915e99b
      Andrew Morton authored
      From: Paul Clements <Paul.Clements@SteelEye.com>
      
      Here's the updated patch to fix several race conditions in nbd. It
      requires reverting the already included (but incomplete)
      nbd-race-fix.patch that's in -mm5.
      
      This patch fixes the following race conditions:
      
      1) adds an increment of req->ref_count to eliminate races between
      do_nbd_request and nbd_end_request, which resulted in the freeing of
      in-use requests -- there were races between send/receive, send/shutdown
      (killall -9 nbd-client), and send/disconnect (nbd-client -d), which are
      now all fixed
      
      2) adds locking and properly orders the code in NBD_CLEAR_SOCK to
      eliminate races with other code
      
      3) adds an lo->sock check to nbd_clear_que to eliminate races between
      do_nbd_request and nbd_clear_que, which resulted in the dequeuing of
      active requests
      
      4) adds an lo->sock check to NBD_DO_IT to eliminate races with
      NBD_CLEAR_SOCK, which caused an Oops when "nbd-client -d" was called
      e915e99b
    • Andrew Morton's avatar
      [PATCH] Set up P4 thermal interrupt vector on UP · bf1520a5
      Andrew Morton authored
      From: Zwane Mwaikambo <zwane@arm.linux.org.uk>
      
      The P4 thermal interrupt vector was only getting set on SMP builds.
      bf1520a5
    • Andrew Morton's avatar
      [PATCH] reiserfs: Fix handling of some extended inode · 60a46c69
      Andrew Morton authored
      From: Oleg Drokin <green@namesys.com>
      
      This patch fixes a problem in reiserfs' handling of immutable attribute,
      where every user (not just root) can unset it.  Also it adds "append-only"
      attribute "support" (all the support is in VFS anyway, we only recognise the
      bit now).  Also misleading comment in reiserfs_fs.h is removed.
      60a46c69
    • Andrew Morton's avatar
      [PATCH] reiserfs: remove unneeded kunmap · a996a1cc
      Andrew Morton authored
      From: Oleg Drokin <green@namesys.com>
      
      There is a leftover kunmap in reiserfs_unprepare_pages() which was not
      deleted after conversion to kmap_atomic.  This path is virtually never
      executed, that's why it was not caught earlier.  Please apply.
      a996a1cc
    • Andrew Morton's avatar
      [PATCH] pipe.c: don't write to readonly filesystems · 3bc19c2a
      Andrew Morton authored
      The pipe code's mtime and ctime updates are causing writes to read-only
      mounted filesystems.
      
      Fix that up by teaching inode_update_time() to honour readonly mounts, and
      call it from the pipe code.
      3bc19c2a
    • Andrew Morton's avatar
      [PATCH] standalone elevator noop · 03497495
      Andrew Morton authored
      From: Nick Piggin <piggin@cyberone.com.au>
      
      Following patch seperates elevator noop, and allows it to be treated
      like the other schedulers.
      03497495
    • Andrew Morton's avatar
      [PATCH] AS requeue implementation · 9633628e
      Andrew Morton authored
      From: Mark Haverkamp <markh@osdl.org>
      
      Properly implement elevator_t..elevator_requeue_req_fn for the anticipatory
      scheduler.
      
      This fixes some rarely-occurring oops in the IO scheduler.
      9633628e
    • Andrew Morton's avatar
      [PATCH] AS: no trinary states · 27f3c465
      Andrew Morton authored
      From: Nick Piggin <piggin@cyberone.com.au>
      
      Gets rid of the silly (and undocumented) trinary stateness of
      ad->changed_batch.
      
      Kernel style flags field could now save 20 bytes per asd (request queue) and
      4 per arq.  But I figure that change can wait until I do autotuning...
      27f3c465
    • Andrew Morton's avatar
      [PATCH] AS: remove hash valid stuff · 4f0c0d09
      Andrew Morton authored
      From: Nick Piggin <piggin@cyberone.com.au>
      
      The crazy HASH_VALID stuff now makes no difference now.  It was there to
      try to enforce no merging over a barrier, but it turned out that requests
      can just be reordered.  Jens picked this up a a while ago and fixed
      deadline (and I AS) by simply dispatching all reqs on the queue on
      encountering a barrier.  The hash valid stuff didn't get cleaned up.
      4f0c0d09
    • Andrew Morton's avatar
      [PATCH] timer race fixes · c49d8060
      Andrew Morton authored
      From: Ingo Molnar <mingo@elte.hu>
      
      It unifies the functionality of add_timer() and mod_timer(), and makes any
      combination of the timer API calls completely SMP-safe.  del_timer() is still
      not using the timer lock.
      
      this patch fixes the only timer bug in 2.6 i'm aware of: the del_timer_sync()
      + add_timer() combination in kernel/itimer.c is buggy.  This was correct code
      in 2.4, because there it was safe to do an add_timer() from the timer handler
      itself, parallel to a del_timer_sync().
      
      If we want to make this safe in 2.6 too (which i think we want to) then we
      have to make add_timer() almost equivalent to mod_timer(), locking-wise.  And
      once we are at this point i think it's much cleaner to actually make
      add_timer() a variant of mod_timer().  (There's no locking cost for
      add_timer(), only the cost of an extra branch.  And we've removed another
      commonly used function from the icache.)
      c49d8060
    • Andrew Morton's avatar
      [PATCH] missing #if for 1000 HZ · 752274c9
      Andrew Morton authored
      From: Albert Cahalan <albert@users.sourceforge.net>
      
      This should improve timekeeping a bit @ 1000 HZ.
      752274c9
    • Andrew Morton's avatar
      [PATCH] Fix raid "bio too big" failures · d2e45eac
      Andrew Morton authored
      From: Neil Brown <neilb@cse.unsw.edu.au>
      
      Fix "bio too big" problem with md
      
      Whenever a device is attached to an md device, we make sure the sector
      limits of the md device do not exceed those of the added device.
      d2e45eac
    • Andrew Morton's avatar
      [PATCH] sys_fadvise64_64 · 94e77119
      Andrew Morton authored
      Alas, both POSIX and I got the fadvise() interface wrong.  It needs to take a
      64-bit length, not a 32-bit one.  Because fadvise(POSIX_FADV_DONTNEED) on a
      4TB file will require 1000 syscalls.  Silly.
      
      There are glibc's in the wild which use the existing syscall, so we must
      make a new one.
      94e77119
    • Andrew Morton's avatar
      [PATCH] fadvise(POSIX_FADV_DONTNEED) fix · 7161ee20
      Andrew Morton authored
      invalidate_mapping_pages() takes start/end, but fadvise is currently passing
      it start/len.
      7161ee20
    • Linus Torvalds's avatar
      DRI CVS update: bump i810 driver to 1.4. · 310b411f
      Linus Torvalds authored
      This fixes the DMA interface to be backwards compatible with older
      XFree86 versions, by looking at the I810_INIT_DMA parameters and
      figuring out old version semantics.
      310b411f
    • Linus Torvalds's avatar
    • Linus Torvalds's avatar
      Mark CLONE_DETACHED as being irrelevant: it must match CLONE_THREAD. · 856c781e
      Linus Torvalds authored
      CLONE_THREAD without CLONE_DETACHED will now return -EINVAL, and
      for a while we will warn about anything that uses it (there are no
      known users, but this will help pinpoint any problems if somebody
      used to care about the invalid combination).
      856c781e
    • Christophe Saout's avatar
      [PATCH] Fix /sys/<dev>/<partition>/dev format: %04x -> %u:%u · 7ea448d5
      Christophe Saout authored
      A part of the 64 bit kdev_t patch already got merged, and it changes the
      format of /sys/block/<dev>/dev from %02x%02x to %u:%u.  The partition
      could must also be changed.
      
      e.g. cat /sys/block/hda/hda5/dev should return 3:5 instead of 0305
      7ea448d5
    • Fruhwirth Clemens's avatar
      [PATCH] Fix cryptoloop disk corruption under CBC mode · 5c470bbf
      Fruhwirth Clemens authored
      It was caused by improper IV calculation in loop.c
      5c470bbf