1. 29 5月, 2011 1 次提交
    • L
      x86 idle floppy: deprecate disable_hlt() · 3b70b2e5
      Len Brown 提交于
      Plan to remove floppy_disable_hlt in 2012, an ancient
      workaround with comments that it should be removed.
      
      This allows us to remove clutter and a run-time branch
      from the idle code.
      
      WARN_ONCE() on invocation until it is removed.
      
      cc: x86@kernel.org
      cc: stable@kernel.org # .39.x
      Signed-off-by: NLen Brown <len.brown@intel.com>
      3b70b2e5
  2. 22 4月, 2011 1 次提交
    • T
      block: unexport DISK_EVENT_MEDIA_CHANGE for legacy/fringe drivers · 9fd097b1
      Tejun Heo 提交于
      In-kernel disk event polling doesn't matter for legacy/fringe drivers
      and may lead to infinite event loop if ->check_events() implementation
      generates events on level condition instead of edge.
      
      Now that block layer supports suppressing exporting unlisted events,
      simply leaving disk->events cleared allows these drivers to keep the
      internal revalidation behavior intact while avoiding weird
      interactions with userland event handler.
      Signed-off-by: NTejun Heo <tj@kernel.org>
      Cc: Kay Sievers <kay.sievers@vrfy.org>
      Signed-off-by: NJens Axboe <jaxboe@fusionio.com>
      9fd097b1
  3. 10 3月, 2011 2 次提交
    • J
      block: remove per-queue plugging · 7eaceacc
      Jens Axboe 提交于
      Code has been converted over to the new explicit on-stack plugging,
      and delay users have been converted to use the new API for that.
      So lets kill off the old plugging along with aops->sync_page().
      Signed-off-by: NJens Axboe <jaxboe@fusionio.com>
      7eaceacc
    • T
      floppy,{ami|ata}flop: Convert to bdops->check_events() · 1a8a74f0
      Tejun Heo 提交于
      Convert the floppy drivers from ->media_changed() to ->check_events().
      Both floppy and ataflop buffer media changed state bit and clear them
      on revalidation and will behave correctly with kernel event polling.
      
      I can't tell how amiflop clears its event and it's possible that it
      may generate spurious events when polled.
      Signed-off-by: NTejun Heo <tj@kernel.org>
      Cc: Jens Axboe <axboe@kernel.dk>
      Cc: Kay Sievers <kay.sievers@vrfy.org>
      1a8a74f0
  4. 24 2月, 2011 1 次提交
    • N
      Fix over-zealous flush_disk when changing device size. · 93b270f7
      NeilBrown 提交于
      There are two cases when we call flush_disk.
      In one, the device has disappeared (check_disk_change) so any
      data will hold becomes irrelevant.
      In the oter, the device has changed size (check_disk_size_change)
      so data we hold may be irrelevant.
      
      In both cases it makes sense to discard any 'clean' buffers,
      so they will be read back from the device if needed.
      
      In the former case it makes sense to discard 'dirty' buffers
      as there will never be anywhere safe to write the data.  In the
      second case it *does*not* make sense to discard dirty buffers
      as that will lead to file system corruption when you simply enlarge
      the containing devices.
      
      flush_disk calls __invalidate_devices.
      __invalidate_device calls both invalidate_inodes and invalidate_bdev.
      
      invalidate_inodes *does* discard I_DIRTY inodes and this does lead
      to fs corruption.
      
      invalidate_bev *does*not* discard dirty pages, but I don't really care
      about that at present.
      
      So this patch adds a flag to __invalidate_device (calling it
      __invalidate_device2) to indicate whether dirty buffers should be
      killed, and this is passed to invalidate_inodes which can choose to
      skip dirty inodes.
      
      flusk_disk then passes true from check_disk_change and false from
      check_disk_size_change.
      
      dm avoids tripping over this problem by calling i_size_write directly
      rathher than using check_disk_size_change.
      
      md does use check_disk_size_change and so is affected.
      
      This regression was introduced by commit 608aeef1 which causes
      check_disk_size_change to call flush_disk, so it is suitable for any
      kernel since 2.6.27.
      
      Cc: stable@kernel.org
      Acked-by: NJeff Moyer <jmoyer@redhat.com>
      Cc: Andrew Patterson <andrew.patterson@hp.com>
      Cc: Jens Axboe <axboe@kernel.dk>
      Signed-off-by: NNeilBrown <neilb@suse.de>
      93b270f7
  5. 24 12月, 2010 1 次提交
  6. 08 11月, 2010 1 次提交
  7. 06 11月, 2010 2 次提交
    • V
      floppy: fix another use-after-free · d017bf6b
      Vivek Goyal 提交于
      While scanning the floopy code due to c093ee4f ("floppy: fix
      use-after-free in module load failure path"), I found one more instance
      of trying to access disk->queue pointer after doing put_disk() on
      gendisk.  For some reason , floppy moule still loads/unloads fine.  The
      object is probably still around with right pointer values.
      
       o There seems to be one more instance of trying to cleanup the request
         queue after we have called put_disk() on associated gendisk.
      
       o This fix is more out of code inspection.  Even without this fix for
         some reason I am able to load/unload floppy module without any
         issues.
      
       o Floppy module loads/unloads fine after the fix.
      Signed-off-by: NVivek Goyal <vgoyal@redhat.com>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      d017bf6b
    • L
      floppy: fix use-after-free in module load failure path · c093ee4f
      Linus Torvalds 提交于
      Commit 48821184 ("floppy: switch to one queue per drive instead of
      sharing a queue") introduced a use-after-free.  We do "put_disk()" on
      the disk device _before_ we then clean up the queue associated with that
      disk.
      
      Move the put_disk() down to avoid dereferencing a free'd data structure.
      
      Cc: Jens Axboe <jaxboe@fusionio.com>
      Cc: Vivek Goyal <vgoyal@redhat.com>
      Reported-and-tested-by: NRandy Dunlap <randy.dunlap@oracle.com>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      c093ee4f
  8. 05 10月, 2010 1 次提交
    • A
      block: autoconvert trivial BKL users to private mutex · 2a48fc0a
      Arnd Bergmann 提交于
      The block device drivers have all gained new lock_kernel
      calls from a recent pushdown, and some of the drivers
      were already using the BKL before.
      
      This turns the BKL into a set of per-driver mutexes.
      Still need to check whether this is safe to do.
      
      file=$1
      name=$2
      if grep -q lock_kernel ${file} ; then
          if grep -q 'include.*linux.mutex.h' ${file} ; then
                  sed -i '/include.*<linux\/smp_lock.h>/d' ${file}
          else
                  sed -i 's/include.*<linux\/smp_lock.h>.*$/include <linux\/mutex.h>/g' ${file}
          fi
          sed -i ${file} \
              -e "/^#include.*linux.mutex.h/,$ {
                      1,/^\(static\|int\|long\)/ {
                           /^\(static\|int\|long\)/istatic DEFINE_MUTEX(${name}_mutex);
      
      } }"  \
          -e "s/\(un\)*lock_kernel\>[ ]*()/mutex_\1lock(\&${name}_mutex)/g" \
          -e '/[      ]*cycle_kernel_lock();/d'
      else
          sed -i -e '/include.*\<smp_lock.h\>/d' ${file}  \
                      -e '/cycle_kernel_lock()/d'
      fi
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      2a48fc0a
  9. 22 9月, 2010 1 次提交
  10. 08 8月, 2010 11 次提交
  11. 13 3月, 2010 18 次提交