1. 25 5月, 2018 1 次提交
  2. 24 5月, 2018 1 次提交
  3. 23 5月, 2018 1 次提交
  4. 17 5月, 2018 6 次提交
  5. 15 5月, 2018 1 次提交
  6. 14 5月, 2018 2 次提交
  7. 12 5月, 2018 4 次提交
  8. 10 5月, 2018 1 次提交
  9. 09 5月, 2018 1 次提交
  10. 08 5月, 2018 1 次提交
  11. 17 4月, 2018 8 次提交
    • F
      block/swim: Select appropriate drive on device open · b3906535
      Finn Thain 提交于
      The driver supports internal and external FDD units so the floppy_open
      function must not hard-code the drive location.
      
      Cc: Laurent Vivier <lvivier@redhat.com>
      Cc: Jens Axboe <axboe@kernel.dk>
      Cc: stable@vger.kernel.org # v4.14+
      Tested-by: NStan Johnson <userm57@yahoo.com>
      Signed-off-by: NFinn Thain <fthain@telegraphics.com.au>
      Acked-by: NLaurent Vivier <lvivier@redhat.com>
      Signed-off-by: NJens Axboe <axboe@kernel.dk>
      b3906535
    • F
      block/swim: Fix IO error at end of medium · 5a13388d
      Finn Thain 提交于
      Reading to the end of a 720K disk results in an IO error instead of EOF
      because the block layer thinks the disk has 2880 sectors. (Partly this
      is a result of inverted logic of the ONEMEG_MEDIA bit that's now fixed.)
      
      Initialize the density and head count in swim_add_floppy() to agree
      with the device size passed to set_capacity() during drive probe.
      
      Call set_capacity() again upon device open, after refreshing the density
      and head count values.
      
      Cc: Laurent Vivier <lvivier@redhat.com>
      Cc: Jens Axboe <axboe@kernel.dk>
      Cc: stable@vger.kernel.org # v4.14+
      Tested-by: NStan Johnson <userm57@yahoo.com>
      Signed-off-by: NFinn Thain <fthain@telegraphics.com.au>
      Acked-by: NLaurent Vivier <lvivier@redhat.com>
      Signed-off-by: NJens Axboe <axboe@kernel.dk>
      5a13388d
    • F
      block/swim: Check drive type · 8a500df6
      Finn Thain 提交于
      The SWIM chip is compatible with GCR-mode Sony 400K/800K drives but
      this driver only supports MFM mode. Therefore only Sony FDHD drives
      are supported. Skip incompatible drives.
      
      Cc: Laurent Vivier <lvivier@redhat.com>
      Cc: Jens Axboe <axboe@kernel.dk>
      Cc: stable@vger.kernel.org # v4.14+
      Tested-by: NStan Johnson <userm57@yahoo.com>
      Signed-off-by: NFinn Thain <fthain@telegraphics.com.au>
      Acked-by: NLaurent Vivier <lvivier@redhat.com>
      Signed-off-by: NJens Axboe <axboe@kernel.dk>
      8a500df6
    • F
      block/swim: Rename macros to avoid inconsistent inverted logic · 56a1c5ee
      Finn Thain 提交于
      The Sony drive status bits use active-low logic. The swim_readbit()
      function converts that to 'C' logic for readability. Hence, the
      sense of the names of the status bit macros should not be inverted.
      
      Mostly they are correct. However, the TWOMEG_DRIVE, MFM_MODE and
      TWOMEG_MEDIA macros have inverted sense (like MkLinux). Fix this
      inconsistency and make the following patches less confusing.
      
      The same problem affects swim3.c so fix that too.
      
      No functional change.
      
      The FDHD drive status bits are documented in sonydriv.cpp from MAME
      and in swimiii.h from MkLinux.
      
      Cc: Laurent Vivier <lvivier@redhat.com>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: linuxppc-dev@lists.ozlabs.org
      Cc: Jens Axboe <axboe@kernel.dk>
      Cc: stable@vger.kernel.org # v4.14+
      Tested-by: NStan Johnson <userm57@yahoo.com>
      Signed-off-by: NFinn Thain <fthain@telegraphics.com.au>
      Acked-by: NLaurent Vivier <lvivier@redhat.com>
      Signed-off-by: NJens Axboe <axboe@kernel.dk>
      56a1c5ee
    • F
      block/swim: Don't log an error message for an invalid ioctl · 8e2ab5a4
      Finn Thain 提交于
      The 'eject' shell command may send various different ioctl commands.
      This leads to error messages on the console even though the FDEJECT
      ioctl succeeds.
      
      ~# eject floppy
      SWIM floppy_ioctl: unknown cmd 21257
      SWIM floppy_ioctl: unknown cmd 1
      
      Don't log an error message for an invalid ioctl, just do as the
      swim3 driver does and return -ENOTTY.
      
      Cc: Laurent Vivier <lvivier@redhat.com>
      Cc: Jens Axboe <axboe@kernel.dk>
      Cc: stable@vger.kernel.org # v4.14+
      Tested-by: NStan Johnson <userm57@yahoo.com>
      Signed-off-by: NFinn Thain <fthain@telegraphics.com.au>
      Acked-by: NLaurent Vivier <lvivier@redhat.com>
      Reviewed-by: NGeert Uytterhoeven <geert@linux-m68k.org>
      Signed-off-by: NJens Axboe <axboe@kernel.dk>
      8e2ab5a4
    • F
      block/swim: Remove extra put_disk() call from error path · c1d6207c
      Finn Thain 提交于
      Cc: Laurent Vivier <lvivier@redhat.com>
      Cc: Jens Axboe <axboe@kernel.dk>
      Cc: stable@vger.kernel.org # v4.14+
      Fixes: 103db8b2 ("[PATCH] swim: stop sharing request queue across multiple gendisks")
      Tested-by: NStan Johnson <userm57@yahoo.com>
      Signed-off-by: NFinn Thain <fthain@telegraphics.com.au>
      Acked-by: NLaurent Vivier <lvivier@redhat.com>
      Reviewed-by: NGeert Uytterhoeven <geert@linux-m68k.org>
      Signed-off-by: NJens Axboe <axboe@kernel.dk>
      c1d6207c
    • F
      block/swim: Fix array bounds check · 7ae6a2b6
      Finn Thain 提交于
      In the floppy_find() function in swim.c is a call to
      get_disk(swd->unit[drive].disk). The actual parameter to this call
      can be a NULL pointer when drive == swd->floppy_count. This causes
      an oops in get_disk().
      
      Data read fault at 0x00000198 in Super Data (pc=0x1be5b6)
      BAD KERNEL BUSERR
      Oops: 00000000
      Modules linked in: swim_mod ipv6 mac8390
      PC: [<001be5b6>] get_disk+0xc/0x76
      SR: 2004  SP: 9a078bc1  a2: 0213ed90
      d0: 00000000    d1: 00000000    d2: 00000000    d3: 000000ff
      d4: 00000002    d5: 02983590    a0: 02332e00    a1: 022dfd64
      Process dd (pid: 285, task=020ab25b)
      Frame format=B ssw=074d isc=4a88 isb=6732 daddr=00000198 dobuf=00000000
      baddr=001be5bc dibuf=bfffffff ver=f
      Stack from 022dfca4:
              00000000 0203fc00 0213ed90 022dfcc0 02982936 00000000 00200000 022dfd08
              0020f85a 00200000 022dfd64 02332e00 004040fc 00000014 001be77e 022dfd64
              00334e4a 001be3f8 0800001d 022dfd64 01c04b60 01c04b70 022aba80 029828f8
              02332e00 022dfd2c 001be7ac 0203fc00 00200000 022dfd64 02103a00 01c04b60
              01c04b60 0200e400 022dfd68 000e191a 00200000 022dfd64 02103a00 0800001d
              00000000 00000003 000b89de 00500000 02103a00 01c04b60 02103a08 01c04c2e
      Call Trace: [<02982936>] floppy_find+0x3e/0x4a [swim_mod]
       [<00200000>] uart_remove_one_port+0x1a2/0x260
       [<0020f85a>] kobj_lookup+0xde/0x132
       [<00200000>] uart_remove_one_port+0x1a2/0x260
       [<001be77e>] get_gendisk+0x0/0x130
       [<00334e4a>] mutex_lock+0x0/0x2e
       [<001be3f8>] disk_block_events+0x0/0x6c
       [<029828f8>] floppy_find+0x0/0x4a [swim_mod]
       [<001be7ac>] get_gendisk+0x2e/0x130
       [<00200000>] uart_remove_one_port+0x1a2/0x260
       [<000e191a>] __blkdev_get+0x32/0x45a
       [<00200000>] uart_remove_one_port+0x1a2/0x260
       [<000b89de>] complete_walk+0x0/0x8a
       [<000e1e22>] blkdev_get+0xe0/0x29a
       [<000e1fdc>] blkdev_open+0x0/0xb0
       [<000b89de>] complete_walk+0x0/0x8a
       [<000e1fdc>] blkdev_open+0x0/0xb0
       [<000e01cc>] bd_acquire+0x74/0x8a
       [<000e205c>] blkdev_open+0x80/0xb0
       [<000e1fdc>] blkdev_open+0x0/0xb0
       [<000abf24>] do_dentry_open+0x1a4/0x322
       [<00020000>] __do_proc_douintvec+0x22/0x27e
       [<000b89de>] complete_walk+0x0/0x8a
       [<000baa62>] link_path_walk+0x0/0x48e
       [<000ba3f8>] inode_permission+0x20/0x54
       [<000ac0e4>] vfs_open+0x42/0x78
       [<000bc372>] path_openat+0x2b2/0xeaa
       [<000bc0c0>] path_openat+0x0/0xeaa
       [<0004463e>] __irq_wake_thread+0x0/0x4e
       [<0003a45a>] task_tick_fair+0x18/0xc8
       [<000bd00a>] do_filp_open+0xa0/0xea
       [<000abae0>] do_sys_open+0x11a/0x1ee
       [<00020000>] __do_proc_douintvec+0x22/0x27e
       [<000abbf4>] SyS_open+0x1e/0x22
       [<00020000>] __do_proc_douintvec+0x22/0x27e
       [<00002b40>] syscall+0x8/0xc
       [<00020000>] __do_proc_douintvec+0x22/0x27e
       [<0000c00b>] dyadic+0x1/0x28
      Code: 4e5e 4e75 4e56 fffc 2f0b 2f02 266e 0008 <206b> 0198 4a88 6732 2428 002c 661e 486b 0058 4eb9 0032 0b96 588f 4a88 672c 2008
      Disabling lock debugging due to kernel taint
      
      Fix the array index bounds check to avoid this.
      
      Cc: Laurent Vivier <lvivier@redhat.com>
      Cc: Jens Axboe <axboe@kernel.dk>
      Cc: stable@vger.kernel.org # v4.14+
      Fixes: 8852ecd9 ("[PATCH] m68k: mac - Add SWIM floppy support")
      Tested-by: NStan Johnson <userm57@yahoo.com>
      Signed-off-by: NFinn Thain <fthain@telegraphics.com.au>
      Acked-by: NLaurent Vivier <lvivier@redhat.com>
      Reviewed-by: NGeert Uytterhoeven <geert@linux-m68k.org>
      Signed-off-by: NJens Axboe <axboe@kernel.dk>
      7ae6a2b6
    • F
      m68k/mac: Don't remap SWIM MMIO region · b64576cb
      Finn Thain 提交于
      For reasons I don't understand, calling ioremap() then iounmap() on
      the SWIM MMIO region causes a hang on 68030 (but not on 68040).
      
      ~# modprobe swim_mod
      SWIM floppy driver Version 0.2 (2008-10-30)
      SWIM device not found !
      watchdog: BUG: soft lockup - CPU#0 stuck for 23s! [modprobe:285]
      Modules linked in: swim_mod(+)
      Format 00  Vector: 0064  PC: 000075aa  Status: 2000    Not tainted
      ORIG_D0: ffffffff  D0: d00c0000  A2: 007c2370  A1: 003f810c
      A0: 00040000  D5: d0096800  D4: d0097e00
      D3: 00000001  D2: 00000003  D1: 00000000
      Non-Maskable Interrupt
      Modules linked in: swim_mod(+)
      PC: [<000075ba>] __iounmap+0x24/0x10e
      SR: 2000  SP: 007abc48  a2: 007c2370
      d0: d00c0000    d1: 000001a0    d2: 00000019    d3: 00000001
      d4: d0097e00    d5: d0096800    a0: 00040000    a1: 003f810c
      Process modprobe (pid: 285, task=007c2370)
      Frame format=0
      Stack from 007abc7c:
              ffffffed 00000000 006a4060 004712e0 007abca0 000076ea d0080000 00080000
              010bb4b8 007abcd8 010ba542 d0096000 00000000 00000000 00000001 010bb59c
              00000000 007abf30 010bb4b8 0047760a 0047763c 00477612 00616540 007abcec
              0020a91a 00477600 0047760a 010bb4cc 007abd18 002092f2 0047760a 00333b06
              007abd5c 00000000 0047760a 010bb4cc 00404f90 004776b8 00000001 007abd38
              00209446 010bb4cc 0047760a 010bb4cc 0020938e 0031f8be 00616540 007abd64
      Call Trace: [<000076ea>] iounmap+0x46/0x5a
       [<00080000>] shrink_page_list+0x7f6/0xe06
       [<010ba542>] swim_probe+0xe4/0x496 [swim_mod]
       [<0020a91a>] platform_drv_probe+0x20/0x5e
       [<002092f2>] driver_probe_device+0x21c/0x2b8
       [<00333b06>] mutex_lock+0x0/0x2e
       [<00209446>] __driver_attach+0xb8/0xce
       [<0020938e>] __driver_attach+0x0/0xce
       [<0031f8be>] klist_next+0x0/0xa0
       [<00207562>] bus_for_each_dev+0x74/0xba
       [<000344c0>] blocking_notifier_call_chain+0x0/0x20
       [<00333b06>] mutex_lock+0x0/0x2e
       [<00208e44>] driver_attach+0x1a/0x1e
       [<0020938e>] __driver_attach+0x0/0xce
       [<00207e26>] bus_add_driver+0x188/0x234
       [<000344c0>] blocking_notifier_call_chain+0x0/0x20
       [<00209894>] driver_register+0x58/0x104
       [<000344c0>] blocking_notifier_call_chain+0x0/0x20
       [<010bd000>] swim_init+0x0/0x2c [swim_mod]
       [<0020a7be>] __platform_driver_register+0x38/0x3c
       [<010bd028>] swim_init+0x28/0x2c [swim_mod]
       [<000020dc>] do_one_initcall+0x38/0x196
       [<000344c0>] blocking_notifier_call_chain+0x0/0x20
       [<003331cc>] mutex_unlock+0x0/0x3e
       [<00333b06>] mutex_lock+0x0/0x2e
       [<003331cc>] mutex_unlock+0x0/0x3e
       [<00333b06>] mutex_lock+0x0/0x2e
       [<003331cc>] mutex_unlock+0x0/0x3e
       [<00333b06>] mutex_lock+0x0/0x2e
       [<003331cc>] mutex_unlock+0x0/0x3e
       [<00333b06>] mutex_lock+0x0/0x2e
       [<00075008>] __free_pages+0x0/0x38
       [<000045c0>] mangle_kernel_stack+0x30/0xda
       [<000344c0>] blocking_notifier_call_chain+0x0/0x20
       [<003331cc>] mutex_unlock+0x0/0x3e
       [<00333b06>] mutex_lock+0x0/0x2e
       [<0005ced4>] do_init_module+0x42/0x266
       [<010bd000>] swim_init+0x0/0x2c [swim_mod]
       [<000344c0>] blocking_notifier_call_chain+0x0/0x20
       [<0005eda0>] load_module+0x1a30/0x1e70
       [<0000465d>] mangle_kernel_stack+0xcd/0xda
       [<00331c64>] __generic_copy_from_user+0x0/0x46
       [<0033256e>] _cond_resched+0x0/0x32
       [<00331b9c>] memset+0x0/0x98
       [<0033256e>] _cond_resched+0x0/0x32
       [<0005f25c>] SyS_init_module+0x7c/0x112
       [<00002000>] _start+0x0/0x8
       [<00002000>] _start+0x0/0x8
       [<00331c82>] __generic_copy_from_user+0x1e/0x46
       [<0005f2b2>] SyS_init_module+0xd2/0x112
       [<0000465d>] mangle_kernel_stack+0xcd/0xda
       [<00002b40>] syscall+0x8/0xc
       [<0000465d>] mangle_kernel_stack+0xcd/0xda
       [<0008c00c>] pcpu_balance_workfn+0xb2/0x40e
      Code: 2200 7419 e4a9 e589 2841 d9fc 0000 1000 <2414> 7203 c282 7602 b681 6600 0096 0242 fe00 0482 0000 0000 e9c0 11c3 ed89 2642
      
      There's no need to call ioremap() for the SWIM address range, as it lies
      within the usual IO device region at 0x5000 0000, which has already been
      mapped by head.S.
      
      Remove the redundant ioremap() and iounmap() calls to fix the hang.
      
      Cc: Laurent Vivier <lvivier@redhat.com>
      Cc: stable@vger.kernel.org # v4.14+
      Tested-by: NStan Johnson <userm57@yahoo.com>
      Signed-off-by: NFinn Thain <fthain@telegraphics.com.au>
      Acked-by: NLaurent Vivier <lvivier@redhat.com>
      Signed-off-by: NJens Axboe <axboe@kernel.dk>
      b64576cb
  12. 16 4月, 2018 5 次提交
  13. 15 4月, 2018 2 次提交
    • J
      loop: handle short DIO reads · f9de14bc
      Jens Axboe 提交于
      We ran into an issue with loop and btrfs, where btrfs would complain about
      checksum errors. It turns out that is because we don't handle short reads
      at all, we just zero fill the remainder. Worse than that, we don't handle
      the filling properly, which results in loop trying to advance a single
      bio by much more than its size, since it doesn't take chaining into
      account.
      
      Handle short reads appropriately, by simply retrying at the new correct
      offset. End the remainder of the request with EIO, if we get a 0 read.
      
      Fixes: bc07c10a ("block: loop: support DIO & AIO")
      Reviewed-by: NMing Lei <ming.lei@redhat.com>
      Signed-off-by: NJens Axboe <axboe@kernel.dk>
      f9de14bc
    • J
      loop: remove cmd->rq member · 1894e916
      Jens Axboe 提交于
      We can always get at the request from the payload, no need to store
      a pointer to it.
      Reviewed-by: NMing Lei <ming.lei@redhat.com>
      Signed-off-by: NJens Axboe <axboe@kernel.dk>
      1894e916
  14. 10 4月, 2018 2 次提交
    • O
      loop: fix LOOP_GET_STATUS lock imbalance · bdac616d
      Omar Sandoval 提交于
      Commit 2d1d4c1e made loop_get_status() drop lo_ctx_mutex before
      returning, but the loop_get_status_old(), loop_get_status64(), and
      loop_get_status_compat() wrappers don't call loop_get_status() if the
      passed argument is NULL. The callers expect that the lock is dropped, so
      make sure we drop it in that case, too.
      
      Reported-by: syzbot+31e8daa8b3fc129e75f2@syzkaller.appspotmail.com
      Fixes: 2d1d4c1e ("loop: don't call into filesystem while holding lo_ctl_mutex")
      Signed-off-by: NOmar Sandoval <osandov@fb.com>
      Signed-off-by: NJens Axboe <axboe@kernel.dk>
      bdac616d
    • T
      block/loop: fix deadlock after loop_set_status · 1e047eaa
      Tetsuo Handa 提交于
      syzbot is reporting deadlocks at __blkdev_get() [1].
      
      ----------------------------------------
      [   92.493919] systemd-udevd   D12696   525      1 0x00000000
      [   92.495891] Call Trace:
      [   92.501560]  schedule+0x23/0x80
      [   92.502923]  schedule_preempt_disabled+0x5/0x10
      [   92.504645]  __mutex_lock+0x416/0x9e0
      [   92.510760]  __blkdev_get+0x73/0x4f0
      [   92.512220]  blkdev_get+0x12e/0x390
      [   92.518151]  do_dentry_open+0x1c3/0x2f0
      [   92.519815]  path_openat+0x5d9/0xdc0
      [   92.521437]  do_filp_open+0x7d/0xf0
      [   92.527365]  do_sys_open+0x1b8/0x250
      [   92.528831]  do_syscall_64+0x6e/0x270
      [   92.530341]  entry_SYSCALL_64_after_hwframe+0x42/0xb7
      
      [   92.931922] 1 lock held by systemd-udevd/525:
      [   92.933642]  #0: 00000000a2849e25 (&bdev->bd_mutex){+.+.}, at: __blkdev_get+0x73/0x4f0
      ----------------------------------------
      
      The reason of deadlock turned out that wait_event_interruptible() in
      blk_queue_enter() got stuck with bdev->bd_mutex held at __blkdev_put()
      due to q->mq_freeze_depth == 1.
      
      ----------------------------------------
      [   92.787172] a.out           S12584   634    633 0x80000002
      [   92.789120] Call Trace:
      [   92.796693]  schedule+0x23/0x80
      [   92.797994]  blk_queue_enter+0x3cb/0x540
      [   92.803272]  generic_make_request+0xf0/0x3d0
      [   92.807970]  submit_bio+0x67/0x130
      [   92.810928]  submit_bh_wbc+0x15e/0x190
      [   92.812461]  __block_write_full_page+0x218/0x460
      [   92.815792]  __writepage+0x11/0x50
      [   92.817209]  write_cache_pages+0x1ae/0x3d0
      [   92.825585]  generic_writepages+0x5a/0x90
      [   92.831865]  do_writepages+0x43/0xd0
      [   92.836972]  __filemap_fdatawrite_range+0xc1/0x100
      [   92.838788]  filemap_write_and_wait+0x24/0x70
      [   92.840491]  __blkdev_put+0x69/0x1e0
      [   92.841949]  blkdev_close+0x16/0x20
      [   92.843418]  __fput+0xda/0x1f0
      [   92.844740]  task_work_run+0x87/0xb0
      [   92.846215]  do_exit+0x2f5/0xba0
      [   92.850528]  do_group_exit+0x34/0xb0
      [   92.852018]  SyS_exit_group+0xb/0x10
      [   92.853449]  do_syscall_64+0x6e/0x270
      [   92.854944]  entry_SYSCALL_64_after_hwframe+0x42/0xb7
      
      [   92.943530] 1 lock held by a.out/634:
      [   92.945105]  #0: 00000000a2849e25 (&bdev->bd_mutex){+.+.}, at: __blkdev_put+0x3c/0x1e0
      ----------------------------------------
      
      The reason of q->mq_freeze_depth == 1 turned out that loop_set_status()
      forgot to call blk_mq_unfreeze_queue() at error paths for
      info->lo_encrypt_type != NULL case.
      
      ----------------------------------------
      [   37.509497] CPU: 2 PID: 634 Comm: a.out Tainted: G        W        4.16.0+ #457
      [   37.513608] Hardware name: VMware, Inc. VMware Virtual Platform/440BX Desktop Reference Platform, BIOS 6.00 05/19/2017
      [   37.518832] RIP: 0010:blk_freeze_queue_start+0x17/0x40
      [   37.521778] RSP: 0018:ffffb0c2013e7c60 EFLAGS: 00010246
      [   37.524078] RAX: 0000000000000000 RBX: ffff8b07b1519798 RCX: 0000000000000000
      [   37.527015] RDX: 0000000000000002 RSI: ffffb0c2013e7cc0 RDI: ffff8b07b1519798
      [   37.529934] RBP: ffffb0c2013e7cc0 R08: 0000000000000008 R09: 47a189966239b898
      [   37.532684] R10: dad78b99b278552f R11: 9332dca72259d5ef R12: ffff8b07acd73678
      [   37.535452] R13: 0000000000004c04 R14: 0000000000000000 R15: ffff8b07b841e940
      [   37.538186] FS:  00007fede33b9740(0000) GS:ffff8b07b8e80000(0000) knlGS:0000000000000000
      [   37.541168] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
      [   37.543590] CR2: 00000000206fdf18 CR3: 0000000130b30006 CR4: 00000000000606e0
      [   37.546410] Call Trace:
      [   37.547902]  blk_freeze_queue+0x9/0x30
      [   37.549968]  loop_set_status+0x67/0x3c0 [loop]
      [   37.549975]  loop_set_status64+0x3b/0x70 [loop]
      [   37.549986]  lo_ioctl+0x223/0x810 [loop]
      [   37.549995]  blkdev_ioctl+0x572/0x980
      [   37.550003]  block_ioctl+0x34/0x40
      [   37.550006]  do_vfs_ioctl+0xa7/0x6d0
      [   37.550017]  ksys_ioctl+0x6b/0x80
      [   37.573076]  SyS_ioctl+0x5/0x10
      [   37.574831]  do_syscall_64+0x6e/0x270
      [   37.576769]  entry_SYSCALL_64_after_hwframe+0x42/0xb7
      ----------------------------------------
      
      [1] https://syzkaller.appspot.com/bug?id=cd662bc3f6022c0979d01a262c318fab2ee9b56fSigned-off-by: NTetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
      Reported-by: Nsyzbot <bot+48594378e9851eab70bcd6f99327c7db58c5a28a@syzkaller.appspotmail.com>
      Fixes: ecdd0959 ("block/loop: fix race between I/O and set_status")
      Cc: Ming Lei <tom.leiming@gmail.com>
      Cc: Dmitry Vyukov <dvyukov@google.com>
      Cc: stable <stable@vger.kernel.org>
      Cc: Jens Axboe <axboe@fb.com>
      Signed-off-by: NJens Axboe <axboe@kernel.dk>
      1e047eaa
  15. 06 4月, 2018 1 次提交
    • S
      zram: drop max_zpage_size and use zs_huge_class_size() · 60f5921a
      Sergey Senozhatsky 提交于
      Remove ZRAM's enforced "huge object" value and use zsmalloc huge-class
      watermark instead, which makes more sense.
      
      TEST
      - I used a 1G zram device, LZO compression back-end, original
        data set size was 444MB. Looking at zsmalloc classes stats the
        test ended up to be pretty fair.
      
      BASE ZRAM/ZSMALLOC
      =====================
      zram mm_stat
      
      498978816 191482495 199831552        0 199831552    15634        0
      
      zsmalloc classes
      
       class  size almost_full almost_empty obj_allocated   obj_used pages_used pages_per_zspage freeable
      ...
         151  2448           0            0          1240       1240        744                3        0
         168  2720           0            0          4200       4200       2800                2        0
         190  3072           0            0         10100      10100       7575                3        0
         202  3264           0            0           380        380        304                4        0
         254  4096           0            0         10620      10620      10620                1        0
      
       Total                 7           46        106982     106187      48787                         0
      
      PATCHED ZRAM/ZSMALLOC
      =====================
      
      zram mm_stat
      
      498978816 182579184 194248704        0 194248704    15628        0
      
      zsmalloc classes
      
       class  size almost_full almost_empty obj_allocated   obj_used pages_used pages_per_zspage freeable
      ...
         151  2448           0            0          1240       1240        744                3        0
         168  2720           0            0          4200       4200       2800                2        0
         190  3072           0            0         10100      10100       7575                3        0
         202  3264           0            0          7180       7180       5744                4        0
         254  4096           0            0          3820       3820       3820                1        0
      
       Total                 8           45        106959     106193      47424                         0
      
      As we can see, we reduced the number of objects stored in class-4096,
      because a huge number of objects which we previously forcibly stored in
      class-4096 now stored in non-huge class-3264.  This results in lower
      memory consumption:
      
      - zsmalloc now uses 47424 physical pages, which is less than 48787 pages
        zsmalloc used before.
      
      - objects that we store in class-3264 share zspages.  That's why overall
        the number of pages that both class-4096 and class-3264 consumed went
        down from 10924 to 9564.
      
      [sergey.senozhatsky.work@gmail.com: add pool param to zs_huge_class_size()]
        Link: http://lkml.kernel.org/r/20180314081833.1096-3-sergey.senozhatsky@gmail.com
      Link: http://lkml.kernel.org/r/20180306070639.7389-3-sergey.senozhatsky@gmail.comSigned-off-by: NSergey Senozhatsky <sergey.senozhatsky@gmail.com>
      Acked-by: NMinchan Kim <minchan@kernel.org>
      Cc: Mike Rapoport <rppt@linux.vnet.ibm.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      60f5921a
  16. 02 4月, 2018 3 次提交