1. 25 9月, 2020 9 次提交
  2. 24 9月, 2020 5 次提交
  3. 12 9月, 2020 1 次提交
  4. 10 9月, 2020 3 次提交
  5. 08 9月, 2020 1 次提交
    • J
      block: Do not discard buffers under a mounted filesystem · 384d87ef
      Jan Kara 提交于
      Discarding blocks and buffers under a mounted filesystem is hardly
      anything admin wants to do. Usually it will confuse the filesystem and
      sometimes the loss of buffer_head state (including b_private field) can
      even cause crashes like:
      
      BUG: unable to handle kernel NULL pointer dereference at 0000000000000008
      PGD 0 P4D 0
      Oops: 0002 [#1] SMP PTI
      CPU: 4 PID: 203778 Comm: jbd2/dm-3-8 Kdump: loaded Tainted: G O     --------- -  - 4.18.0-147.5.0.5.h126.eulerosv2r9.x86_64 #1
      Hardware name: Huawei RH2288H V3/BC11HGSA0, BIOS 1.57 08/11/2015
      RIP: 0010:jbd2_journal_grab_journal_head+0x1b/0x40 [jbd2]
      ...
      Call Trace:
       __jbd2_journal_insert_checkpoint+0x23/0x70 [jbd2]
       jbd2_journal_commit_transaction+0x155f/0x1b60 [jbd2]
       kjournald2+0xbd/0x270 [jbd2]
      
      So if we don't have block device open with O_EXCL already, claim the
      block device while we truncate buffer cache. This makes sure any
      exclusive block device user (such as filesystem) cannot operate on the
      device while we are discarding buffer cache.
      Reported-by: NYe Bin <yebin10@huawei.com>
      Signed-off-by: NJan Kara <jack@suse.cz>
      Reviewed-by: NChristoph Hellwig <hch@lst.de>
      [axboe: fix !CONFIG_BLOCK error in truncate_bdev_range()]
      Signed-off-by: NJens Axboe <axboe@kernel.dk>
      384d87ef
  6. 04 9月, 2020 5 次提交
  7. 02 9月, 2020 13 次提交
  8. 29 8月, 2020 1 次提交
  9. 27 8月, 2020 1 次提交
  10. 26 8月, 2020 1 次提交
    • N
      lockdep: Only trace IRQ edges · 044d0d6d
      Nicholas Piggin 提交于
      Problem:
      
        raw_local_irq_save(); // software state on
        local_irq_save(); // software state off
        ...
        local_irq_restore(); // software state still off, because we don't enable IRQs
        raw_local_irq_restore(); // software state still off, *whoopsie*
      
      existing instances:
      
       - lock_acquire()
           raw_local_irq_save()
           __lock_acquire()
             arch_spin_lock(&graph_lock)
               pv_wait() := kvm_wait() (same or worse for Xen/HyperV)
                 local_irq_save()
      
       - trace_clock_global()
           raw_local_irq_save()
           arch_spin_lock()
             pv_wait() := kvm_wait()
      	 local_irq_save()
      
       - apic_retrigger_irq()
           raw_local_irq_save()
           apic->send_IPI() := default_send_IPI_single_phys()
             local_irq_save()
      
      Possible solutions:
      
       A) make it work by enabling the tracing inside raw_*()
       B) make it work by keeping tracing disabled inside raw_*()
       C) call it broken and clean it up now
      
      Now, given that the only reason to use the raw_* variant is because you don't
      want tracing. Therefore A) seems like a weird option (although it can be done).
      C) is tempting, but OTOH it ends up converting a _lot_ of code to raw just
      because there is one raw user, this strips the validation/tracing off for all
      the other users.
      
      So we pick B) and declare any code that ends up doing:
      
      	raw_local_irq_save()
      	local_irq_save()
      	lockdep_assert_irqs_disabled();
      
      broken. AFAICT this problem has existed forever, the only reason it came
      up is because commit: 859d069e ("lockdep: Prepare for NMI IRQ
      state tracking") changed IRQ tracing vs lockdep recursion and the
      first instance is fairly common, the other cases hardly ever happen.
      Signed-off-by: NNicholas Piggin <npiggin@gmail.com>
      [rewrote changelog]
      Signed-off-by: NPeter Zijlstra (Intel) <peterz@infradead.org>
      Reviewed-by: NSteven Rostedt (VMware) <rostedt@goodmis.org>
      Reviewed-by: NThomas Gleixner <tglx@linutronix.de>
      Acked-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      Tested-by: NMarco Elver <elver@google.com>
      Link: https://lkml.kernel.org/r/20200723105615.1268126-1-npiggin@gmail.com
      044d0d6d