stable.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH AUTOSEL 4.18 067/113] powerpc: Fix size calculation using resource_size()
@ 2018-08-30 18:07 Sasha Levin
  2018-08-30 18:07 ` [PATCH AUTOSEL 4.18 068/113] perf probe powerpc: Fix trace event post-processing Sasha Levin
                   ` (45 more replies)
  0 siblings, 46 replies; 57+ messages in thread
From: Sasha Levin @ 2018-08-30 18:07 UTC (permalink / raw)
  To: stable@vger.kernel.org; +Cc: Dan Carpenter, Michael Ellerman, Sasha Levin

From: Dan Carpenter <dan.carpenter@oracle.com>

[ Upstream commit c42d3be0c06f0c1c416054022aa535c08a1f9b39 ]

The problem is the the calculation should be "end - start + 1" but the
plus one is missing in this calculation.

Fixes: 8626816e905e ("powerpc: add support for MPIC message register API")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: Tyrel Datwyler <tyreld@linux.vnet.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
---
 arch/powerpc/sysdev/mpic_msgr.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/powerpc/sysdev/mpic_msgr.c b/arch/powerpc/sysdev/mpic_msgr.c
index eb69a5186243..280e964e1aa8 100644
--- a/arch/powerpc/sysdev/mpic_msgr.c
+++ b/arch/powerpc/sysdev/mpic_msgr.c
@@ -196,7 +196,7 @@ static int mpic_msgr_probe(struct platform_device *dev)
 
 	/* IO map the message register block. */
 	of_address_to_resource(np, 0, &rsrc);
-	msgr_block_addr = ioremap(rsrc.start, rsrc.end - rsrc.start);
+	msgr_block_addr = ioremap(rsrc.start, resource_size(&rsrc));
 	if (!msgr_block_addr) {
 		dev_err(&dev->dev, "Failed to iomap MPIC message registers");
 		return -EFAULT;
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 57+ messages in thread

* [PATCH AUTOSEL 4.18 068/113] perf probe powerpc: Fix trace event post-processing
  2018-08-30 18:07 [PATCH AUTOSEL 4.18 067/113] powerpc: Fix size calculation using resource_size() Sasha Levin
@ 2018-08-30 18:07 ` Sasha Levin
  2018-08-30 18:07 ` [PATCH AUTOSEL 4.18 069/113] block: bvec_nr_vecs() returns value for wrong slab Sasha Levin
                   ` (44 subsequent siblings)
  45 siblings, 0 replies; 57+ messages in thread
From: Sasha Levin @ 2018-08-30 18:07 UTC (permalink / raw)
  To: stable@vger.kernel.org
  Cc: Sandipan Das, Aneesh Kumar, Jiri Olsa, Ravi Bangoria,
	Arnaldo Carvalho de Melo, Sasha Levin

From: Sandipan Das <sandipan@linux.ibm.com>

[ Upstream commit 354b064b8ebc1e1ede58550ca9e08bfa81e6af43 ]

In some cases, a symbol may have multiple aliases. Attempting to add an
entry probe for such symbols results in a probe being added at an
incorrect location while it fails altogether for return probes. This is
only applicable for binaries with debug information.

During the arch-dependent post-processing, the offset from the start of
the symbol at which the probe is to be attached is determined and added
to the start address of the symbol to get the probe's location.  In case
there are multiple aliases, this offset gets added multiple times for
each alias of the symbol and we end up with an incorrect probe location.

This can be verified on a powerpc64le system as shown below.

  $ nm /lib/modules/$(uname -r)/build/vmlinux | grep "sys_open$"
  ...
  c000000000414290 T __se_sys_open
  c000000000414290 T sys_open

  $ objdump -d /lib/modules/$(uname -r)/build/vmlinux | grep -A 10 "<__se_sys_open>:"

  c000000000414290 <__se_sys_open>:
  c000000000414290:       19 01 4c 3c     addis   r2,r12,281
  c000000000414294:       70 c4 42 38     addi    r2,r2,-15248
  c000000000414298:       a6 02 08 7c     mflr    r0
  c00000000041429c:       e8 ff a1 fb     std     r29,-24(r1)
  c0000000004142a0:       f0 ff c1 fb     std     r30,-16(r1)
  c0000000004142a4:       f8 ff e1 fb     std     r31,-8(r1)
  c0000000004142a8:       10 00 01 f8     std     r0,16(r1)
  c0000000004142ac:       c1 ff 21 f8     stdu    r1,-64(r1)
  c0000000004142b0:       78 23 9f 7c     mr      r31,r4
  c0000000004142b4:       78 1b 7e 7c     mr      r30,r3

  For both the entry probe and the return probe, the probe location
  should be _text+4276888 (0xc000000000414298). Since another alias
  exists for 'sys_open', the post-processing code will end up adding
  the offset (8 for powerpc64le) twice and perf will attempt to add
  the probe at _text+4276896 (0xc0000000004142a0) instead.

Before:

  # perf probe -v -a sys_open

  probe-definition(0): sys_open
  symbol:sys_open file:(null) line:0 offset:0 return:0 lazy:(null)
  0 arguments
  Looking at the vmlinux_path (8 entries long)
  Using /lib/modules/4.18.0-rc8+/build/vmlinux for symbols
  Open Debuginfo file: /lib/modules/4.18.0-rc8+/build/vmlinux
  Try to find probe point from debuginfo.
  Symbol sys_open address found : c000000000414290
  Matched function: __se_sys_open [2ad03a0]
  Probe point found: __se_sys_open+0
  Found 1 probe_trace_events.
  Opening /sys/kernel/debug/tracing/kprobe_events write=1
  Writing event: p:probe/sys_open _text+4276896
  Added new event:
    probe:sys_open       (on sys_open)
  ...

  # perf probe -v -a sys_open%return $retval

  probe-definition(0): sys_open%return
  symbol:sys_open file:(null) line:0 offset:0 return:1 lazy:(null)
  0 arguments
  Looking at the vmlinux_path (8 entries long)
  Using /lib/modules/4.18.0-rc8+/build/vmlinux for symbols
  Open Debuginfo file: /lib/modules/4.18.0-rc8+/build/vmlinux
  Try to find probe point from debuginfo.
  Symbol sys_open address found : c000000000414290
  Matched function: __se_sys_open [2ad03a0]
  Probe point found: __se_sys_open+0
  Found 1 probe_trace_events.
  Opening /sys/kernel/debug/tracing/README write=0
  Opening /sys/kernel/debug/tracing/kprobe_events write=1
  Parsing probe_events: p:probe/sys_open _text+4276896
  Group:probe Event:sys_open probe:p
  Writing event: r:probe/sys_open__return _text+4276896
  Failed to write event: Invalid argument
    Error: Failed to add events. Reason: Invalid argument (Code: -22)

After:

  # perf probe -v -a sys_open

  probe-definition(0): sys_open
  symbol:sys_open file:(null) line:0 offset:0 return:0 lazy:(null)
  0 arguments
  Looking at the vmlinux_path (8 entries long)
  Using /lib/modules/4.18.0-rc8+/build/vmlinux for symbols
  Open Debuginfo file: /lib/modules/4.18.0-rc8+/build/vmlinux
  Try to find probe point from debuginfo.
  Symbol sys_open address found : c000000000414290
  Matched function: __se_sys_open [2ad03a0]
  Probe point found: __se_sys_open+0
  Found 1 probe_trace_events.
  Opening /sys/kernel/debug/tracing/kprobe_events write=1
  Writing event: p:probe/sys_open _text+4276888
  Added new event:
    probe:sys_open       (on sys_open)
  ...

  # perf probe -v -a sys_open%return $retval

  probe-definition(0): sys_open%return
  symbol:sys_open file:(null) line:0 offset:0 return:1 lazy:(null)
  0 arguments
  Looking at the vmlinux_path (8 entries long)
  Using /lib/modules/4.18.0-rc8+/build/vmlinux for symbols
  Open Debuginfo file: /lib/modules/4.18.0-rc8+/build/vmlinux
  Try to find probe point from debuginfo.
  Symbol sys_open address found : c000000000414290
  Matched function: __se_sys_open [2ad03a0]
  Probe point found: __se_sys_open+0
  Found 1 probe_trace_events.
  Opening /sys/kernel/debug/tracing/README write=0
  Opening /sys/kernel/debug/tracing/kprobe_events write=1
  Parsing probe_events: p:probe/sys_open _text+4276888
  Group:probe Event:sys_open probe:p
  Writing event: r:probe/sys_open__return _text+4276888
  Added new event:
    probe:sys_open__return (on sys_open%return)
  ...

Reported-by: Aneesh Kumar <aneesh.kumar@linux.vnet.ibm.com>
Signed-off-by: Sandipan Das <sandipan@linux.ibm.com>
Acked-by: Naveen N. Rao <naveen.n.rao@linux.vnet.ibm.com>
Cc: Aneesh Kumar <aneesh.kumar@linux.vnet.ibm.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Ravi Bangoria <ravi.bangoria@linux.ibm.com>
Fixes: 99e608b5954c ("perf probe ppc64le: Fix probe location when using DWARF")
Link: http://lkml.kernel.org/r/20180809161929.35058-1-sandipan@linux.ibm.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
---
 tools/perf/arch/powerpc/util/sym-handling.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/tools/perf/arch/powerpc/util/sym-handling.c b/tools/perf/arch/powerpc/util/sym-handling.c
index 53d83d7e6a09..20e7d74d86cd 100644
--- a/tools/perf/arch/powerpc/util/sym-handling.c
+++ b/tools/perf/arch/powerpc/util/sym-handling.c
@@ -141,8 +141,10 @@ void arch__post_process_probe_trace_events(struct perf_probe_event *pev,
 	for (i = 0; i < ntevs; i++) {
 		tev = &pev->tevs[i];
 		map__for_each_symbol(map, sym, tmp) {
-			if (map->unmap_ip(map, sym->start) == tev->point.address)
+			if (map->unmap_ip(map, sym->start) == tev->point.address) {
 				arch__fix_tev_from_maps(pev, tev, map, sym);
+				break;
+			}
 		}
 	}
 }
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 57+ messages in thread

* [PATCH AUTOSEL 4.18 069/113] block: bvec_nr_vecs() returns value for wrong slab
  2018-08-30 18:07 [PATCH AUTOSEL 4.18 067/113] powerpc: Fix size calculation using resource_size() Sasha Levin
  2018-08-30 18:07 ` [PATCH AUTOSEL 4.18 068/113] perf probe powerpc: Fix trace event post-processing Sasha Levin
@ 2018-08-30 18:07 ` Sasha Levin
  2018-08-30 18:07 ` [PATCH AUTOSEL 4.18 070/113] brcmfmac: fix brcmf_wiphy_wowl_params() NULL pointer dereference Sasha Levin
                   ` (43 subsequent siblings)
  45 siblings, 0 replies; 57+ messages in thread
From: Sasha Levin @ 2018-08-30 18:07 UTC (permalink / raw)
  To: stable@vger.kernel.org; +Cc: Greg Edwards, Jens Axboe, Sasha Levin

From: Greg Edwards <gedwards@ddn.com>

[ Upstream commit d6c02a9beb67f13d5f14f23e72fa9981e8b84477 ]

In commit ed996a52c868 ("block: simplify and cleanup bvec pool
handling"), the value of the slab index is incremented by one in
bvec_alloc() after the allocation is done to indicate an index value of
0 does not need to be later freed.

bvec_nr_vecs() was not updated accordingly, and thus returns the wrong
value.  Decrement idx before performing the lookup.

Fixes: ed996a52c868 ("block: simplify and cleanup bvec pool handling")
Signed-off-by: Greg Edwards <gedwards@ddn.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
---
 block/bio.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/block/bio.c b/block/bio.c
index 047c5dca6d90..ff94640bc734 100644
--- a/block/bio.c
+++ b/block/bio.c
@@ -156,7 +156,7 @@ static void bio_put_slab(struct bio_set *bs)
 
 unsigned int bvec_nr_vecs(unsigned short idx)
 {
-	return bvec_slabs[idx].nr_vecs;
+	return bvec_slabs[--idx].nr_vecs;
 }
 
 void bvec_free(mempool_t *pool, struct bio_vec *bv, unsigned int idx)
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 57+ messages in thread

* [PATCH AUTOSEL 4.18 070/113] brcmfmac: fix brcmf_wiphy_wowl_params() NULL pointer dereference
  2018-08-30 18:07 [PATCH AUTOSEL 4.18 067/113] powerpc: Fix size calculation using resource_size() Sasha Levin
  2018-08-30 18:07 ` [PATCH AUTOSEL 4.18 068/113] perf probe powerpc: Fix trace event post-processing Sasha Levin
  2018-08-30 18:07 ` [PATCH AUTOSEL 4.18 069/113] block: bvec_nr_vecs() returns value for wrong slab Sasha Levin
@ 2018-08-30 18:07 ` Sasha Levin
  2018-08-30 18:07 ` [PATCH AUTOSEL 4.18 071/113] s390/dasd: fix hanging offline processing due to canceled worker Sasha Levin
                   ` (42 subsequent siblings)
  45 siblings, 0 replies; 57+ messages in thread
From: Sasha Levin @ 2018-08-30 18:07 UTC (permalink / raw)
  To: stable@vger.kernel.org
  Cc: Winnie Chang, Chi-Hsien Lin, Kalle Valo, Sasha Levin

From: Winnie Chang <winnie.chang@cypress.com>

[ Upstream commit 27a8aea13053700ad2a08189024df7e341d1ee51 ]

The kernel BUG happens when wowl is enabled from firmware. In
brcmf_wiphy_wowl_params(), cfg is a NULL pointer because it is
drvr->config returned from wiphy_to_cfg(), and drvr->config is not set
yet. To fix it, set drvr->config before brcmf_setup_wiphy() which
calls brcmf_wiphy_wowl_params().

Fixes: 856d5a011c86 ("brcmfmac: allocate struct brcmf_pub instance using wiphy_new()")
Signed-off-by: Winnie Chang <winnie.chang@cypress.com>
Signed-off-by: Chi-Hsien Lin <chi-hsien.lin@cypress.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
---
 .../net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c   | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
index b6122aad639e..7569f9af8d47 100644
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
@@ -6926,15 +6926,15 @@ struct brcmf_cfg80211_info *brcmf_cfg80211_attach(struct brcmf_pub *drvr,
 	cfg->d11inf.io_type = (u8)io_type;
 	brcmu_d11_attach(&cfg->d11inf);
 
-	err = brcmf_setup_wiphy(wiphy, ifp);
-	if (err < 0)
-		goto priv_out;
-
 	/* regulatory notifer below needs access to cfg so
 	 * assign it now.
 	 */
 	drvr->config = cfg;
 
+	err = brcmf_setup_wiphy(wiphy, ifp);
+	if (err < 0)
+		goto priv_out;
+
 	brcmf_dbg(INFO, "Registering custom regulatory\n");
 	wiphy->reg_notifier = brcmf_cfg80211_reg_notifier;
 	wiphy->regulatory_flags |= REGULATORY_CUSTOM_REG;
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 57+ messages in thread

* [PATCH AUTOSEL 4.18 071/113] s390/dasd: fix hanging offline processing due to canceled worker
  2018-08-30 18:07 [PATCH AUTOSEL 4.18 067/113] powerpc: Fix size calculation using resource_size() Sasha Levin
                   ` (2 preceding siblings ...)
  2018-08-30 18:07 ` [PATCH AUTOSEL 4.18 070/113] brcmfmac: fix brcmf_wiphy_wowl_params() NULL pointer dereference Sasha Levin
@ 2018-08-30 18:07 ` Sasha Levin
  2018-08-30 18:07 ` [PATCH AUTOSEL 4.18 072/113] s390/dasd: fix panic for failed online processing Sasha Levin
                   ` (41 subsequent siblings)
  45 siblings, 0 replies; 57+ messages in thread
From: Sasha Levin @ 2018-08-30 18:07 UTC (permalink / raw)
  To: stable@vger.kernel.org; +Cc: Stefan Haberland, Martin Schwidefsky, Sasha Levin

From: Stefan Haberland <sth@linux.ibm.com>

[ Upstream commit 669f3765b755fd8739ab46ce3a9c6292ce8b3d2a ]

During offline processing two worker threads are canceled without
freeing the device reference which leads to a hanging offline process.

Reviewed-by: Jan Hoeppner <hoeppner@linux.ibm.com>
Signed-off-by: Stefan Haberland <sth@linux.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
---
 drivers/s390/block/dasd_eckd.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/drivers/s390/block/dasd_eckd.c b/drivers/s390/block/dasd_eckd.c
index bbf95b78ef5d..58fef76a99e6 100644
--- a/drivers/s390/block/dasd_eckd.c
+++ b/drivers/s390/block/dasd_eckd.c
@@ -2035,8 +2035,11 @@ static int dasd_eckd_basic_to_ready(struct dasd_device *device)
 
 static int dasd_eckd_online_to_ready(struct dasd_device *device)
 {
-	cancel_work_sync(&device->reload_device);
-	cancel_work_sync(&device->kick_validate);
+	if (cancel_work_sync(&device->reload_device))
+		dasd_put_device(device);
+	if (cancel_work_sync(&device->kick_validate))
+		dasd_put_device(device);
+
 	return 0;
 };
 
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 57+ messages in thread

* [PATCH AUTOSEL 4.18 072/113] s390/dasd: fix panic for failed online processing
  2018-08-30 18:07 [PATCH AUTOSEL 4.18 067/113] powerpc: Fix size calculation using resource_size() Sasha Levin
                   ` (3 preceding siblings ...)
  2018-08-30 18:07 ` [PATCH AUTOSEL 4.18 071/113] s390/dasd: fix hanging offline processing due to canceled worker Sasha Levin
@ 2018-08-30 18:07 ` Sasha Levin
  2018-08-30 18:07 ` [PATCH AUTOSEL 4.18 073/113] ACPI / scan: Initialize status to ACPI_STA_DEFAULT Sasha Levin
                   ` (40 subsequent siblings)
  45 siblings, 0 replies; 57+ messages in thread
From: Sasha Levin @ 2018-08-30 18:07 UTC (permalink / raw)
  To: stable@vger.kernel.org; +Cc: Stefan Haberland, Martin Schwidefsky, Sasha Levin

From: Stefan Haberland <sth@linux.ibm.com>

[ Upstream commit 7c6553d4db03350dad0110c3224194c19df76a8f ]

Fix a panic that occurs for a device that got an error in
dasd_eckd_check_characteristics() during online processing.
For example the read configuration data command may have failed.

If this error occurs the device is not being set online and the earlier
invoked steps during online processing are rolled back. Therefore
dasd_eckd_uncheck_device() is called which needs a valid private
structure. But this pointer is not valid if
dasd_eckd_check_characteristics() has failed.

Check for a valid device->private pointer to prevent a panic.

Reviewed-by: Jan Hoeppner <hoeppner@linux.ibm.com>
Signed-off-by: Stefan Haberland <sth@linux.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
---
 drivers/s390/block/dasd_eckd.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/s390/block/dasd_eckd.c b/drivers/s390/block/dasd_eckd.c
index 58fef76a99e6..43e3398c9268 100644
--- a/drivers/s390/block/dasd_eckd.c
+++ b/drivers/s390/block/dasd_eckd.c
@@ -1780,6 +1780,9 @@ static void dasd_eckd_uncheck_device(struct dasd_device *device)
 	struct dasd_eckd_private *private = device->private;
 	int i;
 
+	if (!private)
+		return;
+
 	dasd_alias_disconnect_device_from_lcu(device);
 	private->ned = NULL;
 	private->sneq = NULL;
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 57+ messages in thread

* [PATCH AUTOSEL 4.18 073/113] ACPI / scan: Initialize status to ACPI_STA_DEFAULT
  2018-08-30 18:07 [PATCH AUTOSEL 4.18 067/113] powerpc: Fix size calculation using resource_size() Sasha Levin
                   ` (4 preceding siblings ...)
  2018-08-30 18:07 ` [PATCH AUTOSEL 4.18 072/113] s390/dasd: fix panic for failed online processing Sasha Levin
@ 2018-08-30 18:07 ` Sasha Levin
  2018-08-30 18:07 ` [PATCH AUTOSEL 4.18 074/113] blk-mq: count the hctx as active before allocating tag Sasha Levin
                   ` (39 subsequent siblings)
  45 siblings, 0 replies; 57+ messages in thread
From: Sasha Levin @ 2018-08-30 18:07 UTC (permalink / raw)
  To: stable@vger.kernel.org; +Cc: Hans de Goede, Rafael J . Wysocki, Sasha Levin

From: Hans de Goede <hdegoede@redhat.com>

[ Upstream commit 5971b0c1594d6c34e257101ed5fdffec65205c50 ]

Since commit 63347db0affa "ACPI / scan: Use acpi_bus_get_status() to
initialize ACPI_TYPE_DEVICE devs" the status field of normal acpi_devices
gets set to 0 by acpi_bus_type_and_status() and filled with its actual
value later when acpi_add_single_object() calls acpi_bus_get_status().

This means that any acpi_match_device_ids() calls in between will always
fail with -ENOENT.

We already have a workaround for this, which temporary forces status to
ACPI_STA_DEFAULT in drivers/acpi/x86/utils.c: acpi_device_always_present()
and the next commit in this series adds another acpi_match_device_ids()
call between status being initialized as 0 and the acpi_bus_get_status()
call.

Rather then adding another workaround, this commit makes
acpi_bus_type_and_status() initialize status to ACPI_STA_DEFAULT, this is
safe to do as the only code looking at status between the initialization
and the acpi_bus_get_status() call is those acpi_match_device_ids() calls.

Note this does mean that we need to (re)set status to 0 in case the
acpi_bus_get_status() call fails.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
---
 drivers/acpi/scan.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/acpi/scan.c b/drivers/acpi/scan.c
index 970dd87d347c..6799d00dd790 100644
--- a/drivers/acpi/scan.c
+++ b/drivers/acpi/scan.c
@@ -1612,7 +1612,8 @@ static int acpi_add_single_object(struct acpi_device **child,
 	 * Note this must be done before the get power-/wakeup_dev-flags calls.
 	 */
 	if (type == ACPI_BUS_TYPE_DEVICE)
-		acpi_bus_get_status(device);
+		if (acpi_bus_get_status(device) < 0)
+			acpi_set_device_status(device, 0);
 
 	acpi_bus_get_power_flags(device);
 	acpi_bus_get_wakeup_device_flags(device);
@@ -1690,7 +1691,7 @@ static int acpi_bus_type_and_status(acpi_handle handle, int *type,
 		 * acpi_add_single_object updates this once we've an acpi_device
 		 * so that acpi_bus_get_status' quirk handling can be used.
 		 */
-		*sta = 0;
+		*sta = ACPI_STA_DEFAULT;
 		break;
 	case ACPI_TYPE_PROCESSOR:
 		*type = ACPI_BUS_TYPE_PROCESSOR;
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 57+ messages in thread

* [PATCH AUTOSEL 4.18 074/113] blk-mq: count the hctx as active before allocating tag
  2018-08-30 18:07 [PATCH AUTOSEL 4.18 067/113] powerpc: Fix size calculation using resource_size() Sasha Levin
                   ` (5 preceding siblings ...)
  2018-08-30 18:07 ` [PATCH AUTOSEL 4.18 073/113] ACPI / scan: Initialize status to ACPI_STA_DEFAULT Sasha Levin
@ 2018-08-30 18:07 ` Sasha Levin
  2018-08-30 18:07 ` [PATCH AUTOSEL 4.18 075/113] scsi: aic94xx: fix an error code in aic94xx_init() Sasha Levin
                   ` (38 subsequent siblings)
  45 siblings, 0 replies; 57+ messages in thread
From: Sasha Levin @ 2018-08-30 18:07 UTC (permalink / raw)
  To: stable@vger.kernel.org; +Cc: Jianchao Wang, Jens Axboe, Sasha Levin

From: Jianchao Wang <jianchao.w.wang@oracle.com>

[ Upstream commit d263ed9926823c462f99a7679e18f0c9e5b8550d ]

Currently, we count the hctx as active after allocate driver tag
successfully. If a previously inactive hctx try to get tag first
time, it may fails and need to wait. However, due to the stale tag
->active_queues, the other shared-tags users are still able to
occupy all driver tags while there is someone waiting for tag.
Consequently, even if the previously inactive hctx is waked up, it
still may not be able to get a tag and could be starved.

To fix it, we count the hctx as active before try to allocate driver
tag, then when it is waiting the tag, the other shared-tag users
will reserve budget for it.

Reviewed-by: Ming Lei <ming.lei@redhat.com>
Signed-off-by: Jianchao Wang <jianchao.w.wang@oracle.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
---
 block/blk-mq-tag.c | 3 +++
 block/blk-mq.c     | 8 ++++++--
 2 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/block/blk-mq-tag.c b/block/blk-mq-tag.c
index 3de0836163c2..d5f2c21d8531 100644
--- a/block/blk-mq-tag.c
+++ b/block/blk-mq-tag.c
@@ -23,6 +23,9 @@ bool blk_mq_has_free_tags(struct blk_mq_tags *tags)
 
 /*
  * If a previously inactive queue goes active, bump the active user count.
+ * We need to do this before try to allocate driver tag, then even if fail
+ * to get tag when first time, the other shared-tag users could reserve
+ * budget for it.
  */
 bool __blk_mq_tag_busy(struct blk_mq_hw_ctx *hctx)
 {
diff --git a/block/blk-mq.c b/block/blk-mq.c
index 654b0dc7e001..2f9e14361673 100644
--- a/block/blk-mq.c
+++ b/block/blk-mq.c
@@ -285,7 +285,7 @@ static struct request *blk_mq_rq_ctx_init(struct blk_mq_alloc_data *data,
 		rq->tag = -1;
 		rq->internal_tag = tag;
 	} else {
-		if (blk_mq_tag_busy(data->hctx)) {
+		if (data->hctx->flags & BLK_MQ_F_TAG_SHARED) {
 			rq_flags = RQF_MQ_INFLIGHT;
 			atomic_inc(&data->hctx->nr_active);
 		}
@@ -367,6 +367,8 @@ static struct request *blk_mq_get_request(struct request_queue *q,
 		if (!op_is_flush(op) && e->type->ops.mq.limit_depth &&
 		    !(data->flags & BLK_MQ_REQ_RESERVED))
 			e->type->ops.mq.limit_depth(op, data);
+	} else {
+		blk_mq_tag_busy(data->hctx);
 	}
 
 	tag = blk_mq_get_tag(data);
@@ -970,6 +972,7 @@ bool blk_mq_get_driver_tag(struct request *rq, struct blk_mq_hw_ctx **hctx,
 		.hctx = blk_mq_map_queue(rq->q, rq->mq_ctx->cpu),
 		.flags = wait ? 0 : BLK_MQ_REQ_NOWAIT,
 	};
+	bool shared;
 
 	might_sleep_if(wait);
 
@@ -979,9 +982,10 @@ bool blk_mq_get_driver_tag(struct request *rq, struct blk_mq_hw_ctx **hctx,
 	if (blk_mq_tag_is_reserved(data.hctx->sched_tags, rq->internal_tag))
 		data.flags |= BLK_MQ_REQ_RESERVED;
 
+	shared = blk_mq_tag_busy(data.hctx);
 	rq->tag = blk_mq_get_tag(&data);
 	if (rq->tag >= 0) {
-		if (blk_mq_tag_busy(data.hctx)) {
+		if (shared) {
 			rq->rq_flags |= RQF_MQ_INFLIGHT;
 			atomic_inc(&data.hctx->nr_active);
 		}
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 57+ messages in thread

* [PATCH AUTOSEL 4.18 075/113] scsi: aic94xx: fix an error code in aic94xx_init()
  2018-08-30 18:07 [PATCH AUTOSEL 4.18 067/113] powerpc: Fix size calculation using resource_size() Sasha Levin
                   ` (6 preceding siblings ...)
  2018-08-30 18:07 ` [PATCH AUTOSEL 4.18 074/113] blk-mq: count the hctx as active before allocating tag Sasha Levin
@ 2018-08-30 18:07 ` Sasha Levin
  2018-08-30 18:07 ` [PATCH AUTOSEL 4.18 076/113] NFSv4: Fix error handling in nfs4_sp4_select_mode() Sasha Levin
                   ` (37 subsequent siblings)
  45 siblings, 0 replies; 57+ messages in thread
From: Sasha Levin @ 2018-08-30 18:07 UTC (permalink / raw)
  To: stable@vger.kernel.org; +Cc: Dan Carpenter, Martin K . Petersen, Sasha Levin

From: Dan Carpenter <dan.carpenter@oracle.com>

[ Upstream commit 0756c57bce3d26da2592d834d8910b6887021701 ]

We accidentally return success instead of -ENOMEM on this error path.

Fixes: 2908d778ab3e ("[SCSI] aic94xx: new driver")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Reviewed-by: John Garry <john.garry@huawei.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
---
 drivers/scsi/aic94xx/aic94xx_init.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/scsi/aic94xx/aic94xx_init.c b/drivers/scsi/aic94xx/aic94xx_init.c
index 80e5b283fd81..1391e5f35918 100644
--- a/drivers/scsi/aic94xx/aic94xx_init.c
+++ b/drivers/scsi/aic94xx/aic94xx_init.c
@@ -1030,8 +1030,10 @@ static int __init aic94xx_init(void)
 
 	aic94xx_transport_template =
 		sas_domain_attach_transport(&aic94xx_transport_functions);
-	if (!aic94xx_transport_template)
+	if (!aic94xx_transport_template) {
+		err = -ENOMEM;
 		goto out_destroy_caches;
+	}
 
 	err = pci_register_driver(&aic94xx_pci_driver);
 	if (err)
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 57+ messages in thread

* [PATCH AUTOSEL 4.18 076/113] NFSv4: Fix error handling in nfs4_sp4_select_mode()
  2018-08-30 18:07 [PATCH AUTOSEL 4.18 067/113] powerpc: Fix size calculation using resource_size() Sasha Levin
                   ` (7 preceding siblings ...)
  2018-08-30 18:07 ` [PATCH AUTOSEL 4.18 075/113] scsi: aic94xx: fix an error code in aic94xx_init() Sasha Levin
@ 2018-08-30 18:07 ` Sasha Levin
  2018-08-30 18:07 ` [PATCH AUTOSEL 4.18 077/113] ALSA: hda/ca0132 - Add DSP setup defaults for Recon3D Sasha Levin
                   ` (36 subsequent siblings)
  45 siblings, 0 replies; 57+ messages in thread
From: Sasha Levin @ 2018-08-30 18:07 UTC (permalink / raw)
  To: stable@vger.kernel.org; +Cc: Wei Yongjun, Anna Schumaker, Sasha Levin

From: Wei Yongjun <weiyongjun1@huawei.com>

[ Upstream commit 72bf75cfc00c02aa66ef6133048f37aa5d88825c ]

Error code is set in the error handling cases but never used. Fix it.

Fixes: 937e3133cd0b ("NFSv4.1: Ensure we clear the SP4_MACH_CRED flags in nfs4_sp4_select_mode()")
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
---
 fs/nfs/nfs4proc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c
index f6c4ccd693f4..0fd4a8ba03cc 100644
--- a/fs/nfs/nfs4proc.c
+++ b/fs/nfs/nfs4proc.c
@@ -7727,7 +7727,7 @@ static int nfs4_sp4_select_mode(struct nfs_client *clp,
 	}
 out:
 	clp->cl_sp4_flags = flags;
-	return 0;
+	return ret;
 }
 
 struct nfs41_exchange_id_data {
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 57+ messages in thread

* [PATCH AUTOSEL 4.18 077/113] ALSA: hda/ca0132 - Add DSP setup defaults for Recon3D
  2018-08-30 18:07 [PATCH AUTOSEL 4.18 067/113] powerpc: Fix size calculation using resource_size() Sasha Levin
                   ` (8 preceding siblings ...)
  2018-08-30 18:07 ` [PATCH AUTOSEL 4.18 076/113] NFSv4: Fix error handling in nfs4_sp4_select_mode() Sasha Levin
@ 2018-08-30 18:07 ` Sasha Levin
  2018-08-30 20:13   ` Takashi Iwai
  2018-08-30 18:07 ` [PATCH AUTOSEL 4.18 078/113] ALSA: hda/ca0132 - Add quirk ID and enum " Sasha Levin
                   ` (35 subsequent siblings)
  45 siblings, 1 reply; 57+ messages in thread
From: Sasha Levin @ 2018-08-30 18:07 UTC (permalink / raw)
  To: stable@vger.kernel.org; +Cc: Connor McAdams, Takashi Iwai, Sasha Levin

From: Connor McAdams <conmanx360@gmail.com>

[ Upstream commit c986f50ca974397f8726bf6776ad8938d6808848 ]

The Recon3D can use many of the same functions as the Recon3Di, so many
of the r3di prefix function remain the same, but change their names to
the more generic r3d prefix. This patch does this, and adds quirk checks
for things specific to the Recon3Di.

Signed-off-by: Connor McAdams <conmanx360@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
---
 sound/pci/hda/patch_ca0132.c | 21 +++++++++++----------
 1 file changed, 11 insertions(+), 10 deletions(-)

diff --git a/sound/pci/hda/patch_ca0132.c b/sound/pci/hda/patch_ca0132.c
index 321e95c409c1..27ecff0d5c72 100644
--- a/sound/pci/hda/patch_ca0132.c
+++ b/sound/pci/hda/patch_ca0132.c
@@ -6187,10 +6187,10 @@ static void ca0132_refresh_widget_caps(struct hda_codec *codec)
 }
 
 /*
- * Recon3Di r3di_setup_defaults sub functions.
+ * Recon3D r3d_setup_defaults sub functions.
  */
 
-static void r3di_dsp_scp_startup(struct hda_codec *codec)
+static void r3d_dsp_scp_startup(struct hda_codec *codec)
 {
 	unsigned int tmp;
 
@@ -6211,7 +6211,7 @@ static void r3di_dsp_scp_startup(struct hda_codec *codec)
 
 }
 
-static void r3di_dsp_initial_mic_setup(struct hda_codec *codec)
+static void r3d_dsp_initial_mic_setup(struct hda_codec *codec)
 {
 	unsigned int tmp;
 
@@ -6421,10 +6421,10 @@ static void ca0132_setup_defaults(struct hda_codec *codec)
 }
 
 /*
- * Setup default parameters for Recon3Di DSP.
+ * Setup default parameters for Recon3D/Recon3Di DSP.
  */
 
-static void r3di_setup_defaults(struct hda_codec *codec)
+static void r3d_setup_defaults(struct hda_codec *codec)
 {
 	struct ca0132_spec *spec = codec->spec;
 	unsigned int tmp;
@@ -6434,9 +6434,9 @@ static void r3di_setup_defaults(struct hda_codec *codec)
 	if (spec->dsp_state != DSP_DOWNLOADED)
 		return;
 
-	r3di_dsp_scp_startup(codec);
+	r3d_dsp_scp_startup(codec);
 
-	r3di_dsp_initial_mic_setup(codec);
+	r3d_dsp_initial_mic_setup(codec);
 
 	/*remove DSP headroom*/
 	tmp = FLOAT_ZERO;
@@ -6450,7 +6450,8 @@ static void r3di_setup_defaults(struct hda_codec *codec)
 	/* Set speaker source? */
 	dspio_set_uint_param(codec, 0x32, 0x00, tmp);
 
-	r3di_gpio_dsp_status_set(codec, R3DI_DSP_DOWNLOADED);
+	if (spec->quirk == QUIRK_R3DI)
+		r3di_gpio_dsp_status_set(codec, R3DI_DSP_DOWNLOADED);
 
 	/* Setup effect defaults */
 	num_fx = OUT_EFFECTS_COUNT + IN_EFFECTS_COUNT + 1;
@@ -6462,7 +6463,6 @@ static void r3di_setup_defaults(struct hda_codec *codec)
 					ca0132_effects[idx].def_vals[i]);
 		}
 	}
-
 }
 
 /*
@@ -7241,7 +7241,8 @@ static int ca0132_init(struct hda_codec *codec)
 
 	switch (spec->quirk) {
 	case QUIRK_R3DI:
-		r3di_setup_defaults(codec);
+	case QUIRK_R3D:
+		r3d_setup_defaults(codec);
 		break;
 	case QUIRK_SBZ:
 		break;
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 57+ messages in thread

* [PATCH AUTOSEL 4.18 078/113] ALSA: hda/ca0132 - Add quirk ID and enum for Recon3D
  2018-08-30 18:07 [PATCH AUTOSEL 4.18 067/113] powerpc: Fix size calculation using resource_size() Sasha Levin
                   ` (9 preceding siblings ...)
  2018-08-30 18:07 ` [PATCH AUTOSEL 4.18 077/113] ALSA: hda/ca0132 - Add DSP setup defaults for Recon3D Sasha Levin
@ 2018-08-30 18:07 ` Sasha Levin
  2018-08-30 20:08   ` Takashi Iwai
  2018-08-30 18:07 ` [PATCH AUTOSEL 4.18 079/113] ALSA: hda/ca0132 - Add alt_functions unsolicited response Sasha Levin
                   ` (34 subsequent siblings)
  45 siblings, 1 reply; 57+ messages in thread
From: Sasha Levin @ 2018-08-30 18:07 UTC (permalink / raw)
  To: stable@vger.kernel.org; +Cc: Connor McAdams, Takashi Iwai, Sasha Levin

From: Connor McAdams <conmanx360@gmail.com>

[ Upstream commit 8f8c523c4604afe231196920bf08310141a4f0ba ]

This patch adds the PCI subsys ID for the Recon3D that has been tested,
and adds the QUIRK_R3D enumeration.

Signed-off-by: Connor McAdams <conmanx360@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
---
 sound/pci/hda/patch_ca0132.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/sound/pci/hda/patch_ca0132.c b/sound/pci/hda/patch_ca0132.c
index 27ecff0d5c72..3288bbc3687c 100644
--- a/sound/pci/hda/patch_ca0132.c
+++ b/sound/pci/hda/patch_ca0132.c
@@ -994,6 +994,7 @@ enum {
 	QUIRK_ALIENWARE_M17XR4,
 	QUIRK_SBZ,
 	QUIRK_R3DI,
+	QUIRK_R3D,
 };
 
 static const struct hda_pintbl alienware_pincfgs[] = {
@@ -1050,6 +1051,7 @@ static const struct snd_pci_quirk ca0132_quirks[] = {
 	SND_PCI_QUIRK(0x1458, 0xA016, "Recon3Di", QUIRK_R3DI),
 	SND_PCI_QUIRK(0x1458, 0xA026, "Gigabyte G1.Sniper Z97", QUIRK_R3DI),
 	SND_PCI_QUIRK(0x1458, 0xA036, "Gigabyte GA-Z170X-Gaming 7", QUIRK_R3DI),
+	SND_PCI_QUIRK(0x1102, 0x0013, "Recon3D", QUIRK_R3D),
 	{}
 };
 
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 57+ messages in thread

* [PATCH AUTOSEL 4.18 079/113] ALSA: hda/ca0132 - Add alt_functions unsolicited response
  2018-08-30 18:07 [PATCH AUTOSEL 4.18 067/113] powerpc: Fix size calculation using resource_size() Sasha Levin
                   ` (10 preceding siblings ...)
  2018-08-30 18:07 ` [PATCH AUTOSEL 4.18 078/113] ALSA: hda/ca0132 - Add quirk ID and enum " Sasha Levin
@ 2018-08-30 18:07 ` Sasha Levin
  2018-08-30 18:07 ` [PATCH AUTOSEL 4.18 080/113] Input: do not use WARN() in input_alloc_absinfo() Sasha Levin
                   ` (33 subsequent siblings)
  45 siblings, 0 replies; 57+ messages in thread
From: Sasha Levin @ 2018-08-30 18:07 UTC (permalink / raw)
  To: stable@vger.kernel.org; +Cc: Connor McAdams, Takashi Iwai, Sasha Levin

From: Connor McAdams <conmanx360@gmail.com>

[ Upstream commit a1b7f016a1ae5e51f0e11a70cf1a5875d3ccee73 ]

This patch fixes a previous oversight where the microphone unsolicited
response would use the wrong input selection function.

Signed-off-by: Connor McAdams <conmanx360@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
---
 sound/pci/hda/patch_ca0132.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/sound/pci/hda/patch_ca0132.c b/sound/pci/hda/patch_ca0132.c
index 3288bbc3687c..773beed9b2fe 100644
--- a/sound/pci/hda/patch_ca0132.c
+++ b/sound/pci/hda/patch_ca0132.c
@@ -6729,7 +6729,12 @@ static void hp_callback(struct hda_codec *codec, struct hda_jack_callback *cb)
 
 static void amic_callback(struct hda_codec *codec, struct hda_jack_callback *cb)
 {
-	ca0132_select_mic(codec);
+	struct ca0132_spec *spec = codec->spec;
+
+	if (spec->use_alt_functions)
+		ca0132_alt_select_in(codec);
+	else
+		ca0132_select_mic(codec);
 }
 
 static void ca0132_init_unsol(struct hda_codec *codec)
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 57+ messages in thread

* [PATCH AUTOSEL 4.18 080/113] Input: do not use WARN() in input_alloc_absinfo()
  2018-08-30 18:07 [PATCH AUTOSEL 4.18 067/113] powerpc: Fix size calculation using resource_size() Sasha Levin
                   ` (11 preceding siblings ...)
  2018-08-30 18:07 ` [PATCH AUTOSEL 4.18 079/113] ALSA: hda/ca0132 - Add alt_functions unsolicited response Sasha Levin
@ 2018-08-30 18:07 ` Sasha Levin
  2018-08-30 18:07 ` [PATCH AUTOSEL 4.18 081/113] xen/balloon: fix balloon initialization for PVH Dom0 Sasha Levin
                   ` (32 subsequent siblings)
  45 siblings, 0 replies; 57+ messages in thread
From: Sasha Levin @ 2018-08-30 18:07 UTC (permalink / raw)
  To: stable@vger.kernel.org; +Cc: Dmitry Torokhov, Sasha Levin

From: Dmitry Torokhov <dmitry.torokhov@gmail.com>

[ Upstream commit 100294cee9a98bfd4d6cb2d1c8a8aef0e959b0c4 ]

Some of fuzzers set panic_on_warn=1 so that they can handle WARN()ings
the same way they handle full-blown kernel crashes. We used WARN() in
input_alloc_absinfo() to get a better idea where memory allocation
failed, but since then kmalloc() and friends started dumping call stack on
memory allocation failures anyway, so we are not getting anything extra
from WARN().

Because of the above, let's replace WARN with dev_err(). We use dev_err()
instead of simply removing message and relying on kcalloc() to give us
stack dump so that we'd know the instance of hardware device to which we
were trying to attach input device.

Reported-by: Dmitry Vyukov <dvyukov@google.com>
Acked-by: Dmitry Vyukov <dvyukov@google.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
---
 drivers/input/input.c | 16 ++++++++++++----
 1 file changed, 12 insertions(+), 4 deletions(-)

diff --git a/drivers/input/input.c b/drivers/input/input.c
index 6365c1958264..3304aaaffe87 100644
--- a/drivers/input/input.c
+++ b/drivers/input/input.c
@@ -480,11 +480,19 @@ EXPORT_SYMBOL(input_inject_event);
  */
 void input_alloc_absinfo(struct input_dev *dev)
 {
-	if (!dev->absinfo)
-		dev->absinfo = kcalloc(ABS_CNT, sizeof(*dev->absinfo),
-					GFP_KERNEL);
+	if (dev->absinfo)
+		return;
 
-	WARN(!dev->absinfo, "%s(): kcalloc() failed?\n", __func__);
+	dev->absinfo = kcalloc(ABS_CNT, sizeof(*dev->absinfo), GFP_KERNEL);
+	if (!dev->absinfo) {
+		dev_err(dev->dev.parent ?: &dev->dev,
+			"%s: unable to allocate memory\n", __func__);
+		/*
+		 * We will handle this allocation failure in
+		 * input_register_device() when we refuse to register input
+		 * device with ABS bits but without absinfo.
+		 */
+	}
 }
 EXPORT_SYMBOL(input_alloc_absinfo);
 
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 57+ messages in thread

* [PATCH AUTOSEL 4.18 081/113] xen/balloon: fix balloon initialization for PVH Dom0
  2018-08-30 18:07 [PATCH AUTOSEL 4.18 067/113] powerpc: Fix size calculation using resource_size() Sasha Levin
                   ` (12 preceding siblings ...)
  2018-08-30 18:07 ` [PATCH AUTOSEL 4.18 080/113] Input: do not use WARN() in input_alloc_absinfo() Sasha Levin
@ 2018-08-30 18:07 ` Sasha Levin
  2018-08-30 18:07 ` [PATCH AUTOSEL 4.18 082/113] PCI: mvebu: Fix I/O space end address calculation Sasha Levin
                   ` (31 subsequent siblings)
  45 siblings, 0 replies; 57+ messages in thread
From: Sasha Levin @ 2018-08-30 18:07 UTC (permalink / raw)
  To: stable@vger.kernel.org; +Cc: Roger Pau Monne, Boris Ostrovsky, Sasha Levin

From: Roger Pau Monne <roger.pau@citrix.com>

[ Upstream commit 3596924a233e45aa918c961a902170fc4916461b ]

The current balloon code tries to calculate a delta factor for the
balloon target when running in HVM mode in order to account for memory
used by the firmware.

This workaround for memory accounting doesn't work properly on a PVH
Dom0, that has a static-max value different from the target value even
at startup. Note that this is not a problem for DomUs because guests are
started with a static-max value that matches the amount of RAM in the
memory map.

Fix this by forcefully setting target_diff for Dom0, regardless of
it's mode.

Reported-by: Gabriel Bercarug <bercarug@amazon.com>
Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
Reviewed-by: Juergen Gross <jgross@suse.com>
Signed-off-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
---
 drivers/xen/xen-balloon.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/xen/xen-balloon.c b/drivers/xen/xen-balloon.c
index b437fccd4e62..294f35ce9e46 100644
--- a/drivers/xen/xen-balloon.c
+++ b/drivers/xen/xen-balloon.c
@@ -81,7 +81,7 @@ static void watch_target(struct xenbus_watch *watch,
 			static_max = new_target;
 		else
 			static_max >>= PAGE_SHIFT - 10;
-		target_diff = xen_pv_domain() ? 0
+		target_diff = (xen_pv_domain() || xen_initial_domain()) ? 0
 				: static_max - balloon_stats.target_pages;
 	}
 
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 57+ messages in thread

* [PATCH AUTOSEL 4.18 082/113] PCI: mvebu: Fix I/O space end address calculation
  2018-08-30 18:07 [PATCH AUTOSEL 4.18 067/113] powerpc: Fix size calculation using resource_size() Sasha Levin
                   ` (13 preceding siblings ...)
  2018-08-30 18:07 ` [PATCH AUTOSEL 4.18 081/113] xen/balloon: fix balloon initialization for PVH Dom0 Sasha Levin
@ 2018-08-30 18:07 ` Sasha Levin
  2018-08-30 18:07 ` [PATCH AUTOSEL 4.18 083/113] dm kcopyd: avoid softlockup in run_complete_job Sasha Levin
                   ` (30 subsequent siblings)
  45 siblings, 0 replies; 57+ messages in thread
From: Sasha Levin @ 2018-08-30 18:07 UTC (permalink / raw)
  To: stable@vger.kernel.org; +Cc: Thomas Petazzoni, Lorenzo Pieralisi, Sasha Levin

From: Thomas Petazzoni <thomas.petazzoni@bootlin.com>

[ Upstream commit dfd0309fd7b30a5baffaf47b2fccb88b46d64d69 ]

pcie->realio.end should be the address of last byte of the area,
therefore using resource_size() of another resource is not correct, we
must substract 1 to get the address of the last byte.

Fixes: 11be65472a427 ("PCI: mvebu: Adapt to the new device tree layout")
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
---
 drivers/pci/controller/pci-mvebu.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/pci/controller/pci-mvebu.c b/drivers/pci/controller/pci-mvebu.c
index 23e270839e6a..f00df2384985 100644
--- a/drivers/pci/controller/pci-mvebu.c
+++ b/drivers/pci/controller/pci-mvebu.c
@@ -1219,7 +1219,7 @@ static int mvebu_pcie_probe(struct platform_device *pdev)
 		pcie->realio.start = PCIBIOS_MIN_IO;
 		pcie->realio.end = min_t(resource_size_t,
 					 IO_SPACE_LIMIT,
-					 resource_size(&pcie->io));
+					 resource_size(&pcie->io) - 1);
 	} else
 		pcie->realio = pcie->io;
 
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 57+ messages in thread

* [PATCH AUTOSEL 4.18 083/113] dm kcopyd: avoid softlockup in run_complete_job
  2018-08-30 18:07 [PATCH AUTOSEL 4.18 067/113] powerpc: Fix size calculation using resource_size() Sasha Levin
                   ` (14 preceding siblings ...)
  2018-08-30 18:07 ` [PATCH AUTOSEL 4.18 082/113] PCI: mvebu: Fix I/O space end address calculation Sasha Levin
@ 2018-08-30 18:07 ` Sasha Levin
  2018-08-30 18:07 ` [PATCH AUTOSEL 4.18 084/113] staging: comedi: ni_mio_common: fix subdevice flags for PFI subdevice Sasha Levin
                   ` (29 subsequent siblings)
  45 siblings, 0 replies; 57+ messages in thread
From: Sasha Levin @ 2018-08-30 18:07 UTC (permalink / raw)
  To: stable@vger.kernel.org; +Cc: John Pittman, Mike Snitzer, Sasha Levin

From: John Pittman <jpittman@redhat.com>

[ Upstream commit 784c9a29e99eb40b842c29ecf1cc3a79e00fb629 ]

It was reported that softlockups occur when using dm-snapshot ontop of
slow (rbd) storage.  E.g.:

[ 4047.990647] watchdog: BUG: soft lockup - CPU#10 stuck for 22s! [kworker/10:23:26177]
...
[ 4048.034151] Workqueue: kcopyd do_work [dm_mod]
[ 4048.034156] RIP: 0010:copy_callback+0x41/0x160 [dm_snapshot]
...
[ 4048.034190] Call Trace:
[ 4048.034196]  ? __chunk_is_tracked+0x70/0x70 [dm_snapshot]
[ 4048.034200]  run_complete_job+0x5f/0xb0 [dm_mod]
[ 4048.034205]  process_jobs+0x91/0x220 [dm_mod]
[ 4048.034210]  ? kcopyd_put_pages+0x40/0x40 [dm_mod]
[ 4048.034214]  do_work+0x46/0xa0 [dm_mod]
[ 4048.034219]  process_one_work+0x171/0x370
[ 4048.034221]  worker_thread+0x1fc/0x3f0
[ 4048.034224]  kthread+0xf8/0x130
[ 4048.034226]  ? max_active_store+0x80/0x80
[ 4048.034227]  ? kthread_bind+0x10/0x10
[ 4048.034231]  ret_from_fork+0x35/0x40
[ 4048.034233] Kernel panic - not syncing: softlockup: hung tasks

Fix this by calling cond_resched() after run_complete_job()'s callout to
the dm_kcopyd_notify_fn (which is dm-snap.c:copy_callback in the above
trace).

Signed-off-by: John Pittman <jpittman@redhat.com>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
---
 drivers/md/dm-kcopyd.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/md/dm-kcopyd.c b/drivers/md/dm-kcopyd.c
index 3c7547a3c371..d7b9cdafd1c3 100644
--- a/drivers/md/dm-kcopyd.c
+++ b/drivers/md/dm-kcopyd.c
@@ -487,6 +487,8 @@ static int run_complete_job(struct kcopyd_job *job)
 	if (atomic_dec_and_test(&kc->nr_jobs))
 		wake_up(&kc->destroyq);
 
+	cond_resched();
+
 	return 0;
 }
 
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 57+ messages in thread

* [PATCH AUTOSEL 4.18 084/113] staging: comedi: ni_mio_common: fix subdevice flags for PFI subdevice
  2018-08-30 18:07 [PATCH AUTOSEL 4.18 067/113] powerpc: Fix size calculation using resource_size() Sasha Levin
                   ` (15 preceding siblings ...)
  2018-08-30 18:07 ` [PATCH AUTOSEL 4.18 083/113] dm kcopyd: avoid softlockup in run_complete_job Sasha Levin
@ 2018-08-30 18:07 ` Sasha Levin
  2018-08-30 18:07 ` [PATCH AUTOSEL 4.18 085/113] ASoC: rt5677: Fix initialization of rt5677_of_match.data Sasha Levin
                   ` (28 subsequent siblings)
  45 siblings, 0 replies; 57+ messages in thread
From: Sasha Levin @ 2018-08-30 18:07 UTC (permalink / raw)
  To: stable@vger.kernel.org; +Cc: Ian Abbott, Greg Kroah-Hartman, Sasha Levin

From: Ian Abbott <abbotti@mev.co.uk>

[ Upstream commit e083926b3e269d4064825dcf2ad50c636fddf8cf ]

The PFI subdevice flags indicate that the subdevice is readable and
writeable, but that is only true for the supported "M-series" boards,
not the older "E-series" boards.  Only set the SDF_READABLE and
SDF_WRITABLE subdevice flags for the M-series boards.  These two flags
are mainly for informational purposes.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
---
 drivers/staging/comedi/drivers/ni_mio_common.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/staging/comedi/drivers/ni_mio_common.c b/drivers/staging/comedi/drivers/ni_mio_common.c
index e40a2c0a9543..d3da39a9f567 100644
--- a/drivers/staging/comedi/drivers/ni_mio_common.c
+++ b/drivers/staging/comedi/drivers/ni_mio_common.c
@@ -5446,11 +5446,11 @@ static int ni_E_init(struct comedi_device *dev,
 	/* Digital I/O (PFI) subdevice */
 	s = &dev->subdevices[NI_PFI_DIO_SUBDEV];
 	s->type		= COMEDI_SUBD_DIO;
-	s->subdev_flags	= SDF_READABLE | SDF_WRITABLE | SDF_INTERNAL;
 	s->maxdata	= 1;
 	if (devpriv->is_m_series) {
 		s->n_chan	= 16;
 		s->insn_bits	= ni_pfi_insn_bits;
+		s->subdev_flags	= SDF_READABLE | SDF_WRITABLE | SDF_INTERNAL;
 
 		ni_writew(dev, s->state, NI_M_PFI_DO_REG);
 		for (i = 0; i < NUM_PFI_OUTPUT_SELECT_REGS; ++i) {
@@ -5459,6 +5459,7 @@ static int ni_E_init(struct comedi_device *dev,
 		}
 	} else {
 		s->n_chan	= 10;
+		s->subdev_flags	= SDF_INTERNAL;
 	}
 	s->insn_config	= ni_pfi_insn_config;
 
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 57+ messages in thread

* [PATCH AUTOSEL 4.18 085/113] ASoC: rt5677: Fix initialization of rt5677_of_match.data
  2018-08-30 18:07 [PATCH AUTOSEL 4.18 067/113] powerpc: Fix size calculation using resource_size() Sasha Levin
                   ` (16 preceding siblings ...)
  2018-08-30 18:07 ` [PATCH AUTOSEL 4.18 084/113] staging: comedi: ni_mio_common: fix subdevice flags for PFI subdevice Sasha Levin
@ 2018-08-30 18:07 ` Sasha Levin
  2018-08-30 18:07 ` [PATCH AUTOSEL 4.18 086/113] iommu/omap: Fix cache flushes on L2 table entries Sasha Levin
                   ` (27 subsequent siblings)
  45 siblings, 0 replies; 57+ messages in thread
From: Sasha Levin @ 2018-08-30 18:07 UTC (permalink / raw)
  To: stable@vger.kernel.org; +Cc: Matthias Kaehlcke, Mark Brown, Sasha Levin

From: Matthias Kaehlcke <mka@chromium.org>

[ Upstream commit f861e3e28a3016a2064d9f600eaa92a530b732b4 ]

The driver expects to find the device id in rt5677_of_match.data, however
it is currently assigned to rt5677_of_match.type. Fix this.

The problem was found with the help of clang:
  sound/soc/codecs/rt5677.c:5010:36: warning: expression which evaluates to
  zero treated as a null pointer constant of type 'const void *'
  [-Wnon-literal-null-conversion]
    { .compatible = "realtek,rt5677", RT5677 },
                                      ^~~~~~

Fixes: ddc9e69b9dc2 ("ASoC: rt5677: Hide platform data in the module sources")
Signed-off-by: Matthias Kaehlcke <mka@chromium.org>
Reviewed-by: Guenter Roeck <groeck@chromium.org>
Acked-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
---
 sound/soc/codecs/rt5677.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sound/soc/codecs/rt5677.c b/sound/soc/codecs/rt5677.c
index 8a0181a2db08..47feef30dadb 100644
--- a/sound/soc/codecs/rt5677.c
+++ b/sound/soc/codecs/rt5677.c
@@ -5007,7 +5007,7 @@ static const struct regmap_config rt5677_regmap = {
 };
 
 static const struct of_device_id rt5677_of_match[] = {
-	{ .compatible = "realtek,rt5677", RT5677 },
+	{ .compatible = "realtek,rt5677", .data = (const void *)RT5677 },
 	{ }
 };
 MODULE_DEVICE_TABLE(of, rt5677_of_match);
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 57+ messages in thread

* [PATCH AUTOSEL 4.18 086/113] iommu/omap: Fix cache flushes on L2 table entries
  2018-08-30 18:07 [PATCH AUTOSEL 4.18 067/113] powerpc: Fix size calculation using resource_size() Sasha Levin
                   ` (17 preceding siblings ...)
  2018-08-30 18:07 ` [PATCH AUTOSEL 4.18 085/113] ASoC: rt5677: Fix initialization of rt5677_of_match.data Sasha Levin
@ 2018-08-30 18:07 ` Sasha Levin
  2018-08-30 18:07 ` [PATCH AUTOSEL 4.18 087/113] selftests/powerpc: Kill child processes on SIGINT Sasha Levin
                   ` (26 subsequent siblings)
  45 siblings, 0 replies; 57+ messages in thread
From: Sasha Levin @ 2018-08-30 18:07 UTC (permalink / raw)
  To: stable@vger.kernel.org; +Cc: Ralf Goebel, Joerg Roedel, Sasha Levin

From: Ralf Goebel <ralf.goebel@imago-technologies.com>

[ Upstream commit 04c532a1cdc7e423656c07937aa4b5c1c2b064f9 ]

The base address used for DMA operations on the second-level table
did incorrectly include the offset for the table entry. The offset
was then added again which lead to incorrect behavior.

Operations on the L1 table are not affected.

The calculation of the base address is changed to point to the
beginning of the L2 table.

Fixes: bfee0cf0ee1d ("iommu/omap: Use DMA-API for performing cache flushes")
Acked-by: Suman Anna <s-anna@ti.com>
Signed-off-by: Ralf Goebel <ralf.goebel@imago-technologies.com>
Signed-off-by: Joerg Roedel <jroedel@suse.de>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
---
 drivers/iommu/omap-iommu.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/iommu/omap-iommu.c b/drivers/iommu/omap-iommu.c
index af4a8e7fcd27..3b05117118c3 100644
--- a/drivers/iommu/omap-iommu.c
+++ b/drivers/iommu/omap-iommu.c
@@ -550,7 +550,7 @@ static u32 *iopte_alloc(struct omap_iommu *obj, u32 *iopgd,
 
 pte_ready:
 	iopte = iopte_offset(iopgd, da);
-	*pt_dma = virt_to_phys(iopte);
+	*pt_dma = iopgd_page_paddr(iopgd);
 	dev_vdbg(obj->dev,
 		 "%s: da:%08x pgd:%p *pgd:%08x pte:%p *pte:%08x\n",
 		 __func__, da, iopgd, *iopgd, iopte, *iopte);
@@ -738,7 +738,7 @@ static size_t iopgtable_clear_entry_core(struct omap_iommu *obj, u32 da)
 		}
 		bytes *= nent;
 		memset(iopte, 0, nent * sizeof(*iopte));
-		pt_dma = virt_to_phys(iopte);
+		pt_dma = iopgd_page_paddr(iopgd);
 		flush_iopte_range(obj->dev, pt_dma, pt_offset, nent);
 
 		/*
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 57+ messages in thread

* [PATCH AUTOSEL 4.18 087/113] selftests/powerpc: Kill child processes on SIGINT
  2018-08-30 18:07 [PATCH AUTOSEL 4.18 067/113] powerpc: Fix size calculation using resource_size() Sasha Levin
                   ` (18 preceding siblings ...)
  2018-08-30 18:07 ` [PATCH AUTOSEL 4.18 086/113] iommu/omap: Fix cache flushes on L2 table entries Sasha Levin
@ 2018-08-30 18:07 ` Sasha Levin
  2018-08-30 18:07 ` [PATCH AUTOSEL 4.18 088/113] selinux: cleanup dentry and inodes on error in selinuxfs Sasha Levin
                   ` (25 subsequent siblings)
  45 siblings, 0 replies; 57+ messages in thread
From: Sasha Levin @ 2018-08-30 18:07 UTC (permalink / raw)
  To: stable@vger.kernel.org
  Cc: Breno Leitao, Gustavo Romero, Michael Ellerman, Sasha Levin

From: Breno Leitao <leitao@debian.org>

[ Upstream commit 7c27a26e1ed5a7dd709aa19685d2c98f64e1cf0c ]

There are some powerpc selftests, as tm/tm-unavailable, that run for a long
period (>120 seconds), and if it is interrupted, as pressing CRTL-C
(SIGINT), the foreground process (harness) dies but the child process and
threads continue to execute (with PPID = 1 now) in background.

In this case, you'd think the whole test exited, but there are remaining
threads and processes being executed in background. Sometimes these
zombies processes are doing annoying things, as consuming the whole CPU or
dumping things to STDOUT.

This patch fixes this problem by attaching an empty signal handler to
SIGINT in the harness process. This handler will interrupt (EINTR) the
parent process waitpid() call, letting the code to follow through the
normal flow, which will kill all the processes in the child process group.

This patch also fixes a typo.

Signed-off-by: Breno Leitao <leitao@debian.org>
Signed-off-by: Gustavo Romero <gromero@linux.vnet.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
---
 tools/testing/selftests/powerpc/harness.c | 18 ++++++++++++------
 1 file changed, 12 insertions(+), 6 deletions(-)

diff --git a/tools/testing/selftests/powerpc/harness.c b/tools/testing/selftests/powerpc/harness.c
index 66d31de60b9a..9d7166dfad1e 100644
--- a/tools/testing/selftests/powerpc/harness.c
+++ b/tools/testing/selftests/powerpc/harness.c
@@ -85,13 +85,13 @@ int run_test(int (test_function)(void), char *name)
 	return status;
 }
 
-static void alarm_handler(int signum)
+static void sig_handler(int signum)
 {
-	/* Jut wake us up from waitpid */
+	/* Just wake us up from waitpid */
 }
 
-static struct sigaction alarm_action = {
-	.sa_handler = alarm_handler,
+static struct sigaction sig_action = {
+	.sa_handler = sig_handler,
 };
 
 void test_harness_set_timeout(uint64_t time)
@@ -106,8 +106,14 @@ int test_harness(int (test_function)(void), char *name)
 	test_start(name);
 	test_set_git_version(GIT_VERSION);
 
-	if (sigaction(SIGALRM, &alarm_action, NULL)) {
-		perror("sigaction");
+	if (sigaction(SIGINT, &sig_action, NULL)) {
+		perror("sigaction (sigint)");
+		test_error(name);
+		return 1;
+	}
+
+	if (sigaction(SIGALRM, &sig_action, NULL)) {
+		perror("sigaction (sigalrm)");
 		test_error(name);
 		return 1;
 	}
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 57+ messages in thread

* [PATCH AUTOSEL 4.18 088/113] selinux: cleanup dentry and inodes on error in selinuxfs
  2018-08-30 18:07 [PATCH AUTOSEL 4.18 067/113] powerpc: Fix size calculation using resource_size() Sasha Levin
                   ` (19 preceding siblings ...)
  2018-08-30 18:07 ` [PATCH AUTOSEL 4.18 087/113] selftests/powerpc: Kill child processes on SIGINT Sasha Levin
@ 2018-08-30 18:07 ` Sasha Levin
  2018-08-30 18:07 ` [PATCH AUTOSEL 4.18 089/113] RDS: IB: fix 'passing zero to ERR_PTR()' warning Sasha Levin
                   ` (24 subsequent siblings)
  45 siblings, 0 replies; 57+ messages in thread
From: Sasha Levin @ 2018-08-30 18:07 UTC (permalink / raw)
  To: stable@vger.kernel.org; +Cc: nixiaoming, Paul Moore, Sasha Levin

From: nixiaoming <nixiaoming@huawei.com>

[ Upstream commit 7e4237faa7213c1cc1d0aa65a44c67ba4729ce9f ]

If the resource requested by d_alloc_name is not added to the linked
list through d_add, then dput needs to be called to release the
subsequent abnormal branch to avoid resource leakage.

Add missing dput to selinuxfs.c

Signed-off-by: nixiaoming <nixiaoming@huawei.com>
[PM: tweak the subject line]
Signed-off-by: Paul Moore <paul@paul-moore.com>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
---
 security/selinux/selinuxfs.c | 33 +++++++++++++++++++++++++--------
 1 file changed, 25 insertions(+), 8 deletions(-)

diff --git a/security/selinux/selinuxfs.c b/security/selinux/selinuxfs.c
index 79d3709b0671..0b66d7283b00 100644
--- a/security/selinux/selinuxfs.c
+++ b/security/selinux/selinuxfs.c
@@ -1365,13 +1365,18 @@ static int sel_make_bools(struct selinux_fs_info *fsi)
 
 		ret = -ENOMEM;
 		inode = sel_make_inode(dir->d_sb, S_IFREG | S_IRUGO | S_IWUSR);
-		if (!inode)
+		if (!inode) {
+			dput(dentry);
 			goto out;
+		}
 
 		ret = -ENAMETOOLONG;
 		len = snprintf(page, PAGE_SIZE, "/%s/%s", BOOL_DIR_NAME, names[i]);
-		if (len >= PAGE_SIZE)
+		if (len >= PAGE_SIZE) {
+			dput(dentry);
+			iput(inode);
 			goto out;
+		}
 
 		isec = (struct inode_security_struct *)inode->i_security;
 		ret = security_genfs_sid(fsi->state, "selinuxfs", page,
@@ -1586,8 +1591,10 @@ static int sel_make_avc_files(struct dentry *dir)
 			return -ENOMEM;
 
 		inode = sel_make_inode(dir->d_sb, S_IFREG|files[i].mode);
-		if (!inode)
+		if (!inode) {
+			dput(dentry);
 			return -ENOMEM;
+		}
 
 		inode->i_fop = files[i].ops;
 		inode->i_ino = ++fsi->last_ino;
@@ -1632,8 +1639,10 @@ static int sel_make_initcon_files(struct dentry *dir)
 			return -ENOMEM;
 
 		inode = sel_make_inode(dir->d_sb, S_IFREG|S_IRUGO);
-		if (!inode)
+		if (!inode) {
+			dput(dentry);
 			return -ENOMEM;
+		}
 
 		inode->i_fop = &sel_initcon_ops;
 		inode->i_ino = i|SEL_INITCON_INO_OFFSET;
@@ -1733,8 +1742,10 @@ static int sel_make_perm_files(char *objclass, int classvalue,
 
 		rc = -ENOMEM;
 		inode = sel_make_inode(dir->d_sb, S_IFREG|S_IRUGO);
-		if (!inode)
+		if (!inode) {
+			dput(dentry);
 			goto out;
+		}
 
 		inode->i_fop = &sel_perm_ops;
 		/* i+1 since perm values are 1-indexed */
@@ -1763,8 +1774,10 @@ static int sel_make_class_dir_entries(char *classname, int index,
 		return -ENOMEM;
 
 	inode = sel_make_inode(dir->d_sb, S_IFREG|S_IRUGO);
-	if (!inode)
+	if (!inode) {
+		dput(dentry);
 		return -ENOMEM;
+	}
 
 	inode->i_fop = &sel_class_ops;
 	inode->i_ino = sel_class_to_ino(index);
@@ -1838,8 +1851,10 @@ static int sel_make_policycap(struct selinux_fs_info *fsi)
 			return -ENOMEM;
 
 		inode = sel_make_inode(fsi->sb, S_IFREG | 0444);
-		if (inode == NULL)
+		if (inode == NULL) {
+			dput(dentry);
 			return -ENOMEM;
+		}
 
 		inode->i_fop = &sel_policycap_ops;
 		inode->i_ino = iter | SEL_POLICYCAP_INO_OFFSET;
@@ -1932,8 +1947,10 @@ static int sel_fill_super(struct super_block *sb, void *data, int silent)
 
 	ret = -ENOMEM;
 	inode = sel_make_inode(sb, S_IFCHR | S_IRUGO | S_IWUGO);
-	if (!inode)
+	if (!inode) {
+		dput(dentry);
 		goto err;
+	}
 
 	inode->i_ino = ++fsi->last_ino;
 	isec = (struct inode_security_struct *)inode->i_security;
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 57+ messages in thread

* [PATCH AUTOSEL 4.18 089/113] RDS: IB: fix 'passing zero to ERR_PTR()' warning
  2018-08-30 18:07 [PATCH AUTOSEL 4.18 067/113] powerpc: Fix size calculation using resource_size() Sasha Levin
                   ` (20 preceding siblings ...)
  2018-08-30 18:07 ` [PATCH AUTOSEL 4.18 088/113] selinux: cleanup dentry and inodes on error in selinuxfs Sasha Levin
@ 2018-08-30 18:07 ` Sasha Levin
  2018-08-30 18:07 ` [PATCH AUTOSEL 4.18 090/113] cfq: Suppress compiler warnings about comparisons Sasha Levin
                   ` (23 subsequent siblings)
  45 siblings, 0 replies; 57+ messages in thread
From: Sasha Levin @ 2018-08-30 18:07 UTC (permalink / raw)
  To: stable@vger.kernel.org; +Cc: YueHaibing, David S . Miller, Sasha Levin

From: YueHaibing <yuehaibing@huawei.com>

[ Upstream commit 5941923da29e84bc9e2a1abb2c14fffaf8d71e2f ]

Fix a static code checker warning:
 net/rds/ib_frmr.c:82 rds_ib_alloc_frmr() warn: passing zero to 'ERR_PTR'

The error path for ib_alloc_mr failure should set err to PTR_ERR.

Fixes: 1659185fb4d0 ("RDS: IB: Support Fastreg MR (FRMR) memory registration mode")
Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Acked-by: Santosh Shilimkar <santosh.shilimkar@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
---
 net/rds/ib_frmr.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/net/rds/ib_frmr.c b/net/rds/ib_frmr.c
index d152e48ea371..8596eed6d9a8 100644
--- a/net/rds/ib_frmr.c
+++ b/net/rds/ib_frmr.c
@@ -61,6 +61,7 @@ static struct rds_ib_mr *rds_ib_alloc_frmr(struct rds_ib_device *rds_ibdev,
 			 pool->fmr_attr.max_pages);
 	if (IS_ERR(frmr->mr)) {
 		pr_warn("RDS/IB: %s failed to allocate MR", __func__);
+		err = PTR_ERR(frmr->mr);
 		goto out_no_cigar;
 	}
 
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 57+ messages in thread

* [PATCH AUTOSEL 4.18 090/113] cfq: Suppress compiler warnings about comparisons
  2018-08-30 18:07 [PATCH AUTOSEL 4.18 067/113] powerpc: Fix size calculation using resource_size() Sasha Levin
                   ` (21 preceding siblings ...)
  2018-08-30 18:07 ` [PATCH AUTOSEL 4.18 089/113] RDS: IB: fix 'passing zero to ERR_PTR()' warning Sasha Levin
@ 2018-08-30 18:07 ` Sasha Levin
  2018-08-30 18:07 ` [PATCH AUTOSEL 4.18 091/113] smb3: fix reset of bytes read and written stats Sasha Levin
                   ` (22 subsequent siblings)
  45 siblings, 0 replies; 57+ messages in thread
From: Sasha Levin @ 2018-08-30 18:07 UTC (permalink / raw)
  To: stable@vger.kernel.org; +Cc: Bart Van Assche, Jens Axboe, Sasha Levin

From: Bart Van Assche <bart.vanassche@wdc.com>

[ Upstream commit f7ecb1b109da1006a08d5675debe60990e824432 ]

This patch does not change any functionality but avoids that gcc
reports the following warnings when building with W=1:

block/cfq-iosched.c: In function ?cfq_back_seek_max_store?:
block/cfq-iosched.c:4741:13: warning: comparison of unsigned expression < 0 is always false [-Wtype-limits]
  if (__data < (MIN))      \
             ^
block/cfq-iosched.c:4756:1: note: in expansion of macro ?STORE_FUNCTION?
 STORE_FUNCTION(cfq_back_seek_max_store, &cfqd->cfq_back_max, 0, UINT_MAX, 0);
 ^~~~~~~~~~~~~~
block/cfq-iosched.c: In function ?cfq_slice_idle_store?:
block/cfq-iosched.c:4741:13: warning: comparison of unsigned expression < 0 is always false [-Wtype-limits]
  if (__data < (MIN))      \
             ^
block/cfq-iosched.c:4759:1: note: in expansion of macro ?STORE_FUNCTION?
 STORE_FUNCTION(cfq_slice_idle_store, &cfqd->cfq_slice_idle, 0, UINT_MAX, 1);
 ^~~~~~~~~~~~~~
block/cfq-iosched.c: In function ?cfq_group_idle_store?:
block/cfq-iosched.c:4741:13: warning: comparison of unsigned expression < 0 is always false [-Wtype-limits]
  if (__data < (MIN))      \
             ^
block/cfq-iosched.c:4760:1: note: in expansion of macro ?STORE_FUNCTION?
 STORE_FUNCTION(cfq_group_idle_store, &cfqd->cfq_group_idle, 0, UINT_MAX, 1);
 ^~~~~~~~~~~~~~
block/cfq-iosched.c: In function ?cfq_low_latency_store?:
block/cfq-iosched.c:4741:13: warning: comparison of unsigned expression < 0 is always false [-Wtype-limits]
  if (__data < (MIN))      \
             ^
block/cfq-iosched.c:4765:1: note: in expansion of macro ?STORE_FUNCTION?
 STORE_FUNCTION(cfq_low_latency_store, &cfqd->cfq_latency, 0, 1, 0);
 ^~~~~~~~~~~~~~
block/cfq-iosched.c: In function ?cfq_slice_idle_us_store?:
block/cfq-iosched.c:4775:13: warning: comparison of unsigned expression < 0 is always false [-Wtype-limits]
  if (__data < (MIN))      \
             ^
block/cfq-iosched.c:4782:1: note: in expansion of macro ?USEC_STORE_FUNCTION?
 USEC_STORE_FUNCTION(cfq_slice_idle_us_store, &cfqd->cfq_slice_idle, 0, UINT_MAX);
 ^~~~~~~~~~~~~~~~~~~
block/cfq-iosched.c: In function ?cfq_group_idle_us_store?:
block/cfq-iosched.c:4775:13: warning: comparison of unsigned expression < 0 is always false [-Wtype-limits]
  if (__data < (MIN))      \
             ^
block/cfq-iosched.c:4783:1: note: in expansion of macro ?USEC_STORE_FUNCTION?
 USEC_STORE_FUNCTION(cfq_group_idle_us_store, &cfqd->cfq_group_idle, 0, UINT_MAX);
 ^~~~~~~~~~~~~~~~~~~

Signed-off-by: Bart Van Assche <bart.vanassche@wdc.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
---
 block/cfq-iosched.c | 22 ++++++++++++----------
 1 file changed, 12 insertions(+), 10 deletions(-)

diff --git a/block/cfq-iosched.c b/block/cfq-iosched.c
index 82b6c27b3245..f6f180f3aa1c 100644
--- a/block/cfq-iosched.c
+++ b/block/cfq-iosched.c
@@ -4735,12 +4735,13 @@ USEC_SHOW_FUNCTION(cfq_target_latency_us_show, cfqd->cfq_target_latency);
 static ssize_t __FUNC(struct elevator_queue *e, const char *page, size_t count)	\
 {									\
 	struct cfq_data *cfqd = e->elevator_data;			\
-	unsigned int __data;						\
+	unsigned int __data, __min = (MIN), __max = (MAX);		\
+									\
 	cfq_var_store(&__data, (page));					\
-	if (__data < (MIN))						\
-		__data = (MIN);						\
-	else if (__data > (MAX))					\
-		__data = (MAX);						\
+	if (__data < __min)						\
+		__data = __min;						\
+	else if (__data > __max)					\
+		__data = __max;						\
 	if (__CONV)							\
 		*(__PTR) = (u64)__data * NSEC_PER_MSEC;			\
 	else								\
@@ -4769,12 +4770,13 @@ STORE_FUNCTION(cfq_target_latency_store, &cfqd->cfq_target_latency, 1, UINT_MAX,
 static ssize_t __FUNC(struct elevator_queue *e, const char *page, size_t count)	\
 {									\
 	struct cfq_data *cfqd = e->elevator_data;			\
-	unsigned int __data;						\
+	unsigned int __data, __min = (MIN), __max = (MAX);		\
+									\
 	cfq_var_store(&__data, (page));					\
-	if (__data < (MIN))						\
-		__data = (MIN);						\
-	else if (__data > (MAX))					\
-		__data = (MAX);						\
+	if (__data < __min)						\
+		__data = __min;						\
+	else if (__data > __max)					\
+		__data = __max;						\
 	*(__PTR) = (u64)__data * NSEC_PER_USEC;				\
 	return count;							\
 }
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 57+ messages in thread

* [PATCH AUTOSEL 4.18 091/113] smb3: fix reset of bytes read and written stats
  2018-08-30 18:07 [PATCH AUTOSEL 4.18 067/113] powerpc: Fix size calculation using resource_size() Sasha Levin
                   ` (22 preceding siblings ...)
  2018-08-30 18:07 ` [PATCH AUTOSEL 4.18 090/113] cfq: Suppress compiler warnings about comparisons Sasha Levin
@ 2018-08-30 18:07 ` Sasha Levin
  2018-08-30 18:08 ` [PATCH AUTOSEL 4.18 092/113] CIFS: fix memory leak and remove dead code Sasha Levin
                   ` (21 subsequent siblings)
  45 siblings, 0 replies; 57+ messages in thread
From: Sasha Levin @ 2018-08-30 18:07 UTC (permalink / raw)
  To: stable@vger.kernel.org; +Cc: Steven French, Sasha Levin

From: Steve French <stfrench@microsoft.com>

[ Upstream commit c281bc0c7412308c7ec0888904f7c99353da4796 ]

echo 0 > /proc/fs/cifs/Stats is supposed to reset the stats
but there were four (see example below) that were not reset
(bytes read and witten, total vfs ops and max ops
at one time).

...
0 session 0 share reconnects
Total vfs operations: 100 maximum at one time: 2

1) \\localhost\test
SMBs: 0
Bytes read: 502092  Bytes written: 31457286
TreeConnects: 0 total 0 failed
TreeDisconnects: 0 total 0 failed
...

This patch fixes cifs_stats_proc_write to properly reset
those four.

Signed-off-by: Steve French <stfrench@microsoft.com>
Reviewed-by: Aurelien Aptel <aaptel@suse.com>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
---
 fs/cifs/cifs_debug.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/fs/cifs/cifs_debug.c b/fs/cifs/cifs_debug.c
index bfe999505815..6107077169bf 100644
--- a/fs/cifs/cifs_debug.c
+++ b/fs/cifs/cifs_debug.c
@@ -367,6 +367,10 @@ static ssize_t cifs_stats_proc_write(struct file *file,
 		atomic_set(&totBufAllocCount, 0);
 		atomic_set(&totSmBufAllocCount, 0);
 #endif /* CONFIG_CIFS_STATS2 */
+		spin_lock(&GlobalMid_Lock);
+		GlobalMaxActiveXid = 0;
+		GlobalCurrentXid = 0;
+		spin_unlock(&GlobalMid_Lock);
 		spin_lock(&cifs_tcp_ses_lock);
 		list_for_each(tmp1, &cifs_tcp_ses_list) {
 			server = list_entry(tmp1, struct TCP_Server_Info,
@@ -379,6 +383,10 @@ static ssize_t cifs_stats_proc_write(struct file *file,
 							  struct cifs_tcon,
 							  tcon_list);
 					atomic_set(&tcon->num_smbs_sent, 0);
+					spin_lock(&tcon->stat_lock);
+					tcon->bytes_read = 0;
+					tcon->bytes_written = 0;
+					spin_unlock(&tcon->stat_lock);
 					if (server->ops->clear_stats)
 						server->ops->clear_stats(tcon);
 				}
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 57+ messages in thread

* [PATCH AUTOSEL 4.18 092/113] CIFS: fix memory leak and remove dead code
  2018-08-30 18:07 [PATCH AUTOSEL 4.18 067/113] powerpc: Fix size calculation using resource_size() Sasha Levin
                   ` (23 preceding siblings ...)
  2018-08-30 18:07 ` [PATCH AUTOSEL 4.18 091/113] smb3: fix reset of bytes read and written stats Sasha Levin
@ 2018-08-30 18:08 ` Sasha Levin
  2018-08-30 18:08 ` [PATCH AUTOSEL 4.18 093/113] SMB3: Number of requests sent should be displayed for SMB3 not just CIFS Sasha Levin
                   ` (20 subsequent siblings)
  45 siblings, 0 replies; 57+ messages in thread
From: Sasha Levin @ 2018-08-30 18:08 UTC (permalink / raw)
  To: stable@vger.kernel.org
  Cc: Aurelien Aptel, Dan Carpenter, Gustavo A . R . Silva,
	Steven French, Sasha Levin

From: Aurelien Aptel <aaptel@suse.com>

[ Upstream commit 256b4c3f03d77d8c0dc69e3a6ceb3afd0d1810bd ]

also fixes error code in smb311_posix_mkdir() (where
the error assignment needs to go before the goto)
a typo that Dan Carpenter and Paulo and Gustavo
pointed out.

Signed-off-by: Aurelien Aptel <aaptel@suse.com>
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
Reviewed-by: Paulo Alcantara <palcantara@suse.de>
Signed-off-by: Steve French <stfrench@microsoft.com>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
---
 fs/cifs/smb2pdu.c | 101 +++++++++++++++++++++++-----------------------
 1 file changed, 50 insertions(+), 51 deletions(-)

diff --git a/fs/cifs/smb2pdu.c b/fs/cifs/smb2pdu.c
index 3c92678cb45b..641fe79708d0 100644
--- a/fs/cifs/smb2pdu.c
+++ b/fs/cifs/smb2pdu.c
@@ -1928,7 +1928,7 @@ int smb311_posix_mkdir(const unsigned int xid, struct inode *inode,
 {
 	struct smb_rqst rqst;
 	struct smb2_create_req *req;
-	struct smb2_create_rsp *rsp;
+	struct smb2_create_rsp *rsp = NULL;
 	struct TCP_Server_Info *server;
 	struct cifs_ses *ses = tcon->ses;
 	struct kvec iov[3]; /* make sure at least one for each open context */
@@ -1943,27 +1943,31 @@ int smb311_posix_mkdir(const unsigned int xid, struct inode *inode,
 	char *pc_buf = NULL;
 	int flags = 0;
 	unsigned int total_len;
-	__le16 *path = cifs_convert_path_to_utf16(full_path, cifs_sb);
-
-	if (!path)
-		return -ENOMEM;
+	__le16 *utf16_path = NULL;
 
 	cifs_dbg(FYI, "mkdir\n");
 
+	/* resource #1: path allocation */
+	utf16_path = cifs_convert_path_to_utf16(full_path, cifs_sb);
+	if (!utf16_path)
+		return -ENOMEM;
+
 	if (ses && (ses->server))
 		server = ses->server;
-	else
-		return -EIO;
+	else {
+		rc = -EIO;
+		goto err_free_path;
+	}
 
+	/* resource #2: request */
 	rc = smb2_plain_req_init(SMB2_CREATE, tcon, (void **) &req, &total_len);
-
 	if (rc)
-		return rc;
+		goto err_free_path;
+
 
 	if (smb3_encryption_required(tcon))
 		flags |= CIFS_TRANSFORM_REQ;
 
-
 	req->ImpersonationLevel = IL_IMPERSONATION;
 	req->DesiredAccess = cpu_to_le32(FILE_WRITE_ATTRIBUTES);
 	/* File attributes ignored on open (used in create though) */
@@ -1992,50 +1996,44 @@ int smb311_posix_mkdir(const unsigned int xid, struct inode *inode,
 		req->sync_hdr.Flags |= SMB2_FLAGS_DFS_OPERATIONS;
 		rc = alloc_path_with_tree_prefix(&copy_path, &copy_size,
 						 &name_len,
-						 tcon->treeName, path);
-		if (rc) {
-			cifs_small_buf_release(req);
-			return rc;
-		}
+						 tcon->treeName, utf16_path);
+		if (rc)
+			goto err_free_req;
+
 		req->NameLength = cpu_to_le16(name_len * 2);
 		uni_path_len = copy_size;
-		path = copy_path;
+		/* free before overwriting resource */
+		kfree(utf16_path);
+		utf16_path = copy_path;
 	} else {
-		uni_path_len = (2 * UniStrnlen((wchar_t *)path, PATH_MAX)) + 2;
+		uni_path_len = (2 * UniStrnlen((wchar_t *)utf16_path, PATH_MAX)) + 2;
 		/* MUST set path len (NameLength) to 0 opening root of share */
 		req->NameLength = cpu_to_le16(uni_path_len - 2);
 		if (uni_path_len % 8 != 0) {
 			copy_size = roundup(uni_path_len, 8);
 			copy_path = kzalloc(copy_size, GFP_KERNEL);
 			if (!copy_path) {
-				cifs_small_buf_release(req);
-				return -ENOMEM;
+				rc = -ENOMEM;
+				goto err_free_req;
 			}
-			memcpy((char *)copy_path, (const char *)path,
+			memcpy((char *)copy_path, (const char *)utf16_path,
 			       uni_path_len);
 			uni_path_len = copy_size;
-			path = copy_path;
+			/* free before overwriting resource */
+			kfree(utf16_path);
+			utf16_path = copy_path;
 		}
 	}
 
 	iov[1].iov_len = uni_path_len;
-	iov[1].iov_base = path;
+	iov[1].iov_base = utf16_path;
 	req->RequestedOplockLevel = SMB2_OPLOCK_LEVEL_NONE;
 
 	if (tcon->posix_extensions) {
-		if (n_iov > 2) {
-			struct create_context *ccontext =
-			    (struct create_context *)iov[n_iov-1].iov_base;
-			ccontext->Next =
-				cpu_to_le32(iov[n_iov-1].iov_len);
-		}
-
+		/* resource #3: posix buf */
 		rc = add_posix_context(iov, &n_iov, mode);
-		if (rc) {
-			cifs_small_buf_release(req);
-			kfree(copy_path);
-			return rc;
-		}
+		if (rc)
+			goto err_free_req;
 		pc_buf = iov[n_iov-1].iov_base;
 	}
 
@@ -2044,32 +2042,33 @@ int smb311_posix_mkdir(const unsigned int xid, struct inode *inode,
 	rqst.rq_iov = iov;
 	rqst.rq_nvec = n_iov;
 
-	rc = cifs_send_recv(xid, ses, &rqst, &resp_buftype, flags,
-			    &rsp_iov);
-
-	cifs_small_buf_release(req);
-	rsp = (struct smb2_create_rsp *)rsp_iov.iov_base;
-
-	if (rc != 0) {
+	/* resource #4: response buffer */
+	rc = cifs_send_recv(xid, ses, &rqst, &resp_buftype, flags, &rsp_iov);
+	if (rc) {
 		cifs_stats_fail_inc(tcon, SMB2_CREATE_HE);
 		trace_smb3_posix_mkdir_err(xid, tcon->tid, ses->Suid,
-				    CREATE_NOT_FILE, FILE_WRITE_ATTRIBUTES, rc);
-		goto smb311_mkdir_exit;
-	} else
-		trace_smb3_posix_mkdir_done(xid, rsp->PersistentFileId, tcon->tid,
-				     ses->Suid, CREATE_NOT_FILE,
-				     FILE_WRITE_ATTRIBUTES);
+					   CREATE_NOT_FILE,
+					   FILE_WRITE_ATTRIBUTES, rc);
+		goto err_free_rsp_buf;
+	}
+
+	rsp = (struct smb2_create_rsp *)rsp_iov.iov_base;
+	trace_smb3_posix_mkdir_done(xid, rsp->PersistentFileId, tcon->tid,
+				    ses->Suid, CREATE_NOT_FILE,
+				    FILE_WRITE_ATTRIBUTES);
 
 	SMB2_close(xid, tcon, rsp->PersistentFileId, rsp->VolatileFileId);
 
 	/* Eventually save off posix specific response info and timestaps */
 
-smb311_mkdir_exit:
-	kfree(copy_path);
-	kfree(pc_buf);
+err_free_rsp_buf:
 	free_rsp_buf(resp_buftype, rsp);
+	kfree(pc_buf);
+err_free_req:
+	cifs_small_buf_release(req);
+err_free_path:
+	kfree(utf16_path);
 	return rc;
-
 }
 #endif /* SMB311 */
 
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 57+ messages in thread

* [PATCH AUTOSEL 4.18 093/113] SMB3: Number of requests sent should be displayed for SMB3 not just CIFS
  2018-08-30 18:07 [PATCH AUTOSEL 4.18 067/113] powerpc: Fix size calculation using resource_size() Sasha Levin
                   ` (24 preceding siblings ...)
  2018-08-30 18:08 ` [PATCH AUTOSEL 4.18 092/113] CIFS: fix memory leak and remove dead code Sasha Levin
@ 2018-08-30 18:08 ` Sasha Levin
  2018-08-30 18:08 ` [PATCH AUTOSEL 4.18 094/113] smb3: if server does not support posix do not allow posix mount option Sasha Levin
                   ` (19 subsequent siblings)
  45 siblings, 0 replies; 57+ messages in thread
From: Sasha Levin @ 2018-08-30 18:08 UTC (permalink / raw)
  To: stable@vger.kernel.org; +Cc: Steven French, Sasha Levin

From: Steve French <stfrench@microsoft.com>

[ Upstream commit 289131e1f1e6ad8c661ec05e176b8f0915672059 ]

For SMB2/SMB3 the number of requests sent was not displayed
in /proc/fs/cifs/Stats unless CONFIG_CIFS_STATS2 was
enabled (only number of failed requests displayed). As
with earlier dialects, we should be displaying these
counters if CONFIG_CIFS_STATS is enabled. They
are important for debugging.

e.g. when you cat /proc/fs/cifs/Stats (before the patch)
Resources in use
CIFS Session: 1
Share (unique mount targets): 2
SMB Request/Response Buffer: 1 Pool size: 5
SMB Small Req/Resp Buffer: 1 Pool size: 30
Operations (MIDs): 0

0 session 0 share reconnects
Total vfs operations: 690 maximum at one time: 2

1) \\localhost\test
SMBs: 975
Negotiates: 0 sent 0 failed
SessionSetups: 0 sent 0 failed
Logoffs: 0 sent 0 failed
TreeConnects: 0 sent 0 failed
TreeDisconnects: 0 sent 0 failed
Creates: 0 sent 2 failed
Closes: 0 sent 0 failed
Flushes: 0 sent 0 failed
Reads: 0 sent 0 failed
Writes: 0 sent 0 failed
Locks: 0 sent 0 failed
IOCTLs: 0 sent 1 failed
Cancels: 0 sent 0 failed
Echos: 0 sent 0 failed
QueryDirectories: 0 sent 63 failed

Signed-off-by: Steve French <stfrench@microsoft.com>
Reviewed-by: Aurelien Aptel <aaptel@suse.com>
Reviewed-by: Pavel Shilovsky <pshilov@microsoft.com>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
---
 fs/cifs/smb2pdu.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/cifs/smb2pdu.c b/fs/cifs/smb2pdu.c
index 641fe79708d0..6b17edeb0b74 100644
--- a/fs/cifs/smb2pdu.c
+++ b/fs/cifs/smb2pdu.c
@@ -360,7 +360,7 @@ smb2_plain_req_init(__le16 smb2_command, struct cifs_tcon *tcon,
 		       total_len);
 
 	if (tcon != NULL) {
-#ifdef CONFIG_CIFS_STATS2
+#ifdef CONFIG_CIFS_STATS
 		uint16_t com_code = le16_to_cpu(smb2_command);
 		cifs_stats_inc(&tcon->stats.smb2_stats.smb2_com_sent[com_code]);
 #endif
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 57+ messages in thread

* [PATCH AUTOSEL 4.18 094/113] smb3: if server does not support posix do not allow posix mount option
  2018-08-30 18:07 [PATCH AUTOSEL 4.18 067/113] powerpc: Fix size calculation using resource_size() Sasha Levin
                   ` (25 preceding siblings ...)
  2018-08-30 18:08 ` [PATCH AUTOSEL 4.18 093/113] SMB3: Number of requests sent should be displayed for SMB3 not just CIFS Sasha Levin
@ 2018-08-30 18:08 ` Sasha Levin
  2018-08-30 18:08 ` [PATCH AUTOSEL 4.18 095/113] powerpc/platforms/85xx: fix t1042rdb_diu.c build errors & warning Sasha Levin
                   ` (18 subsequent siblings)
  45 siblings, 0 replies; 57+ messages in thread
From: Sasha Levin @ 2018-08-30 18:08 UTC (permalink / raw)
  To: stable@vger.kernel.org; +Cc: Steven French, Sasha Levin

From: Steve French <stfrench@microsoft.com>

[ Upstream commit 8505c8bfd85a260c9dc5c47e15bd8c5357fcbcd2 ]

If user specifies "posix" on an SMB3.11 mount, then fail the mount
if server does not return the POSIX negotiate context indicating
support for posix.

Signed-off-by: Steve French <stfrench@microsoft.com>
Reviewed-by: Aurelien Aptel <aaptel@suse.com>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
---
 fs/cifs/connect.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c
index 5df2c0698cda..9d02563b2147 100644
--- a/fs/cifs/connect.c
+++ b/fs/cifs/connect.c
@@ -3031,11 +3031,15 @@ cifs_get_tcon(struct cifs_ses *ses, struct smb_vol *volume_info)
 	}
 
 #ifdef CONFIG_CIFS_SMB311
-	if ((volume_info->linux_ext) && (ses->server->posix_ext_supported)) {
-		if (ses->server->vals->protocol_id == SMB311_PROT_ID) {
+	if (volume_info->linux_ext) {
+		if (ses->server->posix_ext_supported) {
 			tcon->posix_extensions = true;
 			printk_once(KERN_WARNING
 				"SMB3.11 POSIX Extensions are experimental\n");
+		} else {
+			cifs_dbg(VFS, "Server does not support mounting with posix SMB3.11 extensions.\n");
+			rc = -EOPNOTSUPP;
+			goto out_fail;
 		}
 	}
 #endif /* 311 */
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 57+ messages in thread

* [PATCH AUTOSEL 4.18 095/113] powerpc/platforms/85xx: fix t1042rdb_diu.c build errors & warning
  2018-08-30 18:07 [PATCH AUTOSEL 4.18 067/113] powerpc: Fix size calculation using resource_size() Sasha Levin
                   ` (26 preceding siblings ...)
  2018-08-30 18:08 ` [PATCH AUTOSEL 4.18 094/113] smb3: if server does not support posix do not allow posix mount option Sasha Levin
@ 2018-08-30 18:08 ` Sasha Levin
  2018-08-30 18:08 ` [PATCH AUTOSEL 4.18 096/113] powerpc/64s: Make rfi_flush_fallback a little more robust Sasha Levin
                   ` (17 subsequent siblings)
  45 siblings, 0 replies; 57+ messages in thread
From: Sasha Levin @ 2018-08-30 18:08 UTC (permalink / raw)
  To: stable@vger.kernel.org
  Cc: Randy Dunlap, Benjamin Herrenschmidt, Paul Mackerras,
	Michael Ellerman, Scott Wood, Kumar Gala,
	linuxppc-dev@lists.ozlabs.org, Sasha Levin

From: Randy Dunlap <rdunlap@infradead.org>

[ Upstream commit f5daf77a55ef0e695cc90c440ed6503073ac5e07 ]

Fix build errors and warnings in t1042rdb_diu.c by adding header files
and MODULE_LICENSE().

../arch/powerpc/platforms/85xx/t1042rdb_diu.c:152:1: warning: data definition has no type or storage class
 early_initcall(t1042rdb_diu_init);
../arch/powerpc/platforms/85xx/t1042rdb_diu.c:152:1: error: type defaults to 'int' in declaration of 'early_initcall' [-Werror=implicit-int]
../arch/powerpc/platforms/85xx/t1042rdb_diu.c:152:1: warning: parameter names (without types) in function declaration

and
WARNING: modpost: missing MODULE_LICENSE() in arch/powerpc/platforms/85xx/t1042rdb_diu.o

Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Michael Ellerman <mpe@ellerman.id.au>
Cc: Scott Wood <oss@buserror.net>
Cc: Kumar Gala <galak@kernel.crashing.org>
Cc: linuxppc-dev@lists.ozlabs.org
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
---
 arch/powerpc/platforms/85xx/t1042rdb_diu.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/arch/powerpc/platforms/85xx/t1042rdb_diu.c b/arch/powerpc/platforms/85xx/t1042rdb_diu.c
index 58fa3d319f1c..dac36ba82fea 100644
--- a/arch/powerpc/platforms/85xx/t1042rdb_diu.c
+++ b/arch/powerpc/platforms/85xx/t1042rdb_diu.c
@@ -9,8 +9,10 @@
  * option) any later version.
  */
 
+#include <linux/init.h>
 #include <linux/io.h>
 #include <linux/kernel.h>
+#include <linux/module.h>
 #include <linux/of.h>
 #include <linux/of_address.h>
 
@@ -150,3 +152,5 @@ static int __init t1042rdb_diu_init(void)
 }
 
 early_initcall(t1042rdb_diu_init);
+
+MODULE_LICENSE("GPL");
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 57+ messages in thread

* [PATCH AUTOSEL 4.18 096/113] powerpc/64s: Make rfi_flush_fallback a little more robust
  2018-08-30 18:07 [PATCH AUTOSEL 4.18 067/113] powerpc: Fix size calculation using resource_size() Sasha Levin
                   ` (27 preceding siblings ...)
  2018-08-30 18:08 ` [PATCH AUTOSEL 4.18 095/113] powerpc/platforms/85xx: fix t1042rdb_diu.c build errors & warning Sasha Levin
@ 2018-08-30 18:08 ` Sasha Levin
  2018-08-30 18:08 ` [PATCH AUTOSEL 4.18 097/113] um: fix parallel building with O= option Sasha Levin
                   ` (16 subsequent siblings)
  45 siblings, 0 replies; 57+ messages in thread
From: Sasha Levin @ 2018-08-30 18:08 UTC (permalink / raw)
  To: stable@vger.kernel.org; +Cc: Michael Ellerman, Sasha Levin

From: Michael Ellerman <mpe@ellerman.id.au>

[ Upstream commit 78ee9946371f5848ddfc88ab1a43867df8f17d83 ]

Because rfi_flush_fallback runs immediately before the return to
userspace it currently runs with the user r1 (stack pointer). This
means if we oops in there we will report a bad kernel stack pointer in
the exception entry path, eg:

  Bad kernel stack pointer 7ffff7150e40 at c0000000000023b4
  Oops: Bad kernel stack pointer, sig: 6 [#1]
  LE SMP NR_CPUS=32 NUMA PowerNV
  Modules linked in:
  CPU: 0 PID: 1246 Comm: klogd Not tainted 4.18.0-rc2-gcc-7.3.1-00175-g0443f8a69ba3 #7
  NIP:  c0000000000023b4 LR: 0000000010053e00 CTR: 0000000000000040
  REGS: c0000000fffe7d40 TRAP: 4100   Not tainted  (4.18.0-rc2-gcc-7.3.1-00175-g0443f8a69ba3)
  MSR:  9000000002803031 <SF,HV,VEC,VSX,FP,ME,IR,DR,LE>  CR: 44000442  XER: 20000000
  CFAR: c00000000000bac8 IRQMASK: c0000000f1e66a80
  GPR00: 0000000002000000 00007ffff7150e40 00007fff93a99900 0000000000000020
  ...
  NIP [c0000000000023b4] rfi_flush_fallback+0x34/0x80
  LR [0000000010053e00] 0x10053e00

Although the NIP tells us where we were, and the TRAP number tells us
what happened, it would still be nicer if we could report the actual
exception rather than barfing about the stack pointer.

We an do that fairly simply by loading the kernel stack pointer on
entry and restoring the user value before returning. That way we see a
regular oops such as:

  Unrecoverable exception 4100 at c00000000000239c
  Oops: Unrecoverable exception, sig: 6 [#1]
  LE SMP NR_CPUS=32 NUMA PowerNV
  Modules linked in:
  CPU: 0 PID: 1251 Comm: klogd Not tainted 4.18.0-rc3-gcc-7.3.1-00097-g4ebfcac65acd-dirty #40
  NIP:  c00000000000239c LR: 0000000010053e00 CTR: 0000000000000040
  REGS: c0000000f1e17bb0 TRAP: 4100   Not tainted  (4.18.0-rc3-gcc-7.3.1-00097-g4ebfcac65acd-dirty)
  MSR:  9000000002803031 <SF,HV,VEC,VSX,FP,ME,IR,DR,LE>  CR: 44000442  XER: 20000000
  CFAR: c00000000000bac8 IRQMASK: 0
  ...
  NIP [c00000000000239c] rfi_flush_fallback+0x3c/0x80
  LR [0000000010053e00] 0x10053e00
  Call Trace:
  [c0000000f1e17e30] [c00000000000b9e4] system_call+0x5c/0x70 (unreliable)

Note this shouldn't make the kernel stack pointer vulnerable to a
meltdown attack, because it should be flushed from the cache before we
return to userspace. The user r1 value will be in the cache, because
we load it in the return path, but that is harmless.

Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Reviewed-by: Nicholas Piggin <npiggin@gmail.com>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
---
 arch/powerpc/kernel/exceptions-64s.S | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/arch/powerpc/kernel/exceptions-64s.S b/arch/powerpc/kernel/exceptions-64s.S
index 285c6465324a..f817342aab8f 100644
--- a/arch/powerpc/kernel/exceptions-64s.S
+++ b/arch/powerpc/kernel/exceptions-64s.S
@@ -1526,6 +1526,8 @@ TRAMP_REAL_BEGIN(stf_barrier_fallback)
 TRAMP_REAL_BEGIN(rfi_flush_fallback)
 	SET_SCRATCH0(r13);
 	GET_PACA(r13);
+	std	r1,PACA_EXRFI+EX_R12(r13)
+	ld	r1,PACAKSAVE(r13)
 	std	r9,PACA_EXRFI+EX_R9(r13)
 	std	r10,PACA_EXRFI+EX_R10(r13)
 	std	r11,PACA_EXRFI+EX_R11(r13)
@@ -1560,12 +1562,15 @@ TRAMP_REAL_BEGIN(rfi_flush_fallback)
 	ld	r9,PACA_EXRFI+EX_R9(r13)
 	ld	r10,PACA_EXRFI+EX_R10(r13)
 	ld	r11,PACA_EXRFI+EX_R11(r13)
+	ld	r1,PACA_EXRFI+EX_R12(r13)
 	GET_SCRATCH0(r13);
 	rfid
 
 TRAMP_REAL_BEGIN(hrfi_flush_fallback)
 	SET_SCRATCH0(r13);
 	GET_PACA(r13);
+	std	r1,PACA_EXRFI+EX_R12(r13)
+	ld	r1,PACAKSAVE(r13)
 	std	r9,PACA_EXRFI+EX_R9(r13)
 	std	r10,PACA_EXRFI+EX_R10(r13)
 	std	r11,PACA_EXRFI+EX_R11(r13)
@@ -1600,6 +1605,7 @@ TRAMP_REAL_BEGIN(hrfi_flush_fallback)
 	ld	r9,PACA_EXRFI+EX_R9(r13)
 	ld	r10,PACA_EXRFI+EX_R10(r13)
 	ld	r11,PACA_EXRFI+EX_R11(r13)
+	ld	r1,PACA_EXRFI+EX_R12(r13)
 	GET_SCRATCH0(r13);
 	hrfid
 
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 57+ messages in thread

* [PATCH AUTOSEL 4.18 097/113] um: fix parallel building with O= option
  2018-08-30 18:07 [PATCH AUTOSEL 4.18 067/113] powerpc: Fix size calculation using resource_size() Sasha Levin
                   ` (28 preceding siblings ...)
  2018-08-30 18:08 ` [PATCH AUTOSEL 4.18 096/113] powerpc/64s: Make rfi_flush_fallback a little more robust Sasha Levin
@ 2018-08-30 18:08 ` Sasha Levin
  2018-08-30 18:08 ` [PATCH AUTOSEL 4.18 098/113] powerpc/pseries: Avoid using the size greater than RTAS_ERROR_LOG_MAX Sasha Levin
                   ` (15 subsequent siblings)
  45 siblings, 0 replies; 57+ messages in thread
From: Sasha Levin @ 2018-08-30 18:08 UTC (permalink / raw)
  To: stable@vger.kernel.org; +Cc: Masahiro Yamada, Sasha Levin

From: Masahiro Yamada <yamada.masahiro@socionext.com>

[ Upstream commit 13d3d01e26b942ada7cfced68ccb6db49597874a ]

Randy Dunlap reports UML occasionally fails to build with -j<N> and
O=<builddir> options.

  make[1]: Entering directory '/home/rdunlap/mmotm-2018-0802-1529/UM64'
    UPD     include/generated/uapi/linux/version.h
    WRAP    arch/x86/include/generated/asm/dma-contiguous.h
    WRAP    arch/x86/include/generated/asm/export.h
    WRAP    arch/x86/include/generated/asm/early_ioremap.h
    WRAP    arch/x86/include/generated/asm/mcs_spinlock.h
    WRAP    arch/x86/include/generated/asm/mm-arch-hooks.h
    WRAP    arch/x86/include/generated/uapi/asm/bpf_perf_event.h
    WRAP    arch/x86/include/generated/uapi/asm/poll.h
    GEN     ./Makefile
  make[2]: *** No rule to make target 'archheaders'.  Stop.
  arch/um/Makefile:119: recipe for target 'archheaders' failed
  make[1]: *** [archheaders] Error 2
  make[1]: *** Waiting for unfinished jobs....
    UPD     include/config/kernel.release
  make[1]: *** wait: No child processes.  Stop.
  Makefile:146: recipe for target 'sub-make' failed
  make: *** [sub-make] Error 2

The cause of the problem is the use of '$(MAKE) KBUILD_SRC=',
which recurses to the top Makefile via the $(objtree)/Makefile
generated by scripts/mkmakefile.

When you run "make -j<N> O=<builddir> ARCH=um", Make can execute
'archheaders' and 'outputmakefile' targets simultaneously because
there is no dependency between them.

If it happens,

  $(Q)$(MAKE) KBUILD_SRC= ARCH=$(HEADER_ARCH) archheaders

... tries to run $(objtree)/Makefile that is being updated.

The correct way for the recursion is

  $(Q)$(MAKE) -f $(srctree)/Makefile ARCH=$(HEADER_ARCH) archheaders

..., which does not rely on the generated Makefile.

Reported-by: Randy Dunlap <rdunlap@infradead.org>
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Tested-by: Randy Dunlap <rdunlap@infradead.org>
Acked-by: Richard Weinberger <richard@nod.at>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
---
 arch/um/Makefile | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/arch/um/Makefile b/arch/um/Makefile
index e54dda8a0363..de340e41f3b2 100644
--- a/arch/um/Makefile
+++ b/arch/um/Makefile
@@ -122,8 +122,7 @@ archheaders:
 	$(Q)$(MAKE) -f $(srctree)/scripts/Makefile.asm-generic \
 	            kbuild-file=$(HOST_DIR)/include/uapi/asm/Kbuild \
 		    obj=$(HOST_DIR)/include/generated/uapi/asm
-	$(Q)$(MAKE) KBUILD_SRC= ARCH=$(HEADER_ARCH) archheaders
-
+	$(Q)$(MAKE) -f $(srctree)/Makefile ARCH=$(HEADER_ARCH) archheaders
 
 archprepare: include/generated/user_constants.h
 
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 57+ messages in thread

* [PATCH AUTOSEL 4.18 098/113] powerpc/pseries: Avoid using the size greater than RTAS_ERROR_LOG_MAX.
  2018-08-30 18:07 [PATCH AUTOSEL 4.18 067/113] powerpc: Fix size calculation using resource_size() Sasha Levin
                   ` (29 preceding siblings ...)
  2018-08-30 18:08 ` [PATCH AUTOSEL 4.18 097/113] um: fix parallel building with O= option Sasha Levin
@ 2018-08-30 18:08 ` Sasha Levin
  2018-08-30 18:08 ` [PATCH AUTOSEL 4.18 099/113] clk: rockchip: Add pclk_rkpwm_pmu to PMU critical clocks in rk3399 Sasha Levin
                   ` (14 subsequent siblings)
  45 siblings, 0 replies; 57+ messages in thread
From: Sasha Levin @ 2018-08-30 18:08 UTC (permalink / raw)
  To: stable@vger.kernel.org; +Cc: Mahesh Salgaonkar, Michael Ellerman, Sasha Levin

From: Mahesh Salgaonkar <mahesh@linux.vnet.ibm.com>

[ Upstream commit 74e96bf44f430cf7a01de19ba6cf49b361cdfd6e ]

The global mce data buffer that used to copy rtas error log is of 2048
(RTAS_ERROR_LOG_MAX) bytes in size. Before the copy we read
extended_log_length from rtas error log header, then use max of
extended_log_length and RTAS_ERROR_LOG_MAX as a size of data to be copied.
Ideally the platform (phyp) will never send extended error log with
size > 2048. But if that happens, then we have a risk of buffer overrun
and corruption. Fix this by using min_t instead.

Fixes: d368514c3097 ("powerpc: Fix corruption when grabbing FWNMI data")
Reported-by: Michal Suchanek <msuchanek@suse.com>
Signed-off-by: Mahesh Salgaonkar <mahesh@linux.vnet.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
---
 arch/powerpc/platforms/pseries/ras.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/powerpc/platforms/pseries/ras.c b/arch/powerpc/platforms/pseries/ras.c
index 5e1ef9150182..ef104144d4bc 100644
--- a/arch/powerpc/platforms/pseries/ras.c
+++ b/arch/powerpc/platforms/pseries/ras.c
@@ -371,7 +371,7 @@ static struct rtas_error_log *fwnmi_get_errinfo(struct pt_regs *regs)
 		int len, error_log_length;
 
 		error_log_length = 8 + rtas_error_extended_log_length(h);
-		len = max_t(int, error_log_length, RTAS_ERROR_LOG_MAX);
+		len = min_t(int, error_log_length, RTAS_ERROR_LOG_MAX);
 		memset(global_mce_data_buf, 0, RTAS_ERROR_LOG_MAX);
 		memcpy(global_mce_data_buf, h, len);
 		errhdr = (struct rtas_error_log *)global_mce_data_buf;
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 57+ messages in thread

* [PATCH AUTOSEL 4.18 099/113] clk: rockchip: Add pclk_rkpwm_pmu to PMU critical clocks in rk3399
  2018-08-30 18:07 [PATCH AUTOSEL 4.18 067/113] powerpc: Fix size calculation using resource_size() Sasha Levin
                   ` (30 preceding siblings ...)
  2018-08-30 18:08 ` [PATCH AUTOSEL 4.18 098/113] powerpc/pseries: Avoid using the size greater than RTAS_ERROR_LOG_MAX Sasha Levin
@ 2018-08-30 18:08 ` Sasha Levin
  2018-08-30 18:08 ` [PATCH AUTOSEL 4.18 100/113] drm/amd/display: Read back max backlight value at boot Sasha Levin
                   ` (13 subsequent siblings)
  45 siblings, 0 replies; 57+ messages in thread
From: Sasha Levin @ 2018-08-30 18:08 UTC (permalink / raw)
  To: stable@vger.kernel.org; +Cc: Levin Du, Heiko Stuebner, Sasha Levin

From: Levin Du <djw@t-chip.com.cn>

[ Upstream commit 640332d1a089909df08bc9f3e42888a2019c66e2 ]

PWM2 is commonly used to control voltage of PWM regulator of VDD_LOG in
RK3399. On the Firefly-RK3399 board, PWM2 outputs 40 KHz square wave
from power on and the VDD_LOG is about 0.9V. When the kernel boots
normally into the system, the PWM2 keeps outputing PWM signal.

But the kernel hangs randomly after "Starting kernel ..." line on that
board. When it happens, PWM2 outputs high level which causes VDD_LOG
drops to 0.4V below the normal operating voltage.

By adding "pclk_rkpwm_pmu" to the rk3399_pmucru_critical_clocks array,
PWM clock is ensured to be prepared at startup and the PWM2 output is
normal. After repeated tests, the early boot hang is gone.

This patch works on both Firefly-RK3399 and ROC-RK3399-PC boards.

Signed-off-by: Levin Du <djw@t-chip.com.cn>
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
---
 drivers/clk/rockchip/clk-rk3399.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/clk/rockchip/clk-rk3399.c b/drivers/clk/rockchip/clk-rk3399.c
index bca10d618f0a..118759d2f7d2 100644
--- a/drivers/clk/rockchip/clk-rk3399.c
+++ b/drivers/clk/rockchip/clk-rk3399.c
@@ -1523,6 +1523,7 @@ static const char *const rk3399_pmucru_critical_clocks[] __initconst = {
 	"pclk_pmu_src",
 	"fclk_cm0s_src_pmu",
 	"clk_timer_src_pmu",
+	"pclk_rkpwm_pmu",
 };
 
 static void __init rk3399_clk_init(struct device_node *np)
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 57+ messages in thread

* [PATCH AUTOSEL 4.18 100/113] drm/amd/display: Read back max backlight value at boot
  2018-08-30 18:07 [PATCH AUTOSEL 4.18 067/113] powerpc: Fix size calculation using resource_size() Sasha Levin
                   ` (31 preceding siblings ...)
  2018-08-30 18:08 ` [PATCH AUTOSEL 4.18 099/113] clk: rockchip: Add pclk_rkpwm_pmu to PMU critical clocks in rk3399 Sasha Levin
@ 2018-08-30 18:08 ` Sasha Levin
  2018-08-30 18:08 ` [PATCH AUTOSEL 4.18 101/113] KVM: vmx: track host_state.loaded using a loaded_vmcs pointer Sasha Levin
                   ` (12 subsequent siblings)
  45 siblings, 0 replies; 57+ messages in thread
From: Sasha Levin @ 2018-08-30 18:08 UTC (permalink / raw)
  To: stable@vger.kernel.org; +Cc: David Francis, Alex Deucher, Sasha Levin

From: David Francis <David.Francis@amd.com>

[ Upstream commit 53a53f8687faf492df2644d8c18ff0217fc18730 ]

[Why]
If there is no program explicitly setting the backlight
brightness (for example, during a minimal install of linux), the
hardware defaults to maximum brightness but the backlight_device
defaults to 0 value.  Thus, settings displays the wrong brightness
value.

[How]
When creating the backlight device, set brightness to max

Signed-off-by: David Francis <David.Francis@amd.com>
Reviewed-by: Harry Wentland <Harry.Wentland@amd.com>
Acked-by: Bhawanpreet Lakha <Bhawanpreet.Lakha@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
---
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
index 770c6b24be0b..a1d90331a903 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
@@ -1334,6 +1334,7 @@ amdgpu_dm_register_backlight_device(struct amdgpu_display_manager *dm)
 	struct backlight_properties props = { 0 };
 
 	props.max_brightness = AMDGPU_MAX_BL_LEVEL;
+	props.brightness = AMDGPU_MAX_BL_LEVEL;
 	props.type = BACKLIGHT_RAW;
 
 	snprintf(bl_name, sizeof(bl_name), "amdgpu_bl%d",
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 57+ messages in thread

* [PATCH AUTOSEL 4.18 101/113] KVM: vmx: track host_state.loaded using a loaded_vmcs pointer
  2018-08-30 18:07 [PATCH AUTOSEL 4.18 067/113] powerpc: Fix size calculation using resource_size() Sasha Levin
                   ` (32 preceding siblings ...)
  2018-08-30 18:08 ` [PATCH AUTOSEL 4.18 100/113] drm/amd/display: Read back max backlight value at boot Sasha Levin
@ 2018-08-30 18:08 ` Sasha Levin
  2018-08-30 18:08 ` [PATCH AUTOSEL 4.18 102/113] kvm: nVMX: Fix fault vector for VMX operation at CPL > 0 Sasha Levin
                   ` (11 subsequent siblings)
  45 siblings, 0 replies; 57+ messages in thread
From: Sasha Levin @ 2018-08-30 18:08 UTC (permalink / raw)
  To: stable@vger.kernel.org; +Cc: Sean Christopherson, Paolo Bonzini, Sasha Levin

From: Sean Christopherson <sean.j.christopherson@intel.com>

[ Upstream commit bd9966de4e14fb559e89a06f7f5c9aab2cc028b9 ]

Using 'struct loaded_vmcs*' to track whether the CPU registers
contain host or guest state kills two birds with one stone.

  1. The (effective) boolean host_state.loaded is poorly named.
     It does not track whether or not host state is loaded into
     the CPU registers (which most readers would expect), but
     rather tracks if host state has been saved AND guest state
     is loaded.

  2. Using a loaded_vmcs pointer provides a more robust framework
     for the optimized guest/host state switching, especially when
     consideration per-VMCS enhancements.  To that end, WARN_ONCE
     if we try to switch to host state with a different VMCS than
     was last used to save host state.

Resolve an occurrence of the new WARN by setting loaded_vmcs after
the call to vmx_vcpu_put() in vmx_switch_vmcs().

Signed-off-by: Sean Christopherson <sean.j.christopherson@intel.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
---
 arch/x86/kvm/vmx.c | 22 +++++++++++++++-------
 1 file changed, 15 insertions(+), 7 deletions(-)

diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c
index 46b428c0990e..845c67d71c29 100644
--- a/arch/x86/kvm/vmx.c
+++ b/arch/x86/kvm/vmx.c
@@ -933,17 +933,21 @@ struct vcpu_vmx {
 	/*
 	 * loaded_vmcs points to the VMCS currently used in this vcpu. For a
 	 * non-nested (L1) guest, it always points to vmcs01. For a nested
-	 * guest (L2), it points to a different VMCS.
+	 * guest (L2), it points to a different VMCS.  loaded_cpu_state points
+	 * to the VMCS whose state is loaded into the CPU registers that only
+	 * need to be switched when transitioning to/from the kernel; a NULL
+	 * value indicates that host state is loaded.
 	 */
 	struct loaded_vmcs    vmcs01;
 	struct loaded_vmcs   *loaded_vmcs;
+	struct loaded_vmcs   *loaded_cpu_state;
 	bool                  __launched; /* temporary, used in vmx_vcpu_run */
 	struct msr_autoload {
 		struct vmx_msrs guest;
 		struct vmx_msrs host;
 	} msr_autoload;
+
 	struct {
-		int           loaded;
 		u16           fs_sel, gs_sel, ldt_sel;
 #ifdef CONFIG_X86_64
 		u16           ds_sel, es_sel;
@@ -2744,10 +2748,11 @@ static void vmx_save_host_state(struct kvm_vcpu *vcpu)
 #endif
 	int i;
 
-	if (vmx->host_state.loaded)
+	if (vmx->loaded_cpu_state)
 		return;
 
-	vmx->host_state.loaded = 1;
+	vmx->loaded_cpu_state = vmx->loaded_vmcs;
+
 	/*
 	 * Set host fs and gs selectors.  Unfortunately, 22.2.3 does not
 	 * allow segment selectors with cpl > 0 or ti == 1.
@@ -2809,11 +2814,14 @@ static void vmx_save_host_state(struct kvm_vcpu *vcpu)
 
 static void __vmx_load_host_state(struct vcpu_vmx *vmx)
 {
-	if (!vmx->host_state.loaded)
+	if (!vmx->loaded_cpu_state)
 		return;
 
+	WARN_ON_ONCE(vmx->loaded_cpu_state != vmx->loaded_vmcs);
+
 	++vmx->vcpu.stat.host_state_reload;
-	vmx->host_state.loaded = 0;
+	vmx->loaded_cpu_state = NULL;
+
 #ifdef CONFIG_X86_64
 	if (is_long_mode(&vmx->vcpu))
 		rdmsrl(MSR_KERNEL_GS_BASE, vmx->msr_guest_kernel_gs_base);
@@ -10511,8 +10519,8 @@ static void vmx_switch_vmcs(struct kvm_vcpu *vcpu, struct loaded_vmcs *vmcs)
 		return;
 
 	cpu = get_cpu();
-	vmx->loaded_vmcs = vmcs;
 	vmx_vcpu_put(vcpu);
+	vmx->loaded_vmcs = vmcs;
 	vmx_vcpu_load(vcpu, cpu);
 	put_cpu();
 }
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 57+ messages in thread

* [PATCH AUTOSEL 4.18 102/113] kvm: nVMX: Fix fault vector for VMX operation at CPL > 0
  2018-08-30 18:07 [PATCH AUTOSEL 4.18 067/113] powerpc: Fix size calculation using resource_size() Sasha Levin
                   ` (33 preceding siblings ...)
  2018-08-30 18:08 ` [PATCH AUTOSEL 4.18 101/113] KVM: vmx: track host_state.loaded using a loaded_vmcs pointer Sasha Levin
@ 2018-08-30 18:08 ` Sasha Levin
  2018-08-30 18:08 ` [PATCH AUTOSEL 4.18 103/113] drm/etnaviv: fix crash in GPU suspend when init failed due to buffer placement Sasha Levin
                   ` (10 subsequent siblings)
  45 siblings, 0 replies; 57+ messages in thread
From: Sasha Levin @ 2018-08-30 18:08 UTC (permalink / raw)
  To: stable@vger.kernel.org; +Cc: Jim Mattson, Paolo Bonzini, Sasha Levin

From: Jim Mattson <jmattson@google.com>

[ Upstream commit 36090bf43a6b835a42f515cb515ff6fa293a25fe ]

The fault that should be raised for a privilege level violation is #GP
rather than #UD.

Fixes: 727ba748e110b4 ("kvm: nVMX: Enforce cpl=0 for VMX instructions")
Signed-off-by: Jim Mattson <jmattson@google.com>
Reviewed-by: David Hildenbrand <david@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
---
 arch/x86/kvm/vmx.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c
index 845c67d71c29..6c5d2d5f7a15 100644
--- a/arch/x86/kvm/vmx.c
+++ b/arch/x86/kvm/vmx.c
@@ -8117,7 +8117,7 @@ static int handle_vmon(struct kvm_vcpu *vcpu)
 
 	/* CPL=0 must be checked manually. */
 	if (vmx_get_cpl(vcpu)) {
-		kvm_queue_exception(vcpu, UD_VECTOR);
+		kvm_inject_gp(vcpu, 0);
 		return 1;
 	}
 
@@ -8181,7 +8181,7 @@ static int handle_vmon(struct kvm_vcpu *vcpu)
 static int nested_vmx_check_permission(struct kvm_vcpu *vcpu)
 {
 	if (vmx_get_cpl(vcpu)) {
-		kvm_queue_exception(vcpu, UD_VECTOR);
+		kvm_inject_gp(vcpu, 0);
 		return 0;
 	}
 
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 57+ messages in thread

* [PATCH AUTOSEL 4.18 103/113] drm/etnaviv: fix crash in GPU suspend when init failed due to buffer placement
  2018-08-30 18:07 [PATCH AUTOSEL 4.18 067/113] powerpc: Fix size calculation using resource_size() Sasha Levin
                   ` (34 preceding siblings ...)
  2018-08-30 18:08 ` [PATCH AUTOSEL 4.18 102/113] kvm: nVMX: Fix fault vector for VMX operation at CPL > 0 Sasha Levin
@ 2018-08-30 18:08 ` Sasha Levin
  2018-08-30 18:08 ` [PATCH AUTOSEL 4.18 104/113] btrfs: Exit gracefully when chunk map cannot be inserted to the tree Sasha Levin
                   ` (9 subsequent siblings)
  45 siblings, 0 replies; 57+ messages in thread
From: Sasha Levin @ 2018-08-30 18:08 UTC (permalink / raw)
  To: stable@vger.kernel.org; +Cc: Lucas Stach, Sasha Levin

From: Lucas Stach <l.stach@pengutronix.de>

[ Upstream commit 5b147465532365dc4e2fee8499d6ca1f52dd0d16 ]

When the suballocator was unable to provide a suitable buffer for the MMUv1
linear window, we roll back the GPU initialization. As the GPU is runtime
resumed at that point we need to clear the kernel cmdbuf suballoc entry to
properly skip any attempt to manipulate the cmdbuf when the GPU gets shut
down in the runtime suspend later on.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
---
 drivers/gpu/drm/etnaviv/etnaviv_gpu.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/gpu/drm/etnaviv/etnaviv_gpu.c b/drivers/gpu/drm/etnaviv/etnaviv_gpu.c
index 686f6552db48..3ef440b235e5 100644
--- a/drivers/gpu/drm/etnaviv/etnaviv_gpu.c
+++ b/drivers/gpu/drm/etnaviv/etnaviv_gpu.c
@@ -799,6 +799,7 @@ int etnaviv_gpu_init(struct etnaviv_gpu *gpu)
 
 free_buffer:
 	etnaviv_cmdbuf_free(&gpu->buffer);
+	gpu->buffer.suballoc = NULL;
 destroy_iommu:
 	etnaviv_iommu_destroy(gpu->mmu);
 	gpu->mmu = NULL;
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 57+ messages in thread

* [PATCH AUTOSEL 4.18 104/113] btrfs: Exit gracefully when chunk map cannot be inserted to the tree
  2018-08-30 18:07 [PATCH AUTOSEL 4.18 067/113] powerpc: Fix size calculation using resource_size() Sasha Levin
                   ` (35 preceding siblings ...)
  2018-08-30 18:08 ` [PATCH AUTOSEL 4.18 103/113] drm/etnaviv: fix crash in GPU suspend when init failed due to buffer placement Sasha Levin
@ 2018-08-30 18:08 ` Sasha Levin
  2018-08-30 18:08 ` [PATCH AUTOSEL 4.18 105/113] btrfs: replace: Reset on-disk dev stats value after replace Sasha Levin
                   ` (8 subsequent siblings)
  45 siblings, 0 replies; 57+ messages in thread
From: Sasha Levin @ 2018-08-30 18:08 UTC (permalink / raw)
  To: stable@vger.kernel.org; +Cc: Qu Wenruo, David Sterba, Sasha Levin

From: Qu Wenruo <wqu@suse.com>

[ Upstream commit 64f64f43c89aca1782aa672e0586f6903c5d8979 ]

It's entirely possible that a crafted btrfs image contains overlapping
chunks.

Although we can't detect such problem by tree-checker, it's not a
catastrophic problem, current extent map can already detect such problem
and return -EEXIST.

We just only need to exit gracefully and fail the mount.

Reported-by: Xu Wen <wen.xu@gatech.edu>
Link: https://bugzilla.kernel.org/show_bug.cgi?id=200409
Signed-off-by: Qu Wenruo <wqu@suse.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
---
 fs/btrfs/volumes.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c
index 1da162928d1a..93765f17a454 100644
--- a/fs/btrfs/volumes.c
+++ b/fs/btrfs/volumes.c
@@ -6563,10 +6563,14 @@ static int read_one_chunk(struct btrfs_fs_info *fs_info, struct btrfs_key *key,
 	write_lock(&map_tree->map_tree.lock);
 	ret = add_extent_mapping(&map_tree->map_tree, em, 0);
 	write_unlock(&map_tree->map_tree.lock);
-	BUG_ON(ret); /* Tree corruption */
+	if (ret < 0) {
+		btrfs_err(fs_info,
+			  "failed to add chunk map, start=%llu len=%llu: %d",
+			  em->start, em->len, ret);
+	}
 	free_extent_map(em);
 
-	return 0;
+	return ret;
 }
 
 static void fill_device_from_item(struct extent_buffer *leaf,
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 57+ messages in thread

* [PATCH AUTOSEL 4.18 105/113] btrfs: replace: Reset on-disk dev stats value after replace
  2018-08-30 18:07 [PATCH AUTOSEL 4.18 067/113] powerpc: Fix size calculation using resource_size() Sasha Levin
                   ` (36 preceding siblings ...)
  2018-08-30 18:08 ` [PATCH AUTOSEL 4.18 104/113] btrfs: Exit gracefully when chunk map cannot be inserted to the tree Sasha Levin
@ 2018-08-30 18:08 ` Sasha Levin
  2018-08-30 18:08 ` [PATCH AUTOSEL 4.18 106/113] btrfs: fix in-memory value of total_devices after seed device deletion Sasha Levin
                   ` (7 subsequent siblings)
  45 siblings, 0 replies; 57+ messages in thread
From: Sasha Levin @ 2018-08-30 18:08 UTC (permalink / raw)
  To: stable@vger.kernel.org; +Cc: Misono Tomohiro, David Sterba, Sasha Levin

From: Misono Tomohiro <misono.tomohiro@jp.fujitsu.com>

[ Upstream commit 1e7e1f9e3aba00c9b9c323bfeeddafe69ff21ff6 ]

on-disk devs stats value is updated in btrfs_run_dev_stats(),
which is called during commit transaction, if device->dev_stats_ccnt
is not zero.

Since current replace operation does not touch dev_stats_ccnt,
on-disk dev stats value is not updated. Therefore "btrfs device stats"
may return old device's value after umount/mount
(Example: See "btrfs ins dump-t -t DEV $DEV" after btrfs/100 finish).

Fix this by just incrementing dev_stats_ccnt in
btrfs_dev_replace_finishing() when replace is succeeded and this will
update the values.

Signed-off-by: Misono Tomohiro <misono.tomohiro@jp.fujitsu.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
---
 fs/btrfs/dev-replace.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/fs/btrfs/dev-replace.c b/fs/btrfs/dev-replace.c
index e2ba0419297a..d20b244623f2 100644
--- a/fs/btrfs/dev-replace.c
+++ b/fs/btrfs/dev-replace.c
@@ -676,6 +676,12 @@ static int btrfs_dev_replace_finishing(struct btrfs_fs_info *fs_info,
 
 	btrfs_rm_dev_replace_unblocked(fs_info);
 
+	/*
+	 * Increment dev_stats_ccnt so that btrfs_run_dev_stats() will
+	 * update on-disk dev stats value during commit transaction
+	 */
+	atomic_inc(&tgt_device->dev_stats_ccnt);
+
 	/*
 	 * this is again a consistent state where no dev_replace procedure
 	 * is running, the target device is part of the filesystem, the
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 57+ messages in thread

* [PATCH AUTOSEL 4.18 106/113] btrfs: fix in-memory value of total_devices after seed device deletion
  2018-08-30 18:07 [PATCH AUTOSEL 4.18 067/113] powerpc: Fix size calculation using resource_size() Sasha Levin
                   ` (37 preceding siblings ...)
  2018-08-30 18:08 ` [PATCH AUTOSEL 4.18 105/113] btrfs: replace: Reset on-disk dev stats value after replace Sasha Levin
@ 2018-08-30 18:08 ` Sasha Levin
  2018-08-30 18:08 ` [PATCH AUTOSEL 4.18 107/113] btrfs: Rewrite retry logic in do_chunk_alloc Sasha Levin
                   ` (6 subsequent siblings)
  45 siblings, 0 replies; 57+ messages in thread
From: Sasha Levin @ 2018-08-30 18:08 UTC (permalink / raw)
  To: stable@vger.kernel.org; +Cc: Anand Jain, David Sterba, Sasha Levin

From: Anand Jain <anand.jain@oracle.com>

[ Upstream commit b4993e64f78a9605b45252fa9ba385c88a1f4ce9 ]

In case of deleting the seed device the %cur_devices (seed) and the
%fs_devices (parent) are different. Now, as the parent
fs_devices::total_devices also maintains the total number of devices
including the seed device, so decrement its in-memory value for the
successful seed delete. We are already updating its corresponding
on-disk btrfs_super_block::number_devices value.

Signed-off-by: Anand Jain <anand.jain@oracle.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
---
 fs/btrfs/volumes.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c
index 93765f17a454..fca57c1f077c 100644
--- a/fs/btrfs/volumes.c
+++ b/fs/btrfs/volumes.c
@@ -2029,6 +2029,9 @@ int btrfs_rm_device(struct btrfs_fs_info *fs_info, const char *device_path,
 
 	cur_devices->num_devices--;
 	cur_devices->total_devices--;
+	/* Update total_devices of the parent fs_devices if it's seed */
+	if (cur_devices != fs_devices)
+		fs_devices->total_devices--;
 
 	if (test_bit(BTRFS_DEV_STATE_MISSING, &device->dev_state))
 		cur_devices->missing_devices--;
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 57+ messages in thread

* [PATCH AUTOSEL 4.18 107/113] btrfs: Rewrite retry logic in do_chunk_alloc
  2018-08-30 18:07 [PATCH AUTOSEL 4.18 067/113] powerpc: Fix size calculation using resource_size() Sasha Levin
                   ` (38 preceding siblings ...)
  2018-08-30 18:08 ` [PATCH AUTOSEL 4.18 106/113] btrfs: fix in-memory value of total_devices after seed device deletion Sasha Levin
@ 2018-08-30 18:08 ` Sasha Levin
  2018-09-05  9:22   ` David Sterba
  2018-08-30 18:08 ` [PATCH AUTOSEL 4.18 108/113] btrfs: relocation: Only remove reloc rb_trees if reloc control has been initialized Sasha Levin
                   ` (5 subsequent siblings)
  45 siblings, 1 reply; 57+ messages in thread
From: Sasha Levin @ 2018-08-30 18:08 UTC (permalink / raw)
  To: stable@vger.kernel.org; +Cc: Nikolay Borisov, David Sterba, Sasha Levin

From: Nikolay Borisov <nborisov@suse.com>

[ Upstream commit 2556fbb0bead7929ddf67f8b4184f434cee4e7d7 ]

do_chunk_alloc implements logic to detect whether there is currently
pending chunk allocation (by means of space_info->chunk_alloc being
set) and if so it loops around to the 'again' label. Additionally,
based on the state of the space_info (e.g. whether it's full or not)
and the return value of should_alloc_chunk() it decides whether this
is a "hard" error (ENOSPC) or we can just return 0.

This patch refactors all of this:

1. Put order to the scattered ifs handling the various cases in an
easy-to-read if {} else if{} branches. This makes clear the various
cases we are interested in handling.

2. Call should_alloc_chunk only once and use the result in the
if/else if constructs. All of this is done under space_info->lock, so
even before multiple calls of should_alloc_chunk were unnecessary.

3. Rewrite the "do {} while()" loop currently implemented via label
into an explicit loop construct.

4. Move the mutex locking for the case where the caller is the one doing
the allocation. For the case where the caller needs to wait a concurrent
allocation, introduce a pair of mutex_lock/mutex_unlock to act as a
barrier and reword the comment.

5. Switch local vars to bool type where pertinent.

All in all this shouldn't introduce any functional changes.

Signed-off-by: Nikolay Borisov <nborisov@suse.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
---
 fs/btrfs/extent-tree.c | 74 +++++++++++++++++++++---------------------
 1 file changed, 37 insertions(+), 37 deletions(-)

diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c
index 3d9fe58c0080..f7a96f7871b7 100644
--- a/fs/btrfs/extent-tree.c
+++ b/fs/btrfs/extent-tree.c
@@ -4577,7 +4577,8 @@ static int do_chunk_alloc(struct btrfs_trans_handle *trans,
 			  struct btrfs_fs_info *fs_info, u64 flags, int force)
 {
 	struct btrfs_space_info *space_info;
-	int wait_for_alloc = 0;
+	bool wait_for_alloc = false;
+	bool should_alloc = false;
 	int ret = 0;
 
 	/* Don't re-enter if we're already allocating a chunk */
@@ -4587,45 +4588,44 @@ static int do_chunk_alloc(struct btrfs_trans_handle *trans,
 	space_info = __find_space_info(fs_info, flags);
 	ASSERT(space_info);
 
-again:
-	spin_lock(&space_info->lock);
-	if (force < space_info->force_alloc)
-		force = space_info->force_alloc;
-	if (space_info->full) {
-		if (should_alloc_chunk(fs_info, space_info, force))
-			ret = -ENOSPC;
-		else
-			ret = 0;
-		spin_unlock(&space_info->lock);
-		return ret;
-	}
-
-	if (!should_alloc_chunk(fs_info, space_info, force)) {
-		spin_unlock(&space_info->lock);
-		return 0;
-	} else if (space_info->chunk_alloc) {
-		wait_for_alloc = 1;
-	} else {
-		space_info->chunk_alloc = 1;
-	}
-
-	spin_unlock(&space_info->lock);
-
-	mutex_lock(&fs_info->chunk_mutex);
+	do {
+		spin_lock(&space_info->lock);
+		if (force < space_info->force_alloc)
+			force = space_info->force_alloc;
+		should_alloc = should_alloc_chunk(fs_info, space_info, force);
+		if (space_info->full) {
+			/* No more free physical space */
+			if (should_alloc)
+				ret = -ENOSPC;
+			else
+				ret = 0;
+			spin_unlock(&space_info->lock);
+			return ret;
+		} else if (!should_alloc) {
+			spin_unlock(&space_info->lock);
+			return 0;
+		} else if (space_info->chunk_alloc) {
+			/*
+			 * Someone is already allocating, so we need to block
+			 * until this someone is finished and then loop to
+			 * recheck if we should continue with our allocation
+			 * attempt.
+			 */
+			wait_for_alloc = true;
+			spin_unlock(&space_info->lock);
+			mutex_lock(&fs_info->chunk_mutex);
+			mutex_unlock(&fs_info->chunk_mutex);
+		} else {
+			/* Proceed with allocation */
+			space_info->chunk_alloc = 1;
+			wait_for_alloc = false;
+			spin_unlock(&space_info->lock);
+		}
 
-	/*
-	 * The chunk_mutex is held throughout the entirety of a chunk
-	 * allocation, so once we've acquired the chunk_mutex we know that the
-	 * other guy is done and we need to recheck and see if we should
-	 * allocate.
-	 */
-	if (wait_for_alloc) {
-		mutex_unlock(&fs_info->chunk_mutex);
-		wait_for_alloc = 0;
 		cond_resched();
-		goto again;
-	}
+	} while (wait_for_alloc);
 
+	mutex_lock(&fs_info->chunk_mutex);
 	trans->allocating_chunk = true;
 
 	/*
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 57+ messages in thread

* [PATCH AUTOSEL 4.18 108/113] btrfs: relocation: Only remove reloc rb_trees if reloc control has been initialized
  2018-08-30 18:07 [PATCH AUTOSEL 4.18 067/113] powerpc: Fix size calculation using resource_size() Sasha Levin
                   ` (39 preceding siblings ...)
  2018-08-30 18:08 ` [PATCH AUTOSEL 4.18 107/113] btrfs: Rewrite retry logic in do_chunk_alloc Sasha Levin
@ 2018-08-30 18:08 ` Sasha Levin
  2018-08-30 18:08 ` [PATCH AUTOSEL 4.18 109/113] btrfs: tree-checker: Detect invalid and empty essential trees Sasha Levin
                   ` (4 subsequent siblings)
  45 siblings, 0 replies; 57+ messages in thread
From: Sasha Levin @ 2018-08-30 18:08 UTC (permalink / raw)
  To: stable@vger.kernel.org; +Cc: Qu Wenruo, David Sterba, Sasha Levin

From: Qu Wenruo <wqu@suse.com>

[ Upstream commit 389305b2aa68723c754f88d9dbd268a400e10664 ]

Invalid reloc tree can cause kernel NULL pointer dereference when btrfs
does some cleanup of the reloc roots.

It turns out that fs_info::reloc_ctl can be NULL in
btrfs_recover_relocation() as we allocate relocation control after all
reloc roots have been verified.
So when we hit: note, we haven't called set_reloc_control() thus
fs_info::reloc_ctl is still NULL.

Link: https://bugzilla.kernel.org/show_bug.cgi?id=199833
Reported-by: Xu Wen <wen.xu@gatech.edu>
Signed-off-by: Qu Wenruo <wqu@suse.com>
Tested-by: Gu Jinxiang <gujx@cn.fujitsu.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
---
 fs/btrfs/relocation.c | 23 ++++++++++++-----------
 1 file changed, 12 insertions(+), 11 deletions(-)

diff --git a/fs/btrfs/relocation.c b/fs/btrfs/relocation.c
index 879b76fa881a..be94c65bb4d2 100644
--- a/fs/btrfs/relocation.c
+++ b/fs/btrfs/relocation.c
@@ -1321,18 +1321,19 @@ static void __del_reloc_root(struct btrfs_root *root)
 	struct mapping_node *node = NULL;
 	struct reloc_control *rc = fs_info->reloc_ctl;
 
-	spin_lock(&rc->reloc_root_tree.lock);
-	rb_node = tree_search(&rc->reloc_root_tree.rb_root,
-			      root->node->start);
-	if (rb_node) {
-		node = rb_entry(rb_node, struct mapping_node, rb_node);
-		rb_erase(&node->rb_node, &rc->reloc_root_tree.rb_root);
+	if (rc) {
+		spin_lock(&rc->reloc_root_tree.lock);
+		rb_node = tree_search(&rc->reloc_root_tree.rb_root,
+				      root->node->start);
+		if (rb_node) {
+			node = rb_entry(rb_node, struct mapping_node, rb_node);
+			rb_erase(&node->rb_node, &rc->reloc_root_tree.rb_root);
+		}
+		spin_unlock(&rc->reloc_root_tree.lock);
+		if (!node)
+			return;
+		BUG_ON((struct btrfs_root *)node->data != root);
 	}
-	spin_unlock(&rc->reloc_root_tree.lock);
-
-	if (!node)
-		return;
-	BUG_ON((struct btrfs_root *)node->data != root);
 
 	spin_lock(&fs_info->trans_lock);
 	list_del_init(&root->root_list);
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 57+ messages in thread

* [PATCH AUTOSEL 4.18 109/113] btrfs: tree-checker: Detect invalid and empty essential trees
  2018-08-30 18:07 [PATCH AUTOSEL 4.18 067/113] powerpc: Fix size calculation using resource_size() Sasha Levin
                   ` (40 preceding siblings ...)
  2018-08-30 18:08 ` [PATCH AUTOSEL 4.18 108/113] btrfs: relocation: Only remove reloc rb_trees if reloc control has been initialized Sasha Levin
@ 2018-08-30 18:08 ` Sasha Levin
  2018-08-30 18:08 ` [PATCH AUTOSEL 4.18 110/113] btrfs: check-integrity: Fix NULL pointer dereference for degraded mount Sasha Levin
                   ` (3 subsequent siblings)
  45 siblings, 0 replies; 57+ messages in thread
From: Sasha Levin @ 2018-08-30 18:08 UTC (permalink / raw)
  To: stable@vger.kernel.org; +Cc: Qu Wenruo, David Sterba, Sasha Levin

From: Qu Wenruo <wqu@suse.com>

[ Upstream commit ba480dd4db9f1798541eb2d1c423fc95feee8d36 ]

A crafted image has empty root tree block, which will later cause NULL
pointer dereference.

The following trees should never be empty:
1) Tree root
   Must contain at least root items for extent tree, device tree and fs
   tree

2) Chunk tree
   Or we can't even bootstrap as it contains the mapping.

3) Fs tree
   At least inode item for top level inode (.).

4) Device tree
   Dev extents for chunks

5) Extent tree
   Must have corresponding extent for each chunk.

If any of them is empty, we are sure the fs is corrupted and no need to
mount it.

Link: https://bugzilla.kernel.org/show_bug.cgi?id=199847
Reported-by: Xu Wen <wen.xu@gatech.edu>
Signed-off-by: Qu Wenruo <wqu@suse.com>
Tested-by: Gu Jinxiang <gujx@cn.fujitsu.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
---
 fs/btrfs/tree-checker.c | 15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)

diff --git a/fs/btrfs/tree-checker.c b/fs/btrfs/tree-checker.c
index 8d40e7dd8c30..d014af352ce0 100644
--- a/fs/btrfs/tree-checker.c
+++ b/fs/btrfs/tree-checker.c
@@ -396,9 +396,22 @@ static int check_leaf(struct btrfs_fs_info *fs_info, struct extent_buffer *leaf,
 	 * skip this check for relocation trees.
 	 */
 	if (nritems == 0 && !btrfs_header_flag(leaf, BTRFS_HEADER_FLAG_RELOC)) {
+		u64 owner = btrfs_header_owner(leaf);
 		struct btrfs_root *check_root;
 
-		key.objectid = btrfs_header_owner(leaf);
+		/* These trees must never be empty */
+		if (owner == BTRFS_ROOT_TREE_OBJECTID ||
+		    owner == BTRFS_CHUNK_TREE_OBJECTID ||
+		    owner == BTRFS_EXTENT_TREE_OBJECTID ||
+		    owner == BTRFS_DEV_TREE_OBJECTID ||
+		    owner == BTRFS_FS_TREE_OBJECTID ||
+		    owner == BTRFS_DATA_RELOC_TREE_OBJECTID) {
+			generic_err(fs_info, leaf, 0,
+			"invalid root, root %llu must never be empty",
+				    owner);
+			return -EUCLEAN;
+		}
+		key.objectid = owner;
 		key.type = BTRFS_ROOT_ITEM_KEY;
 		key.offset = (u64)-1;
 
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 57+ messages in thread

* [PATCH AUTOSEL 4.18 110/113] btrfs: check-integrity: Fix NULL pointer dereference for degraded mount
  2018-08-30 18:07 [PATCH AUTOSEL 4.18 067/113] powerpc: Fix size calculation using resource_size() Sasha Levin
                   ` (41 preceding siblings ...)
  2018-08-30 18:08 ` [PATCH AUTOSEL 4.18 109/113] btrfs: tree-checker: Detect invalid and empty essential trees Sasha Levin
@ 2018-08-30 18:08 ` Sasha Levin
  2018-08-30 18:08 ` [PATCH AUTOSEL 4.18 111/113] btrfs: lift uuid_mutex to callers of btrfs_open_devices Sasha Levin
                   ` (2 subsequent siblings)
  45 siblings, 0 replies; 57+ messages in thread
From: Sasha Levin @ 2018-08-30 18:08 UTC (permalink / raw)
  To: stable@vger.kernel.org; +Cc: Qu Wenruo, David Sterba, Sasha Levin

From: Qu Wenruo <wqu@suse.com>

[ Upstream commit 9912bbf6440ba0555e91d3306520da01872c7c1d ]

Commit f8f84b2dfda5 ("btrfs: index check-integrity state hash by a dev_t")
changed how btrfsic indexes device state.

Now we need to access device->bdev->bd_dev, while for degraded mount
it's completely possible to have device->bdev as NULL, thus it will
trigger a NULL pointer dereference at mount time.

Fix it by checking if the device is degraded before accessing
device->bdev->bd_dev.

There are a lot of other places accessing device->bdev->bd_dev, however
the other call sites have either checked device->bdev, or the
device->bdev is passed from btrfsic_map_block(), so it won't cause harm.

Fixes: f8f84b2dfda5 ("btrfs: index check-integrity state hash by a dev_t")
Signed-off-by: Qu Wenruo <wqu@suse.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
---
 fs/btrfs/check-integrity.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/fs/btrfs/check-integrity.c b/fs/btrfs/check-integrity.c
index a3fdb4fe967d..daf45472bef9 100644
--- a/fs/btrfs/check-integrity.c
+++ b/fs/btrfs/check-integrity.c
@@ -1539,7 +1539,12 @@ static int btrfsic_map_block(struct btrfsic_state *state, u64 bytenr, u32 len,
 	}
 
 	device = multi->stripes[0].dev;
-	block_ctx_out->dev = btrfsic_dev_state_lookup(device->bdev->bd_dev);
+	if (test_bit(BTRFS_DEV_STATE_MISSING, &device->dev_state) ||
+	    !device->bdev || !device->name)
+		block_ctx_out->dev = NULL;
+	else
+		block_ctx_out->dev = btrfsic_dev_state_lookup(
+							device->bdev->bd_dev);
 	block_ctx_out->dev_bytenr = multi->stripes[0].physical;
 	block_ctx_out->start = bytenr;
 	block_ctx_out->len = len;
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 57+ messages in thread

* [PATCH AUTOSEL 4.18 111/113] btrfs: lift uuid_mutex to callers of btrfs_open_devices
  2018-08-30 18:07 [PATCH AUTOSEL 4.18 067/113] powerpc: Fix size calculation using resource_size() Sasha Levin
                   ` (42 preceding siblings ...)
  2018-08-30 18:08 ` [PATCH AUTOSEL 4.18 110/113] btrfs: check-integrity: Fix NULL pointer dereference for degraded mount Sasha Levin
@ 2018-08-30 18:08 ` Sasha Levin
  2018-09-05  9:29   ` David Sterba
  2018-08-30 18:08 ` [PATCH AUTOSEL 4.18 112/113] btrfs: Don't remove block group that still has pinned down bytes Sasha Levin
  2018-08-30 18:08 ` [PATCH AUTOSEL 4.18 113/113] btrfs: Fix a C compliance issue Sasha Levin
  45 siblings, 1 reply; 57+ messages in thread
From: Sasha Levin @ 2018-08-30 18:08 UTC (permalink / raw)
  To: stable@vger.kernel.org; +Cc: David Sterba, Sasha Levin

From: David Sterba <dsterba@suse.com>

[ Upstream commit f5194e34cabaddd348a90f950e0a8188dd26cdc0 ]

Prepartory work to fix race between mount and device scan.

The callers will have to manage the critical section, eg. mount wants to
scan and then call btrfs_open_devices without the ioctl scan walking in
and modifying the fs devices in the meantime.

Reviewed-by: Anand Jain <anand.jain@oracle.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
---
 fs/btrfs/super.c   | 2 ++
 fs/btrfs/volumes.c | 4 ++--
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/fs/btrfs/super.c b/fs/btrfs/super.c
index 81107ad49f3a..f369b480956a 100644
--- a/fs/btrfs/super.c
+++ b/fs/btrfs/super.c
@@ -1565,7 +1565,9 @@ static struct dentry *btrfs_mount_root(struct file_system_type *fs_type,
 		goto error_fs_info;
 	}
 
+	mutex_lock(&uuid_mutex);
 	error = btrfs_open_devices(fs_devices, mode, fs_type);
+	mutex_unlock(&uuid_mutex);
 	if (error)
 		goto error_fs_info;
 
diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c
index fca57c1f077c..0bd8c544d2de 100644
--- a/fs/btrfs/volumes.c
+++ b/fs/btrfs/volumes.c
@@ -1146,7 +1146,8 @@ int btrfs_open_devices(struct btrfs_fs_devices *fs_devices,
 {
 	int ret;
 
-	mutex_lock(&uuid_mutex);
+	lockdep_assert_held(&uuid_mutex);
+
 	mutex_lock(&fs_devices->device_list_mutex);
 	if (fs_devices->opened) {
 		fs_devices->opened++;
@@ -1156,7 +1157,6 @@ int btrfs_open_devices(struct btrfs_fs_devices *fs_devices,
 		ret = open_fs_devices(fs_devices, flags, holder);
 	}
 	mutex_unlock(&fs_devices->device_list_mutex);
-	mutex_unlock(&uuid_mutex);
 
 	return ret;
 }
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 57+ messages in thread

* [PATCH AUTOSEL 4.18 112/113] btrfs: Don't remove block group that still has pinned down bytes
  2018-08-30 18:07 [PATCH AUTOSEL 4.18 067/113] powerpc: Fix size calculation using resource_size() Sasha Levin
                   ` (43 preceding siblings ...)
  2018-08-30 18:08 ` [PATCH AUTOSEL 4.18 111/113] btrfs: lift uuid_mutex to callers of btrfs_open_devices Sasha Levin
@ 2018-08-30 18:08 ` Sasha Levin
  2018-08-30 18:08 ` [PATCH AUTOSEL 4.18 113/113] btrfs: Fix a C compliance issue Sasha Levin
  45 siblings, 0 replies; 57+ messages in thread
From: Sasha Levin @ 2018-08-30 18:08 UTC (permalink / raw)
  To: stable@vger.kernel.org; +Cc: Qu Wenruo, David Sterba, Sasha Levin

From: Qu Wenruo <wqu@suse.com>

[ Upstream commit 43794446548730ac8461be30bbe47d5d027d1d16 ]

[BUG]
Under certain KVM load and LTP tests, it is possible to hit the
following calltrace if quota is enabled:

BTRFS critical (device vda2): unable to find logical 8820195328 length 4096
BTRFS critical (device vda2): unable to find logical 8820195328 length 4096

WARNING: CPU: 0 PID: 49 at ../block/blk-core.c:172 blk_status_to_errno+0x1a/0x30
CPU: 0 PID: 49 Comm: kworker/u2:1 Not tainted 4.12.14-15-default #1 SLE15 (unreleased)
Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.0.0-prebuilt.qemu-project.org 04/01/2014
Workqueue: btrfs-endio-write btrfs_endio_write_helper [btrfs]
task: ffff9f827b340bc0 task.stack: ffffb4f8c0304000
RIP: 0010:blk_status_to_errno+0x1a/0x30
Call Trace:
 submit_extent_page+0x191/0x270 [btrfs]
 ? btrfs_create_repair_bio+0x130/0x130 [btrfs]
 __do_readpage+0x2d2/0x810 [btrfs]
 ? btrfs_create_repair_bio+0x130/0x130 [btrfs]
 ? run_one_async_done+0xc0/0xc0 [btrfs]
 __extent_read_full_page+0xe7/0x100 [btrfs]
 ? run_one_async_done+0xc0/0xc0 [btrfs]
 read_extent_buffer_pages+0x1ab/0x2d0 [btrfs]
 ? run_one_async_done+0xc0/0xc0 [btrfs]
 btree_read_extent_buffer_pages+0x94/0xf0 [btrfs]
 read_tree_block+0x31/0x60 [btrfs]
 read_block_for_search.isra.35+0xf0/0x2e0 [btrfs]
 btrfs_search_slot+0x46b/0xa00 [btrfs]
 ? kmem_cache_alloc+0x1a8/0x510
 ? btrfs_get_token_32+0x5b/0x120 [btrfs]
 find_parent_nodes+0x11d/0xeb0 [btrfs]
 ? leaf_space_used+0xb8/0xd0 [btrfs]
 ? btrfs_leaf_free_space+0x49/0x90 [btrfs]
 ? btrfs_find_all_roots_safe+0x93/0x100 [btrfs]
 btrfs_find_all_roots_safe+0x93/0x100 [btrfs]
 btrfs_find_all_roots+0x45/0x60 [btrfs]
 btrfs_qgroup_trace_extent_post+0x20/0x40 [btrfs]
 btrfs_add_delayed_data_ref+0x1a3/0x1d0 [btrfs]
 btrfs_alloc_reserved_file_extent+0x38/0x40 [btrfs]
 insert_reserved_file_extent.constprop.71+0x289/0x2e0 [btrfs]
 btrfs_finish_ordered_io+0x2f4/0x7f0 [btrfs]
 ? pick_next_task_fair+0x2cd/0x530
 ? __switch_to+0x92/0x4b0
 btrfs_worker_helper+0x81/0x300 [btrfs]
 process_one_work+0x1da/0x3f0
 worker_thread+0x2b/0x3f0
 ? process_one_work+0x3f0/0x3f0
 kthread+0x11a/0x130
 ? kthread_create_on_node+0x40/0x40
 ret_from_fork+0x35/0x40

BTRFS critical (device vda2): unable to find logical 8820195328 length 16384
BTRFS: error (device vda2) in btrfs_finish_ordered_io:3023: errno=-5 IO failure
BTRFS info (device vda2): forced readonly
BTRFS error (device vda2): pending csums is 2887680

[CAUSE]
It's caused by race with block group auto removal:

- There is a meta block group X, which has only one tree block
  The tree block belongs to fs tree 257.
- In current transaction, some operation modified fs tree 257
  The tree block gets COWed, so the block group X is empty, and marked
  as unused, queued to be deleted.
- Some workload (like fsync) wakes up cleaner_kthread()
  Which will call btrfs_delete_unused_bgs() to remove unused block
  groups.
  So block group X along its chunk map get removed.
- Some delalloc work finished for fs tree 257
  Quota needs to get the original reference of the extent, which will
  read tree blocks of commit root of 257.
  Then since the chunk map gets removed, the above warning gets
  triggered.

[FIX]
Just let btrfs_delete_unused_bgs() skip block group which still has
pinned bytes.

However there is a minor side effect: currently we only queue empty
blocks at update_block_group(), and such empty block group with pinned
bytes won't go through update_block_group() again, such block group
won't be removed, until it gets new extent allocated and removed.

Signed-off-by: Qu Wenruo <wqu@suse.com>
Reviewed-by: Filipe Manana <fdmanana@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
---
 fs/btrfs/extent-tree.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c
index f7a96f7871b7..95c9ad49a3d5 100644
--- a/fs/btrfs/extent-tree.c
+++ b/fs/btrfs/extent-tree.c
@@ -10687,7 +10687,7 @@ void btrfs_delete_unused_bgs(struct btrfs_fs_info *fs_info)
 		/* Don't want to race with allocators so take the groups_sem */
 		down_write(&space_info->groups_sem);
 		spin_lock(&block_group->lock);
-		if (block_group->reserved ||
+		if (block_group->reserved || block_group->pinned ||
 		    btrfs_block_group_used(&block_group->item) ||
 		    block_group->ro ||
 		    list_is_singular(&block_group->list)) {
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 57+ messages in thread

* [PATCH AUTOSEL 4.18 113/113] btrfs: Fix a C compliance issue
  2018-08-30 18:07 [PATCH AUTOSEL 4.18 067/113] powerpc: Fix size calculation using resource_size() Sasha Levin
                   ` (44 preceding siblings ...)
  2018-08-30 18:08 ` [PATCH AUTOSEL 4.18 112/113] btrfs: Don't remove block group that still has pinned down bytes Sasha Levin
@ 2018-08-30 18:08 ` Sasha Levin
  45 siblings, 0 replies; 57+ messages in thread
From: Sasha Levin @ 2018-08-30 18:08 UTC (permalink / raw)
  To: stable@vger.kernel.org; +Cc: Bart Van Assche, David Sterba, Sasha Levin

From: Bart Van Assche <bart.vanassche@wdc.com>

[ Upstream commit edf57cbf2b030781885e339f32e35a470d2f8eba ]

The C programming language does not allow to use preprocessor statements
inside macro arguments (pr_info() is defined as a macro). Hence rework
the pr_info() statement in btrfs_print_mod_info() such that it becomes
compliant. This patch allows tools like sparse to analyze the BTRFS
source code.

Fixes: 62e855771dac ("btrfs: convert printk(KERN_* to use pr_* calls")
Signed-off-by: Bart Van Assche <bart.vanassche@wdc.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
---
 fs/btrfs/super.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/fs/btrfs/super.c b/fs/btrfs/super.c
index f369b480956a..689551da9dce 100644
--- a/fs/btrfs/super.c
+++ b/fs/btrfs/super.c
@@ -2371,7 +2371,7 @@ static __cold void btrfs_interface_exit(void)
 
 static void __init btrfs_print_mod_info(void)
 {
-	pr_info("Btrfs loaded, crc32c=%s"
+	static const char options[] = ""
 #ifdef CONFIG_BTRFS_DEBUG
 			", debug=on"
 #endif
@@ -2384,8 +2384,8 @@ static void __init btrfs_print_mod_info(void)
 #ifdef CONFIG_BTRFS_FS_REF_VERIFY
 			", ref-verify=on"
 #endif
-			"\n",
-			crc32c_impl());
+			;
+	pr_info("Btrfs loaded, crc32c=%s%s\n", crc32c_impl(), options);
 }
 
 static int __init init_btrfs_fs(void)
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 57+ messages in thread

* Re: [PATCH AUTOSEL 4.18 078/113] ALSA: hda/ca0132 - Add quirk ID and enum for Recon3D
  2018-08-30 18:07 ` [PATCH AUTOSEL 4.18 078/113] ALSA: hda/ca0132 - Add quirk ID and enum " Sasha Levin
@ 2018-08-30 20:08   ` Takashi Iwai
  2018-08-30 20:10     ` Connor McAdams
  0 siblings, 1 reply; 57+ messages in thread
From: Takashi Iwai @ 2018-08-30 20:08 UTC (permalink / raw)
  To: Sasha Levin; +Cc: stable@vger.kernel.org, Connor McAdams

On Thu, 30 Aug 2018 20:07:38 +0200,
Sasha Levin wrote:
> 
> From: Connor McAdams <conmanx360@gmail.com>
> 
> [ Upstream commit 8f8c523c4604afe231196920bf08310141a4f0ba ]
> 
> This patch adds the PCI subsys ID for the Recon3D that has been tested,
> and adds the QUIRK_R3D enumeration.
> 
> Signed-off-by: Connor McAdams <conmanx360@gmail.com>
> Signed-off-by: Takashi Iwai <tiwai@suse.de>
> Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>

Is the order or patches correct?
This one has to be applied before patch 77, at least.


thanks,

Takashi

> ---
>  sound/pci/hda/patch_ca0132.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/sound/pci/hda/patch_ca0132.c b/sound/pci/hda/patch_ca0132.c
> index 27ecff0d5c72..3288bbc3687c 100644
> --- a/sound/pci/hda/patch_ca0132.c
> +++ b/sound/pci/hda/patch_ca0132.c
> @@ -994,6 +994,7 @@ enum {
>  	QUIRK_ALIENWARE_M17XR4,
>  	QUIRK_SBZ,
>  	QUIRK_R3DI,
> +	QUIRK_R3D,
>  };
>  
>  static const struct hda_pintbl alienware_pincfgs[] = {
> @@ -1050,6 +1051,7 @@ static const struct snd_pci_quirk ca0132_quirks[] = {
>  	SND_PCI_QUIRK(0x1458, 0xA016, "Recon3Di", QUIRK_R3DI),
>  	SND_PCI_QUIRK(0x1458, 0xA026, "Gigabyte G1.Sniper Z97", QUIRK_R3DI),
>  	SND_PCI_QUIRK(0x1458, 0xA036, "Gigabyte GA-Z170X-Gaming 7", QUIRK_R3DI),
> +	SND_PCI_QUIRK(0x1102, 0x0013, "Recon3D", QUIRK_R3D),
>  	{}
>  };
>  
> -- 
> 2.17.1
> 

^ permalink raw reply	[flat|nested] 57+ messages in thread

* Re: [PATCH AUTOSEL 4.18 078/113] ALSA: hda/ca0132 - Add quirk ID and enum for Recon3D
  2018-08-30 20:08   ` Takashi Iwai
@ 2018-08-30 20:10     ` Connor McAdams
  2018-08-31 16:07       ` Sasha Levin
  0 siblings, 1 reply; 57+ messages in thread
From: Connor McAdams @ 2018-08-30 20:10 UTC (permalink / raw)
  To: Takashi Iwai; +Cc: Sasha Levin, stable@vger.kernel.org

Yes, there also seems to be some missing if I'm not mistaken
(immediately I notice the ones for switching output and input.) If you
lack those, just setting up the DSP is almost pointless.

On Thu, Aug 30, 2018 at 4:08 PM, Takashi Iwai <tiwai@suse.de> wrote:
> On Thu, 30 Aug 2018 20:07:38 +0200,
> Sasha Levin wrote:
>>
>> From: Connor McAdams <conmanx360@gmail.com>
>>
>> [ Upstream commit 8f8c523c4604afe231196920bf08310141a4f0ba ]
>>
>> This patch adds the PCI subsys ID for the Recon3D that has been tested,
>> and adds the QUIRK_R3D enumeration.
>>
>> Signed-off-by: Connor McAdams <conmanx360@gmail.com>
>> Signed-off-by: Takashi Iwai <tiwai@suse.de>
>> Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
>
> Is the order or patches correct?
> This one has to be applied before patch 77, at least.
>
>
> thanks,
>
> Takashi
>
>> ---
>>  sound/pci/hda/patch_ca0132.c | 2 ++
>>  1 file changed, 2 insertions(+)
>>
>> diff --git a/sound/pci/hda/patch_ca0132.c b/sound/pci/hda/patch_ca0132.c
>> index 27ecff0d5c72..3288bbc3687c 100644
>> --- a/sound/pci/hda/patch_ca0132.c
>> +++ b/sound/pci/hda/patch_ca0132.c
>> @@ -994,6 +994,7 @@ enum {
>>       QUIRK_ALIENWARE_M17XR4,
>>       QUIRK_SBZ,
>>       QUIRK_R3DI,
>> +     QUIRK_R3D,
>>  };
>>
>>  static const struct hda_pintbl alienware_pincfgs[] = {
>> @@ -1050,6 +1051,7 @@ static const struct snd_pci_quirk ca0132_quirks[] = {
>>       SND_PCI_QUIRK(0x1458, 0xA016, "Recon3Di", QUIRK_R3DI),
>>       SND_PCI_QUIRK(0x1458, 0xA026, "Gigabyte G1.Sniper Z97", QUIRK_R3DI),
>>       SND_PCI_QUIRK(0x1458, 0xA036, "Gigabyte GA-Z170X-Gaming 7", QUIRK_R3DI),
>> +     SND_PCI_QUIRK(0x1102, 0x0013, "Recon3D", QUIRK_R3D),
>>       {}
>>  };
>>
>> --
>> 2.17.1
>>

^ permalink raw reply	[flat|nested] 57+ messages in thread

* Re: [PATCH AUTOSEL 4.18 077/113] ALSA: hda/ca0132 - Add DSP setup defaults for Recon3D
  2018-08-30 18:07 ` [PATCH AUTOSEL 4.18 077/113] ALSA: hda/ca0132 - Add DSP setup defaults for Recon3D Sasha Levin
@ 2018-08-30 20:13   ` Takashi Iwai
  0 siblings, 0 replies; 57+ messages in thread
From: Takashi Iwai @ 2018-08-30 20:13 UTC (permalink / raw)
  To: Sasha Levin; +Cc: stable@vger.kernel.org, Connor McAdams

On Thu, 30 Aug 2018 20:07:37 +0200,
Sasha Levin wrote:
> 
> From: Connor McAdams <conmanx360@gmail.com>
> 
> [ Upstream commit c986f50ca974397f8726bf6776ad8938d6808848 ]
> 
> The Recon3D can use many of the same functions as the Recon3Di, so many
> of the r3di prefix function remain the same, but change their names to
> the more generic r3d prefix. This patch does this, and adds quirk checks
> for things specific to the Recon3Di.
> 
> Signed-off-by: Connor McAdams <conmanx360@gmail.com>
> Signed-off-by: Takashi Iwai <tiwai@suse.de>
> Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>

... and this and only patch 78 don't suffice for the support of
Recon3D.  We need either a complete series of backports or to drop
these.


thanks,

Takashi


> ---
>  sound/pci/hda/patch_ca0132.c | 21 +++++++++++----------
>  1 file changed, 11 insertions(+), 10 deletions(-)
> 
> diff --git a/sound/pci/hda/patch_ca0132.c b/sound/pci/hda/patch_ca0132.c
> index 321e95c409c1..27ecff0d5c72 100644
> --- a/sound/pci/hda/patch_ca0132.c
> +++ b/sound/pci/hda/patch_ca0132.c
> @@ -6187,10 +6187,10 @@ static void ca0132_refresh_widget_caps(struct hda_codec *codec)
>  }
>  
>  /*
> - * Recon3Di r3di_setup_defaults sub functions.
> + * Recon3D r3d_setup_defaults sub functions.
>   */
>  
> -static void r3di_dsp_scp_startup(struct hda_codec *codec)
> +static void r3d_dsp_scp_startup(struct hda_codec *codec)
>  {
>  	unsigned int tmp;
>  
> @@ -6211,7 +6211,7 @@ static void r3di_dsp_scp_startup(struct hda_codec *codec)
>  
>  }
>  
> -static void r3di_dsp_initial_mic_setup(struct hda_codec *codec)
> +static void r3d_dsp_initial_mic_setup(struct hda_codec *codec)
>  {
>  	unsigned int tmp;
>  
> @@ -6421,10 +6421,10 @@ static void ca0132_setup_defaults(struct hda_codec *codec)
>  }
>  
>  /*
> - * Setup default parameters for Recon3Di DSP.
> + * Setup default parameters for Recon3D/Recon3Di DSP.
>   */
>  
> -static void r3di_setup_defaults(struct hda_codec *codec)
> +static void r3d_setup_defaults(struct hda_codec *codec)
>  {
>  	struct ca0132_spec *spec = codec->spec;
>  	unsigned int tmp;
> @@ -6434,9 +6434,9 @@ static void r3di_setup_defaults(struct hda_codec *codec)
>  	if (spec->dsp_state != DSP_DOWNLOADED)
>  		return;
>  
> -	r3di_dsp_scp_startup(codec);
> +	r3d_dsp_scp_startup(codec);
>  
> -	r3di_dsp_initial_mic_setup(codec);
> +	r3d_dsp_initial_mic_setup(codec);
>  
>  	/*remove DSP headroom*/
>  	tmp = FLOAT_ZERO;
> @@ -6450,7 +6450,8 @@ static void r3di_setup_defaults(struct hda_codec *codec)
>  	/* Set speaker source? */
>  	dspio_set_uint_param(codec, 0x32, 0x00, tmp);
>  
> -	r3di_gpio_dsp_status_set(codec, R3DI_DSP_DOWNLOADED);
> +	if (spec->quirk == QUIRK_R3DI)
> +		r3di_gpio_dsp_status_set(codec, R3DI_DSP_DOWNLOADED);
>  
>  	/* Setup effect defaults */
>  	num_fx = OUT_EFFECTS_COUNT + IN_EFFECTS_COUNT + 1;
> @@ -6462,7 +6463,6 @@ static void r3di_setup_defaults(struct hda_codec *codec)
>  					ca0132_effects[idx].def_vals[i]);
>  		}
>  	}
> -
>  }
>  
>  /*
> @@ -7241,7 +7241,8 @@ static int ca0132_init(struct hda_codec *codec)
>  
>  	switch (spec->quirk) {
>  	case QUIRK_R3DI:
> -		r3di_setup_defaults(codec);
> +	case QUIRK_R3D:
> +		r3d_setup_defaults(codec);
>  		break;
>  	case QUIRK_SBZ:
>  		break;
> -- 
> 2.17.1
> 

^ permalink raw reply	[flat|nested] 57+ messages in thread

* Re: [PATCH AUTOSEL 4.18 078/113] ALSA: hda/ca0132 - Add quirk ID and enum for Recon3D
  2018-08-30 20:10     ` Connor McAdams
@ 2018-08-31 16:07       ` Sasha Levin
  2018-09-02  6:30         ` Takashi Iwai
  0 siblings, 1 reply; 57+ messages in thread
From: Sasha Levin @ 2018-08-31 16:07 UTC (permalink / raw)
  To: Connor McAdams; +Cc: Takashi Iwai, stable@vger.kernel.org

On Thu, Aug 30, 2018 at 04:10:42PM -0400, Connor McAdams wrote:
>Yes, there also seems to be some missing if I'm not mistaken
>(immediately I notice the ones for switching output and input.) If you
>lack those, just setting up the DSP is almost pointless.

Could you give me a list of commits I should take to fix this issue? Or
alternatively, I can just drop this and the previous patch.

^ permalink raw reply	[flat|nested] 57+ messages in thread

* Re: [PATCH AUTOSEL 4.18 078/113] ALSA: hda/ca0132 - Add quirk ID and enum for Recon3D
  2018-08-31 16:07       ` Sasha Levin
@ 2018-09-02  6:30         ` Takashi Iwai
  2018-09-02 12:56           ` Sasha Levin
  0 siblings, 1 reply; 57+ messages in thread
From: Takashi Iwai @ 2018-09-02  6:30 UTC (permalink / raw)
  To: Sasha Levin; +Cc: Connor McAdams, stable@vger.kernel.org

On Fri, 31 Aug 2018 18:07:54 +0200,
Sasha Levin wrote:
> 
> On Thu, Aug 30, 2018 at 04:10:42PM -0400, Connor McAdams wrote:
> >Yes, there also seems to be some missing if I'm not mistaken
> >(immediately I notice the ones for switching output and input.) If you
> >lack those, just setting up the DSP is almost pointless.
> 
> Could you give me a list of commits I should take to fix this issue? Or
> alternatively, I can just drop this and the previous patch.

Just drop these.  They are no regression fixes, after all.


Takashi

^ permalink raw reply	[flat|nested] 57+ messages in thread

* Re: [PATCH AUTOSEL 4.18 078/113] ALSA: hda/ca0132 - Add quirk ID and enum for Recon3D
  2018-09-02  6:30         ` Takashi Iwai
@ 2018-09-02 12:56           ` Sasha Levin
  0 siblings, 0 replies; 57+ messages in thread
From: Sasha Levin @ 2018-09-02 12:56 UTC (permalink / raw)
  To: Takashi Iwai; +Cc: Connor McAdams, stable@vger.kernel.org

On Sun, Sep 02, 2018 at 08:30:35AM +0200, Takashi Iwai wrote:
>On Fri, 31 Aug 2018 18:07:54 +0200,
>Sasha Levin wrote:
>>
>> On Thu, Aug 30, 2018 at 04:10:42PM -0400, Connor McAdams wrote:
>> >Yes, there also seems to be some missing if I'm not mistaken
>> >(immediately I notice the ones for switching output and input.) If you
>> >lack those, just setting up the DSP is almost pointless.
>>
>> Could you give me a list of commits I should take to fix this issue? Or
>> alternatively, I can just drop this and the previous patch.
>
>Just drop these.  They are no regression fixes, after all.

dropped, thanks!

^ permalink raw reply	[flat|nested] 57+ messages in thread

* Re: [PATCH AUTOSEL 4.18 107/113] btrfs: Rewrite retry logic in do_chunk_alloc
  2018-08-30 18:08 ` [PATCH AUTOSEL 4.18 107/113] btrfs: Rewrite retry logic in do_chunk_alloc Sasha Levin
@ 2018-09-05  9:22   ` David Sterba
  2018-09-07  0:16     ` Sasha Levin
  0 siblings, 1 reply; 57+ messages in thread
From: David Sterba @ 2018-09-05  9:22 UTC (permalink / raw)
  To: Sasha Levin; +Cc: stable@vger.kernel.org, Nikolay Borisov

On Thu, Aug 30, 2018 at 06:08:33PM +0000, Sasha Levin wrote:
> From: Nikolay Borisov <nborisov@suse.com>
> 
> [ Upstream commit 2556fbb0bead7929ddf67f8b4184f434cee4e7d7 ]
> 
> do_chunk_alloc implements logic to detect whether there is currently
> pending chunk allocation (by means of space_info->chunk_alloc being
> set) and if so it loops around to the 'again' label. Additionally,
> based on the state of the space_info (e.g. whether it's full or not)
> and the return value of should_alloc_chunk() it decides whether this
> is a "hard" error (ENOSPC) or we can just return 0.
> 
> This patch refactors all of this:
> 
> 1. Put order to the scattered ifs handling the various cases in an
> easy-to-read if {} else if{} branches. This makes clear the various
> cases we are interested in handling.
> 
> 2. Call should_alloc_chunk only once and use the result in the
> if/else if constructs. All of this is done under space_info->lock, so
> even before multiple calls of should_alloc_chunk were unnecessary.
> 
> 3. Rewrite the "do {} while()" loop currently implemented via label
> into an explicit loop construct.
> 
> 4. Move the mutex locking for the case where the caller is the one doing
> the allocation. For the case where the caller needs to wait a concurrent
> allocation, introduce a pair of mutex_lock/mutex_unlock to act as a
> barrier and reword the comment.
> 
> 5. Switch local vars to bool type where pertinent.
> 
> All in all this shouldn't introduce any functional changes.

Unless there are other followup patches "No functional changes" is a
hint for autosel not to pick the patch.

^ permalink raw reply	[flat|nested] 57+ messages in thread

* Re: [PATCH AUTOSEL 4.18 111/113] btrfs: lift uuid_mutex to callers of btrfs_open_devices
  2018-08-30 18:08 ` [PATCH AUTOSEL 4.18 111/113] btrfs: lift uuid_mutex to callers of btrfs_open_devices Sasha Levin
@ 2018-09-05  9:29   ` David Sterba
  2018-09-07  0:17     ` Sasha Levin
  0 siblings, 1 reply; 57+ messages in thread
From: David Sterba @ 2018-09-05  9:29 UTC (permalink / raw)
  To: Sasha Levin; +Cc: stable@vger.kernel.org

On Thu, Aug 30, 2018 at 06:08:40PM +0000, Sasha Levin wrote:
> From: David Sterba <dsterba@suse.com>
> 
> [ Upstream commit f5194e34cabaddd348a90f950e0a8188dd26cdc0 ]
> 
> Prepartory work to fix race between mount and device scan.

The patch is part of a larger series that would have to be backported
completely, but the bug it fixes was triggered by fuzzing and I don't
think it's that important for 4.18 stable. It would make more sense for
some long-term branch like 4.14 though.

The whole series is 959b1c04675735aa..81ffd56b5745355b

^ permalink raw reply	[flat|nested] 57+ messages in thread

* Re: [PATCH AUTOSEL 4.18 107/113] btrfs: Rewrite retry logic in do_chunk_alloc
  2018-09-05  9:22   ` David Sterba
@ 2018-09-07  0:16     ` Sasha Levin
  0 siblings, 0 replies; 57+ messages in thread
From: Sasha Levin @ 2018-09-07  0:16 UTC (permalink / raw)
  To: David Sterba; +Cc: stable@vger.kernel.org, Nikolay Borisov

On Wed, Sep 05, 2018 at 11:22:32AM +0200, David Sterba wrote:
>On Thu, Aug 30, 2018 at 06:08:33PM +0000, Sasha Levin wrote:
>> From: Nikolay Borisov <nborisov@suse.com>
>>
>> [ Upstream commit 2556fbb0bead7929ddf67f8b4184f434cee4e7d7 ]
>>
>> do_chunk_alloc implements logic to detect whether there is currently
>> pending chunk allocation (by means of space_info->chunk_alloc being
>> set) and if so it loops around to the 'again' label. Additionally,
>> based on the state of the space_info (e.g. whether it's full or not)
>> and the return value of should_alloc_chunk() it decides whether this
>> is a "hard" error (ENOSPC) or we can just return 0.
>>
>> This patch refactors all of this:
>>
>> 1. Put order to the scattered ifs handling the various cases in an
>> easy-to-read if {} else if{} branches. This makes clear the various
>> cases we are interested in handling.
>>
>> 2. Call should_alloc_chunk only once and use the result in the
>> if/else if constructs. All of this is done under space_info->lock, so
>> even before multiple calls of should_alloc_chunk were unnecessary.
>>
>> 3. Rewrite the "do {} while()" loop currently implemented via label
>> into an explicit loop construct.
>>
>> 4. Move the mutex locking for the case where the caller is the one doing
>> the allocation. For the case where the caller needs to wait a concurrent
>> allocation, introduce a pair of mutex_lock/mutex_unlock to act as a
>> barrier and reword the comment.
>>
>> 5. Switch local vars to bool type where pertinent.
>>
>> All in all this shouldn't introduce any functional changes.
>
>Unless there are other followup patches "No functional changes" is a
>hint for autosel not to pick the patch.

Out it goes, thanks!

^ permalink raw reply	[flat|nested] 57+ messages in thread

* Re: [PATCH AUTOSEL 4.18 111/113] btrfs: lift uuid_mutex to callers of btrfs_open_devices
  2018-09-05  9:29   ` David Sterba
@ 2018-09-07  0:17     ` Sasha Levin
  0 siblings, 0 replies; 57+ messages in thread
From: Sasha Levin @ 2018-09-07  0:17 UTC (permalink / raw)
  To: David Sterba; +Cc: stable@vger.kernel.org

On Wed, Sep 05, 2018 at 11:29:50AM +0200, David Sterba wrote:
>On Thu, Aug 30, 2018 at 06:08:40PM +0000, Sasha Levin wrote:
>> From: David Sterba <dsterba@suse.com>
>>
>> [ Upstream commit f5194e34cabaddd348a90f950e0a8188dd26cdc0 ]
>>
>> Prepartory work to fix race between mount and device scan.
>
>The patch is part of a larger series that would have to be backported
>completely, but the bug it fixes was triggered by fuzzing and I don't
>think it's that important for 4.18 stable. It would make more sense for
>some long-term branch like 4.14 though.
>
>The whole series is 959b1c04675735aa..81ffd56b5745355b

We don't really differentiate between stable and LTS trees w.r.t what
patches we backport. I'll grab it for 4.18 as well if you don't have any
objections.

^ permalink raw reply	[flat|nested] 57+ messages in thread

end of thread, other threads:[~2018-09-07  4:55 UTC | newest]

Thread overview: 57+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-08-30 18:07 [PATCH AUTOSEL 4.18 067/113] powerpc: Fix size calculation using resource_size() Sasha Levin
2018-08-30 18:07 ` [PATCH AUTOSEL 4.18 068/113] perf probe powerpc: Fix trace event post-processing Sasha Levin
2018-08-30 18:07 ` [PATCH AUTOSEL 4.18 069/113] block: bvec_nr_vecs() returns value for wrong slab Sasha Levin
2018-08-30 18:07 ` [PATCH AUTOSEL 4.18 070/113] brcmfmac: fix brcmf_wiphy_wowl_params() NULL pointer dereference Sasha Levin
2018-08-30 18:07 ` [PATCH AUTOSEL 4.18 071/113] s390/dasd: fix hanging offline processing due to canceled worker Sasha Levin
2018-08-30 18:07 ` [PATCH AUTOSEL 4.18 072/113] s390/dasd: fix panic for failed online processing Sasha Levin
2018-08-30 18:07 ` [PATCH AUTOSEL 4.18 073/113] ACPI / scan: Initialize status to ACPI_STA_DEFAULT Sasha Levin
2018-08-30 18:07 ` [PATCH AUTOSEL 4.18 074/113] blk-mq: count the hctx as active before allocating tag Sasha Levin
2018-08-30 18:07 ` [PATCH AUTOSEL 4.18 075/113] scsi: aic94xx: fix an error code in aic94xx_init() Sasha Levin
2018-08-30 18:07 ` [PATCH AUTOSEL 4.18 076/113] NFSv4: Fix error handling in nfs4_sp4_select_mode() Sasha Levin
2018-08-30 18:07 ` [PATCH AUTOSEL 4.18 077/113] ALSA: hda/ca0132 - Add DSP setup defaults for Recon3D Sasha Levin
2018-08-30 20:13   ` Takashi Iwai
2018-08-30 18:07 ` [PATCH AUTOSEL 4.18 078/113] ALSA: hda/ca0132 - Add quirk ID and enum " Sasha Levin
2018-08-30 20:08   ` Takashi Iwai
2018-08-30 20:10     ` Connor McAdams
2018-08-31 16:07       ` Sasha Levin
2018-09-02  6:30         ` Takashi Iwai
2018-09-02 12:56           ` Sasha Levin
2018-08-30 18:07 ` [PATCH AUTOSEL 4.18 079/113] ALSA: hda/ca0132 - Add alt_functions unsolicited response Sasha Levin
2018-08-30 18:07 ` [PATCH AUTOSEL 4.18 080/113] Input: do not use WARN() in input_alloc_absinfo() Sasha Levin
2018-08-30 18:07 ` [PATCH AUTOSEL 4.18 081/113] xen/balloon: fix balloon initialization for PVH Dom0 Sasha Levin
2018-08-30 18:07 ` [PATCH AUTOSEL 4.18 082/113] PCI: mvebu: Fix I/O space end address calculation Sasha Levin
2018-08-30 18:07 ` [PATCH AUTOSEL 4.18 083/113] dm kcopyd: avoid softlockup in run_complete_job Sasha Levin
2018-08-30 18:07 ` [PATCH AUTOSEL 4.18 084/113] staging: comedi: ni_mio_common: fix subdevice flags for PFI subdevice Sasha Levin
2018-08-30 18:07 ` [PATCH AUTOSEL 4.18 085/113] ASoC: rt5677: Fix initialization of rt5677_of_match.data Sasha Levin
2018-08-30 18:07 ` [PATCH AUTOSEL 4.18 086/113] iommu/omap: Fix cache flushes on L2 table entries Sasha Levin
2018-08-30 18:07 ` [PATCH AUTOSEL 4.18 087/113] selftests/powerpc: Kill child processes on SIGINT Sasha Levin
2018-08-30 18:07 ` [PATCH AUTOSEL 4.18 088/113] selinux: cleanup dentry and inodes on error in selinuxfs Sasha Levin
2018-08-30 18:07 ` [PATCH AUTOSEL 4.18 089/113] RDS: IB: fix 'passing zero to ERR_PTR()' warning Sasha Levin
2018-08-30 18:07 ` [PATCH AUTOSEL 4.18 090/113] cfq: Suppress compiler warnings about comparisons Sasha Levin
2018-08-30 18:07 ` [PATCH AUTOSEL 4.18 091/113] smb3: fix reset of bytes read and written stats Sasha Levin
2018-08-30 18:08 ` [PATCH AUTOSEL 4.18 092/113] CIFS: fix memory leak and remove dead code Sasha Levin
2018-08-30 18:08 ` [PATCH AUTOSEL 4.18 093/113] SMB3: Number of requests sent should be displayed for SMB3 not just CIFS Sasha Levin
2018-08-30 18:08 ` [PATCH AUTOSEL 4.18 094/113] smb3: if server does not support posix do not allow posix mount option Sasha Levin
2018-08-30 18:08 ` [PATCH AUTOSEL 4.18 095/113] powerpc/platforms/85xx: fix t1042rdb_diu.c build errors & warning Sasha Levin
2018-08-30 18:08 ` [PATCH AUTOSEL 4.18 096/113] powerpc/64s: Make rfi_flush_fallback a little more robust Sasha Levin
2018-08-30 18:08 ` [PATCH AUTOSEL 4.18 097/113] um: fix parallel building with O= option Sasha Levin
2018-08-30 18:08 ` [PATCH AUTOSEL 4.18 098/113] powerpc/pseries: Avoid using the size greater than RTAS_ERROR_LOG_MAX Sasha Levin
2018-08-30 18:08 ` [PATCH AUTOSEL 4.18 099/113] clk: rockchip: Add pclk_rkpwm_pmu to PMU critical clocks in rk3399 Sasha Levin
2018-08-30 18:08 ` [PATCH AUTOSEL 4.18 100/113] drm/amd/display: Read back max backlight value at boot Sasha Levin
2018-08-30 18:08 ` [PATCH AUTOSEL 4.18 101/113] KVM: vmx: track host_state.loaded using a loaded_vmcs pointer Sasha Levin
2018-08-30 18:08 ` [PATCH AUTOSEL 4.18 102/113] kvm: nVMX: Fix fault vector for VMX operation at CPL > 0 Sasha Levin
2018-08-30 18:08 ` [PATCH AUTOSEL 4.18 103/113] drm/etnaviv: fix crash in GPU suspend when init failed due to buffer placement Sasha Levin
2018-08-30 18:08 ` [PATCH AUTOSEL 4.18 104/113] btrfs: Exit gracefully when chunk map cannot be inserted to the tree Sasha Levin
2018-08-30 18:08 ` [PATCH AUTOSEL 4.18 105/113] btrfs: replace: Reset on-disk dev stats value after replace Sasha Levin
2018-08-30 18:08 ` [PATCH AUTOSEL 4.18 106/113] btrfs: fix in-memory value of total_devices after seed device deletion Sasha Levin
2018-08-30 18:08 ` [PATCH AUTOSEL 4.18 107/113] btrfs: Rewrite retry logic in do_chunk_alloc Sasha Levin
2018-09-05  9:22   ` David Sterba
2018-09-07  0:16     ` Sasha Levin
2018-08-30 18:08 ` [PATCH AUTOSEL 4.18 108/113] btrfs: relocation: Only remove reloc rb_trees if reloc control has been initialized Sasha Levin
2018-08-30 18:08 ` [PATCH AUTOSEL 4.18 109/113] btrfs: tree-checker: Detect invalid and empty essential trees Sasha Levin
2018-08-30 18:08 ` [PATCH AUTOSEL 4.18 110/113] btrfs: check-integrity: Fix NULL pointer dereference for degraded mount Sasha Levin
2018-08-30 18:08 ` [PATCH AUTOSEL 4.18 111/113] btrfs: lift uuid_mutex to callers of btrfs_open_devices Sasha Levin
2018-09-05  9:29   ` David Sterba
2018-09-07  0:17     ` Sasha Levin
2018-08-30 18:08 ` [PATCH AUTOSEL 4.18 112/113] btrfs: Don't remove block group that still has pinned down bytes Sasha Levin
2018-08-30 18:08 ` [PATCH AUTOSEL 4.18 113/113] btrfs: Fix a C compliance issue Sasha Levin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).