1. 14 10月, 2008 34 次提交
  2. 09 10月, 2008 1 次提交
    • T
      block: don't depend on consecutive minor space · f331c029
      Tejun Heo 提交于
      * Implement disk_devt() and part_devt() and use them to directly
        access devt instead of computing it from ->major and ->first_minor.
      
        Note that all references to ->major and ->first_minor outside of
        block layer is used to determine devt of the disk (the part0) and as
        ->major and ->first_minor will continue to represent devt for the
        disk, converting these users aren't strictly necessary.  However,
        convert them for consistency.
      
      * Implement disk_max_parts() to avoid directly deferencing
        genhd->minors.
      
      * Update bdget_disk() such that it doesn't assume consecutive minor
        space.
      
      * Move devt computation from register_disk() to add_disk() and make it
        the only one (all other usages use the initially determined value).
      
      These changes clean up the code and will help disk->part dereference
      fix and extended block device numbers.
      Signed-off-by: NTejun Heo <tj@kernel.org>
      Signed-off-by: NJens Axboe <jens.axboe@oracle.com>
      f331c029
  3. 26 9月, 2008 1 次提交
  4. 03 9月, 2008 1 次提交
    • A
      drivers/char/random.c: fix a race which can lead to a bogus BUG() · 8b76f46a
      Andrew Morton 提交于
      Fix a bug reported by and diagnosed by Aaron Straus.
      
      This is a regression intruduced into 2.6.26 by
      
          commit adc782da
          Author: Matt Mackall <mpm@selenic.com>
          Date:   Tue Apr 29 01:03:07 2008 -0700
      
              random: simplify and rename credit_entropy_store
      
      credit_entropy_bits() does:
      
      	spin_lock_irqsave(&r->lock, flags);
      	...
      	if (r->entropy_count > r->poolinfo->POOLBITS)
      		r->entropy_count = r->poolinfo->POOLBITS;
      
      so there is a time window in which this BUG_ON():
      
      static size_t account(struct entropy_store *r, size_t nbytes, int min,
      		      int reserved)
      {
      	unsigned long flags;
      
      	BUG_ON(r->entropy_count > r->poolinfo->POOLBITS);
      
      	/* Hold lock while accounting */
      	spin_lock_irqsave(&r->lock, flags);
      
      can trigger.
      
      We could fix this by moving the assertion inside the lock, but it seems
      safer and saner to revert to the old behaviour wherein
      entropy_store.entropy_count at no time exceeds
      entropy_store.poolinfo->POOLBITS.
      Reported-by: NAaron Straus <aaron@merfinllc.com>
      Cc: Matt Mackall <mpm@selenic.com>
      Cc: Theodore Ts'o <tytso@mit.edu>
      Cc: <stable@kernel.org>		[2.6.26.x]
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      8b76f46a
  5. 31 8月, 2008 1 次提交
  6. 30 8月, 2008 1 次提交
  7. 28 8月, 2008 1 次提交