Commit b1a62749 authored by Linus Torvalds's avatar Linus Torvalds

Merge branch 'akpm' (patches from Andrew)

Pull updates from Andrew Morton:
 "A few fixes and stragglers.

  Subsystems affected by this patch series: mm/memory-failure, ocfs2,
  lib/lzo, misc"

* emailed patches from Andrew Morton <akpm@linux-foundation.org>:
  amdgpu: a NULL ->mm does not mean a thread is a kthread
  lib/lzo: fix ambiguous encoding bug in lzo-rle
  ocfs2: fix build failure when TCP/IP is disabled
  mm/memory-failure: send SIGBUS(BUS_MCEERR_AR) only to current thread
  mm/memory-failure: prioritize prctl(PR_MCE_KILL) over vm.memory_failure_early_kill
parents b961f8dc 8449d150
...@@ -159,11 +159,15 @@ Byte sequences ...@@ -159,11 +159,15 @@ Byte sequences
distance = 16384 + (H << 14) + D distance = 16384 + (H << 14) + D
state = S (copy S literals after this block) state = S (copy S literals after this block)
End of stream is reached if distance == 16384 End of stream is reached if distance == 16384
In version 1 only, to prevent ambiguity with the RLE case when
((distance & 0x803f) == 0x803f) && (261 <= length <= 264), the
compressor must not emit block copies where distance and length
meet these conditions.
In version 1 only, this instruction is also used to encode a run of In version 1 only, this instruction is also used to encode a run of
zeros if distance = 0xbfff, i.e. H = 1 and the D bits are all 1. zeros if distance = 0xbfff, i.e. H = 1 and the D bits are all 1.
In this case, it is followed by a fourth byte, X. In this case, it is followed by a fourth byte, X.
run length = ((X << 3) | (0 0 0 0 0 L L L)) + 4. run length = ((X << 3) | (0 0 0 0 0 L L L)) + 4
0 0 1 L L L L L (32..63) 0 0 1 L L L L L (32..63)
Copy of small block within 16kB distance (preferably less than 34B) Copy of small block within 16kB distance (preferably less than 34B)
......
...@@ -196,7 +196,7 @@ uint8_t amdgpu_amdkfd_get_xgmi_hops_count(struct kgd_dev *dst, struct kgd_dev *s ...@@ -196,7 +196,7 @@ uint8_t amdgpu_amdkfd_get_xgmi_hops_count(struct kgd_dev *dst, struct kgd_dev *s
pagefault_disable(); \ pagefault_disable(); \
if ((mmptr) == current->mm) { \ if ((mmptr) == current->mm) { \
valid = !get_user((dst), (wptr)); \ valid = !get_user((dst), (wptr)); \
} else if (current->mm == NULL) { \ } else if (current->flags & PF_KTHREAD) { \
kthread_use_mm(mmptr); \ kthread_use_mm(mmptr); \
valid = !get_user((dst), (wptr)); \ valid = !get_user((dst), (wptr)); \
kthread_unuse_mm(mmptr); \ kthread_unuse_mm(mmptr); \
......
# SPDX-License-Identifier: GPL-2.0-only # SPDX-License-Identifier: GPL-2.0-only
config OCFS2_FS config OCFS2_FS
tristate "OCFS2 file system support" tristate "OCFS2 file system support"
depends on NET && SYSFS && CONFIGFS_FS depends on INET && SYSFS && CONFIGFS_FS
select JBD2 select JBD2
select CRC32 select CRC32
select QUOTA select QUOTA
......
...@@ -268,6 +268,19 @@ lzo1x_1_do_compress(const unsigned char *in, size_t in_len, ...@@ -268,6 +268,19 @@ lzo1x_1_do_compress(const unsigned char *in, size_t in_len,
*op++ = (M4_MARKER | ((m_off >> 11) & 8) *op++ = (M4_MARKER | ((m_off >> 11) & 8)
| (m_len - 2)); | (m_len - 2));
else { else {
if (unlikely(((m_off & 0x403f) == 0x403f)
&& (m_len >= 261)
&& (m_len <= 264))
&& likely(bitstream_version)) {
// Under lzo-rle, block copies
// for 261 <= length <= 264 and
// (distance & 0x80f3) == 0x80f3
// can result in ambiguous
// output. Adjust length
// to 260 to prevent ambiguity.
ip -= m_len - 260;
m_len = 260;
}
m_len -= M4_MAX_LEN; m_len -= M4_MAX_LEN;
*op++ = (M4_MARKER | ((m_off >> 11) & 8)); *op++ = (M4_MARKER | ((m_off >> 11) & 8));
while (unlikely(m_len > 255)) { while (unlikely(m_len > 255)) {
......
...@@ -212,15 +212,13 @@ static int kill_proc(struct to_kill *tk, unsigned long pfn, int flags) ...@@ -212,15 +212,13 @@ static int kill_proc(struct to_kill *tk, unsigned long pfn, int flags)
short addr_lsb = tk->size_shift; short addr_lsb = tk->size_shift;
int ret = 0; int ret = 0;
if ((t->mm == current->mm) || !(flags & MF_ACTION_REQUIRED)) pr_err("Memory failure: %#lx: Sending SIGBUS to %s:%d due to hardware memory corruption\n",
pr_err("Memory failure: %#lx: Sending SIGBUS to %s:%d due to hardware memory corruption\n",
pfn, t->comm, t->pid); pfn, t->comm, t->pid);
if (flags & MF_ACTION_REQUIRED) { if (flags & MF_ACTION_REQUIRED) {
if (t->mm == current->mm) WARN_ON_ONCE(t != current);
ret = force_sig_mceerr(BUS_MCEERR_AR, ret = force_sig_mceerr(BUS_MCEERR_AR,
(void __user *)tk->addr, addr_lsb); (void __user *)tk->addr, addr_lsb);
/* send no signal to non-current processes */
} else { } else {
/* /*
* Don't use force here, it's convenient if the signal * Don't use force here, it's convenient if the signal
...@@ -402,9 +400,15 @@ static struct task_struct *find_early_kill_thread(struct task_struct *tsk) ...@@ -402,9 +400,15 @@ static struct task_struct *find_early_kill_thread(struct task_struct *tsk)
{ {
struct task_struct *t; struct task_struct *t;
for_each_thread(tsk, t) for_each_thread(tsk, t) {
if ((t->flags & PF_MCE_PROCESS) && (t->flags & PF_MCE_EARLY)) if (t->flags & PF_MCE_PROCESS) {
return t; if (t->flags & PF_MCE_EARLY)
return t;
} else {
if (sysctl_memory_failure_early_kill)
return t;
}
}
return NULL; return NULL;
} }
...@@ -413,21 +417,26 @@ static struct task_struct *find_early_kill_thread(struct task_struct *tsk) ...@@ -413,21 +417,26 @@ static struct task_struct *find_early_kill_thread(struct task_struct *tsk)
* to be signaled when some page under the process is hwpoisoned. * to be signaled when some page under the process is hwpoisoned.
* Return task_struct of the dedicated thread (main thread unless explicitly * Return task_struct of the dedicated thread (main thread unless explicitly
* specified) if the process is "early kill," and otherwise returns NULL. * specified) if the process is "early kill," and otherwise returns NULL.
*
* Note that the above is true for Action Optional case, but not for Action
* Required case where SIGBUS should sent only to the current thread.
*/ */
static struct task_struct *task_early_kill(struct task_struct *tsk, static struct task_struct *task_early_kill(struct task_struct *tsk,
int force_early) int force_early)
{ {
struct task_struct *t;
if (!tsk->mm) if (!tsk->mm)
return NULL; return NULL;
if (force_early) if (force_early) {
return tsk; /*
t = find_early_kill_thread(tsk); * Comparing ->mm here because current task might represent
if (t) * a subthread, while tsk always points to the main thread.
return t; */
if (sysctl_memory_failure_early_kill) if (tsk->mm == current->mm)
return tsk; return current;
return NULL; else
return NULL;
}
return find_early_kill_thread(tsk);
} }
/* /*
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment