1. 22 Feb, 2018 8 commits
    • Zhouyi Zhou's avatar
      ext4: save error to disk in __ext4_grp_locked_error() · 4a36f437
      Zhouyi Zhou authored
      commit 06f29cc8 upstream.
      
      In the function __ext4_grp_locked_error(), __save_error_info()
      is called to save error info in super block block, but does not sync
      that information to disk to info the subsequence fsck after reboot.
      
      This patch writes the error information to disk.  After this patch,
      I think there is no obvious EXT4 error handle branches which leads to
      "Remounting filesystem read-only" will leave the disk partition miss
      the subsequence fsck.
      Signed-off-by: default avatarZhouyi Zhou <zhouzhouyi@gmail.com>
      Signed-off-by: default avatarTheodore Ts'o <tytso@mit.edu>
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      4a36f437
    • Harshad Shirwadkar's avatar
      ext4: fix a race in the ext4 shutdown path · 539deabf
      Harshad Shirwadkar authored
      commit abbc3f93 upstream.
      
      This patch fixes a race between the shutdown path and bio completion
      handling. In the ext4 direct io path with async io, after submitting a
      bio to the block layer, if journal starting fails,
      ext4_direct_IO_write() would bail out pretending that the IO
      failed. The caller would have had no way of knowing whether or not the
      IO was successfully submitted. So instead, we return -EIOCBQUEUED in
      this case. Now, the caller knows that the IO was submitted.  The bio
      completion handler takes care of the error.
      
      Tested: Ran the shutdown xfstest test 461 in loop for over 2 hours across
      4 machines resulting in over 400 runs. Verified that the race didn't
      occur. Usually the race was seen in about 20-30 iterations.
      Signed-off-by: default avatarHarshad Shirwadkar <harshads@google.com>
      Signed-off-by: default avatarTheodore Ts'o <tytso@mit.edu>
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      539deabf
    • Tobin C. Harding's avatar
      jbd2: fix sphinx kernel-doc build warnings · 99a89d8f
      Tobin C. Harding authored
      commit f69120ce upstream.
      
      Sphinx emits various (26) warnings when building make target 'htmldocs'.
      Currently struct definitions contain duplicate documentation, some as
      kernel-docs and some as standard c89 comments.  We can reduce
      duplication while cleaning up the kernel docs.
      
      Move all kernel-docs to right above each struct member.  Use the set of
      all existing comments (kernel-doc and c89).  Add documentation for
      missing struct members and function arguments.
      Signed-off-by: default avatarTobin C. Harding <me@tobin.cc>
      Signed-off-by: default avatarTheodore Ts'o <tytso@mit.edu>
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      99a89d8f
    • Alexander Potapenko's avatar
      mbcache: initialize entry->e_referenced in mb_cache_entry_create() · 9cb2d0bc
      Alexander Potapenko authored
      commit 3876bbe2 upstream.
      
      KMSAN reported use of uninitialized |entry->e_referenced| in a condition
      in mb_cache_shrink():
      
      ==================================================================
      BUG: KMSAN: use of uninitialized memory in mb_cache_shrink+0x3b4/0xc50 fs/mbcache.c:287
      CPU: 2 PID: 816 Comm: kswapd1 Not tainted 4.11.0-rc5+ #2877
      Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS Bochs
      01/01/2011
      Call Trace:
       __dump_stack lib/dump_stack.c:16 [inline]
       dump_stack+0x172/0x1c0 lib/dump_stack.c:52
       kmsan_report+0x12a/0x180 mm/kmsan/kmsan.c:927
       __msan_warning_32+0x61/0xb0 mm/kmsan/kmsan_instr.c:469
       mb_cache_shrink+0x3b4/0xc50 fs/mbcache.c:287
       mb_cache_scan+0x67/0x80 fs/mbcache.c:321
       do_shrink_slab mm/vmscan.c:397 [inline]
       shrink_slab+0xc3d/0x12d0 mm/vmscan.c:500
       shrink_node+0x208f/0x2fd0 mm/vmscan.c:2603
       kswapd_shrink_node mm/vmscan.c:3172 [inline]
       balance_pgdat mm/vmscan.c:3289 [inline]
       kswapd+0x160f/0x2850 mm/vmscan.c:3478
       kthread+0x46c/0x5f0 kernel/kthread.c:230
       ret_from_fork+0x29/0x40 arch/x86/entry/entry_64.S:430
      chained origin:
       save_stack_trace+0x37/0x40 arch/x86/kernel/stacktrace.c:59
       kmsan_save_stack_with_flags mm/kmsan/kmsan.c:302 [inline]
       kmsan_save_stack mm/kmsan/kmsan.c:317 [inline]
       kmsan_internal_chain_origin+0x12a/0x1f0 mm/kmsan/kmsan.c:547
       __msan_store_shadow_origin_1+0xac/0x110 mm/kmsan/kmsan_instr.c:257
       mb_cache_entry_create+0x3b3/0xc60 fs/mbcache.c:95
       ext4_xattr_cache_insert fs/ext4/xattr.c:1647 [inline]
       ext4_xattr_block_set+0x4c82/0x5530 fs/ext4/xattr.c:1022
       ext4_xattr_set_handle+0x1332/0x20a0 fs/ext4/xattr.c:1252
       ext4_xattr_set+0x4d2/0x680 fs/ext4/xattr.c:1306
       ext4_xattr_trusted_set+0x8d/0xa0 fs/ext4/xattr_trusted.c:36
       __vfs_setxattr+0x703/0x790 fs/xattr.c:149
       __vfs_setxattr_noperm+0x27a/0x6f0 fs/xattr.c:180
       vfs_setxattr fs/xattr.c:223 [inline]
       setxattr+0x6ae/0x790 fs/xattr.c:449
       path_setxattr+0x1eb/0x380 fs/xattr.c:468
       SYSC_lsetxattr+0x8d/0xb0 fs/xattr.c:490
       SyS_lsetxattr+0x77/0xa0 fs/xattr.c:486
       entry_SYSCALL_64_fastpath+0x13/0x94
      origin:
       save_stack_trace+0x37/0x40 arch/x86/kernel/stacktrace.c:59
       kmsan_save_stack_with_flags mm/kmsan/kmsan.c:302 [inline]
       kmsan_internal_poison_shadow+0xb1/0x1a0 mm/kmsan/kmsan.c:198
       kmsan_kmalloc+0x7f/0xe0 mm/kmsan/kmsan.c:337
       kmem_cache_alloc+0x1c2/0x1e0 mm/slub.c:2766
       mb_cache_entry_create+0x283/0xc60 fs/mbcache.c:86
       ext4_xattr_cache_insert fs/ext4/xattr.c:1647 [inline]
       ext4_xattr_block_set+0x4c82/0x5530 fs/ext4/xattr.c:1022
       ext4_xattr_set_handle+0x1332/0x20a0 fs/ext4/xattr.c:1252
       ext4_xattr_set+0x4d2/0x680 fs/ext4/xattr.c:1306
       ext4_xattr_trusted_set+0x8d/0xa0 fs/ext4/xattr_trusted.c:36
       __vfs_setxattr+0x703/0x790 fs/xattr.c:149
       __vfs_setxattr_noperm+0x27a/0x6f0 fs/xattr.c:180
       vfs_setxattr fs/xattr.c:223 [inline]
       setxattr+0x6ae/0x790 fs/xattr.c:449
       path_setxattr+0x1eb/0x380 fs/xattr.c:468
       SYSC_lsetxattr+0x8d/0xb0 fs/xattr.c:490
       SyS_lsetxattr+0x77/0xa0 fs/xattr.c:486
       entry_SYSCALL_64_fastpath+0x13/0x94
      ==================================================================
      Signed-off-by: default avatarAlexander Potapenko <glider@google.com>
      Signed-off-by: default avatarEric Biggers <ebiggers@google.com>
      Cc: stable@vger.kernel.org # v4.6
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      9cb2d0bc
    • Stewart Smith's avatar
      rtc-opal: Fix handling of firmware error codes, prevent busy loops · b7dc0f53
      Stewart Smith authored
      commit 5b8b5806 upstream.
      
      According to the OPAL docs:
        skiboot-5.2.5/doc/opal-api/opal-rtc-read-3.txt
        skiboot-5.2.5/doc/opal-api/opal-rtc-write-4.txt
      
      OPAL_HARDWARE may be returned from OPAL_RTC_READ or OPAL_RTC_WRITE and
      this indicates either a transient or permanent error.
      
      Prior to this patch, Linux was not dealing with OPAL_HARDWARE being a
      permanent error particularly well, in that you could end up in a busy
      loop.
      
      This was not too hard to trigger on an AMI BMC based OpenPOWER machine
      doing a continuous "ipmitool mc reset cold" to the BMC, the result of
      that being that we'd get stuck in an infinite loop in
      opal_get_rtc_time().
      
      We now retry a few times before returning the error higher up the
      stack.
      
      Fixes: 16b1d26e ("rtc/tpo: Driver to support rtc and wakeup on PowerNV platform")
      Cc: stable@vger.kernel.org # v3.19+
      Signed-off-by: default avatarStewart Smith <stewart@linux.vnet.ibm.com>
      Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      b7dc0f53
    • Julia Lawall's avatar
      drm/radeon: adjust tested variable · 9172bbcd
      Julia Lawall authored
      commit 3a61b527 upstream.
      
      Check the variable that was most recently initialized.
      
      The semantic match that finds this problem is as follows:
      (http://coccinelle.lip6.fr/)
      
      // <smpl>
      @@
      expression x, y, f, g, e, m;
      statement S1,S2,S3,S4;
      @@
      
      x = f(...);
      if (\(<+...x...+>\&e\)) S1 else S2
      (
      x = g(...);
      |
      m = g(...,&x,...);
      |
      y = g(...);
      *if (e)
       S3 else S4
      )
      // </smpl>
      Signed-off-by: default avatarJulia Lawall <Julia.Lawall@lip6.fr>
      Reviewed-by: default avatarChristian König <christian.koenig@amd.com>
      Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      9172bbcd
    • Alex Deucher's avatar
      drm/radeon: Add dpm quirk for Jet PRO (v2) · d7b2a684
      Alex Deucher authored
      commit 239b5f64 upstream.
      
      Fixes stability issues.
      
      v2: clamp sclk to 600 Mhz
      
      Bug: https://bugs.freedesktop.org/show_bug.cgi?id=103370Acked-by: default avatarChristian König <christian.koenig@amd.com>
      Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      d7b2a684
    • Steffen Weber's avatar
      scsi: smartpqi: allow static build ("built-in") · aed3b970
      Steffen Weber authored
      commit dc2db1dc upstream.
      
      If CONFIG_SCSI_SMARTPQI=y then don't build this driver as a module.
      Signed-off-by: default avatarSteffen Weber <steffen.weber@gmail.com>
      Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      aed3b970
  2. 17 Feb, 2018 32 commits