1. 21 12月, 2019 2 次提交
    • B
      block: Fix a lockdep complaint triggered by request queue flushing · b3c6a599
      Bart Van Assche 提交于
      Avoid that running test nvme/012 from the blktests suite triggers the
      following false positive lockdep complaint:
      
      ============================================
      WARNING: possible recursive locking detected
      5.0.0-rc3-xfstests-00015-g1236f7d60242 #841 Not tainted
      --------------------------------------------
      ksoftirqd/1/16 is trying to acquire lock:
      000000000282032e (&(&fq->mq_flush_lock)->rlock){..-.}, at: flush_end_io+0x4e/0x1d0
      
      but task is already holding lock:
      00000000cbadcbc2 (&(&fq->mq_flush_lock)->rlock){..-.}, at: flush_end_io+0x4e/0x1d0
      
      other info that might help us debug this:
       Possible unsafe locking scenario:
      
             CPU0
             ----
        lock(&(&fq->mq_flush_lock)->rlock);
        lock(&(&fq->mq_flush_lock)->rlock);
      
       *** DEADLOCK ***
      
       May be due to missing lock nesting notation
      
      1 lock held by ksoftirqd/1/16:
       #0: 00000000cbadcbc2 (&(&fq->mq_flush_lock)->rlock){..-.}, at: flush_end_io+0x4e/0x1d0
      
      stack backtrace:
      CPU: 1 PID: 16 Comm: ksoftirqd/1 Not tainted 5.0.0-rc3-xfstests-00015-g1236f7d60242 #841
      Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
      Call Trace:
       dump_stack+0x67/0x90
       __lock_acquire.cold.45+0x2b4/0x313
       lock_acquire+0x98/0x160
       _raw_spin_lock_irqsave+0x3b/0x80
       flush_end_io+0x4e/0x1d0
       blk_mq_complete_request+0x76/0x110
       nvmet_req_complete+0x15/0x110 [nvmet]
       nvmet_bio_done+0x27/0x50 [nvmet]
       blk_update_request+0xd7/0x2d0
       blk_mq_end_request+0x1a/0x100
       blk_flush_complete_seq+0xe5/0x350
       flush_end_io+0x12f/0x1d0
       blk_done_softirq+0x9f/0xd0
       __do_softirq+0xca/0x440
       run_ksoftirqd+0x24/0x50
       smpboot_thread_fn+0x113/0x1e0
       kthread+0x121/0x140
       ret_from_fork+0x3a/0x50
      
      Cc: Christoph Hellwig <hch@infradead.org>
      Cc: Ming Lei <ming.lei@redhat.com>
      Cc: Hannes Reinecke <hare@suse.com>
      Signed-off-by: NBart Van Assche <bvanassche@acm.org>
      Signed-off-by: NJens Axboe <axboe@kernel.dk>
      b3c6a599
    • B
      block: Fix the type of 'sts' in bsg_queue_rq() · c44a4edb
      Bart Van Assche 提交于
      This patch fixes the following sparse warnings:
      
      block/bsg-lib.c:269:19: warning: incorrect type in initializer (different base types)
      block/bsg-lib.c:269:19:    expected int sts
      block/bsg-lib.c:269:19:    got restricted blk_status_t [usertype]
      block/bsg-lib.c:286:16: warning: incorrect type in return expression (different base types)
      block/bsg-lib.c:286:16:    expected restricted blk_status_t
      block/bsg-lib.c:286:16:    got int [assigned] sts
      
      Cc: Martin Wilck <mwilck@suse.com>
      Fixes: d46fe2cb ("block: drop device references in bsg_queue_rq()")
      Signed-off-by: NBart Van Assche <bvanassche@acm.org>
      Signed-off-by: NJens Axboe <axboe@kernel.dk>
      c44a4edb
  2. 18 12月, 2019 1 次提交
  3. 17 12月, 2019 1 次提交
    • T
      iocost: over-budget forced IOs should schedule async delay · d7bd15a1
      Tejun Heo 提交于
      When over-budget IOs are force-issued through root cgroup,
      iocg_kick_delay() adjusts the async delay accordingly but doesn't
      actually schedule async throttle for the issuing task.  This bug is
      pretty well masked because sooner or later the offending threads are
      gonna get directly throttled on regular IOs or have async delay
      scheduled by mem_cgroup_throttle_swaprate().
      
      However, it can affect control quality on filesystem metadata heavy
      operations.  Let's fix it by invoking blkcg_schedule_throttle() when
      iocg_kick_delay() says async delay is needed.
      Signed-off-by: NTejun Heo <tj@kernel.org>
      Fixes: 7caa4715 ("blkcg: implement blk-iocost")
      Cc: stable@vger.kernel.org
      Reported-by: NJosef Bacik <josef@toxicpanda.com>
      Signed-off-by: NJens Axboe <axboe@kernel.dk>
      d7bd15a1
  4. 13 12月, 2019 1 次提交
  5. 12 12月, 2019 1 次提交
    • L
      block: fix NULL pointer dereference in account statistics with IDE · ecb6186c
      Logan Gunthorpe 提交于
      The IDE driver creates some passthru requests which never get
      submitted to the block layer in such a way that blk_account_io_start()
      gets called. However, the driver still calls __blk_mq_end_request() in
      ide_end_rq() which will call blk_account_io_completion() which tries
      to dereferences req->part which is never set. See ide_prep_sense() for
      an example of where these requests come from.
      
      To fix this, blk_account_io_completion() and blk_account_io_done()
      should do nothing if req->part is not set.
      
      The back trace of this bug is:
      
          BUG: kernel NULL pointer dereference, address: 000002ac
          #PF: supervisor write access in kernel mode
          #PF: error_code(0x0002) - not-present page
          *pde = 00000000
          Oops: 0002 [#1]
          CPU: 0 PID: 237 Comm: kworker/0:1H Not tainted
          5.4.0-rc2-00011-g48d9b0d4 #1
          Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.10.2-1
          04/01/2014
          Workqueue: kblockd drive_rq_insert_work
          EIP: blk_account_io_completion+0x7a/0xf0
          Code: 89 54 24 08 31 d2 89 4c 24 04 31 c9 c7 04 24 02 00 00 00 c1 ee
          09 e8 f5 21 a6 ff e8 70 5c a7 ff 8b 53 60 8d 04 bd 00 00 00 00 <01> b4
          02 ac 02 00 00 8b 9a 88 02 00 00 85 db 74 11 85 d2 74 51 8b
          EAX: 00000000 EBX: f5b80000 ECX: 00000000 EDX: 00000000
          ESI: 00000000 EDI: 00000000 EBP: f3031e70 ESP: f3031e54
          DS: 007b ES: 007b FS: 0000 GS: 0000 SS: 0068 EFLAGS: 00010046
          CR0: 80050033 CR2: 000002ac CR3: 03c25000 CR4: 000406d0
          Call Trace:
           <IRQ>
            blk_update_request+0x85/0x420
            ide_end_rq+0x38/0xa0
            ide_complete_rq+0x3d/0x70
            cdrom_newpc_intr+0x258/0xba0
            ide_intr+0x135/0x250
            __handle_irq_event_percpu+0x3e/0x250
            handle_irq_event_percpu+0x1f/0x50
            handle_irq_event+0x32/0x60
            handle_level_irq+0x6c/0x110
            handle_irq+0x72/0xa0
            </IRQ>
            do_IRQ+0x45/0xad
            common_interrupt+0x115/0x11c
      
      Fixes: 48d9b0d4 ("block: account statistics for passthrough requests")
      Reported-by: Nkernel test robot <rong.a.chen@intel.com>
      Signed-off-by: NLogan Gunthorpe <logang@deltatee.com>
      Signed-off-by: NJens Axboe <axboe@kernel.dk>
      ecb6186c
  6. 10 12月, 2019 2 次提交
  7. 06 12月, 2019 1 次提交
    • J
      block: fix memleak of bio integrity data · ece841ab
      Justin Tee 提交于
      7c20f116 ("bio-integrity: stop abusing bi_end_io") moves
      bio_integrity_free from bio_uninit() to bio_integrity_verify_fn()
      and bio_endio(). This way looks wrong because bio may be freed
      without calling bio_endio(), for example, blk_rq_unprep_clone() is
      called from dm_mq_queue_rq() when the underlying queue of dm-mpath
      is busy.
      
      So memory leak of bio integrity data is caused by commit 7c20f116.
      
      Fixes this issue by re-adding bio_integrity_free() to bio_uninit().
      
      Fixes: 7c20f116 ("bio-integrity: stop abusing bi_end_io")
      Reviewed-by: NChristoph Hellwig <hch@lst.de>
      Signed-off-by Justin Tee <justin.tee@broadcom.com>
      
      Add commit log, and simplify/fix the original patch wroten by Justin.
      Signed-off-by: NMing Lei <ming.lei@redhat.com>
      Signed-off-by: NJens Axboe <axboe@kernel.dk>
      ece841ab
  8. 05 12月, 2019 1 次提交
    • H
      bfq-iosched: Ensure bio->bi_blkg is valid before using it · 08802ed6
      Hou Tao 提交于
      bio->bi_blkg will be NULL when the issue of the request
      has bypassed the block layer as shown in the following oops:
      
       Internal error: Oops: 96000005 [#1] SMP
       CPU: 17 PID: 2996 Comm: scsi_id Not tainted 5.4.0 #4
       Call trace:
        percpu_counter_add_batch+0x38/0x4c8
        bfqg_stats_update_legacy_io+0x9c/0x280
        bfq_insert_requests+0xbac/0x2190
        blk_mq_sched_insert_request+0x288/0x670
        blk_execute_rq_nowait+0x140/0x178
        blk_execute_rq+0x8c/0x140
        sg_io+0x604/0x9c0
        scsi_cmd_ioctl+0xe38/0x10a8
        scsi_cmd_blk_ioctl+0xac/0xe8
        sd_ioctl+0xe4/0x238
        blkdev_ioctl+0x590/0x20e0
        block_ioctl+0x60/0x98
        do_vfs_ioctl+0xe0/0x1b58
        ksys_ioctl+0x80/0xd8
        __arm64_sys_ioctl+0x40/0x78
        el0_svc_handler+0xc4/0x270
      
      so ensure its validity before using it.
      
      Fixes: fd41e603 ("bfq-iosched: stop using blkg->stat_bytes and ->stat_ios")
      Signed-off-by: NHou Tao <houtao1@huawei.com>
      Signed-off-by: NJens Axboe <axboe@kernel.dk>
      08802ed6
  9. 04 12月, 2019 1 次提交
  10. 03 12月, 2019 5 次提交
  11. 22 11月, 2019 2 次提交
  12. 21 11月, 2019 1 次提交
  13. 19 11月, 2019 1 次提交
  14. 18 11月, 2019 1 次提交
  15. 15 11月, 2019 1 次提交
  16. 14 11月, 2019 7 次提交
  17. 13 11月, 2019 5 次提交
  18. 12 11月, 2019 1 次提交
    • J
      block: check bi_size overflow before merge · e3a5d8e3
      Junichi Nomura 提交于
      __bio_try_merge_page() may merge a page to bio without bio_full() check
      and cause bi_size overflow.
      
      The overflow typically ends up with sd_init_command() warning on zero
      segment request with call trace like this:
      
          ------------[ cut here ]------------
          WARNING: CPU: 2 PID: 1986 at drivers/scsi/scsi_lib.c:1025 scsi_init_io+0x156/0x180
          CPU: 2 PID: 1986 Comm: kworker/2:1H Kdump: loaded Not tainted 5.4.0-rc7 #1
          Workqueue: kblockd blk_mq_run_work_fn
          RIP: 0010:scsi_init_io+0x156/0x180
          RSP: 0018:ffffa11487663bf0 EFLAGS: 00010246
          RAX: 00000000002be0a0 RBX: ffff8e6e9ff30118 RCX: 0000000000000000
          RDX: 00000000ffffffe1 RSI: 0000000000000000 RDI: ffff8e6e9ff30118
          RBP: ffffa11487663c18 R08: ffffa11487663d28 R09: ffff8e6e9ff30150
          R10: 0000000000000001 R11: 0000000000000000 R12: ffff8e6e9ff30000
          R13: 0000000000000001 R14: ffff8e74a1cf1800 R15: ffff8e6e9ff30000
          FS:  0000000000000000(0000) GS:ffff8e6ea7680000(0000) knlGS:0000000000000000
          CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
          CR2: 00007fff18cf0fe8 CR3: 0000000659f0a001 CR4: 00000000001606e0
          Call Trace:
           sd_init_command+0x326/0xb40 [sd_mod]
           scsi_queue_rq+0x502/0xaa0
           ? blk_mq_get_driver_tag+0xe7/0x120
           blk_mq_dispatch_rq_list+0x256/0x5a0
           ? elv_rb_del+0x24/0x30
           ? deadline_remove_request+0x7b/0xc0
           blk_mq_do_dispatch_sched+0xa3/0x140
           blk_mq_sched_dispatch_requests+0xfb/0x170
           __blk_mq_run_hw_queue+0x81/0x130
           blk_mq_run_work_fn+0x1b/0x20
           process_one_work+0x179/0x390
           worker_thread+0x4f/0x3e0
           kthread+0x105/0x140
           ? max_active_store+0x80/0x80
           ? kthread_bind+0x20/0x20
           ret_from_fork+0x35/0x40
          ---[ end trace f9036abf5af4a4d3 ]---
          blk_update_request: I/O error, dev sdd, sector 2875552 op 0x1:(WRITE) flags 0x0 phys_seg 0 prio class 0
          XFS (sdd1): writeback error on sector 2875552
      
      __bio_try_merge_page() should check the overflow before actually doing
      merge.
      
      Fixes: 07173c3e ("block: enable multipage bvecs")
      Reviewed-by: NChristoph Hellwig <hch@lst.de>
      Reviewed-by: NMing Lei <ming.lei@redhat.com>
      Reviewed-by: NHannes Reinecke <hare@suse.de>
      Signed-off-by: NJun'ichi Nomura <j-nomura@ce.jp.nec.com>
      Signed-off-by: NJens Axboe <axboe@kernel.dk>
      e3a5d8e3
  19. 08 11月, 2019 5 次提交
新手
引导
客服 返回
顶部