1. 21 4月, 2017 36 次提交
  2. 20 4月, 2017 4 次提交
    • J
      blk-throttle: fix unused variable warning with BLK_DEV_THROTTLING_LOW=n · 2bc19cd5
      Jens Axboe 提交于
      We trigger this warning:
      
      block/blk-throttle.c: In function ‘blk_throtl_bio’:
      block/blk-throttle.c:2042:6: warning: variable ‘ret’ set but not used [-Wunused-but-set-variable]
        int ret;
            ^~~
      
      since we only assign 'ret' if BLK_DEV_THROTTLING_LOW is off, we never
      check it.
      Reported-by: NBart Van Assche <bart.vanassche@sandisk.com>
      Reviewed-by: NBart Van Assche <bart.vanassche@sandisk.com>
      Signed-off-by: NJens Axboe <axboe@fb.com>
      2bc19cd5
    • J
      bfq: fix compile error if CONFIG_CGROUPS=n · 659b3394
      Jens Axboe 提交于
      If we don't have CGROUPS enabled, the compile ends in the
      following misery:
      
      In file included from ../block/bfq-iosched.c:105:0:
      ../block/bfq-iosched.h:819:22: error: array type has incomplete element type
       extern struct cftype bfq_blkcg_legacy_files[];
                            ^
      ../block/bfq-iosched.h:820:22: error: array type has incomplete element type
       extern struct cftype bfq_blkg_files[];
                            ^
      
      Move the declarations under the right ifdef.
      Reported-by: NRandy Dunlap <rdunlap@infradead.org>
      Signed-off-by: NJens Axboe <axboe@fb.com>
      659b3394
    • C
      block, bfq: don't dereference bic before null checking it · 8c9ff1ad
      Colin Ian King 提交于
      The call to bfq_check_ioprio_change will dereference bic, however,
      the null check for bic is after this call.  Move the the null
      check on bic to before the call to avoid any potential null
      pointer dereference issues.
      
      Detected by CoverityScan, CID#1430138 ("Dereference before null check")
      Signed-off-by: NColin Ian King <colin.king@canonical.com>
      Signed-off-by: NJens Axboe <axboe@fb.com>
      8c9ff1ad
    • R
      ligtnvm: fix double blk_put_queue on same queue · 75ba4ada
      Rakesh Pandit 提交于
      On an error path in NVM_DEV_CREATE ioctl blk_put_queue is being called
      twice: one via blk_cleanup_queue and another via put_disk.  Straight fix
      seems to remove queue pointer so that disk_release never ends up caling
      blk_put_queue again.
      
        [  391.808827] WARNING: CPU: 1 PID: 1250 at lib/refcount.c:128 refcount_sub_and_test+0x70/0x80
        [  391.808830] refcount_t: underflow; use-after-free.
        [ 391.808832] Modules linked in: nf_conntrack_netbios_ns............
        [  391.809052] CPU: 1 PID: 1250 Comm: nvme Not tainted.........
        [  391.809057] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996),
                   BIOS rel-1.7.5-0-ge51488c-20140602_164612-nilsson.home.kraxel.org 04/01/2014
        [  391.809060] Call Trace:
        [  391.809079]  dump_stack+0x63/0x86
        [  391.809094]  __warn+0xcb/0xf0
        [  391.809103]  warn_slowpath_fmt+0x5f/0x80
        [  391.809118]  refcount_sub_and_test+0x70/0x80
        [  391.809125]  refcount_dec_and_test+0x11/0x20
        [  391.809136]  kobject_put+0x1f/0x60
        [  391.809149]  blk_put_queue+0x15/0x20
        [  391.809159]  disk_release+0xae/0xf0
        [  391.809172]  device_release+0x32/0x90
        [  391.809184]  kobject_release+0x6a/0x170
        [  391.809196]  kobject_put+0x2f/0x60
        [  391.809206]  put_disk+0x17/0x20
        [  391.809219]  nvm_ioctl_dev_create.isra.16+0x897/0xa30
        [  391.809236]  nvm_ctl_ioctl+0x23c/0x4c0
        [  391.809248]  do_vfs_ioctl+0xa3/0x5f0
        [  391.809258]  SyS_ioctl+0x79/0x90
        [  391.809271]  entry_SYSCALL_64_fastpath+0x1a/0xa9
        [  391.809280] RIP: 0033:0x7f5d3ef363c7
        [  391.809286] RSP: 002b:00007ffc72ed8d78 EFLAGS: 00000206 ORIG_RAX: 0000000000000010
        [  391.809296] RAX: ffffffffffffffda RBX: 00007ffc72edb552 RCX: 00007f5d3ef363c7
        [  391.809301] RDX: 00007ffc72ed8d90 RSI: 0000000040804c22 RDI: 0000000000000003
        [  391.809306] RBP: 0000000000000001 R08: 0000000000000020 R09: 0000000000000001
        [  391.809311] R10: 000000000000053f R11: 0000000000000206 R12: 0000000000000000
        [  391.809316] R13: 0000000000000000 R14: 00007ffc72edb58d R15: 00007ffc72edb581
      Signed-off-by: NRakesh Pandit <rakesh@tuxera.com>
      Reviewed-by: NMatias Bjørling <matias@cnexlabs.com>
      Fixes: 7d1ef2f4 "lightnvm: fix cleanup order of disk on init error"
      Signed-off-by: NJens Axboe <axboe@fb.com>
      75ba4ada