1. 03 Apr, 2003 6 commits
    • Andrew Morton's avatar
      [PATCH] file limit checking simplification · d80bbda5
      Andrew Morton authored
      From: Hugh Dickins <hugh@veritas.com>
      
      When handling rlimit != RLIM_INFINITY, generic_write_checks tests file
      position against 0xFFFFFFFFULL, and casts it to a u32.  This code is
      carried forward from 2.4.4, and the 2.4-ac tree contains an apparently
      obvious fix to one part of it (should set count to 0 not to a negative).
      But when you think it through, it all turns out to be bogus.
      
      On a 32-bit architecture: limit is a 32-bit unsigned long, we've
      already handled *pos < 0 and *pos >= limit, so *pos here has no way
      of being > 0xFFFFFFFFULL, and thus casting it to u32 won't truncate it.
      And on a 64-bit architecture: limit is a 64-bit unsigned long, but this
      code is disallowing file position beyond the 32 bits; or if there's some
      userspace compatibility issue, with limit having to fit into 32 bits,
      the 32-bit architecture argument applies and they're still irrelevant.
      
      So just remove the 0xFFFFFFFFULL test; and in place of the u32, cast to
      typeof(limit) so it's right even if rlimits get wider.  And there's no
      way we'd want to send SIGXFSZ below the limit: remove send_sig comment.
      
      There's a similarly suspicious u32 cast a little further down, when
      checking MAX_NON_LFS.  Given its definition, that does no harm on any
      arch: but it's better changed to unsigned long, the type of MAX_NON_LFS.
      d80bbda5
    • Andrew Morton's avatar
      [PATCH] bio kmapping changes · 240d3e2d
      Andrew Morton authored
      RAID5 is calling copy_data() under sh->lock.  But copy_data() does kmap(),
      which can sleep.
      
      The best fix is to use kmap_atomic() in there.  It is faster than kmap() and
      does not block.
      
      The patch removes the unused bio_kmap() and replaces __bio_kmap() with
      __bio_kmap_atomic().  I think it's best to withdraw the sleeping-and-slow
      bio_kmap() from the kernel API before someone else tries to use it.
      
      
      Also, I notice that bio_kmap_irq() was using local_save_flags().  This is a
      bug - local_save_flags() does not disable interrupts.  Converted that to
      local_irq_save().  These names are terribly chosen.
      
      This patch was acked by Jens and Neil.
      240d3e2d
    • Andrew Morton's avatar
      [PATCH] Fix some compile warnings · d597f71b
      Andrew Morton authored
      From: "Martin J. Bligh" <mbligh@aracnet.com>
      
      Fix a couple of instances of "warning: suggest parentheses around assignment
      used as truth value".
      d597f71b
    • Andrew Morton's avatar
      [PATCH] monotonic clock source for hangcheck timer · 92525be5
      Andrew Morton authored
      From: john stultz <johnstul@us.ibm.com>
      
      This patch, written with the advice of Joel Becker, addresses a problem with
      the hangcheck-timer.
      
      The basic problem is that the hangcheck-timer code (Required for Oracle)
      needs a accurate hard clock which can be used to detect OS stalls (due to
      udelay() or pci bus hangs) that would cause system time to skew (its sort of
      a sanity check that insures the system's notion of time is accurate).
      However, currently they are using get_cycles() to fetch the cpu's TSC
      register, thus this does not work on systems w/o a synced TSC.
      
      As suggested by Andi Kleen (see thread here:
      http://www.uwsg.iu.edu/hypermail/linux/kernel/0302.0/1234.html ) I've worked
      with Joel and others to implement the monotonic_clock() interface.  Some of
      the major considerations made when writing this patch were
      
      o Needs to be able to return accurate time in the absence of multiple timer
        interrupts
      
      o Needs to be abstracted out from the hardware
      
      o Avoids impacting gettimeofday() performance
      
      This interface returns a unsigned long long representing the number of
      nanoseconds that has passed since time_init().
      92525be5
    • Andrew Morton's avatar
      [PATCH] handle bad inodes in put_inode · 68fa8120
      Andrew Morton authored
      From: "J. Bruce Fields" <bfields@fieldses.org>
      
      If the NFS daemon is presented with a filehandle for a file that has
      been deleted, it does an iget() in fs/exportfs/expfs.c:export_iget() and
      gets a bad inode back.  When it subsequently iput()s the inode, the
      result is:
      
      Mar 27 12:53:40 snoopy kernel: EXT2-fs error (device ide0(3,3)): ext2_free_blocks: Freeing blocks not in datazone - block = 1802201963, count = 27499
      Mar 27 12:53:40 snoopy kernel: Remounting filesystem read-only
      
      The same can happen if ext2_get_inode() returns an error - ext2_read_inode()
      will return an uninitialised inode and ext2_put_inode() is not allowed to go
      looking inside the bad inode.
      68fa8120
    • Andrew Morton's avatar
      [PATCH] tmpfs blk_congestion_wait fix · 505f7dd2
      Andrew Morton authored
      From: Hugh Dickins <hugh@veritas.com>
      
      The blk_congestion_waits in shmem_getpage are appropriate when the error is
      -ENOMEM, but not when the error is -EEXIST.  So add that test in the first
      instance, but omit it all in the second instance.
      505f7dd2
  2. 02 Apr, 2003 19 commits
  3. 01 Apr, 2003 15 commits