Home Home > GIT Browse > SLE12-SP3-AZURE
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKernel Build Daemon <kbuild@suse.de>2019-01-22 07:00:32 +0100
committerKernel Build Daemon <kbuild@suse.de>2019-01-22 07:00:32 +0100
commit3a366b96fcaf98129c7cc8892bf204c4603f6faa (patch)
tree8e3235548d3706df4e987006f28b1eab1e452160
parent29f6d0d0ab40e623cbf9f475de234c9181f721e0 (diff)
parentf2a6467622491ccc1cdfbc0ada7c3b3326cf365d (diff)
Merge branch 'SLE12-SP3' into SLE12-SP3-AZURE
-rw-r--r--patches.arch/0049-ACPI-CPPC-Add-prefix-cppc-to-cpudata-structure-name.patch23
-rw-r--r--patches.arch/s390-sles12sp3-01-02-dasd-remove-casts-to-dasd_-_private.patch96
-rw-r--r--patches.drivers/0096-btrfs-have-submit_one_bio-users-use-bio-op-accessors.patch54
-rw-r--r--patches.drivers/ALSA-hda-realtek-Fix-Dell-AIO-LineOut-issue14
-rw-r--r--patches.drivers/i2c-designware-baytrail-Add-support-for-cherrytrail14
-rw-r--r--patches.fixes/0001-omap2fb-Fix-stack-memory-disclosure.patch44
-rw-r--r--patches.fixes/0003-xfs-return-start-block-of-first-bad-log-record-durin.patch2
-rw-r--r--patches.kernel.org/4.4.171-001-ALSA-hda-realtek-Disable-headset-Mic-VREF-for.patch75
-rw-r--r--patches.kernel.org/4.4.171-002-btrfs-cleanup-stop-casting-for-extent_map-loo.patch (renamed from patches.suse/btrfs-0045-cleanup-stop-casting-for-extent_map-lookup-eve.patch)70
-rw-r--r--patches.kernel.org/4.4.171-003-btrfs-Enhance-chunk-validation-check.patch (renamed from patches.suse/btrfs-0051-Enhance-chunk-validation-check.patch)25
-rw-r--r--patches.kernel.org/4.4.171-004-Btrfs-add-validadtion-checks-for-chunk-loadin.patch (renamed from patches.suse/btrfs-0327-add-validadtion-checks-for-chunk-loading.patch)34
-rw-r--r--patches.kernel.org/4.4.171-005-Btrfs-check-inconsistence-between-chunk-and-b.patch (renamed from patches.suse/btrfs-0420-check-inconsistence-between-chunk-and-block-gr.patch)21
-rw-r--r--patches.kernel.org/4.4.171-006-Btrfs-fix-em-leak-in-find_first_block_group.patch (renamed from patches.suse/btrfs-0482-fix-em-leak-in-find_first_block_group.patch)20
-rw-r--r--patches.kernel.org/4.4.171-007-Btrfs-detect-corruption-when-non-root-leaf-ha.patch (renamed from patches.suse/btrfs-0485-detect-corruption-when-non-root-leaf-has-zero-.patch)21
-rw-r--r--patches.kernel.org/4.4.171-008-Btrfs-check-btree-node-s-nritems.patch (renamed from patches.suse/btrfs-0484-check-btree-node-s-nritems.patch)22
-rw-r--r--patches.kernel.org/4.4.171-009-Btrfs-fix-BUG_ON-in-btrfs_mark_buffer_dirty.patch (renamed from patches.suse/btrfs-0653-fix-BUG_ON-in-btrfs_mark_buffer_dirty.patch)23
-rw-r--r--patches.kernel.org/4.4.171-010-Btrfs-memset-to-avoid-stale-content-in-btree-.patch (renamed from patches.suse/btrfs-0509-memset-to-avoid-stale-content-in-btree-node-bl.patch)21
-rw-r--r--patches.kernel.org/4.4.171-011-Btrfs-improve-check_node-to-avoid-reading-cor.patch (renamed from patches.suse/btrfs-0512-improve-check_node-to-avoid-reading-corrupted-.patch)25
-rw-r--r--patches.kernel.org/4.4.171-012-Btrfs-kill-BUG_ON-in-run_delayed_tree_ref.patch (renamed from patches.suse/btrfs-0513-kill-BUG_ON-in-run_delayed_tree_ref.patch)20
-rw-r--r--patches.kernel.org/4.4.171-013-Btrfs-memset-to-avoid-stale-content-in-btree-.patch (renamed from patches.suse/btrfs-0522-memset-to-avoid-stale-content-in-btree-leaf.patch)36
-rw-r--r--patches.kernel.org/4.4.171-014-Btrfs-fix-emptiness-check-for-dirtied-extent-.patch (renamed from patches.suse/btrfs-0654-fix-emptiness-check-for-dirtied-extent-buffers.patch)26
-rw-r--r--patches.kernel.org/4.4.171-015-btrfs-struct-funcs-constify-readers.patch (renamed from patches.suse/btrfs-struct-funcs-constify-readers)123
-rw-r--r--patches.kernel.org/4.4.171-016-btrfs-Refactor-check_leaf-function-for-later-.patch (renamed from patches.suse/0001-btrfs-Refactor-check_leaf-function-for-later-expansi.patch)33
-rw-r--r--patches.kernel.org/4.4.171-017-btrfs-Check-if-item-pointer-overlaps-with-the.patch (renamed from patches.suse/0002-btrfs-Check-if-item-pointer-overlaps-with-the-item-i.patch)19
-rw-r--r--patches.kernel.org/4.4.171-018-btrfs-Add-sanity-check-for-EXTENT_DATA-when-r.patch (renamed from patches.suse/0003-btrfs-Add-sanity-check-for-EXTENT_DATA-when-reading-.patch)53
-rw-r--r--patches.kernel.org/4.4.171-019-btrfs-Add-checker-for-EXTENT_CSUM.patch (renamed from patches.suse/0004-btrfs-Add-checker-for-EXTENT_CSUM.patch)22
-rw-r--r--patches.kernel.org/4.4.171-020-btrfs-Move-leaf-and-node-validation-checker-t.patch (renamed from patches.suse/0005-btrfs-Move-leaf-and-node-validation-checker-to-tree-.patch)46
-rw-r--r--patches.kernel.org/4.4.171-021-btrfs-tree-checker-Enhance-btrfs_check_node-o.patch (renamed from patches.suse/0006-btrfs-tree-checker-Enhance-btrfs_check_node-output.patch)31
-rw-r--r--patches.kernel.org/4.4.171-022-btrfs-tree-checker-Fix-false-panic-for-sanity.patch (renamed from patches.suse/0011-btrfs-tree-checker-Fix-false-panic-for-sanity-test.patch)38
-rw-r--r--patches.kernel.org/4.4.171-023-btrfs-tree-checker-Add-checker-for-dir-item.patch (renamed from patches.suse/0012-btrfs-tree-checker-Add-checker-for-dir-item.patch)28
-rw-r--r--patches.kernel.org/4.4.171-024-btrfs-tree-checker-use-zu-format-string-for-s.patch (renamed from patches.suse/0013-btrfs-tree-checker-use-zu-format-string-for-size_t.patch)18
-rw-r--r--patches.kernel.org/4.4.171-025-btrfs-tree-check-reduce-stack-consumption-in-.patch55
-rw-r--r--patches.kernel.org/4.4.171-026-btrfs-tree-checker-Verify-block_group_item.patch (renamed from patches.suse/0015-btrfs-tree-checker-Verify-block_group_item.patch)68
-rw-r--r--patches.kernel.org/4.4.171-027-btrfs-tree-checker-Detect-invalid-and-empty-e.patch (renamed from patches.suse/0016-btrfs-tree-checker-Detect-invalid-and-empty-essentia.patch)23
-rw-r--r--patches.kernel.org/4.4.171-028-btrfs-validate-type-when-reading-a-chunk.patch77
-rw-r--r--patches.kernel.org/4.4.171-029-btrfs-Check-that-each-block-group-has-corresp.patch (renamed from patches.suse/0017-btrfs-Check-that-each-block-group-has-corresponding-.patch)24
-rw-r--r--patches.kernel.org/4.4.171-030-btrfs-Verify-that-every-chunk-has-correspondi.patch (renamed from patches.suse/0018-btrfs-Verify-that-every-chunk-has-corresponding-bloc.patch)30
-rw-r--r--patches.kernel.org/4.4.171-031-btrfs-tree-checker-Check-level-for-leaves-and.patch69
-rw-r--r--patches.kernel.org/4.4.171-032-btrfs-tree-checker-Fix-misleading-group-syste.patch43
-rw-r--r--patches.kernel.org/4.4.171-033-CIFS-Do-not-hide-EINTR-after-sending-network-.patch40
-rw-r--r--patches.kernel.org/4.4.171-034-cifs-Fix-potential-OOB-access-of-lock-element.patch72
-rw-r--r--patches.kernel.org/4.4.171-035-usb-cdc-acm-send-ZLP-for-Telit-3G-Intel-based.patch41
-rw-r--r--patches.kernel.org/4.4.171-036-USB-storage-don-t-insert-sane-sense-for-SPC3-.patch50
-rw-r--r--patches.kernel.org/4.4.171-037-USB-storage-add-quirk-for-SMI-SM3350.patch50
-rw-r--r--patches.kernel.org/4.4.171-038-USB-Add-USB_QUIRK_DELAY_CTRL_MSG-quirk-for-Co.patch45
-rw-r--r--patches.kernel.org/4.4.171-039-slab-alien-caches-must-not-be-initialized-if-.patch52
-rw-r--r--patches.kernel.org/4.4.171-040-PCI-altera-Fix-altera_pcie_link_is_up.patch47
-rw-r--r--patches.kernel.org/4.4.171-041-PCI-altera-Reorder-read-write-functions.patch81
-rw-r--r--patches.kernel.org/4.4.171-042-PCI-altera-Check-link-status-before-retrain-l.patch40
-rw-r--r--patches.kernel.org/4.4.171-043-PCI-altera-Poll-for-link-up-status-after-retr.patch66
-rw-r--r--patches.kernel.org/4.4.171-044-PCI-altera-Poll-for-link-training-status-afte.patch100
-rw-r--r--patches.kernel.org/4.4.171-045-PCI-altera-Rework-config-accessors-for-use-wi.patch131
-rw-r--r--patches.kernel.org/4.4.171-046-PCI-altera-Move-retrain-from-fixup-to-altera_.patch222
-rw-r--r--patches.kernel.org/4.4.171-047-ACPI-power-Skip-duplicate-power-resource-refe.patch92
-rw-r--r--patches.kernel.org/4.4.171-048-i2c-dev-prevent-adapter-retries-and-timeout-b.patch56
-rw-r--r--patches.kernel.org/4.4.171-049-crypto-cts-fix-crash-on-short-inputs.patch60
-rw-r--r--patches.kernel.org/4.4.171-050-ext4-fix-a-potential-fiemap-page-fault-deadlo.patch52
-rw-r--r--patches.kernel.org/4.4.171-051-sunrpc-use-after-free-in-svc_process_common.patch (renamed from patches.fixes/sunrpc-use-after-free-in-svc_process_common.patch)77
-rw-r--r--patches.kernel.org/4.4.171-052-Linux-4.4.171.patch27
-rw-r--r--patches.suse/0004-mm-memory_hotplug-get-rid-of-is_zone_device_section.patch28
-rw-r--r--patches.suse/0009-btrfs-tree-checker-Enhance-output-for-check_extent_d.patch23
-rw-r--r--patches.suse/0014-btrfs-tree-checker-Replace-root-parameter-with-fs_in.patch87
-rw-r--r--patches.suse/btrfs-0011-make-clear_extent_buffer_uptodate-return-void.patch8
-rw-r--r--patches.suse/btrfs-0012-make-extent_clear_unlock_delalloc-return-void.patch4
-rw-r--r--patches.suse/btrfs-0014-make-extent_range_clear_dirty_for_io-return-vo.patch8
-rw-r--r--patches.suse/btrfs-0015-make-extent_range_redirty_for_io-return-void.patch6
-rw-r--r--patches.suse/btrfs-0273-uapi-linux-btrfs_tree.h-migration-item-types-a.patch32
-rw-r--r--patches.suse/btrfs-0340-fix-error-handling-in-map_private_extent_buffe.patch14
-rw-r--r--patches.suse/btrfs-0453-convert-nodesize-macros-to-static-inlines.patch29
-rw-r--r--patches.suse/btrfs-0504-add-dynamic-debug-support.patch6
-rw-r--r--patches.suse/btrfs-8888-add-allow_unsupported-module-parameter.patch16
-rw-r--r--patches.suse/btrfs-backref-constify-some-arguments41
-rw-r--r--patches.suse/sched-core-Kill-sched_class-task_waking-to-clean-up-the-migration-logic.patch20
-rw-r--r--series.conf81
74 files changed, 2677 insertions, 613 deletions
diff --git a/patches.arch/0049-ACPI-CPPC-Add-prefix-cppc-to-cpudata-structure-name.patch b/patches.arch/0049-ACPI-CPPC-Add-prefix-cppc-to-cpudata-structure-name.patch
index 1190fd9fee..6eef0a82ca 100644
--- a/patches.arch/0049-ACPI-CPPC-Add-prefix-cppc-to-cpudata-structure-name.patch
+++ b/patches.arch/0049-ACPI-CPPC-Add-prefix-cppc-to-cpudata-structure-name.patch
@@ -20,8 +20,6 @@ Signed-off-by: Mian Yousaf Kaukab <yousaf.kaukab@suse.com>
include/acpi/cppc_acpi.h | 4 ++--
3 files changed, 11 insertions(+), 11 deletions(-)
-diff --git a/drivers/acpi/cppc_acpi.c b/drivers/acpi/cppc_acpi.c
-index 715fe8001d59..3d1ae6d37178 100644
--- a/drivers/acpi/cppc_acpi.c
+++ b/drivers/acpi/cppc_acpi.c
@@ -409,13 +409,13 @@ end:
@@ -40,11 +38,9 @@ index 715fe8001d59..3d1ae6d37178 100644
struct acpi_psd_package *pdomain;
struct acpi_psd_package *match_pdomain;
struct cpc_desc *cpc_ptr, *match_cpc_ptr;
-diff --git a/drivers/cpufreq/cppc_cpufreq.c b/drivers/cpufreq/cppc_cpufreq.c
-index e6a33596dea3..6588ec567d93 100644
--- a/drivers/cpufreq/cppc_cpufreq.c
+++ b/drivers/cpufreq/cppc_cpufreq.c
-@@ -30,7 +30,7 @@
+@@ -39,7 +39,7 @@
* performance capabilities, desired performance level
* requested etc.
*/
@@ -53,7 +49,7 @@ index e6a33596dea3..6588ec567d93 100644
/* Capture the max KHz from DMI */
static u64 cppc_dmi_max_khz;
-@@ -100,7 +100,7 @@
+@@ -78,7 +78,7 @@ static int cppc_cpufreq_set_target(struc
unsigned int target_freq,
unsigned int relation)
{
@@ -62,7 +58,7 @@ index e6a33596dea3..6588ec567d93 100644
struct cpufreq_freqs freqs;
int ret = 0;
-@@ -66,7 +66,7 @@ static int cppc_verify_policy(struct cpufreq_policy *policy)
+@@ -108,7 +108,7 @@ static int cppc_verify_policy(struct cpu
static void cppc_cpufreq_stop_cpu(struct cpufreq_policy *policy)
{
int cpu_num = policy->cpu;
@@ -71,7 +67,7 @@ index e6a33596dea3..6588ec567d93 100644
int ret;
cpu->perf_ctrls.desired_perf = cpu->perf_caps.lowest_perf;
-@@ -79,7 +79,7 @@ static void cppc_cpufreq_stop_cpu(struct cpufreq_policy *policy)
+@@ -121,7 +121,7 @@ static void cppc_cpufreq_stop_cpu(struct
static int cppc_cpufreq_cpu_init(struct cpufreq_policy *policy)
{
@@ -80,7 +76,7 @@ index e6a33596dea3..6588ec567d93 100644
unsigned int cpu_num = policy->cpu;
int ret = 0;
-@@ -135,7 +135,7 @@ static struct cpufreq_driver cppc_cpufreq_driver = {
+@@ -190,7 +190,7 @@ static struct cpufreq_driver cppc_cpufre
static int __init cppc_cpufreq_init(void)
{
int i, ret = 0;
@@ -89,7 +85,7 @@ index e6a33596dea3..6588ec567d93 100644
if (acpi_disabled)
return -ENODEV;
-@@ -145,7 +145,7 @@ static int __init cppc_cpufreq_init(void)
+@@ -200,7 +200,7 @@ static int __init cppc_cpufreq_init(void
return -ENOMEM;
for_each_possible_cpu(i) {
@@ -98,7 +94,7 @@ index e6a33596dea3..6588ec567d93 100644
if (!all_cpu_data[i])
goto out;
-@@ -176,7 +176,7 @@ out:
+@@ -236,7 +236,7 @@ out:
static void __exit cppc_cpufreq_exit(void)
{
@@ -107,8 +103,6 @@ index e6a33596dea3..6588ec567d93 100644
int i;
cpufreq_unregister_driver(&cppc_cpufreq_driver);
-diff --git a/include/acpi/cppc_acpi.h b/include/acpi/cppc_acpi.h
-index 0e83cc3009bc..427a7c3e6c75 100644
--- a/include/acpi/cppc_acpi.h
+++ b/include/acpi/cppc_acpi.h
@@ -119,7 +119,7 @@ struct cppc_perf_fb_ctrs {
@@ -129,6 +123,3 @@ index 0e83cc3009bc..427a7c3e6c75 100644
extern unsigned int cppc_get_transition_latency(int cpu);
#endif /* _CPPC_ACPI_H*/
---
-2.11.0
-
diff --git a/patches.arch/s390-sles12sp3-01-02-dasd-remove-casts-to-dasd_-_private.patch b/patches.arch/s390-sles12sp3-01-02-dasd-remove-casts-to-dasd_-_private.patch
index 0a76828c20..3ba843c34b 100644
--- a/patches.arch/s390-sles12sp3-01-02-dasd-remove-casts-to-dasd_-_private.patch
+++ b/patches.arch/s390-sles12sp3-01-02-dasd-remove-casts-to-dasd_-_private.patch
@@ -337,7 +337,7 @@ Acked-by: John Jolly <jjolly@suse.com>
}
--- a/drivers/s390/block/dasd_eckd.c
+++ b/drivers/s390/block/dasd_eckd.c
-@@ -218,10 +218,9 @@ check_XRC (struct ccw1 *de_ccw,
+@@ -212,10 +212,9 @@ check_XRC (struct ccw1 *de_ccw,
struct DE_eckd_data *data,
struct dasd_device *device)
{
@@ -349,7 +349,7 @@ Acked-by: John Jolly <jjolly@suse.com>
if (!private->rdc_data.facilities.XRC_supported)
return 0;
-@@ -243,13 +242,11 @@ static int
+@@ -237,13 +236,11 @@ static int
define_extent(struct ccw1 *ccw, struct DE_eckd_data *data, unsigned int trk,
unsigned int totrk, int cmd, struct dasd_device *device)
{
@@ -364,7 +364,7 @@ Acked-by: John Jolly <jjolly@suse.com>
ccw->cmd_code = DASD_ECKD_CCW_DEFINE_EXTENT;
ccw->flags = 0;
ccw->count = 16;
-@@ -331,10 +328,9 @@ define_extent(struct ccw1 *ccw, struct D
+@@ -322,10 +319,9 @@ define_extent(struct ccw1 *ccw, struct D
static int check_XRC_on_prefix(struct PFX_eckd_data *pfxdata,
struct dasd_device *device)
{
@@ -376,7 +376,7 @@ Acked-by: John Jolly <jjolly@suse.com>
if (!private->rdc_data.facilities.XRC_supported)
return 0;
-@@ -355,12 +351,10 @@ static void fill_LRE_data(struct LRE_eck
+@@ -346,12 +342,10 @@ static void fill_LRE_data(struct LRE_eck
struct dasd_device *device, unsigned int reclen,
unsigned int tlf)
{
@@ -390,7 +390,7 @@ Acked-by: John Jolly <jjolly@suse.com>
memset(data, 0, sizeof(*data));
sector = 0;
if (rec_on_trk) {
-@@ -497,8 +491,8 @@ static int prefix_LRE(struct ccw1 *ccw,
+@@ -488,8 +482,8 @@ static int prefix_LRE(struct ccw1 *ccw,
u16 heads, beghead, endhead;
int rc = 0;
@@ -401,7 +401,7 @@ Acked-by: John Jolly <jjolly@suse.com>
dedata = &pfxdata->define_extent;
lredata = &pfxdata->locate_record;
-@@ -643,12 +637,10 @@ locate_record(struct ccw1 *ccw, struct L
+@@ -633,12 +627,10 @@ locate_record(struct ccw1 *ccw, struct L
unsigned int rec_on_trk, int no_rec, int cmd,
struct dasd_device * device, int reclen)
{
@@ -415,7 +415,7 @@ Acked-by: John Jolly <jjolly@suse.com>
DBF_DEV_EVENT(DBF_INFO, device,
"Locate: trk %d, rec %d, no_rec %d, cmd %d, reclen %d",
trk, rec_on_trk, no_rec, cmd, reclen);
-@@ -812,10 +804,9 @@ static void create_uid(struct dasd_eckd_
+@@ -802,10 +794,9 @@ static void create_uid(struct dasd_eckd_
*/
static int dasd_eckd_generate_uid(struct dasd_device *device)
{
@@ -427,7 +427,7 @@ Acked-by: John Jolly <jjolly@suse.com>
if (!private)
return -ENODEV;
if (!private->ned || !private->gneq)
-@@ -828,11 +819,10 @@ static int dasd_eckd_generate_uid(struct
+@@ -818,11 +809,10 @@ static int dasd_eckd_generate_uid(struct
static int dasd_eckd_get_uid(struct dasd_device *device, struct dasd_uid *uid)
{
@@ -441,7 +441,7 @@ Acked-by: John Jolly <jjolly@suse.com>
spin_lock_irqsave(get_ccwdev_lock(device->cdev), flags);
*uid = private->uid;
spin_unlock_irqrestore(get_ccwdev_lock(device->cdev), flags);
-@@ -1046,10 +1036,9 @@ static unsigned char dasd_eckd_path_acce
+@@ -1036,10 +1026,9 @@ static unsigned char dasd_eckd_path_acce
static void dasd_eckd_clear_conf_data(struct dasd_device *device)
{
@@ -453,7 +453,7 @@ Acked-by: John Jolly <jjolly@suse.com>
private->conf_data = NULL;
private->conf_len = 0;
for (i = 0; i < 8; i++) {
-@@ -1074,7 +1063,7 @@ static int dasd_eckd_read_conf(struct da
+@@ -1060,7 +1049,7 @@ static int dasd_eckd_read_conf(struct da
struct dasd_uid *uid;
char print_path_uid[60], print_device_uid[60];
@@ -462,7 +462,7 @@ Acked-by: John Jolly <jjolly@suse.com>
path_data = &device->path_data;
opm = ccw_device_get_path_mask(device->cdev);
conf_data_saved = 0;
-@@ -1237,11 +1225,10 @@ static u32 get_fcx_max_data(struct dasd_
+@@ -1193,11 +1182,10 @@ static int dasd_eckd_read_conf(struct da
static int verify_fcx_max_data(struct dasd_device *device, __u8 lpm)
{
@@ -475,7 +475,7 @@ Acked-by: John Jolly <jjolly@suse.com>
if (private->fcx_max_data) {
mdc = ccw_device_get_mdc(device->cdev, lpm);
if ((mdc < 0)) {
-@@ -1267,15 +1254,10 @@ static int verify_fcx_max_data(struct da
+@@ -1223,15 +1211,10 @@ static int verify_fcx_max_data(struct da
static int rebuild_device_uid(struct dasd_device *device,
struct path_verification_work_data *data)
{
@@ -483,19 +483,19 @@ Acked-by: John Jolly <jjolly@suse.com>
- struct dasd_path *path_data;
- __u8 lpm, opm;
- int rc;
-+ struct dasd_eckd_private *private = device->private;
-+ struct dasd_path *path_data = &device->path_data;
-+ __u8 lpm, opm = path_data->opm;
-+ int rc = -ENODEV;
-
- rc = -ENODEV;
- private = (struct dasd_eckd_private *) device->private;
- path_data = &device->path_data;
- opm = device->path_data.opm;
++ struct dasd_eckd_private *private = device->private;
++ struct dasd_path *path_data = &device->path_data;
++ __u8 lpm, opm = path_data->opm;
++ int rc = -ENODEV;
for (lpm = 0x80; lpm; lpm >>= 1) {
if (!(lpm & opm))
-@@ -1514,14 +1498,13 @@ static void dasd_eckd_reset_path(struct
+@@ -1465,14 +1448,13 @@ static int dasd_eckd_verify_path(struct
static int dasd_eckd_read_features(struct dasd_device *device)
{
@@ -511,7 +511,7 @@ Acked-by: John Jolly <jjolly@suse.com>
memset(&private->features, 0, sizeof(struct dasd_rssd_features));
cqr = dasd_smalloc_request(DASD_ECKD_MAGIC, 1 /* PSF */ + 1 /* RSSD */,
(sizeof(struct dasd_psf_prssd_data) +
-@@ -1513,11 +1639,9 @@ dasd_eckd_psf_ssc(struct dasd_device *de
+@@ -1607,11 +1589,9 @@ dasd_eckd_psf_ssc(struct dasd_device *de
static int dasd_eckd_validate_server(struct dasd_device *device,
unsigned long flags)
{
@@ -525,7 +525,7 @@ Acked-by: John Jolly <jjolly@suse.com>
if (private->uid.type == UA_BASE_PAV_ALIAS ||
private->uid.type == UA_HYPER_PAV_ALIAS)
return 0;
-@@ -1515,14 +1199,13 @@ static int dasd_eckd_read_conf(struct da
+@@ -1664,14 +1644,13 @@ static void dasd_eckd_kick_validate_serv
static u32 get_fcx_max_data(struct dasd_device *device)
{
@@ -542,7 +542,7 @@ Acked-by: John Jolly <jjolly@suse.com>
fcx_in_css = css_general_characteristics.fcx;
fcx_in_gneq = private->gneq->reserved2[7] & 0x04;
fcx_in_features = private->features.feature[40] & 0x80;
-@@ -1718,7 +1699,7 @@ static void dasd_eckd_kick_validate_serv
+@@ -1696,7 +1675,7 @@ static u32 get_fcx_max_data(struct dasd_
static int
dasd_eckd_check_characteristics(struct dasd_device *device)
{
@@ -551,7 +551,7 @@ Acked-by: John Jolly <jjolly@suse.com>
struct dasd_block *block;
struct dasd_uid temp_uid;
int rc, i;
-@@ -1737,7 +1718,6 @@ dasd_eckd_check_characteristics(struct d
+@@ -1715,7 +1694,6 @@ dasd_eckd_check_characteristics(struct d
dev_info(&device->cdev->dev,
"The DASD is not operating in multipath mode\n");
}
@@ -559,7 +559,7 @@ Acked-by: John Jolly <jjolly@suse.com>
if (!private) {
private = kzalloc(sizeof(*private), GFP_KERNEL | GFP_DMA);
if (!private) {
-@@ -1746,7 +1726,7 @@ dasd_eckd_check_characteristics(struct d
+@@ -1724,7 +1702,7 @@ dasd_eckd_check_characteristics(struct d
"failed\n");
return -ENOMEM;
}
@@ -568,7 +568,7 @@ Acked-by: John Jolly <jjolly@suse.com>
} else {
memset(private, 0, sizeof(*private));
}
-@@ -1862,10 +1842,9 @@ out_err1:
+@@ -1839,10 +1817,9 @@ out_err1:
static void dasd_eckd_uncheck_device(struct dasd_device *device)
{
@@ -580,7 +580,7 @@ Acked-by: John Jolly <jjolly@suse.com>
dasd_alias_disconnect_device_from_lcu(device);
private->ned = NULL;
private->sneq = NULL;
-@@ -1891,7 +1870,7 @@ static void dasd_eckd_uncheck_device(str
+@@ -1865,7 +1842,7 @@ static void dasd_eckd_uncheck_device(str
static struct dasd_ccw_req *
dasd_eckd_analysis_ccw(struct dasd_device *device)
{
@@ -589,7 +589,7 @@ Acked-by: John Jolly <jjolly@suse.com>
struct eckd_count *count_data;
struct LO_eckd_data *LO_data;
struct dasd_ccw_req *cqr;
-@@ -1899,8 +1878,6 @@ dasd_eckd_analysis_ccw(struct dasd_devic
+@@ -1873,8 +1850,6 @@ dasd_eckd_analysis_ccw(struct dasd_devic
int cplength, datasize;
int i;
@@ -598,7 +598,7 @@ Acked-by: John Jolly <jjolly@suse.com>
cplength = 8;
datasize = sizeof(struct DE_eckd_data) + 2*sizeof(struct LO_eckd_data);
cqr = dasd_smalloc_request(DASD_ECKD_MAGIC, cplength, datasize, device);
-@@ -1974,11 +1951,9 @@ static int dasd_eckd_analysis_evaluation
+@@ -1948,11 +1923,9 @@ static int dasd_eckd_analysis_evaluation
static void dasd_eckd_analysis_callback(struct dasd_ccw_req *init_cqr,
void *data)
{
@@ -612,7 +612,7 @@ Acked-by: John Jolly <jjolly@suse.com>
private->init_cqr_status = dasd_eckd_analysis_evaluation(init_cqr);
dasd_sfree_request(init_cqr, device);
dasd_kick_device(device);
-@@ -2005,15 +1980,13 @@ static int dasd_eckd_start_analysis(stru
+@@ -1979,15 +1952,13 @@ static int dasd_eckd_start_analysis(stru
static int dasd_eckd_end_analysis(struct dasd_block *block)
{
@@ -630,7 +630,7 @@ Acked-by: John Jolly <jjolly@suse.com>
status = private->init_cqr_status;
private->init_cqr_status = -1;
if (status == INIT_CQR_ERROR) {
-@@ -2111,9 +2084,8 @@ raw:
+@@ -2085,9 +2056,8 @@ raw:
static int dasd_eckd_do_analysis(struct dasd_block *block)
{
@@ -641,7 +641,7 @@ Acked-by: John Jolly <jjolly@suse.com>
if (private->init_cqr_status < 0)
return dasd_eckd_start_analysis(block);
else
-@@ -2140,9 +2112,8 @@ static int dasd_eckd_basic_to_known(stru
+@@ -2117,9 +2087,8 @@ static int dasd_eckd_basic_to_known(stru
static int
dasd_eckd_fill_geometry(struct dasd_block *block, struct hd_geometry *geo)
{
@@ -652,7 +652,7 @@ Acked-by: John Jolly <jjolly@suse.com>
if (dasd_check_blocksize(block->bp_block) == 0) {
geo->sectors = recs_per_track(&private->rdc_data,
0, block->bp_block);
-@@ -2353,8 +2324,8 @@ dasd_eckd_build_format(struct dasd_devic
+@@ -2156,8 +2125,8 @@ dasd_eckd_build_format(struct dasd_devic
if (!startdev)
startdev = base;
@@ -663,7 +663,7 @@ Acked-by: John Jolly <jjolly@suse.com>
rpt = recs_per_track(&base_priv->rdc_data, 0, fdata->blksize);
-@@ -2619,9 +2590,7 @@ dasd_eckd_format_build_ccw_req(struct da
+@@ -2407,9 +2376,7 @@ dasd_eckd_format_build_ccw_req(struct da
static int dasd_eckd_format_sanity_checks(struct dasd_device *base,
struct format_data_t *fdata)
{
@@ -674,7 +674,7 @@ Acked-by: John Jolly <jjolly@suse.com>
if (fdata->start_unit >=
(private->real_cyl * private->rdc_data.trk_per_cyl)) {
-@@ -2670,16 +2639,14 @@ static int dasd_eckd_format_process_data
+@@ -2447,16 +2414,14 @@ static int dasd_eckd_format_process_data
struct format_data_t *fdata,
int enable_pav)
{
@@ -692,7 +692,7 @@ Acked-by: John Jolly <jjolly@suse.com>
rc = dasd_eckd_format_sanity_checks(base, fdata);
if (rc)
return rc;
-@@ -3049,9 +3017,8 @@ static void dasd_eckd_check_for_device_c
+@@ -2576,9 +2541,8 @@ static void dasd_eckd_check_for_device_c
{
char mask;
char *sense = NULL;
@@ -703,7 +703,7 @@ Acked-by: John Jolly <jjolly@suse.com>
/* first of all check for state change pending interrupt */
mask = DEV_STAT_ATTENTION | DEV_STAT_DEV_END | DEV_STAT_UNIT_EXCEP;
if ((scsw_dstat(&irb->scsw) & mask) == mask) {
-@@ -3140,7 +3107,7 @@ static struct dasd_ccw_req *dasd_eckd_bu
+@@ -2667,7 +2631,7 @@ static struct dasd_ccw_req *dasd_eckd_bu
struct dasd_device *basedev;
basedev = block->base;
@@ -712,7 +712,7 @@ Acked-by: John Jolly <jjolly@suse.com>
if (rq_data_dir(req) == READ)
cmd = DASD_ECKD_CCW_READ_MT;
else if (rq_data_dir(req) == WRITE)
-@@ -3496,8 +3463,8 @@ static int prepare_itcw(struct itcw *itc
+@@ -3023,8 +2987,8 @@ static int prepare_itcw(struct itcw *itc
/* setup prefix data */
@@ -723,7 +723,7 @@ Acked-by: John Jolly <jjolly@suse.com>
dedata = &pfxdata.define_extent;
lredata = &pfxdata.locate_record;
-@@ -3800,7 +3767,7 @@ static struct dasd_ccw_req *dasd_eckd_bu
+@@ -3313,7 +3277,7 @@ static struct dasd_ccw_req *dasd_eckd_bu
struct dasd_ccw_req *cqr;
basedev = block->base;
@@ -732,7 +732,7 @@ Acked-by: John Jolly <jjolly@suse.com>
/* Calculate number of blocks/records per track. */
blksize = block->bp_block;
-@@ -4025,7 +3992,7 @@ dasd_eckd_free_cp(struct dasd_ccw_req *c
+@@ -3538,7 +3502,7 @@ dasd_eckd_free_cp(struct dasd_ccw_req *c
if (!dasd_page_cache)
goto out;
@@ -741,7 +741,7 @@ Acked-by: John Jolly <jjolly@suse.com>
blksize = cqr->block->bp_block;
blk_per_trk = recs_per_track(&private->rdc_data, 0, blksize);
recid = blk_rq_pos(req) >> cqr->block->s2b_shift;
-@@ -4109,7 +4076,7 @@ static struct dasd_ccw_req *dasd_eckd_bu
+@@ -3622,7 +3586,7 @@ static struct dasd_ccw_req *dasd_eckd_bu
startdev = dasd_alias_get_start_dev(base);
if (!startdev)
startdev = base;
@@ -750,7 +750,7 @@ Acked-by: John Jolly <jjolly@suse.com>
if (private->count >= DASD_ECKD_CHANQ_MAX_SIZE)
return ERR_PTR(-EBUSY);
-@@ -4132,7 +4099,7 @@ static int dasd_eckd_free_alias_cp(struc
+@@ -3645,7 +3609,7 @@ static int dasd_eckd_free_alias_cp(struc
unsigned long flags;
spin_lock_irqsave(get_ccwdev_lock(cqr->memdev->cdev), flags);
@@ -759,7 +759,7 @@ Acked-by: John Jolly <jjolly@suse.com>
private->count--;
spin_unlock_irqrestore(get_ccwdev_lock(cqr->memdev->cdev), flags);
return dasd_eckd_free_cp(cqr, req);
-@@ -4142,15 +4109,14 @@ static int
+@@ -3655,15 +3619,14 @@ static int
dasd_eckd_fill_info(struct dasd_device * device,
struct dasd_information2_t * info)
{
@@ -778,7 +778,7 @@ Acked-by: John Jolly <jjolly@suse.com>
info->confdata_size = min((unsigned long)private->conf_len,
sizeof(info->configuration_data));
memcpy(info->configuration_data, private->conf_data,
-@@ -4463,8 +4429,7 @@ dasd_eckd_performance(struct dasd_device
+@@ -3976,8 +3939,7 @@ dasd_eckd_performance(struct dasd_device
static int
dasd_eckd_get_attrib(struct dasd_device *device, void __user *argp)
{
@@ -788,7 +788,7 @@ Acked-by: John Jolly <jjolly@suse.com>
struct attrib_data_t attrib = private->attrib;
int rc;
-@@ -4488,8 +4453,7 @@ dasd_eckd_get_attrib(struct dasd_device
+@@ -4001,8 +3963,7 @@ dasd_eckd_get_attrib(struct dasd_device
static int
dasd_eckd_set_attrib(struct dasd_device *device, void __user *argp)
{
@@ -798,7 +798,7 @@ Acked-by: John Jolly <jjolly@suse.com>
struct attrib_data_t attrib;
if (!capable(CAP_SYS_ADMIN))
-@@ -4977,15 +4941,13 @@ static int dasd_eckd_pm_freeze(struct da
+@@ -4465,15 +4426,13 @@ static int dasd_eckd_pm_freeze(struct da
static int dasd_eckd_restore_device(struct dasd_device *device)
{
@@ -815,7 +815,7 @@ Acked-by: John Jolly <jjolly@suse.com>
/* Read Configuration Data */
rc = dasd_eckd_read_conf(device);
if (rc) {
-@@ -5049,14 +5011,12 @@ out_err:
+@@ -4537,14 +4496,12 @@ out_err:
static int dasd_eckd_reload_device(struct dasd_device *device)
{
@@ -831,7 +831,7 @@ Acked-by: John Jolly <jjolly@suse.com>
spin_lock_irqsave(get_ccwdev_lock(device->cdev), flags);
old_base = private->uid.base_unit_addr;
spin_unlock_irqrestore(get_ccwdev_lock(device->cdev), flags);
-@@ -5103,12 +5063,10 @@ static int dasd_eckd_read_message_buffer
+@@ -4591,12 +4548,10 @@ static int dasd_eckd_read_message_buffer
{
struct dasd_rssd_messages *message_buf;
struct dasd_psf_prssd_data *prssdp;
@@ -844,7 +844,7 @@ Acked-by: John Jolly <jjolly@suse.com>
cqr = dasd_smalloc_request(DASD_ECKD_MAGIC, 1 /* PSF */ + 1 /* RSSD */,
(sizeof(struct dasd_psf_prssd_data) +
sizeof(struct dasd_rssd_messages)),
-@@ -5537,14 +5495,13 @@ static int dasd_eckd_cuir_remove_path(st
+@@ -4864,14 +4819,13 @@ static int dasd_eckd_cuir_quiesce(struct
struct subchannel_id sch_id,
struct dasd_cuir_message *cuir)
{
@@ -860,7 +860,7 @@ Acked-by: John Jolly <jjolly@suse.com>
/* active devices */
list_for_each_entry_safe(dev, n, &private->lcu->active_devices,
alias_list) {
-@@ -5599,13 +5556,12 @@ out_err:
+@@ -4927,13 +4881,12 @@ static int dasd_eckd_cuir_resume(struct
struct subchannel_id sch_id,
struct dasd_cuir_message *cuir)
{
@@ -970,7 +970,7 @@ Acked-by: John Jolly <jjolly@suse.com>
}
--- a/drivers/s390/block/dasd_int.h
+++ b/drivers/s390/block/dasd_int.h
-@@ -476,7 +476,7 @@ struct dasd_device {
+@@ -445,7 +445,7 @@ struct dasd_device {
/* Device discipline stuff. */
struct dasd_discipline *discipline;
struct dasd_discipline *base_discipline;
diff --git a/patches.drivers/0096-btrfs-have-submit_one_bio-users-use-bio-op-accessors.patch b/patches.drivers/0096-btrfs-have-submit_one_bio-users-use-bio-op-accessors.patch
index de377c3d6a..041e929a9a 100644
--- a/patches.drivers/0096-btrfs-have-submit_one_bio-users-use-bio-op-accessors.patch
+++ b/patches.drivers/0096-btrfs-have-submit_one_bio-users-use-bio-op-accessors.patch
@@ -24,7 +24,7 @@ Acked-by: Hannes Reinecke <hare@suse.de>
--- a/fs/btrfs/extent_io.c
+++ b/fs/btrfs/extent_io.c
-@@ -2392,7 +2392,7 @@ static int bio_readpage_error(struct bio
+@@ -2389,7 +2389,7 @@ static int bio_readpage_error(struct bio
int read_mode;
int ret;
@@ -33,7 +33,7 @@ Acked-by: Hannes Reinecke <hare@suse.de>
ret = btrfs_get_io_failure_record(inode, start, end, &failrec);
if (ret)
-@@ -2418,6 +2418,7 @@ static int bio_readpage_error(struct bio
+@@ -2415,6 +2415,7 @@ static int bio_readpage_error(struct bio
free_io_failure(inode, failrec);
return -EIO;
}
@@ -41,7 +41,7 @@ Acked-by: Hannes Reinecke <hare@suse.de>
pr_debug("Repair Read Error: submitting new read[%#x] to this_mirror=%d, in_validation=%d\n",
read_mode, failrec->this_mirror, failrec->in_validation);
-@@ -2724,8 +2725,8 @@ struct bio *btrfs_io_bio_alloc(gfp_t gfp
+@@ -2720,8 +2721,8 @@ struct bio *btrfs_io_bio_alloc(gfp_t gfp
}
@@ -52,7 +52,7 @@ Acked-by: Hannes Reinecke <hare@suse.de>
{
int ret = 0;
struct bio_vec *bvec = bio->bi_io_vec + bio->bi_vcnt - 1;
-@@ -2736,12 +2737,12 @@ static int __must_check submit_one_bio(i
+@@ -2732,12 +2733,12 @@ static int __must_check submit_one_bio(i
start = page_offset(page) + bvec->bv_offset;
bio->bi_private = NULL;
@@ -68,7 +68,7 @@ Acked-by: Hannes Reinecke <hare@suse.de>
else
btrfsic_submit_bio(bio);
-@@ -2749,20 +2750,20 @@ static int __must_check submit_one_bio(i
+@@ -2745,20 +2746,20 @@ static int __must_check submit_one_bio(i
return ret;
}
@@ -93,7 +93,7 @@ Acked-by: Hannes Reinecke <hare@suse.de>
struct writeback_control *wbc,
struct page *page, sector_t sector,
size_t size, unsigned long offset,
-@@ -2789,10 +2790,9 @@ static int submit_extent_page(int rw, st
+@@ -2786,10 +2787,9 @@ static int submit_extent_page(int rw, st
if (prev_bio_flags != bio_flags || !contig ||
force_bio_submit ||
@@ -106,7 +106,7 @@ Acked-by: Hannes Reinecke <hare@suse.de>
if (ret < 0) {
*bio_ret = NULL;
return ret;
-@@ -2813,6 +2813,7 @@ static int submit_extent_page(int rw, st
+@@ -2810,6 +2810,7 @@ static int submit_extent_page(int rw, st
bio_add_page(bio, page, page_size, offset);
bio->bi_end_io = end_io_func;
bio->bi_private = tree;
@@ -114,7 +114,7 @@ Acked-by: Hannes Reinecke <hare@suse.de>
if (wbc) {
wbc_init_bio(wbc, bio);
wbc_account_io(wbc, page, page_size);
-@@ -2821,7 +2822,7 @@ static int submit_extent_page(int rw, st
+@@ -2818,7 +2819,7 @@ static int submit_extent_page(int rw, st
if (bio_ret)
*bio_ret = bio;
else
@@ -123,7 +123,7 @@ Acked-by: Hannes Reinecke <hare@suse.de>
return ret;
}
-@@ -2886,7 +2887,7 @@ static int __do_readpage(struct extent_i
+@@ -2882,7 +2883,7 @@ static int __do_readpage(struct extent_i
get_extent_t *get_extent,
struct extent_map **em_cached,
struct bio **bio, int mirror_num,
@@ -132,7 +132,7 @@ Acked-by: Hannes Reinecke <hare@suse.de>
u64 *prev_em_start)
{
struct inode *inode = page->mapping->host;
-@@ -3069,8 +3070,8 @@ static int __do_readpage(struct extent_i
+@@ -3065,8 +3066,8 @@ static int __do_readpage(struct extent_i
}
pnr -= page->index;
@@ -143,7 +143,7 @@ Acked-by: Hannes Reinecke <hare@suse.de>
bdev, bio, pnr,
end_bio_extent_readpage, mirror_num,
*bio_flags,
-@@ -3102,7 +3103,7 @@ static inline void __do_contiguous_readp
+@@ -3097,7 +3098,7 @@ static inline void __do_contiguous_readp
get_extent_t *get_extent,
struct extent_map **em_cached,
struct bio **bio, int mirror_num,
@@ -152,7 +152,7 @@ Acked-by: Hannes Reinecke <hare@suse.de>
u64 *prev_em_start)
{
struct inode *inode;
-@@ -3123,7 +3124,7 @@ static inline void __do_contiguous_readp
+@@ -3118,7 +3119,7 @@ static inline void __do_contiguous_readp
for (index = 0; index < nr_pages; index++) {
__do_readpage(tree, pages[index], get_extent, em_cached, bio,
@@ -161,7 +161,7 @@ Acked-by: Hannes Reinecke <hare@suse.de>
page_cache_release(pages[index]);
}
}
-@@ -3133,7 +3134,7 @@ static void __extent_readpages(struct ex
+@@ -3128,7 +3129,7 @@ static void __extent_readpages(struct ex
int nr_pages, get_extent_t *get_extent,
struct extent_map **em_cached,
struct bio **bio, int mirror_num,
@@ -170,7 +170,7 @@ Acked-by: Hannes Reinecke <hare@suse.de>
u64 *prev_em_start)
{
u64 start = 0;
-@@ -3155,7 +3156,7 @@ static void __extent_readpages(struct ex
+@@ -3150,7 +3151,7 @@ static void __extent_readpages(struct ex
index - first_index, start,
end, get_extent, em_cached,
bio, mirror_num, bio_flags,
@@ -179,7 +179,7 @@ Acked-by: Hannes Reinecke <hare@suse.de>
start = page_start;
end = start + PAGE_CACHE_SIZE - 1;
first_index = index;
-@@ -3166,7 +3167,7 @@ static void __extent_readpages(struct ex
+@@ -3161,7 +3162,7 @@ static void __extent_readpages(struct ex
__do_contiguous_readpages(tree, &pages[first_index],
index - first_index, start,
end, get_extent, em_cached, bio,
@@ -188,7 +188,7 @@ Acked-by: Hannes Reinecke <hare@suse.de>
prev_em_start);
}
-@@ -3174,7 +3175,7 @@ static int __extent_read_full_page(struc
+@@ -3169,7 +3170,7 @@ static int __extent_read_full_page(struc
struct page *page,
get_extent_t *get_extent,
struct bio **bio, int mirror_num,
@@ -197,7 +197,7 @@ Acked-by: Hannes Reinecke <hare@suse.de>
{
struct inode *inode = page->mapping->host;
struct btrfs_ordered_extent *ordered;
-@@ -3194,7 +3195,7 @@ static int __extent_read_full_page(struc
+@@ -3189,7 +3190,7 @@ static int __extent_read_full_page(struc
}
ret = __do_readpage(tree, page, get_extent, NULL, bio, mirror_num,
@@ -206,7 +206,7 @@ Acked-by: Hannes Reinecke <hare@suse.de>
return ret;
}
-@@ -3206,9 +3207,9 @@ int extent_read_full_page(struct extent_
+@@ -3201,9 +3202,9 @@ int extent_read_full_page(struct extent_
int ret;
ret = __extent_read_full_page(tree, page, get_extent, &bio, mirror_num,
@@ -218,7 +218,7 @@ Acked-by: Hannes Reinecke <hare@suse.de>
return ret;
}
-@@ -3444,8 +3445,8 @@ static noinline_for_stack int __extent_w
+@@ -3439,8 +3440,8 @@ static noinline_for_stack int __extent_w
page->index, cur, end);
}
@@ -229,7 +229,7 @@ Acked-by: Hannes Reinecke <hare@suse.de>
bdev, &epd->bio, max_nr,
end_bio_extent_writepage,
0, 0, 0, false);
-@@ -3484,13 +3485,11 @@ static int __extent_writepage(struct pag
+@@ -3479,13 +3480,11 @@ static int __extent_writepage(struct pag
size_t pg_offset = 0;
loff_t i_size = i_size_read(inode);
unsigned long end_index = i_size >> PAGE_CACHE_SHIFT;
@@ -244,16 +244,16 @@ Acked-by: Hannes Reinecke <hare@suse.de>
trace___extent_writepage(page, inode, wbc);
-@@ -3735,7 +3734,7 @@ static noinline_for_stack int write_one_
- u64 offset = eb->start;
+@@ -3731,7 +3730,7 @@ static noinline_for_stack int write_one_
unsigned long i, num_pages;
unsigned long bio_flags = 0;
+ unsigned long start, end;
- int rw = (epd->sync_io ? WRITE_SYNC : WRITE) | REQ_META;
+ int write_flags = (epd->sync_io ? WRITE_SYNC : 0) | REQ_META;
int ret = 0;
clear_bit(EXTENT_BUFFER_WRITE_ERR, &eb->bflags);
-@@ -3766,9 +3765,10 @@ static noinline_for_stack int write_one_
+@@ -3762,9 +3761,10 @@ static noinline_for_stack int write_one_
clear_page_dirty_for_io(p);
set_page_writeback(p);
@@ -267,7 +267,7 @@ Acked-by: Hannes Reinecke <hare@suse.de>
0, epd->bio_flags, bio_flags, false);
epd->bio_flags = bio_flags;
if (ret) {
-@@ -4078,13 +4078,12 @@ retry:
+@@ -4074,13 +4074,12 @@ retry:
static void flush_epd_write_bio(struct extent_page_data *epd)
{
if (epd->bio) {
@@ -284,7 +284,7 @@ Acked-by: Hannes Reinecke <hare@suse.de>
BUG_ON(ret < 0); /* -ENOMEM */
epd->bio = NULL;
}
-@@ -4211,19 +4210,19 @@ int extent_readpages(struct extent_io_tr
+@@ -4207,19 +4206,19 @@ int extent_readpages(struct extent_io_tr
if (nr < ARRAY_SIZE(pagepool))
continue;
__extent_readpages(tree, pagepool, nr, get_extent, &em_cached,
@@ -307,7 +307,7 @@ Acked-by: Hannes Reinecke <hare@suse.de>
return 0;
}
-@@ -5256,7 +5255,7 @@ int read_extent_buffer_pages(struct exte
+@@ -5255,7 +5254,7 @@ int read_extent_buffer_pages(struct exte
err = __extent_read_full_page(tree, page,
get_extent, &bio,
mirror_num, &bio_flags,
@@ -316,7 +316,7 @@ Acked-by: Hannes Reinecke <hare@suse.de>
if (err)
ret = err;
} else {
-@@ -5275,8 +5274,7 @@ int read_extent_buffer_pages(struct exte
+@@ -5264,8 +5263,7 @@ int read_extent_buffer_pages(struct exte
}
if (bio) {
diff --git a/patches.drivers/ALSA-hda-realtek-Fix-Dell-AIO-LineOut-issue b/patches.drivers/ALSA-hda-realtek-Fix-Dell-AIO-LineOut-issue
index 5d69b133eb..b50a29bc0a 100644
--- a/patches.drivers/ALSA-hda-realtek-Fix-Dell-AIO-LineOut-issue
+++ b/patches.drivers/ALSA-hda-realtek-Fix-Dell-AIO-LineOut-issue
@@ -29,7 +29,7 @@ Signed-off-by: Takashi Iwai <tiwai@suse.de>
--- a/sound/pci/hda/patch_realtek.c
+++ b/sound/pci/hda/patch_realtek.c
-@@ -5087,6 +5087,22 @@ static void alc280_fixup_hp_9480m(struct
+@@ -5119,6 +5119,22 @@ static void alc280_fixup_hp_9480m(struct
}
}
@@ -49,10 +49,10 @@ Signed-off-by: Takashi Iwai <tiwai@suse.de>
+ spec->gen.preferred_dacs = preferred_pairs;
+}
+
- /* for hda_fixup_thinkpad_acpi() */
- #include "thinkpad_helper.c"
-
-@@ -5203,6 +5219,8 @@ enum {
+ static void alc_fixup_disable_mic_vref(struct hda_codec *codec,
+ const struct hda_fixup *fix, int action)
+ {
+@@ -5245,6 +5261,8 @@ enum {
ALC233_FIXUP_EAPD_COEF_AND_MIC_NO_PRESENCE,
ALC294_FIXUP_LENOVO_MIC_LOCATION,
ALC700_FIXUP_INTEL_REFERENCE,
@@ -61,7 +61,7 @@ Signed-off-by: Takashi Iwai <tiwai@suse.de>
};
static const struct hda_fixup alc269_fixups[] = {
-@@ -6009,6 +6027,21 @@ static const struct hda_fixup alc269_fix
+@@ -6065,6 +6083,21 @@ static const struct hda_fixup alc269_fix
{}
}
},
@@ -83,7 +83,7 @@ Signed-off-by: Takashi Iwai <tiwai@suse.de>
};
static const struct snd_pci_quirk alc269_fixup_tbl[] = {
-@@ -6476,7 +6509,7 @@ static const struct snd_hda_pin_quirk al
+@@ -6542,7 +6575,7 @@ static const struct snd_hda_pin_quirk al
{0x14, 0x90170110},
{0x1b, 0x90a70130},
{0x21, 0x03211020}),
diff --git a/patches.drivers/i2c-designware-baytrail-Add-support-for-cherrytrail b/patches.drivers/i2c-designware-baytrail-Add-support-for-cherrytrail
index 408551d1cb..68e82c0064 100644
--- a/patches.drivers/i2c-designware-baytrail-Add-support-for-cherrytrail
+++ b/patches.drivers/i2c-designware-baytrail-Add-support-for-cherrytrail
@@ -23,7 +23,7 @@ Acked-by: Takashi Iwai <tiwai@suse.de>
--- a/drivers/i2c/busses/i2c-designware-baytrail.c
+++ b/drivers/i2c/busses/i2c-designware-baytrail.c
-@@ -24,18 +24,27 @@
+@@ -25,18 +25,27 @@
#define SEMAPHORE_TIMEOUT 100
#define PUNIT_SEMAPHORE 0x7
@@ -53,7 +53,7 @@ Acked-by: Takashi Iwai <tiwai@suse.de>
if (ret) {
dev_err(dev->dev, "iosf failed to read punit semaphore\n");
return ret;
-@@ -50,8 +59,8 @@ static void reset_semaphore(struct dw_i2
+@@ -49,8 +58,8 @@ static int get_sem(struct dw_i2c_dev *de
static void reset_semaphore(struct dw_i2c_dev *dev)
{
@@ -64,7 +64,7 @@ Acked-by: Takashi Iwai <tiwai@suse.de>
dev_err(dev->dev, "iosf failed to reset punit semaphore during write\n");
pm_qos_update_request(&dev->pm_qos, PM_QOS_DEFAULT_VALUE);
-@@ -100,7 +100,8 @@
+@@ -58,7 +67,8 @@ static void reset_semaphore(struct dw_i2
static int baytrail_i2c_acquire(struct dw_i2c_dev *dev)
{
@@ -74,7 +74,7 @@ Acked-by: Takashi Iwai <tiwai@suse.de>
int ret;
unsigned long start, end;
-@@ -77,8 +87,7 @@ static int baytrail_i2c_acquire(struct d
+@@ -78,8 +88,7 @@ static int baytrail_i2c_acquire(struct d
pm_qos_update_request(&dev->pm_qos, 0);
/* host driver writes to side band semaphore register */
@@ -84,7 +84,7 @@ Acked-by: Takashi Iwai <tiwai@suse.de>
if (ret) {
dev_err(dev->dev, "iosf punit semaphore request failed\n");
goto out;
-@@ -102,8 +111,7 @@ static int baytrail_i2c_acquire(struct d
+@@ -104,8 +113,7 @@ static int baytrail_i2c_acquire(struct d
out:
reset_semaphore(dev);
@@ -96,7 +96,7 @@ Acked-by: Takashi Iwai <tiwai@suse.de>
else
--- a/drivers/i2c/busses/i2c-designware-core.h
+++ b/drivers/i2c/busses/i2c-designware-core.h
-@@ -113,6 +113,8 @@ struct dw_i2c_dev {
+@@ -116,6 +116,8 @@ struct dw_i2c_dev {
#define ACCESS_16BIT 0x00000002
#define ACCESS_INTR_MASK 0x00000004
@@ -170,7 +170,7 @@ Acked-by: Takashi Iwai <tiwai@suse.de>
MODULE_DEVICE_TABLE(pci, i2_designware_pci_ids);
--- a/drivers/i2c/busses/i2c-designware-platdrv.c
+++ b/drivers/i2c/busses/i2c-designware-platdrv.c
-@@ -120,7 +120,7 @@ static const struct acpi_device_id dw_i2
+@@ -121,7 +121,7 @@ static const struct acpi_device_id dw_i2
{ "INT3432", 0 },
{ "INT3433", 0 },
{ "80860F41", 0 },
diff --git a/patches.fixes/0001-omap2fb-Fix-stack-memory-disclosure.patch b/patches.fixes/0001-omap2fb-Fix-stack-memory-disclosure.patch
new file mode 100644
index 0000000000..5b491e79c5
--- /dev/null
+++ b/patches.fixes/0001-omap2fb-Fix-stack-memory-disclosure.patch
@@ -0,0 +1,44 @@
+From a01421e4484327fe44f8e126793ed5a48a221e24 Mon Sep 17 00:00:00 2001
+From: Vlad Tsyrklevich <vlad@tsyrklevich.net>
+Date: Fri, 11 Jan 2019 14:34:38 +0100
+Subject: omap2fb: Fix stack memory disclosure
+Git-commit: a01421e4484327fe44f8e126793ed5a48a221e24
+Patch-mainline: v5.0-rc3
+References: bsc#1106929
+
+Using [1] for static analysis I found that the OMAPFB_QUERY_PLANE,
+OMAPFB_GET_COLOR_KEY, OMAPFB_GET_DISPLAY_INFO, and OMAPFB_GET_VRAM_INFO
+cases could all leak uninitialized stack memory--either due to
+uninitialized padding or 'reserved' fields.
+
+Fix them by clearing the shared union used to store copied out data.
+
+[1] https://github.com/vlad902/kernel-uninitialized-memory-checker
+
+Signed-off-by: Vlad Tsyrklevich <vlad@tsyrklevich.net>
+Reviewed-by: Kees Cook <keescook@chromium.org>
+Fixes: b39a982ddecf ("OMAP: DSS2: omapfb driver")
+Cc: security@kernel.org
+[b.zolnierkie: prefix patch subject with "omap2fb: "]
+Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
+Acked-by: Thomas Zimmermann <tzimmermann@suse.de>
+---
+ drivers/video/fbdev/omap2/omapfb/omapfb-ioctl.c | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/drivers/video/fbdev/omap2/omapfb/omapfb-ioctl.c b/drivers/video/fbdev/omap2/omapfb/omapfb-ioctl.c
+index a3edb20ea4c3..a846d32ee653 100644
+--- a/drivers/video/fbdev/omap2/omapfb/omapfb-ioctl.c
++++ b/drivers/video/fbdev/omap2/omapfb/omapfb-ioctl.c
+@@ -609,6 +609,8 @@ int omapfb_ioctl(struct fb_info *fbi, unsigned int cmd, unsigned long arg)
+
+ int r = 0;
+
++ memset(&p, 0, sizeof(p));
++
+ switch (cmd) {
+ case OMAPFB_SYNC_GFX:
+ DBG("ioctl SYNC_GFX\n");
+--
+2.20.1
+
diff --git a/patches.fixes/0003-xfs-return-start-block-of-first-bad-log-record-durin.patch b/patches.fixes/0003-xfs-return-start-block-of-first-bad-log-record-durin.patch
index 80812da1da..0ce00f62cd 100644
--- a/patches.fixes/0003-xfs-return-start-block-of-first-bad-log-record-durin.patch
+++ b/patches.fixes/0003-xfs-return-start-block-of-first-bad-log-record-durin.patch
@@ -30,7 +30,7 @@ Signed-off-by: Luis R. Rodriguez <mcgrof@suse.com>
--- a/fs/xfs/xfs_log_recover.c
+++ b/fs/xfs/xfs_log_recover.c
-@@ -4306,10 +4306,12 @@ xlog_do_recovery_pass(
+@@ -4245,10 +4245,12 @@ xlog_do_recovery_pass(
struct xlog *log,
xfs_daddr_t head_blk,
xfs_daddr_t tail_blk,
diff --git a/patches.kernel.org/4.4.171-001-ALSA-hda-realtek-Disable-headset-Mic-VREF-for.patch b/patches.kernel.org/4.4.171-001-ALSA-hda-realtek-Disable-headset-Mic-VREF-for.patch
new file mode 100644
index 0000000000..92bf85f8d9
--- /dev/null
+++ b/patches.kernel.org/4.4.171-001-ALSA-hda-realtek-Disable-headset-Mic-VREF-for.patch
@@ -0,0 +1,75 @@
+From: Kailang Yang <kailang@realtek.com>
+Date: Wed, 9 Jan 2019 17:05:24 +0800
+Subject: [PATCH] ALSA: hda/realtek - Disable headset Mic VREF for headset mode
+ of ALC225
+References: bnc#1012382
+Patch-mainline: 4.4.171
+Git-commit: d1dd42110d2727e81b9265841a62bc84c454c3a2
+
+commit d1dd42110d2727e81b9265841a62bc84c454c3a2 upstream.
+
+Disable Headset Mic VREF for headset mode of ALC225.
+This will be controlled by coef bits of headset mode functions.
+
+[ Fixed a compile warning and code simplification -- tiwai ]
+
+Signed-off-by: Kailang Yang <kailang@realtek.com>
+Cc: <stable@vger.kernel.org>
+Signed-off-by: Takashi Iwai <tiwai@suse.de>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+Signed-off-by: Jiri Slaby <jslaby@suse.cz>
+---
+ sound/pci/hda/patch_realtek.c | 16 +++++++++++++++-
+ 1 file changed, 15 insertions(+), 1 deletion(-)
+
+diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
+index 0467e5ba82e0..5d8ac2d798df 100644
+--- a/sound/pci/hda/patch_realtek.c
++++ b/sound/pci/hda/patch_realtek.c
+@@ -4792,6 +4792,13 @@ static void alc280_fixup_hp_9480m(struct hda_codec *codec,
+ }
+ }
+
++static void alc_fixup_disable_mic_vref(struct hda_codec *codec,
++ const struct hda_fixup *fix, int action)
++{
++ if (action == HDA_FIXUP_ACT_PRE_PROBE)
++ snd_hda_codec_set_pin_target(codec, 0x19, PIN_VREFHIZ);
++}
++
+ /* for hda_fixup_thinkpad_acpi() */
+ #include "thinkpad_helper.c"
+
+@@ -4891,6 +4898,7 @@ enum {
+ ALC293_FIXUP_LENOVO_SPK_NOISE,
+ ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY,
+ ALC255_FIXUP_DELL_SPK_NOISE,
++ ALC225_FIXUP_DISABLE_MIC_VREF,
+ ALC225_FIXUP_DELL1_MIC_NO_PRESENCE,
+ ALC295_FIXUP_DISABLE_DAC3,
+ ALC280_FIXUP_HP_HEADSET_MIC,
+@@ -5546,6 +5554,12 @@ static const struct hda_fixup alc269_fixups[] = {
+ .chained = true,
+ .chain_id = ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
+ },
++ [ALC225_FIXUP_DISABLE_MIC_VREF] = {
++ .type = HDA_FIXUP_FUNC,
++ .v.func = alc_fixup_disable_mic_vref,
++ .chained = true,
++ .chain_id = ALC269_FIXUP_DELL1_MIC_NO_PRESENCE
++ },
+ [ALC225_FIXUP_DELL1_MIC_NO_PRESENCE] = {
+ .type = HDA_FIXUP_VERBS,
+ .v.verbs = (const struct hda_verb[]) {
+@@ -5555,7 +5569,7 @@ static const struct hda_fixup alc269_fixups[] = {
+ {}
+ },
+ .chained = true,
+- .chain_id = ALC269_FIXUP_DELL1_MIC_NO_PRESENCE
++ .chain_id = ALC225_FIXUP_DISABLE_MIC_VREF
+ },
+ [ALC280_FIXUP_HP_HEADSET_MIC] = {
+ .type = HDA_FIXUP_FUNC,
+--
+2.20.1
+
diff --git a/patches.suse/btrfs-0045-cleanup-stop-casting-for-extent_map-lookup-eve.patch b/patches.kernel.org/4.4.171-002-btrfs-cleanup-stop-casting-for-extent_map-loo.patch
index 47aa2aae3b..3769c68d65 100644
--- a/patches.suse/btrfs-0045-cleanup-stop-casting-for-extent_map-lookup-eve.patch
+++ b/patches.kernel.org/4.4.171-002-btrfs-cleanup-stop-casting-for-extent_map-loo.patch
@@ -1,10 +1,12 @@
From: Jeff Mahoney <jeffm@suse.com>
Date: Wed, 3 Jun 2015 10:55:48 -0400
-Patch-mainline: v4.5-rc1
-Git-commit: 95617d69326ce386c95e33db7aeb832b45ee9f8f
-References: bsc#1012452
Subject: [PATCH] btrfs: cleanup, stop casting for extent_map->lookup
everywhere
+Patch-mainline: 4.4.171
+References: bnc#1012382 bsc#1012452
+Git-commit: 95617d69326ce386c95e33db7aeb832b45ee9f8f
+
+commit 95617d69326ce386c95e33db7aeb832b45ee9f8f upstream.
Overloading extent_map->bdev to struct map_lookup * might have started out
as a means to an end, but it's a pattern that's used all over the place
@@ -12,18 +14,23 @@ now. Let's get rid of the casting and just add a union instead.
Signed-off-by: Jeff Mahoney <jeffm@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
+Signed-off-by: Ben Hutchings <ben.hutchings@codethink.co.uk>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
- fs/btrfs/dev-replace.c | 2 +-
- fs/btrfs/extent-tree.c | 2 +-
- fs/btrfs/extent_map.c | 2 +-
- fs/btrfs/extent_map.h | 10 +++++++++-
- fs/btrfs/scrub.c | 2 +-
- fs/btrfs/volumes.c | 24 ++++++++++++------------
+ fs/btrfs/dev-replace.c | 2 +-
+ fs/btrfs/extent-tree.c | 2 +-
+ fs/btrfs/extent_map.c | 2 +-
+ fs/btrfs/extent_map.h | 10 +++++++++-
+ fs/btrfs/scrub.c | 2 +-
+ fs/btrfs/volumes.c | 24 ++++++++++++------------
6 files changed, 25 insertions(+), 17 deletions(-)
+diff --git a/fs/btrfs/dev-replace.c b/fs/btrfs/dev-replace.c
+index 176a27bc63aa..81e5bc62e8e3 100644
--- a/fs/btrfs/dev-replace.c
+++ b/fs/btrfs/dev-replace.c
-@@ -614,7 +614,7 @@ static void btrfs_dev_replace_update_dev
+@@ -620,7 +620,7 @@ static void btrfs_dev_replace_update_device_in_mapping_tree(
em = lookup_extent_mapping(em_tree, start, (u64)-1);
if (!em)
break;
@@ -32,9 +39,11 @@ Signed-off-by: David Sterba <dsterba@suse.com>
for (i = 0; i < map->num_stripes; i++)
if (srcdev == map->stripes[i].dev)
map->stripes[i].dev = tgtdev;
+diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c
+index 13ff0fdae03e..afbfa7c36ff6 100644
--- a/fs/btrfs/extent-tree.c
+++ b/fs/btrfs/extent-tree.c
-@@ -10359,7 +10359,7 @@ btrfs_start_trans_remove_block_group(str
+@@ -10388,7 +10388,7 @@ btrfs_start_trans_remove_block_group(struct btrfs_fs_info *fs_info,
* more device items and remove one chunk item), but this is done at
* btrfs_remove_chunk() through a call to check_system_chunk().
*/
@@ -43,9 +52,11 @@ Signed-off-by: David Sterba <dsterba@suse.com>
num_items = 3 + map->num_stripes;
free_extent_map(em);
+diff --git a/fs/btrfs/extent_map.c b/fs/btrfs/extent_map.c
+index 6a98bddd8f33..84fb56d5c018 100644
--- a/fs/btrfs/extent_map.c
+++ b/fs/btrfs/extent_map.c
-@@ -76,7 +76,7 @@ void free_extent_map(struct extent_map *
+@@ -76,7 +76,7 @@ void free_extent_map(struct extent_map *em)
WARN_ON(extent_map_in_tree(em));
WARN_ON(!list_empty(&em->list));
if (test_bit(EXTENT_FLAG_FS_MAPPING, &em->flags))
@@ -54,6 +65,8 @@ Signed-off-by: David Sterba <dsterba@suse.com>
kmem_cache_free(extent_map_cache, em);
}
}
+diff --git a/fs/btrfs/extent_map.h b/fs/btrfs/extent_map.h
+index b2991fd8583e..eb8b8fae036b 100644
--- a/fs/btrfs/extent_map.h
+++ b/fs/btrfs/extent_map.h
@@ -32,7 +32,15 @@ struct extent_map {
@@ -73,9 +86,11 @@ Signed-off-by: David Sterba <dsterba@suse.com>
atomic_t refs;
unsigned int compress_type;
struct list_head list;
+diff --git a/fs/btrfs/scrub.c b/fs/btrfs/scrub.c
+index 6dca9f937bf6..cc9ccc42f469 100644
--- a/fs/btrfs/scrub.c
+++ b/fs/btrfs/scrub.c
-@@ -3460,7 +3460,7 @@ static noinline_for_stack int scrub_chun
+@@ -3460,7 +3460,7 @@ static noinline_for_stack int scrub_chunk(struct scrub_ctx *sctx,
return ret;
}
@@ -84,9 +99,11 @@ Signed-off-by: David Sterba <dsterba@suse.com>
if (em->start != chunk_offset)
goto out;
+diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c
+index b4d63a9842fa..f9de5072061d 100644
--- a/fs/btrfs/volumes.c
+++ b/fs/btrfs/volumes.c
-@@ -1184,7 +1184,7 @@ again:
+@@ -1184,7 +1184,7 @@ static int contains_pending_extent(struct btrfs_transaction *transaction,
struct map_lookup *map;
int i;
@@ -95,7 +112,7 @@ Signed-off-by: David Sterba <dsterba@suse.com>
for (i = 0; i < map->num_stripes; i++) {
u64 end;
-@@ -2757,7 +2757,7 @@ int btrfs_remove_chunk(struct btrfs_tran
+@@ -2757,7 +2757,7 @@ int btrfs_remove_chunk(struct btrfs_trans_handle *trans,
free_extent_map(em);
return -EINVAL;
}
@@ -104,7 +121,7 @@ Signed-off-by: David Sterba <dsterba@suse.com>
lock_chunks(root->fs_info->chunk_root);
check_system_chunk(trans, extent_root, map->type);
unlock_chunks(root->fs_info->chunk_root);
-@@ -4720,7 +4720,7 @@ static int __btrfs_alloc_chunk(struct bt
+@@ -4731,7 +4731,7 @@ static int __btrfs_alloc_chunk(struct btrfs_trans_handle *trans,
goto error;
}
set_bit(EXTENT_FLAG_FS_MAPPING, &em->flags);
@@ -113,7 +130,7 @@ Signed-off-by: David Sterba <dsterba@suse.com>
em->start = start;
em->len = num_bytes;
em->block_start = 0;
-@@ -4815,7 +4815,7 @@ int btrfs_finish_chunk_alloc(struct btrf
+@@ -4826,7 +4826,7 @@ int btrfs_finish_chunk_alloc(struct btrfs_trans_handle *trans,
return -EINVAL;
}
@@ -122,7 +139,7 @@ Signed-off-by: David Sterba <dsterba@suse.com>
item_size = btrfs_chunk_item_size(map->num_stripes);
stripe_size = em->orig_block_len;
-@@ -4970,7 +4970,7 @@ int btrfs_chunk_readonly(struct btrfs_ro
+@@ -4968,7 +4968,7 @@ int btrfs_chunk_readonly(struct btrfs_root *root, u64 chunk_offset)
if (!em)
return 1;
@@ -131,7 +148,7 @@ Signed-off-by: David Sterba <dsterba@suse.com>
for (i = 0; i < map->num_stripes; i++) {
if (map->stripes[i].dev->missing) {
miss_ndevs++;
-@@ -5050,7 +5050,7 @@ int btrfs_num_copies(struct btrfs_fs_inf
+@@ -5048,7 +5048,7 @@ int btrfs_num_copies(struct btrfs_fs_info *fs_info, u64 logical, u64 len)
return 1;
}
@@ -140,7 +157,7 @@ Signed-off-by: David Sterba <dsterba@suse.com>
if (map->type & (BTRFS_BLOCK_GROUP_DUP | BTRFS_BLOCK_GROUP_RAID1))
ret = map->num_stripes;
else if (map->type & BTRFS_BLOCK_GROUP_RAID10)
-@@ -5086,7 +5086,7 @@ unsigned long btrfs_full_stripe_len(stru
+@@ -5091,7 +5091,7 @@ unsigned long btrfs_full_stripe_len(struct btrfs_root *root,
BUG_ON(!em);
BUG_ON(em->start > logical || em->start + em->len < logical);
@@ -149,7 +166,7 @@ Signed-off-by: David Sterba <dsterba@suse.com>
if (map->type & BTRFS_BLOCK_GROUP_RAID56_MASK)
len = map->stripe_len * nr_data_stripes(map);
free_extent_map(em);
-@@ -5107,7 +5107,7 @@ int btrfs_is_parity_mirror(struct btrfs_
+@@ -5112,7 +5112,7 @@ int btrfs_is_parity_mirror(struct btrfs_mapping_tree *map_tree,
BUG_ON(!em);
BUG_ON(em->start > logical || em->start + em->len < logical);
@@ -158,7 +175,7 @@ Signed-off-by: David Sterba <dsterba@suse.com>
if (map->type & BTRFS_BLOCK_GROUP_RAID56_MASK)
ret = 1;
free_extent_map(em);
-@@ -5266,7 +5266,7 @@ static int __btrfs_map_block(struct btrf
+@@ -5271,7 +5271,7 @@ static int __btrfs_map_block(struct btrfs_fs_info *fs_info, int rw,
return -EINVAL;
}
@@ -167,7 +184,7 @@ Signed-off-by: David Sterba <dsterba@suse.com>
offset = logical - em->start;
stripe_len = map->stripe_len;
-@@ -5808,7 +5808,7 @@ int btrfs_rmap_block(struct btrfs_mappin
+@@ -5813,7 +5813,7 @@ int btrfs_rmap_block(struct btrfs_mapping_tree *map_tree,
free_extent_map(em);
return -EIO;
}
@@ -176,7 +193,7 @@ Signed-off-by: David Sterba <dsterba@suse.com>
length = em->len;
rmap_len = map->stripe_len;
-@@ -6244,7 +6244,7 @@ static int read_one_chunk(struct btrfs_r
+@@ -6249,7 +6249,7 @@ static int read_one_chunk(struct btrfs_root *root, struct btrfs_key *key,
}
set_bit(EXTENT_FLAG_FS_MAPPING, &em->flags);
@@ -185,7 +202,7 @@ Signed-off-by: David Sterba <dsterba@suse.com>
em->start = logical;
em->len = length;
em->orig_start = 0;
-@@ -6946,7 +6946,7 @@ void btrfs_update_commit_device_bytes_us
+@@ -6948,7 +6948,7 @@ void btrfs_update_commit_device_bytes_used(struct btrfs_root *root,
/* In order to kick the device replace finish process */
lock_chunks(root);
list_for_each_entry(em, &transaction->pending_chunks, list) {
@@ -194,3 +211,6 @@ Signed-off-by: David Sterba <dsterba@suse.com>
for (i = 0; i < map->num_stripes; i++) {
dev = map->stripes[i].dev;
+--
+2.20.1
+
diff --git a/patches.suse/btrfs-0051-Enhance-chunk-validation-check.patch b/patches.kernel.org/4.4.171-003-btrfs-Enhance-chunk-validation-check.patch
index b8519ed0f8..874cd837e5 100644
--- a/patches.suse/btrfs-0051-Enhance-chunk-validation-check.patch
+++ b/patches.kernel.org/4.4.171-003-btrfs-Enhance-chunk-validation-check.patch
@@ -1,9 +1,11 @@
From: Qu Wenruo <quwenruo@cn.fujitsu.com>
Date: Tue, 15 Dec 2015 09:14:37 +0800
-Patch-mainline: v4.5-rc1
-Git-commit: f04b772bfc17f502703794f4d100d12155c1a1a9
-References: bsc#1012452
Subject: [PATCH] btrfs: Enhance chunk validation check
+Patch-mainline: 4.4.171
+References: bnc#1012382 bsc#1012452
+Git-commit: f04b772bfc17f502703794f4d100d12155c1a1a9
+
+commit f04b772bfc17f502703794f4d100d12155c1a1a9 upstream.
Enhance chunk validation:
1) Num_stripes
@@ -32,14 +34,18 @@ mail list should no longer cause kernel panic.
Reported-by: Vegard Nossum <vegard.nossum@oracle.com>
Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com>
Signed-off-by: Chris Mason <clm@fb.com>
-Signed-off-by: David Sterba <dsterba@suse.cz>
+Signed-off-by: Ben Hutchings <ben.hutchings@codethink.co.uk>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
- fs/btrfs/volumes.c | 33 ++++++++++++++++++++++++++++++++-
+ fs/btrfs/volumes.c | 33 ++++++++++++++++++++++++++++++++-
1 file changed, 32 insertions(+), 1 deletion(-)
+diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c
+index f9de5072061d..b81081b082f6 100644
--- a/fs/btrfs/volumes.c
+++ b/fs/btrfs/volumes.c
-@@ -6212,6 +6212,7 @@ static int read_one_chunk(struct btrfs_r
+@@ -6217,6 +6217,7 @@ static int read_one_chunk(struct btrfs_root *root, struct btrfs_key *key,
struct extent_map *em;
u64 logical;
u64 length;
@@ -47,7 +53,7 @@ Signed-off-by: David Sterba <dsterba@suse.cz>
u64 devid;
u8 uuid[BTRFS_UUID_SIZE];
int num_stripes;
-@@ -6220,6 +6221,37 @@ static int read_one_chunk(struct btrfs_r
+@@ -6225,6 +6226,37 @@ static int read_one_chunk(struct btrfs_root *root, struct btrfs_key *key,
logical = key->offset;
length = btrfs_chunk_length(leaf, chunk);
@@ -85,7 +91,7 @@ Signed-off-by: David Sterba <dsterba@suse.cz>
read_lock(&map_tree->map_tree.lock);
em = lookup_extent_mapping(&map_tree->map_tree, logical, 1);
-@@ -6236,7 +6268,6 @@ static int read_one_chunk(struct btrfs_r
+@@ -6241,7 +6273,6 @@ static int read_one_chunk(struct btrfs_root *root, struct btrfs_key *key,
em = alloc_extent_map();
if (!em)
return -ENOMEM;
@@ -93,3 +99,6 @@ Signed-off-by: David Sterba <dsterba@suse.cz>
map = kmalloc(map_lookup_size(num_stripes), GFP_NOFS);
if (!map) {
free_extent_map(em);
+--
+2.20.1
+
diff --git a/patches.suse/btrfs-0327-add-validadtion-checks-for-chunk-loading.patch b/patches.kernel.org/4.4.171-004-Btrfs-add-validadtion-checks-for-chunk-loadin.patch
index ac68c81a6e..2873313bf0 100644
--- a/patches.suse/btrfs-0327-add-validadtion-checks-for-chunk-loading.patch
+++ b/patches.kernel.org/4.4.171-004-Btrfs-add-validadtion-checks-for-chunk-loadin.patch
@@ -1,9 +1,11 @@
From: Liu Bo <bo.li.liu@oracle.com>
Date: Fri, 3 Jun 2016 12:05:15 -0700
-Patch-mainline: v4.7-rc3
-Git-commit: e06cd3dd7cea50e87663a88acdfdb7ac1c53a5ca
-References: bsc#1012452
Subject: [PATCH] Btrfs: add validadtion checks for chunk loading
+Patch-mainline: 4.4.171
+References: bnc#1012382 bsc#1012452
+Git-commit: e06cd3dd7cea50e87663a88acdfdb7ac1c53a5ca
+
+commit e06cd3dd7cea50e87663a88acdfdb7ac1c53a5ca upstream.
To prevent fuzzed filesystem images from panic the whole system,
we need various validation checks to refuse to mount such an image
@@ -18,13 +20,18 @@ Reported-by: Quentin Casasnovas <quentin.casasnovas@oracle.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: Liu Bo <bo.li.liu@oracle.com>
Signed-off-by: David Sterba <dsterba@suse.com>
+Signed-off-by: Ben Hutchings <ben.hutchings@codethink.co.uk>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
- fs/btrfs/volumes.c | 82 +++++++++++++++++++++++++++++++++++++++++++----------
+ fs/btrfs/volumes.c | 82 +++++++++++++++++++++++++++++++++++++---------
1 file changed, 67 insertions(+), 15 deletions(-)
+diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c
+index b81081b082f6..75211630a864 100644
--- a/fs/btrfs/volumes.c
+++ b/fs/btrfs/volumes.c
-@@ -6261,27 +6261,23 @@ struct btrfs_device *btrfs_alloc_device(
+@@ -6208,27 +6208,23 @@ struct btrfs_device *btrfs_alloc_device(struct btrfs_fs_info *fs_info,
return dev;
}
@@ -62,7 +69,7 @@ Signed-off-by: David Sterba <dsterba@suse.com>
if (!num_stripes) {
btrfs_err(root->fs_info, "invalid chunk num_stripes: %u",
num_stripes);
-@@ -6292,6 +6288,11 @@ static int read_one_chunk(struct btrfs_r
+@@ -6239,6 +6235,11 @@ static int read_one_chunk(struct btrfs_root *root, struct btrfs_key *key,
"invalid chunk logical %llu", logical);
return -EIO;
}
@@ -74,7 +81,7 @@ Signed-off-by: David Sterba <dsterba@suse.com>
if (!length || !IS_ALIGNED(length, root->sectorsize)) {
btrfs_err(root->fs_info,
"invalid chunk length %llu", length);
-@@ -6303,13 +6304,54 @@ static int read_one_chunk(struct btrfs_r
+@@ -6250,13 +6251,54 @@ static int read_one_chunk(struct btrfs_root *root, struct btrfs_key *key,
return -EIO;
}
if (~(BTRFS_BLOCK_GROUP_TYPE_MASK | BTRFS_BLOCK_GROUP_PROFILE_MASK) &
@@ -130,7 +137,7 @@ Signed-off-by: David Sterba <dsterba@suse.com>
read_lock(&map_tree->map_tree.lock);
em = lookup_extent_mapping(&map_tree->map_tree, logical, 1);
-@@ -6557,6 +6599,7 @@ int btrfs_read_sys_array(struct btrfs_ro
+@@ -6504,6 +6546,7 @@ int btrfs_read_sys_array(struct btrfs_root *root)
u32 array_size;
u32 len = 0;
u32 cur_offset;
@@ -138,11 +145,10 @@ Signed-off-by: David Sterba <dsterba@suse.com>
struct btrfs_key key;
ASSERT(BTRFS_SUPER_INFO_SIZE <= root->nodesize);
-@@ -6622,6 +6665,15 @@ int btrfs_read_sys_array(struct btrfs_ro
- ret = -EIO;
+@@ -6570,6 +6613,15 @@ int btrfs_read_sys_array(struct btrfs_root *root)
break;
}
-+
+
+ type = btrfs_chunk_type(sb, chunk);
+ if ((type & BTRFS_BLOCK_GROUP_SYSTEM) == 0) {
+ btrfs_err(root->fs_info,
@@ -151,6 +157,10 @@ Signed-off-by: David Sterba <dsterba@suse.com>
+ ret = -EIO;
+ break;
+ }
-
++
len = btrfs_chunk_item_size(num_stripes);
if (cur_offset + len > array_size)
+ goto out_short_read;
+--
+2.20.1
+
diff --git a/patches.suse/btrfs-0420-check-inconsistence-between-chunk-and-block-gr.patch b/patches.kernel.org/4.4.171-005-Btrfs-check-inconsistence-between-chunk-and-b.patch
index 732621f833..5dcaf59dd1 100644
--- a/patches.suse/btrfs-0420-check-inconsistence-between-chunk-and-block-gr.patch
+++ b/patches.kernel.org/4.4.171-005-Btrfs-check-inconsistence-between-chunk-and-b.patch
@@ -1,10 +1,11 @@
From: Liu Bo <bo.li.liu@oracle.com>
Date: Wed, 22 Jun 2016 18:31:27 -0700
-Patch-mainline: v4.8-rc1
+Subject: [PATCH] Btrfs: check inconsistence between chunk and block group
+Patch-mainline: 4.4.171
+References: bnc#1012382 bsc#1012452
Git-commit: 6fb37b756acce6d6e045f79c3764206033f617b4
-References: bsc#1012452
-Subject: [PATCH] Btrfs: check inconsistence between chunk and block
- group
+
+commit 6fb37b756acce6d6e045f79c3764206033f617b4 upstream.
With btrfs-corrupt-block, one can drop one chunk item and mounting
will end up with a panic in btrfs_full_stripe_len().
@@ -15,13 +16,18 @@ earlier when we find the block group item.
Signed-off-by: Liu Bo <bo.li.liu@oracle.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
+Signed-off-by: Ben Hutchings <ben.hutchings@codethink.co.uk>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
- fs/btrfs/extent-tree.c | 17 ++++++++++++++++-
+ fs/btrfs/extent-tree.c | 17 ++++++++++++++++-
1 file changed, 16 insertions(+), 1 deletion(-)
+diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c
+index afbfa7c36ff6..2b7cba4fc8f1 100644
--- a/fs/btrfs/extent-tree.c
+++ b/fs/btrfs/extent-tree.c
-@@ -9874,7 +9874,22 @@ static int find_first_block_group(struct
+@@ -9502,7 +9502,22 @@ static int find_first_block_group(struct btrfs_root *root,
if (found_key.objectid >= key->objectid &&
found_key.type == BTRFS_BLOCK_GROUP_ITEM_KEY) {
@@ -45,3 +51,6 @@ Signed-off-by: David Sterba <dsterba@suse.com>
goto out;
}
path->slots[0]++;
+--
+2.20.1
+
diff --git a/patches.suse/btrfs-0482-fix-em-leak-in-find_first_block_group.patch b/patches.kernel.org/4.4.171-006-Btrfs-fix-em-leak-in-find_first_block_group.patch
index 67f0a0cea5..b406e67f59 100644
--- a/patches.suse/btrfs-0482-fix-em-leak-in-find_first_block_group.patch
+++ b/patches.kernel.org/4.4.171-006-Btrfs-fix-em-leak-in-find_first_block_group.patch
@@ -1,9 +1,11 @@
From: Josef Bacik <jbacik@fb.com>
Date: Thu, 18 Aug 2016 15:30:06 -0400
-Patch-mainline: v4.8-rc4
-Git-commit: 187ee58c62c1d0d238d3dc4835869d33e1869906
-References: bsc#1012452
Subject: [PATCH] Btrfs: fix em leak in find_first_block_group
+Patch-mainline: 4.4.171
+References: bnc#1012382 bsc#1012452
+Git-commit: 187ee58c62c1d0d238d3dc4835869d33e1869906
+
+commit 187ee58c62c1d0d238d3dc4835869d33e1869906 upstream.
We need to call free_extent_map() on the em we look up.
@@ -11,13 +13,18 @@ Signed-off-by: Josef Bacik <jbacik@fb.com>
Reviewed-by: Omar Sandoval <osandov@fb.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Signed-off-by: Chris Mason <clm@fb.com>
+Signed-off-by: Ben Hutchings <ben.hutchings@codethink.co.uk>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
- fs/btrfs/extent-tree.c | 1 +
+ fs/btrfs/extent-tree.c | 1 +
1 file changed, 1 insertion(+)
+diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c
+index 2b7cba4fc8f1..abfd2320873d 100644
--- a/fs/btrfs/extent-tree.c
+++ b/fs/btrfs/extent-tree.c
-@@ -9874,6 +9874,7 @@ static int find_first_block_group(struct
+@@ -9518,6 +9518,7 @@ static int find_first_block_group(struct btrfs_root *root,
} else {
ret = 0;
}
@@ -25,3 +32,6 @@ Signed-off-by: Chris Mason <clm@fb.com>
goto out;
}
path->slots[0]++;
+--
+2.20.1
+
diff --git a/patches.suse/btrfs-0485-detect-corruption-when-non-root-leaf-has-zero-.patch b/patches.kernel.org/4.4.171-007-Btrfs-detect-corruption-when-non-root-leaf-ha.patch
index 2a7c8e4074..459b329331 100644
--- a/patches.suse/btrfs-0485-detect-corruption-when-non-root-leaf-has-zero-.patch
+++ b/patches.kernel.org/4.4.171-007-Btrfs-detect-corruption-when-non-root-leaf-ha.patch
@@ -1,10 +1,11 @@
From: Liu Bo <bo.li.liu@oracle.com>
Date: Tue, 23 Aug 2016 15:22:58 -0700
-Patch-mainline: v4.8-rc4
+Subject: [PATCH] Btrfs: detect corruption when non-root leaf has zero item
+Patch-mainline: 4.4.171
+References: bnc#1012382 bsc#1012452
Git-commit: 1ba98d086fe3a14d6a31f2f66dbab70c45d00f63
-References: bsc#1012452
-Subject: [PATCH] Btrfs: detect corruption when non-root leaf has zero
- item
+
+commit 1ba98d086fe3a14d6a31f2f66dbab70c45d00f63 upstream.
Right now we treat leaf which has zero item as a valid one
because we could have an empty tree, that is, a root that is
@@ -20,13 +21,18 @@ Signed-off-by: Liu Bo <bo.li.liu@oracle.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Signed-off-by: Chris Mason <clm@fb.com>
+Signed-off-by: Ben Hutchings <ben.hutchings@codethink.co.uk>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
- fs/btrfs/disk-io.c | 23 ++++++++++++++++++++++-
+ fs/btrfs/disk-io.c | 23 ++++++++++++++++++++++-
1 file changed, 22 insertions(+), 1 deletion(-)
+diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c
+index 1f21c6c33228..20923889de69 100644
--- a/fs/btrfs/disk-io.c
+++ b/fs/btrfs/disk-io.c
-@@ -559,8 +559,29 @@ static noinline int check_leaf(struct bt
+@@ -535,8 +535,29 @@ static noinline int check_leaf(struct btrfs_root *root,
u32 nritems = btrfs_header_nritems(leaf);
int slot;
@@ -57,3 +63,6 @@ Signed-off-by: Chris Mason <clm@fb.com>
/* Check the 0 item */
if (btrfs_item_offset_nr(leaf, 0) + btrfs_item_size_nr(leaf, 0) !=
+--
+2.20.1
+
diff --git a/patches.suse/btrfs-0484-check-btree-node-s-nritems.patch b/patches.kernel.org/4.4.171-008-Btrfs-check-btree-node-s-nritems.patch
index 17d7f137d0..2a37c4bf85 100644
--- a/patches.suse/btrfs-0484-check-btree-node-s-nritems.patch
+++ b/patches.kernel.org/4.4.171-008-Btrfs-check-btree-node-s-nritems.patch
@@ -1,9 +1,11 @@
From: Liu Bo <bo.li.liu@oracle.com>
Date: Tue, 23 Aug 2016 17:37:45 -0700
-Patch-mainline: v4.8-rc4
-Git-commit: 053ab70f0604224c7893b43f9d9d5efa283580d6
-References: bsc#1012452
Subject: [PATCH] Btrfs: check btree node's nritems
+Patch-mainline: 4.4.171
+References: bnc#1012382 bsc#1012452
+Git-commit: 053ab70f0604224c7893b43f9d9d5efa283580d6
+
+commit 053ab70f0604224c7893b43f9d9d5efa283580d6 upstream.
When btree node (level = 1) has nritems which equals to zero,
we can end up with panic due to insert_ptr()'s
@@ -21,13 +23,18 @@ Signed-off-by: Liu Bo <bo.li.liu@oracle.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Signed-off-by: Chris Mason <clm@fb.com>
+Signed-off-by: Ben Hutchings <ben.hutchings@codethink.co.uk>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
- fs/btrfs/disk-io.c | 16 ++++++++++++++++
+ fs/btrfs/disk-io.c | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
+diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c
+index 20923889de69..55b4f5e02550 100644
--- a/fs/btrfs/disk-io.c
+++ b/fs/btrfs/disk-io.c
-@@ -612,6 +612,19 @@ static noinline int check_leaf(struct bt
+@@ -609,6 +609,19 @@ static noinline int check_leaf(struct btrfs_root *root,
return 0;
}
@@ -47,7 +54,7 @@ Signed-off-by: Chris Mason <clm@fb.com>
static int btree_readpage_end_io_hook(struct btrfs_io_bio *io_bio,
u64 phy_offset, struct page *page,
u64 start, u64 end, int mirror)
-@@ -682,6 +695,9 @@ static int btree_readpage_end_io_hook(st
+@@ -680,6 +693,9 @@ static int btree_readpage_end_io_hook(struct btrfs_io_bio *io_bio,
ret = -EIO;
}
@@ -57,3 +64,6 @@ Signed-off-by: Chris Mason <clm@fb.com>
if (!ret)
set_extent_buffer_uptodate(eb);
err:
+--
+2.20.1
+
diff --git a/patches.suse/btrfs-0653-fix-BUG_ON-in-btrfs_mark_buffer_dirty.patch b/patches.kernel.org/4.4.171-009-Btrfs-fix-BUG_ON-in-btrfs_mark_buffer_dirty.patch
index 2e8a11ce57..5df20650da 100644
--- a/patches.suse/btrfs-0653-fix-BUG_ON-in-btrfs_mark_buffer_dirty.patch
+++ b/patches.kernel.org/4.4.171-009-Btrfs-fix-BUG_ON-in-btrfs_mark_buffer_dirty.patch
@@ -1,9 +1,11 @@
From: Liu Bo <bo.li.liu@oracle.com>
Date: Fri, 2 Sep 2016 12:35:34 -0700
-Patch-mainline: v4.10-rc1
-Git-commit: ef85b25e982b5bba1530b936e283ef129f02ab9d
-References: bsc#1012452
Subject: [PATCH] Btrfs: fix BUG_ON in btrfs_mark_buffer_dirty
+Patch-mainline: 4.4.171
+References: bnc#1012382 bsc#1012452
+Git-commit: ef85b25e982b5bba1530b936e283ef129f02ab9d
+
+commit ef85b25e982b5bba1530b936e283ef129f02ab9d upstream.
This can only happen with CONFIG_BTRFS_FS_CHECK_INTEGRITY=y.
@@ -17,18 +19,22 @@ This changes to use "if (leaf == btrfs_root_node(root))" instead, just like
how we check whether leaf is a root in __btrfs_cow_block().
Fixes: 1ba98d086fe3 (Btrfs: detect corruption when non-root leaf has zero item)
-Cc: stable@vger.kernel.org # 4.8+
Reported-by: Jeff Mahoney <jeffm@suse.com>
Signed-off-by: Liu Bo <bo.li.liu@oracle.com>
Reviewed-by: Filipe Manana <fdmanana@suse.com>
-Signed-off-by: David Sterba <dsterba@suse.cz>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+Signed-off-by: Ben Hutchings <ben.hutchings@codethink.co.uk>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
- fs/btrfs/disk-io.c | 10 +++++++---
+ fs/btrfs/disk-io.c | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
+diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c
+index 55b4f5e02550..5805b4f4702e 100644
--- a/fs/btrfs/disk-io.c
+++ b/fs/btrfs/disk-io.c
-@@ -572,13 +572,17 @@ static noinline int check_leaf(struct bt
+@@ -548,13 +548,17 @@ static noinline int check_leaf(struct btrfs_root *root,
* open_ctree() some roots has not yet been set up.
*/
if (!IS_ERR_OR_NULL(check_root)) {
@@ -49,3 +55,6 @@ Signed-off-by: David Sterba <dsterba@suse.cz>
}
return 0;
}
+--
+2.20.1
+
diff --git a/patches.suse/btrfs-0509-memset-to-avoid-stale-content-in-btree-node-bl.patch b/patches.kernel.org/4.4.171-010-Btrfs-memset-to-avoid-stale-content-in-btree-.patch
index cdd9c908e6..5eeb7e3c0b 100644
--- a/patches.suse/btrfs-0509-memset-to-avoid-stale-content-in-btree-node-bl.patch
+++ b/patches.kernel.org/4.4.171-010-Btrfs-memset-to-avoid-stale-content-in-btree-.patch
@@ -1,10 +1,11 @@
From: Liu Bo <bo.li.liu@oracle.com>
Date: Wed, 14 Sep 2016 17:22:57 -0700
-Patch-mainline: v4.9-rc1
+Subject: [PATCH] Btrfs: memset to avoid stale content in btree node block
+Patch-mainline: 4.4.171
+References: bnc#1012382 bsc#1012452
Git-commit: 3eb548ee3a8042d95ad81be254e67a5222c24e03
-References: bsc#1012452
-Subject: [PATCH] Btrfs: memset to avoid stale content in btree node
- block
+
+commit 3eb548ee3a8042d95ad81be254e67a5222c24e03 upstream.
During updating btree, we could push items between sibling
nodes/leaves, for leaves data sections starts reversely from
@@ -24,13 +25,18 @@ gets to memset the unused part of a btree node.
Signed-off-by: Liu Bo <bo.li.liu@oracle.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
+Signed-off-by: Ben Hutchings <ben.hutchings@codethink.co.uk>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
- fs/btrfs/extent_io.c | 11 +++++++++++
+ fs/btrfs/extent_io.c | 11 +++++++++++
1 file changed, 11 insertions(+)
+diff --git a/fs/btrfs/extent_io.c b/fs/btrfs/extent_io.c
+index 88bee6703cc0..f8b2fe9944a7 100644
--- a/fs/btrfs/extent_io.c
+++ b/fs/btrfs/extent_io.c
-@@ -3737,6 +3737,17 @@ static noinline_for_stack int write_one_
+@@ -3858,6 +3858,17 @@ static noinline_for_stack int write_one_eb(struct extent_buffer *eb,
if (btrfs_header_owner(eb) == BTRFS_TREE_LOG_OBJECTID)
bio_flags = EXTENT_BIO_TREE_LOG;
@@ -48,3 +54,6 @@ Signed-off-by: David Sterba <dsterba@suse.com>
for (i = 0; i < num_pages; i++) {
struct page *p = eb->pages[i];
+--
+2.20.1
+
diff --git a/patches.suse/btrfs-0512-improve-check_node-to-avoid-reading-corrupted-.patch b/patches.kernel.org/4.4.171-011-Btrfs-improve-check_node-to-avoid-reading-cor.patch
index 1a8598d91c..05096b81ab 100644
--- a/patches.suse/btrfs-0512-improve-check_node-to-avoid-reading-corrupted-.patch
+++ b/patches.kernel.org/4.4.171-011-Btrfs-improve-check_node-to-avoid-reading-cor.patch
@@ -1,10 +1,11 @@
From: Liu Bo <bo.li.liu@oracle.com>
Date: Wed, 14 Sep 2016 17:23:24 -0700
-Patch-mainline: v4.9-rc1
+Subject: [PATCH] Btrfs: improve check_node to avoid reading corrupted nodes
+Patch-mainline: 4.4.171
+References: bnc#1012382 bsc#1012452
Git-commit: 6b722c1747d533ac6d4df110dc8233db46918b65
-References: bsc#1012452
-Subject: [PATCH] Btrfs: improve check_node to avoid reading corrupted
- nodes
+
+commit 6b722c1747d533ac6d4df110dc8233db46918b65 upstream.
We need to check items in a node to make sure that we're reading
a valid one, otherwise we could get various crashes while processing
@@ -13,13 +14,18 @@ delayed_refs.
Signed-off-by: Liu Bo <bo.li.liu@oracle.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
+Signed-off-by: Ben Hutchings <ben.hutchings@codethink.co.uk>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
- fs/btrfs/disk-io.c | 32 ++++++++++++++++++++++++++++----
+ fs/btrfs/disk-io.c | 32 ++++++++++++++++++++++++++++----
1 file changed, 28 insertions(+), 4 deletions(-)
+diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c
+index 5805b4f4702e..73e4e5f56692 100644
--- a/fs/btrfs/disk-io.c
+++ b/fs/btrfs/disk-io.c
-@@ -546,9 +546,10 @@ static int check_tree_block_fsid(struct
+@@ -523,9 +523,10 @@ static int check_tree_block_fsid(struct btrfs_fs_info *fs_info,
}
#define CORRUPT(reason, eb, root, slot) \
@@ -33,7 +39,7 @@ Signed-off-by: David Sterba <dsterba@suse.com>
static noinline int check_leaf(struct btrfs_root *root,
struct extent_buffer *leaf)
-@@ -635,6 +636,10 @@ static noinline int check_leaf(struct bt
+@@ -616,6 +617,10 @@ static noinline int check_leaf(struct btrfs_root *root,
static int check_node(struct btrfs_root *root, struct extent_buffer *node)
{
unsigned long nr = btrfs_header_nritems(node);
@@ -44,7 +50,7 @@ Signed-off-by: David Sterba <dsterba@suse.com>
if (nr == 0 || nr > BTRFS_NODEPTRS_PER_BLOCK(root)) {
btrfs_crit(root->fs_info,
-@@ -642,7 +647,26 @@ static int check_node(struct btrfs_root
+@@ -623,7 +628,26 @@ static int check_node(struct btrfs_root *root, struct extent_buffer *node)
node->start, root->objectid, nr);
return -EIO;
}
@@ -72,3 +78,6 @@ Signed-off-by: David Sterba <dsterba@suse.com>
}
static int btree_readpage_end_io_hook(struct btrfs_io_bio *io_bio,
+--
+2.20.1
+
diff --git a/patches.suse/btrfs-0513-kill-BUG_ON-in-run_delayed_tree_ref.patch b/patches.kernel.org/4.4.171-012-Btrfs-kill-BUG_ON-in-run_delayed_tree_ref.patch
index 4ed280da94..b0ff5f54ef 100644
--- a/patches.suse/btrfs-0513-kill-BUG_ON-in-run_delayed_tree_ref.patch
+++ b/patches.kernel.org/4.4.171-012-Btrfs-kill-BUG_ON-in-run_delayed_tree_ref.patch
@@ -1,9 +1,11 @@
From: Liu Bo <bo.li.liu@oracle.com>
Date: Wed, 14 Sep 2016 19:19:05 -0700
-Patch-mainline: v4.9-rc1
-Git-commit: 02794222c4132ac003e7281fb71f4ec1645ffc87
-References: bsc#1012452
Subject: [PATCH] Btrfs: kill BUG_ON in run_delayed_tree_ref
+Patch-mainline: 4.4.171
+References: bnc#1012382 bsc#1012452
+Git-commit: 02794222c4132ac003e7281fb71f4ec1645ffc87
+
+commit 02794222c4132ac003e7281fb71f4ec1645ffc87 upstream.
In a corrupted btrfs image, we can come across this BUG_ON and
get an unreponsive system, but if we return errors instead,
@@ -12,13 +14,18 @@ transaction.
Signed-off-by: Liu Bo <bo.li.liu@oracle.com>
Signed-off-by: David Sterba <dsterba@suse.com>
+Signed-off-by: Ben Hutchings <ben.hutchings@codethink.co.uk>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
- fs/btrfs/extent-tree.c | 8 +++++++-
+ fs/btrfs/extent-tree.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
+diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c
+index abfd2320873d..14549387b518 100644
--- a/fs/btrfs/extent-tree.c
+++ b/fs/btrfs/extent-tree.c
-@@ -2344,7 +2344,13 @@ static int run_delayed_tree_ref(struct b
+@@ -2342,7 +2342,13 @@ static int run_delayed_tree_ref(struct btrfs_trans_handle *trans,
ins.type = BTRFS_EXTENT_ITEM_KEY;
}
@@ -33,3 +40,6 @@ Signed-off-by: David Sterba <dsterba@suse.com>
if (node->action == BTRFS_ADD_DELAYED_REF && insert_reserved) {
BUG_ON(!extent_op || !extent_op->update_flags);
ret = alloc_reserved_tree_block(trans, root,
+--
+2.20.1
+
diff --git a/patches.suse/btrfs-0522-memset-to-avoid-stale-content-in-btree-leaf.patch b/patches.kernel.org/4.4.171-013-Btrfs-memset-to-avoid-stale-content-in-btree-.patch
index b579fa9709..e0ded5c34d 100644
--- a/patches.suse/btrfs-0522-memset-to-avoid-stale-content-in-btree-leaf.patch
+++ b/patches.kernel.org/4.4.171-013-Btrfs-memset-to-avoid-stale-content-in-btree-.patch
@@ -1,9 +1,11 @@
From: Liu Bo <bo.li.liu@oracle.com>
Date: Fri, 23 Sep 2016 13:44:44 -0700
-Patch-mainline: v4.9-rc1
-Git-commit: 851cd173f06045816528176001cf82948282029c
-References: bsc#1012452
Subject: [PATCH] Btrfs: memset to avoid stale content in btree leaf
+Patch-mainline: 4.4.171
+References: bnc#1012382 bsc#1012452
+Git-commit: 851cd173f06045816528176001cf82948282029c
+
+commit 851cd173f06045816528176001cf82948282029c upstream.
This is an additional patch to
"Btrfs: memset to avoid stale content in btree node block".
@@ -15,15 +17,20 @@ between sibling leaves.
Signed-off-by: Liu Bo <bo.li.liu@oracle.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
+Signed-off-by: Ben Hutchings <ben.hutchings@codethink.co.uk>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
- fs/btrfs/ctree.c | 14 --------------
- fs/btrfs/ctree.h | 15 +++++++++++++++
- fs/btrfs/extent_io.c | 18 +++++++++++++-----
+ fs/btrfs/ctree.c | 14 --------------
+ fs/btrfs/ctree.h | 15 +++++++++++++++
+ fs/btrfs/extent_io.c | 18 +++++++++++++-----
3 files changed, 28 insertions(+), 19 deletions(-)
+diff --git a/fs/btrfs/ctree.c b/fs/btrfs/ctree.c
+index 38ee08675468..8f4baa3cb992 100644
--- a/fs/btrfs/ctree.c
+++ b/fs/btrfs/ctree.c
-@@ -1715,20 +1715,6 @@ int btrfs_realloc_node(struct btrfs_tran
+@@ -1726,20 +1726,6 @@ int btrfs_realloc_node(struct btrfs_trans_handle *trans,
return err;
}
@@ -44,9 +51,11 @@ Signed-off-by: David Sterba <dsterba@suse.com>
/*
* search for key in the extent_buffer. The items start at offset p,
+diff --git a/fs/btrfs/ctree.h b/fs/btrfs/ctree.h
+index e847573c6db0..fc6ba1547d75 100644
--- a/fs/btrfs/ctree.h
+++ b/fs/btrfs/ctree.h
-@@ -2269,6 +2269,21 @@ static inline unsigned long btrfs_leaf_d
+@@ -3158,6 +3158,21 @@ static inline unsigned long btrfs_leaf_data(struct extent_buffer *l)
return offsetof(struct btrfs_leaf, items);
}
@@ -68,9 +77,11 @@ Signed-off-by: David Sterba <dsterba@suse.com>
/* struct btrfs_file_extent_item */
BTRFS_SETGET_FUNCS(file_extent_type, struct btrfs_file_extent_item, type, 8);
BTRFS_SETGET_STACK_FUNCS(stack_file_extent_disk_bytenr,
+diff --git a/fs/btrfs/extent_io.c b/fs/btrfs/extent_io.c
+index f8b2fe9944a7..a2fff9a0fe91 100644
--- a/fs/btrfs/extent_io.c
+++ b/fs/btrfs/extent_io.c
-@@ -3730,8 +3730,10 @@ static noinline_for_stack int write_one_
+@@ -3847,8 +3847,10 @@ static noinline_for_stack int write_one_eb(struct extent_buffer *eb,
struct block_device *bdev = fs_info->fs_devices->latest_bdev;
struct extent_io_tree *tree = &BTRFS_I(fs_info->btree_inode)->io_tree;
u64 offset = eb->start;
@@ -78,10 +89,10 @@ Signed-off-by: David Sterba <dsterba@suse.com>
unsigned long i, num_pages;
unsigned long bio_flags = 0;
+ unsigned long start, end;
- int write_flags = (epd->sync_io ? WRITE_SYNC : 0) | REQ_META;
+ int rw = (epd->sync_io ? WRITE_SYNC : WRITE) | REQ_META;
int ret = 0;
-@@ -3741,15 +3743,21 @@ static noinline_for_stack int write_one_
+@@ -3858,15 +3860,21 @@ static noinline_for_stack int write_one_eb(struct extent_buffer *eb,
if (btrfs_header_owner(eb) == BTRFS_TREE_LOG_OBJECTID)
bio_flags = EXTENT_BIO_TREE_LOG;
@@ -108,3 +119,6 @@ Signed-off-by: David Sterba <dsterba@suse.com>
}
for (i = 0; i < num_pages; i++) {
+--
+2.20.1
+
diff --git a/patches.suse/btrfs-0654-fix-emptiness-check-for-dirtied-extent-buffers.patch b/patches.kernel.org/4.4.171-014-Btrfs-fix-emptiness-check-for-dirtied-extent-.patch
index 22f7e3ad92..40601fc2b9 100644
--- a/patches.suse/btrfs-0654-fix-emptiness-check-for-dirtied-extent-buffers.patch
+++ b/patches.kernel.org/4.4.171-014-Btrfs-fix-emptiness-check-for-dirtied-extent-.patch
@@ -1,10 +1,12 @@
From: Filipe Manana <fdmanana@suse.com>
Date: Wed, 23 Nov 2016 16:21:18 +0000
-Patch-mainline: v4.10-rc1
+Subject: [PATCH] Btrfs: fix emptiness check for dirtied extent buffers at
+ check_leaf()
+Patch-mainline: 4.4.171
+References: bnc#1012382 bsc#1012452
Git-commit: f177d73949bf758542ca15a1c1945bd2e802cc65
-References: bsc#1012452
-Subject: [PATCH] Btrfs: fix emptiness check for dirtied extent buffers
- at check_leaf()
+
+commit f177d73949bf758542ca15a1c1945bd2e802cc65 upstream.
We can not simply use the owner field from an extent buffer's header to
get the id of the respective tree when the extent buffer is from a
@@ -77,17 +79,20 @@ This can be easily reproduced by running xfstests with the integrity
checker enabled.
Fixes: 1ba98d086fe3 (Btrfs: detect corruption when non-root leaf has zero item)
-Cc: stable@vger.kernel.org # 4.8+
Signed-off-by: Filipe Manana <fdmanana@suse.com>
Reviewed-by: Liu Bo <bo.li.liu@oracle.com>
-Signed-off-by: David Sterba <dsterba@suse.cz>
+Signed-off-by: Ben Hutchings <ben.hutchings@codethink.co.uk>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
- fs/btrfs/disk-io.c | 13 ++++++++++++-
+ fs/btrfs/disk-io.c | 13 ++++++++++++-
1 file changed, 12 insertions(+), 1 deletion(-)
+diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c
+index 73e4e5f56692..fc70be66ee79 100644
--- a/fs/btrfs/disk-io.c
+++ b/fs/btrfs/disk-io.c
-@@ -559,7 +559,15 @@ static noinline int check_leaf(struct bt
+@@ -536,7 +536,15 @@ static noinline int check_leaf(struct btrfs_root *root,
u32 nritems = btrfs_header_nritems(leaf);
int slot;
@@ -104,7 +109,7 @@ Signed-off-by: David Sterba <dsterba@suse.cz>
struct btrfs_root *check_root;
key.objectid = btrfs_header_owner(leaf);
-@@ -587,6 +595,9 @@ static noinline int check_leaf(struct bt
+@@ -564,6 +572,9 @@ static noinline int check_leaf(struct btrfs_root *root,
return 0;
}
@@ -114,3 +119,6 @@ Signed-off-by: David Sterba <dsterba@suse.cz>
/* Check the 0 item */
if (btrfs_item_offset_nr(leaf, 0) + btrfs_item_size_nr(leaf, 0) !=
BTRFS_LEAF_DATA_SIZE(root)) {
+--
+2.20.1
+
diff --git a/patches.suse/btrfs-struct-funcs-constify-readers b/patches.kernel.org/4.4.171-015-btrfs-struct-funcs-constify-readers.patch
index 5f42c470a3..d17679b984 100644
--- a/patches.suse/btrfs-struct-funcs-constify-readers
+++ b/patches.kernel.org/4.4.171-015-btrfs-struct-funcs-constify-readers.patch
@@ -1,8 +1,11 @@
From: Jeff Mahoney <jeffm@suse.com>
-Subject: btrfs: struct-funcs, constify readers
-References: bsc#974590 bsc#1030061 bsc#1022914 bsc#1017461
+Date: Wed, 28 Jun 2017 21:56:53 -0600
+Subject: [PATCH] btrfs: struct-funcs, constify readers
+Patch-mainline: 4.4.171
+References: bnc#1012382 bsc#1017461 bsc#1022914 bsc#1030061 bsc#974590
Git-commit: 1cbb1f454e5321e47fc1e6b233066c7ccc979d15
-Patch-mainline: v4.14-rc1
+
+commit 1cbb1f454e5321e47fc1e6b233066c7ccc979d15 upstream.
We have reader helpers for most of the on-disk structures that use
an extent_buffer and pointer as offset into the buffer that are
@@ -13,16 +16,22 @@ No impact on code, but serves as documentation that a buffer is intended
not to be modified.
Signed-off-by: Jeff Mahoney <jeffm@suse.com>
+Signed-off-by: David Sterba <dsterba@suse.com>
+Signed-off-by: Ben Hutchings <ben.hutchings@codethink.co.uk>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
- fs/btrfs/ctree.h | 130 ++++++++++++++++++++++++------------------------
- fs/btrfs/extent_io.c | 24 ++++----
- fs/btrfs/extent_io.h | 19 +++----
- fs/btrfs/struct-funcs.c | 9 +--
- 4 files changed, 92 insertions(+), 90 deletions(-)
+ fs/btrfs/ctree.h | 128 +++++++++++++++++++++-------------------
+ fs/btrfs/extent_io.c | 24 ++++----
+ fs/btrfs/extent_io.h | 19 +++---
+ fs/btrfs/struct-funcs.c | 9 +--
+ 4 files changed, 91 insertions(+), 89 deletions(-)
+diff --git a/fs/btrfs/ctree.h b/fs/btrfs/ctree.h
+index fc6ba1547d75..dbad9c9f8d78 100644
--- a/fs/btrfs/ctree.h
+++ b/fs/btrfs/ctree.h
-@@ -1389,7 +1389,7 @@ do {
+@@ -2283,7 +2283,7 @@ do { \
#define BTRFS_INODE_ROOT_ITEM_INIT (1 << 31)
struct btrfs_map_token {
@@ -31,7 +40,7 @@ Signed-off-by: Jeff Mahoney <jeffm@suse.com>
char *kaddr;
unsigned long offset;
};
-@@ -1423,18 +1423,19 @@ static inline void btrfs_init_map_token
+@@ -2314,18 +2314,19 @@ static inline void btrfs_init_map_token (struct btrfs_map_token *token)
sizeof(((type *)0)->member)))
#define DECLARE_BTRFS_SETGET_BITS(bits) \
@@ -57,7 +66,7 @@ Signed-off-by: Jeff Mahoney <jeffm@suse.com>
unsigned long off, u##bits val) \
{ \
btrfs_set_token_##bits(eb, ptr, off, val, NULL); \
-@@ -1446,7 +1447,8 @@ DECLARE_BTRFS_SETGET_BITS(32)
+@@ -2337,7 +2338,8 @@ DECLARE_BTRFS_SETGET_BITS(32)
DECLARE_BTRFS_SETGET_BITS(64)
#define BTRFS_SETGET_FUNCS(name, type, member, bits) \
@@ -67,7 +76,7 @@ Signed-off-by: Jeff Mahoney <jeffm@suse.com>
{ \
BUILD_BUG_ON(sizeof(u##bits) != sizeof(((type *)0))->member); \
return btrfs_get_##bits(eb, s, offsetof(type, member)); \
-@@ -1457,7 +1459,8 @@ static inline void btrfs_set_##name(stru
+@@ -2348,7 +2350,8 @@ static inline void btrfs_set_##name(struct extent_buffer *eb, type *s, \
BUILD_BUG_ON(sizeof(u##bits) != sizeof(((type *)0))->member); \
btrfs_set_##bits(eb, s, offsetof(type, member), val); \
} \
@@ -77,7 +86,7 @@ Signed-off-by: Jeff Mahoney <jeffm@suse.com>
struct btrfs_map_token *token) \
{ \
BUILD_BUG_ON(sizeof(u##bits) != sizeof(((type *)0))->member); \
-@@ -1472,9 +1475,9 @@ static inline void btrfs_set_token_##nam
+@@ -2363,9 +2366,9 @@ static inline void btrfs_set_token_##name(struct extent_buffer *eb, \
}
#define BTRFS_SETGET_HEADER_FUNCS(name, type, member, bits) \
@@ -89,7 +98,7 @@ Signed-off-by: Jeff Mahoney <jeffm@suse.com>
u##bits res = le##bits##_to_cpu(p->member); \
return res; \
} \
-@@ -1486,7 +1489,7 @@ static inline void btrfs_set_##name(stru
+@@ -2377,7 +2380,7 @@ static inline void btrfs_set_##name(struct extent_buffer *eb, \
}
#define BTRFS_SETGET_STACK_FUNCS(name, type, member, bits) \
@@ -98,7 +107,7 @@ Signed-off-by: Jeff Mahoney <jeffm@suse.com>
{ \
return le##bits##_to_cpu(s->member); \
} \
-@@ -1787,7 +1790,7 @@ static inline unsigned long btrfs_node_k
+@@ -2678,7 +2681,7 @@ static inline unsigned long btrfs_node_key_ptr_offset(int nr)
sizeof(struct btrfs_key_ptr) * nr;
}
@@ -107,7 +116,7 @@ Signed-off-by: Jeff Mahoney <jeffm@suse.com>
struct btrfs_disk_key *disk_key, int nr);
static inline void btrfs_set_node_key(struct extent_buffer *eb,
-@@ -1816,28 +1819,28 @@ static inline struct btrfs_item *btrfs_i
+@@ -2707,28 +2710,28 @@ static inline struct btrfs_item *btrfs_item_nr(int nr)
return (struct btrfs_item *)btrfs_item_nr_offset(nr);
}
@@ -141,7 +150,7 @@ Signed-off-by: Jeff Mahoney <jeffm@suse.com>
struct btrfs_disk_key *disk_key, int nr)
{
struct btrfs_item *item = btrfs_item_nr(nr);
-@@ -1873,8 +1876,8 @@ BTRFS_SETGET_STACK_FUNCS(stack_dir_name_
+@@ -2764,8 +2767,8 @@ BTRFS_SETGET_STACK_FUNCS(stack_dir_name_len, struct btrfs_dir_item,
BTRFS_SETGET_STACK_FUNCS(stack_dir_transid, struct btrfs_dir_item,
transid, 64);
@@ -152,7 +161,7 @@ Signed-off-by: Jeff Mahoney <jeffm@suse.com>
struct btrfs_disk_key *key)
{
read_eb_member(eb, item, struct btrfs_dir_item, location, key);
-@@ -1882,7 +1885,7 @@ static inline void btrfs_dir_item_key(st
+@@ -2773,7 +2776,7 @@ static inline void btrfs_dir_item_key(struct extent_buffer *eb,
static inline void btrfs_set_dir_item_key(struct extent_buffer *eb,
struct btrfs_dir_item *item,
@@ -161,7 +170,7 @@ Signed-off-by: Jeff Mahoney <jeffm@suse.com>
{
write_eb_member(eb, item, struct btrfs_dir_item, location, key);
}
-@@ -1894,8 +1897,8 @@ BTRFS_SETGET_FUNCS(free_space_bitmaps, s
+@@ -2785,8 +2788,8 @@ BTRFS_SETGET_FUNCS(free_space_bitmaps, struct btrfs_free_space_header,
BTRFS_SETGET_FUNCS(free_space_generation, struct btrfs_free_space_header,
generation, 64);
@@ -172,7 +181,7 @@ Signed-off-by: Jeff Mahoney <jeffm@suse.com>
struct btrfs_disk_key *key)
{
read_eb_member(eb, h, struct btrfs_free_space_header, location, key);
-@@ -1903,7 +1906,7 @@ static inline void btrfs_free_space_key(
+@@ -2794,7 +2797,7 @@ static inline void btrfs_free_space_key(struct extent_buffer *eb,
static inline void btrfs_set_free_space_key(struct extent_buffer *eb,
struct btrfs_free_space_header *h,
@@ -181,7 +190,7 @@ Signed-off-by: Jeff Mahoney <jeffm@suse.com>
{
write_eb_member(eb, h, struct btrfs_free_space_header, location, key);
}
-@@ -1930,25 +1933,25 @@ static inline void btrfs_cpu_key_to_disk
+@@ -2821,25 +2824,25 @@ static inline void btrfs_cpu_key_to_disk(struct btrfs_disk_key *disk,
disk->objectid = cpu_to_le64(cpu->objectid);
}
@@ -214,7 +223,7 @@ Signed-off-by: Jeff Mahoney <jeffm@suse.com>
{
struct btrfs_disk_key disk_key;
btrfs_dir_item_key(eb, item, &disk_key);
-@@ -1981,7 +1984,7 @@ BTRFS_SETGET_STACK_FUNCS(stack_header_nr
+@@ -2872,7 +2875,7 @@ BTRFS_SETGET_STACK_FUNCS(stack_header_nritems, struct btrfs_header,
nritems, 32);
BTRFS_SETGET_STACK_FUNCS(stack_header_bytenr, struct btrfs_header, bytenr, 64);
@@ -223,7 +232,7 @@ Signed-off-by: Jeff Mahoney <jeffm@suse.com>
{
return (btrfs_header_flags(eb) & flag) == flag;
}
-@@ -2000,7 +2003,7 @@ static inline int btrfs_clear_header_fla
+@@ -2891,7 +2894,7 @@ static inline int btrfs_clear_header_flag(struct extent_buffer *eb, u64 flag)
return (flags & flag) == flag;
}
@@ -232,7 +241,7 @@ Signed-off-by: Jeff Mahoney <jeffm@suse.com>
{
u64 flags = btrfs_header_flags(eb);
return flags >> BTRFS_BACKREF_REV_SHIFT;
-@@ -2020,12 +2023,12 @@ static inline unsigned long btrfs_header
+@@ -2911,12 +2914,12 @@ static inline unsigned long btrfs_header_fsid(void)
return offsetof(struct btrfs_header, fsid);
}
@@ -247,7 +256,7 @@ Signed-off-by: Jeff Mahoney <jeffm@suse.com>
{
return btrfs_header_level(eb) == 0;
}
-@@ -2059,12 +2062,12 @@ BTRFS_SETGET_STACK_FUNCS(root_stransid,
+@@ -2950,12 +2953,12 @@ BTRFS_SETGET_STACK_FUNCS(root_stransid, struct btrfs_root_item,
BTRFS_SETGET_STACK_FUNCS(root_rtransid, struct btrfs_root_item,
rtransid, 64);
@@ -262,7 +271,7 @@ Signed-off-by: Jeff Mahoney <jeffm@suse.com>
{
return (root->root_item.flags & cpu_to_le64(BTRFS_ROOT_SUBVOL_DEAD)) != 0;
}
-@@ -2121,51 +2124,51 @@ BTRFS_SETGET_STACK_FUNCS(backup_num_devi
+@@ -3012,51 +3015,51 @@ BTRFS_SETGET_STACK_FUNCS(backup_num_devices, struct btrfs_root_backup,
/* struct btrfs_balance_item */
BTRFS_SETGET_FUNCS(balance_flags, struct btrfs_balance_item, flags, 64);
@@ -327,7 +336,7 @@ Signed-off-by: Jeff Mahoney <jeffm@suse.com>
{
memset(cpu, 0, sizeof(*cpu));
-@@ -2185,7 +2188,7 @@ btrfs_disk_balance_args_to_cpu(struct bt
+@@ -3076,7 +3079,7 @@ btrfs_disk_balance_args_to_cpu(struct btrfs_balance_args *cpu,
static inline void
btrfs_cpu_balance_args_to_disk(struct btrfs_disk_balance_args *disk,
@@ -336,7 +345,7 @@ Signed-off-by: Jeff Mahoney <jeffm@suse.com>
{
memset(disk, 0, sizeof(*disk));
-@@ -2253,7 +2256,7 @@ BTRFS_SETGET_STACK_FUNCS(super_magic, st
+@@ -3144,7 +3147,7 @@ BTRFS_SETGET_STACK_FUNCS(super_magic, struct btrfs_super_block, magic, 64);
BTRFS_SETGET_STACK_FUNCS(super_uuid_tree_generation, struct btrfs_super_block,
uuid_tree_generation, 64);
@@ -345,16 +354,7 @@ Signed-off-by: Jeff Mahoney <jeffm@suse.com>
{
u16 t = btrfs_super_csum_type(s);
/*
-@@ -2262,7 +2265,7 @@ static inline int btrfs_super_csum_size(
- return btrfs_csum_sizes[t];
- }
-
--static inline unsigned long btrfs_leaf_data(struct extent_buffer *l)
-+static inline unsigned long btrfs_leaf_data(const struct extent_buffer *l)
- {
- return offsetof(struct btrfs_leaf, items);
- }
-@@ -2272,8 +2275,8 @@ static inline unsigned long btrfs_leaf_d
+@@ -3163,8 +3166,8 @@ static inline unsigned long btrfs_leaf_data(struct extent_buffer *l)
* this returns the address of the start of the last item,
* which is the stop of the leaf data stack
*/
@@ -365,7 +365,7 @@ Signed-off-by: Jeff Mahoney <jeffm@suse.com>
{
u32 nr = btrfs_header_nritems(leaf);
-@@ -2298,7 +2301,7 @@ BTRFS_SETGET_STACK_FUNCS(stack_file_exte
+@@ -3189,7 +3192,7 @@ BTRFS_SETGET_STACK_FUNCS(stack_file_extent_compression,
struct btrfs_file_extent_item, compression, 8);
static inline unsigned long
@@ -374,7 +374,7 @@ Signed-off-by: Jeff Mahoney <jeffm@suse.com>
{
return (unsigned long)e + BTRFS_FILE_EXTENT_INLINE_DATA_START;
}
-@@ -2332,8 +2335,9 @@ BTRFS_SETGET_FUNCS(file_extent_other_enc
+@@ -3223,8 +3226,9 @@ BTRFS_SETGET_FUNCS(file_extent_other_encoding, struct btrfs_file_extent_item,
* size of any extent headers. If a file is compressed on disk, this is
* the compressed size
*/
@@ -386,7 +386,7 @@ Signed-off-by: Jeff Mahoney <jeffm@suse.com>
{
return btrfs_item_size(eb, e) - BTRFS_FILE_EXTENT_INLINE_DATA_START;
}
-@@ -2341,9 +2345,9 @@ static inline u32 btrfs_file_extent_inli
+@@ -3232,9 +3236,9 @@ static inline u32 btrfs_file_extent_inline_item_len(struct extent_buffer *eb,
/* this returns the number of file bytes represented by the inline item.
* If an item is compressed, this is the uncompressed size
*/
@@ -399,7 +399,7 @@ Signed-off-by: Jeff Mahoney <jeffm@suse.com>
{
struct btrfs_map_token token;
-@@ -2365,8 +2369,8 @@ static inline u32 btrfs_file_extent_inli
+@@ -3256,8 +3260,8 @@ static inline u32 btrfs_file_extent_inline_len(struct extent_buffer *eb,
/* btrfs_dev_stats_item */
@@ -410,9 +410,11 @@ Signed-off-by: Jeff Mahoney <jeffm@suse.com>
int index)
{
u64 val;
+diff --git a/fs/btrfs/extent_io.c b/fs/btrfs/extent_io.c
+index a2fff9a0fe91..42e7f6a8f91d 100644
--- a/fs/btrfs/extent_io.c
+++ b/fs/btrfs/extent_io.c
-@@ -5317,9 +5317,8 @@ unlock_exit:
+@@ -5381,9 +5381,8 @@ int read_extent_buffer_pages(struct extent_io_tree *tree,
return ret;
}
@@ -424,7 +426,7 @@ Signed-off-by: Jeff Mahoney <jeffm@suse.com>
{
size_t cur;
size_t offset;
-@@ -5348,9 +5347,9 @@ void read_extent_buffer(struct extent_bu
+@@ -5412,9 +5411,9 @@ void read_extent_buffer(struct extent_buffer *eb, void *dstv,
}
}
@@ -437,10 +439,10 @@ Signed-off-by: Jeff Mahoney <jeffm@suse.com>
{
size_t cur;
size_t offset;
-@@ -5390,10 +5389,10 @@ int read_extent_buffer_to_user(struct ex
- * return 1 if the item spans two pages.
- * return -EINVAL otherwise.
- */
+@@ -5449,10 +5448,10 @@ int read_extent_buffer_to_user(struct extent_buffer *eb, void __user *dstv,
+ return ret;
+ }
+
-int map_private_extent_buffer(struct extent_buffer *eb, unsigned long start,
- unsigned long min_len, char **map,
- unsigned long *map_start,
@@ -452,7 +454,7 @@ Signed-off-by: Jeff Mahoney <jeffm@suse.com>
{
size_t offset = start & (PAGE_CACHE_SIZE - 1);
char *kaddr;
-@@ -5427,9 +5426,8 @@ int map_private_extent_buffer(struct ext
+@@ -5487,9 +5486,8 @@ int map_private_extent_buffer(struct extent_buffer *eb, unsigned long start,
return 0;
}
@@ -464,9 +466,11 @@ Signed-off-by: Jeff Mahoney <jeffm@suse.com>
{
size_t cur;
size_t offset;
+diff --git a/fs/btrfs/extent_io.h b/fs/btrfs/extent_io.h
+index f4c1ae11855f..751435967724 100644
--- a/fs/btrfs/extent_io.h
+++ b/fs/btrfs/extent_io.h
-@@ -372,14 +372,13 @@ static inline void extent_buffer_get(str
+@@ -308,14 +308,13 @@ static inline void extent_buffer_get(struct extent_buffer *eb)
atomic_inc(&eb->refs);
}
@@ -486,8 +490,8 @@ Signed-off-by: Jeff Mahoney <jeffm@suse.com>
unsigned long len);
void write_extent_buffer(struct extent_buffer *eb, const void *src,
unsigned long start, unsigned long len);
-@@ -398,10 +397,10 @@ void set_extent_buffer_uptodate(struct e
- void clear_extent_buffer_uptodate(struct extent_buffer *eb);
+@@ -334,10 +333,10 @@ int set_extent_buffer_uptodate(struct extent_buffer *eb);
+ int clear_extent_buffer_uptodate(struct extent_buffer *eb);
int extent_buffer_uptodate(struct extent_buffer *eb);
int extent_buffer_under_io(struct extent_buffer *eb);
-int map_private_extent_buffer(struct extent_buffer *eb, unsigned long offset,
@@ -498,12 +502,14 @@ Signed-off-by: Jeff Mahoney <jeffm@suse.com>
+ unsigned long offset, unsigned long min_len,
+ char **map, unsigned long *map_start,
+ unsigned long *map_len);
- void extent_range_clear_dirty_for_io(struct inode *inode, u64 start, u64 end);
- void extent_range_redirty_for_io(struct inode *inode, u64 start, u64 end);
- void extent_clear_unlock_delalloc(struct inode *inode, u64 start, u64 end,
+ int extent_range_clear_dirty_for_io(struct inode *inode, u64 start, u64 end);
+ int extent_range_redirty_for_io(struct inode *inode, u64 start, u64 end);
+ int extent_clear_unlock_delalloc(struct inode *inode, u64 start, u64 end,
+diff --git a/fs/btrfs/struct-funcs.c b/fs/btrfs/struct-funcs.c
+index b976597b0721..63ffd213b0b7 100644
--- a/fs/btrfs/struct-funcs.c
+++ b/fs/btrfs/struct-funcs.c
-@@ -50,8 +50,8 @@ static inline void put_unaligned_le8(u8
+@@ -50,8 +50,8 @@ static inline void put_unaligned_le8(u8 val, void *p)
*/
#define DEFINE_BTRFS_SETGET_BITS(bits) \
@@ -514,7 +520,7 @@ Signed-off-by: Jeff Mahoney <jeffm@suse.com>
struct btrfs_map_token *token) \
{ \
unsigned long part_offset = (unsigned long)ptr; \
-@@ -90,7 +90,8 @@ u##bits btrfs_get_token_##bits(struct ex
+@@ -90,7 +90,8 @@ u##bits btrfs_get_token_##bits(struct extent_buffer *eb, void *ptr, \
return res; \
} \
void btrfs_set_token_##bits(struct extent_buffer *eb, \
@@ -533,3 +539,6 @@ Signed-off-by: Jeff Mahoney <jeffm@suse.com>
struct btrfs_disk_key *disk_key, int nr)
{
unsigned long ptr = btrfs_node_key_ptr_offset(nr);
+--
+2.20.1
+
diff --git a/patches.suse/0001-btrfs-Refactor-check_leaf-function-for-later-expansi.patch b/patches.kernel.org/4.4.171-016-btrfs-Refactor-check_leaf-function-for-later-.patch
index 55ec803bae..69a7601372 100644
--- a/patches.suse/0001-btrfs-Refactor-check_leaf-function-for-later-expansi.patch
+++ b/patches.kernel.org/4.4.171-016-btrfs-Refactor-check_leaf-function-for-later-.patch
@@ -1,9 +1,11 @@
From: Qu Wenruo <quwenruo.btrfs@gmx.com>
-References: bsc#1102896, CVE-2018-14613
-Patch-mainline: v4.15-rc1
-Git-commit: c3267bbaa9cae09b62960eafe33ad19196803285
Date: Wed, 23 Aug 2017 16:57:56 +0900
-Subject: [PATCH 1/4] btrfs: Refactor check_leaf function for later expansion
+Subject: [PATCH] btrfs: Refactor check_leaf function for later expansion
+Patch-mainline: 4.4.171
+References: CVE-2018-14613 bnc#1012382 bsc#1102896
+Git-commit: c3267bbaa9cae09b62960eafe33ad19196803285
+
+commit c3267bbaa9cae09b62960eafe33ad19196803285 upstream.
Current check_leaf() function does a good job checking key order and
item offset/size.
@@ -29,13 +31,21 @@ Signed-off-by: Qu Wenruo <quwenruo.btrfs@gmx.com>
Reviewed-by: Nikolay Borisov <nborisov@suse.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
+[bwh: Backported to 4.4:
+ - BTRFS_LEAF_DATA_SIZE() takes a root rather than an fs_info
+ - Adjust context]
+Signed-off-by: Ben Hutchings <ben.hutchings@codethink.co.uk>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
- fs/btrfs/disk-io.c | 50 +++++++++++++++++++++++++++-----------------------
+ fs/btrfs/disk-io.c | 50 +++++++++++++++++++++++++---------------------
1 file changed, 27 insertions(+), 23 deletions(-)
+diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c
+index fc70be66ee79..d513650d1b77 100644
--- a/fs/btrfs/disk-io.c
+++ b/fs/btrfs/disk-io.c
-@@ -612,8 +612,9 @@ static int check_tree_block_fsid(struct
+@@ -531,8 +531,9 @@ static int check_tree_block_fsid(struct btrfs_fs_info *fs_info,
static noinline int check_leaf(struct btrfs_root *root,
struct extent_buffer *leaf)
{
@@ -46,7 +56,7 @@ Signed-off-by: David Sterba <dsterba@suse.com>
u32 nritems = btrfs_header_nritems(leaf);
int slot;
-@@ -646,7 +647,7 @@ static noinline int check_leaf(struct bt
+@@ -565,7 +566,7 @@ static noinline int check_leaf(struct btrfs_root *root,
CORRUPT("non-root leaf's nritems is 0",
leaf, check_root, 0);
free_extent_buffer(eb);
@@ -55,7 +65,7 @@ Signed-off-by: David Sterba <dsterba@suse.com>
}
free_extent_buffer(eb);
}
-@@ -656,28 +657,23 @@ static noinline int check_leaf(struct bt
+@@ -575,28 +576,23 @@ static noinline int check_leaf(struct btrfs_root *root,
if (nritems == 0)
return 0;
@@ -96,7 +106,7 @@ Signed-off-by: David Sterba <dsterba@suse.com>
}
/*
-@@ -685,10 +681,14 @@ static noinline int check_leaf(struct bt
+@@ -604,10 +600,14 @@ static noinline int check_leaf(struct btrfs_root *root,
* item data starts at the end of the leaf and grows towards the
* front.
*/
@@ -114,7 +124,7 @@ Signed-off-by: David Sterba <dsterba@suse.com>
}
/*
-@@ -699,8 +699,12 @@ static noinline int check_leaf(struct bt
+@@ -618,8 +618,12 @@ static noinline int check_leaf(struct btrfs_root *root,
if (btrfs_item_end_nr(leaf, slot) >
BTRFS_LEAF_DATA_SIZE(root)) {
CORRUPT("slot end outside of leaf", leaf, root, slot);
@@ -128,3 +138,6 @@ Signed-off-by: David Sterba <dsterba@suse.com>
}
return 0;
+--
+2.20.1
+
diff --git a/patches.suse/0002-btrfs-Check-if-item-pointer-overlaps-with-the-item-i.patch b/patches.kernel.org/4.4.171-017-btrfs-Check-if-item-pointer-overlaps-with-the.patch
index 57c6c3fde0..2acc70c382 100644
--- a/patches.suse/0002-btrfs-Check-if-item-pointer-overlaps-with-the-item-i.patch
+++ b/patches.kernel.org/4.4.171-017-btrfs-Check-if-item-pointer-overlaps-with-the.patch
@@ -1,11 +1,11 @@
From: Qu Wenruo <quwenruo.btrfs@gmx.com>
Date: Wed, 23 Aug 2017 16:57:57 +0900
-References: bsc#1102882, bsc#1102896, bsc#1102879, bsc#1102877, bsc#1102875,
- CVE-2018-14613, CVE-2018-14612, CVE-2018-14611, CVE-2018-14610, CVE-2018-14609,
-Patch-mainline: v4.15-rc1
+Subject: [PATCH] btrfs: Check if item pointer overlaps with the item itself
+Patch-mainline: 4.4.171
+References: bnc#1012382 bsc#1102875 bsc#1102877 bsc#1102879 bsc#1102882 bsc#1102896
Git-commit: 7f43d4affb2a254d421ab20b0cf65ac2569909fb
-Subject: [PATCH 2/4] btrfs: Check if item pointer overlaps with the item
- itself
+
+commit 7f43d4affb2a254d421ab20b0cf65ac2569909fb upstream.
Function check_leaf() checks if any item pointer points outside of the
leaf, but it doesn't check if the pointer overlaps with the item itself.
@@ -17,15 +17,18 @@ Signed-off-by: Qu Wenruo <quwenruo.btrfs@gmx.com>
Reviewed-by: Nikolay Borisov <nborisov@suse.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
+Signed-off-by: Ben Hutchings <ben.hutchings@codethink.co.uk>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
fs/btrfs/disk-io.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c
-index 6c97ae1e7288..d1770b3e0385 100644
+index d513650d1b77..d2725a8798fe 100644
--- a/fs/btrfs/disk-io.c
+++ b/fs/btrfs/disk-io.c
-@@ -643,6 +643,13 @@ static noinline int check_leaf(struct btrfs_root *root,
+@@ -621,6 +621,13 @@ static noinline int check_leaf(struct btrfs_root *root,
return -EUCLEAN;
}
@@ -40,5 +43,5 @@ index 6c97ae1e7288..d1770b3e0385 100644
prev_key.type = key.type;
prev_key.offset = key.offset;
--
-2.18.0
+2.20.1
diff --git a/patches.suse/0003-btrfs-Add-sanity-check-for-EXTENT_DATA-when-reading-.patch b/patches.kernel.org/4.4.171-018-btrfs-Add-sanity-check-for-EXTENT_DATA-when-r.patch
index 5766161a12..75f9ba6339 100644
--- a/patches.suse/0003-btrfs-Add-sanity-check-for-EXTENT_DATA-when-reading-.patch
+++ b/patches.kernel.org/4.4.171-018-btrfs-Add-sanity-check-for-EXTENT_DATA-when-r.patch
@@ -1,11 +1,11 @@
From: Qu Wenruo <quwenruo.btrfs@gmx.com>
Date: Wed, 23 Aug 2017 16:57:58 +0900
-References: bsc#1102882, bsc#1102896, bsc#1102879, bsc#1102877, bsc#1102875,
- CVE-2018-14613, CVE-2018-14612, CVE-2018-14611, CVE-2018-14610, CVE-2018-14609,
-Patch-mainline: v4.15-rc1
+Subject: [PATCH] btrfs: Add sanity check for EXTENT_DATA when reading out leaf
+Patch-mainline: 4.4.171
+References: bnc#1012382 bsc#1102875 bsc#1102877 bsc#1102879 bsc#1102882 bsc#1102896
Git-commit: 40c3c40947324d9f40bf47830c92c59a9bbadf4a
-Subject: [PATCH 3/4] btrfs: Add sanity check for EXTENT_DATA when reading out
- leaf
+
+commit 40c3c40947324d9f40bf47830c92c59a9bbadf4a upstream.
Add extra checks for item with EXTENT_DATA type. This checks the
following thing:
@@ -34,14 +34,34 @@ Reviewed-by: David Sterba <dsterba@suse.com>
[ switch to BTRFS_FILE_EXTENT_TYPES, similar to what
BTRFS_COMPRESS_TYPES does ]
Signed-off-by: David Sterba <dsterba@suse.com>
+[bwh: Backported to 4.4:
+ - Use root->sectorsize instead of root->fs_info->sectorsize
+ - Adjust filename]
+Signed-off-by: Ben Hutchings <ben.hutchings@codethink.co.uk>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
- fs/btrfs/disk-io.c | 103 ++++++++++++++++++++++++++++++++++++++++
- include/uapi/linux/btrfs_tree.h | 1
+ fs/btrfs/ctree.h | 1 +
+ fs/btrfs/disk-io.c | 103 +++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 104 insertions(+)
+diff --git a/fs/btrfs/ctree.h b/fs/btrfs/ctree.h
+index dbad9c9f8d78..3a162ddbe8b7 100644
+--- a/fs/btrfs/ctree.h
++++ b/fs/btrfs/ctree.h
+@@ -897,6 +897,7 @@ struct btrfs_balance_item {
+ #define BTRFS_FILE_EXTENT_INLINE 0
+ #define BTRFS_FILE_EXTENT_REG 1
+ #define BTRFS_FILE_EXTENT_PREALLOC 2
++#define BTRFS_FILE_EXTENT_TYPES 2
+
+ struct btrfs_file_extent_item {
+ /*
+diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c
+index d2725a8798fe..80ebcfdf6051 100644
--- a/fs/btrfs/disk-io.c
+++ b/fs/btrfs/disk-io.c
-@@ -609,6 +609,100 @@ static int check_tree_block_fsid(struct
+@@ -528,6 +528,100 @@ static int check_tree_block_fsid(struct btrfs_fs_info *fs_info,
btrfs_header_level(eb) == 0 ? "leaf" : "node",\
reason, btrfs_header_bytenr(eb), root->objectid, slot)
@@ -142,7 +162,7 @@ Signed-off-by: David Sterba <dsterba@suse.com>
static noinline int check_leaf(struct btrfs_root *root,
struct extent_buffer *leaf)
{
-@@ -664,9 +758,13 @@ static noinline int check_leaf(struct bt
+@@ -583,9 +677,13 @@ static noinline int check_leaf(struct btrfs_root *root,
* 1) key order
* 2) item offset and size
* No overlap, no hole, all inside the leaf.
@@ -156,7 +176,7 @@ Signed-off-by: David Sterba <dsterba@suse.com>
btrfs_item_key_to_cpu(leaf, &key, slot);
-@@ -709,6 +807,11 @@ static noinline int check_leaf(struct bt
+@@ -628,6 +726,11 @@ static noinline int check_leaf(struct btrfs_root *root,
return -EUCLEAN;
}
@@ -168,13 +188,6 @@ Signed-off-by: David Sterba <dsterba@suse.com>
prev_key.objectid = key.objectid;
prev_key.type = key.type;
prev_key.offset = key.offset;
---- a/include/uapi/linux/btrfs_tree.h
-+++ b/include/uapi/linux/btrfs_tree.h
-@@ -729,6 +729,7 @@ struct btrfs_balance_item {
- #define BTRFS_FILE_EXTENT_INLINE 0
- #define BTRFS_FILE_EXTENT_REG 1
- #define BTRFS_FILE_EXTENT_PREALLOC 2
-+#define BTRFS_FILE_EXTENT_TYPES 2
-
- struct btrfs_file_extent_item {
- /*
+--
+2.20.1
+
diff --git a/patches.suse/0004-btrfs-Add-checker-for-EXTENT_CSUM.patch b/patches.kernel.org/4.4.171-019-btrfs-Add-checker-for-EXTENT_CSUM.patch
index 444549a570..6d927cbf37 100644
--- a/patches.suse/0004-btrfs-Add-checker-for-EXTENT_CSUM.patch
+++ b/patches.kernel.org/4.4.171-019-btrfs-Add-checker-for-EXTENT_CSUM.patch
@@ -1,10 +1,11 @@
From: Qu Wenruo <quwenruo.btrfs@gmx.com>
Date: Wed, 23 Aug 2017 16:57:59 +0900
-References: bsc#1102882, bsc#1102896, bsc#1102879, bsc#1102877, bsc#1102875,
- CVE-2018-14613, CVE-2018-14612, CVE-2018-14611, CVE-2018-14610, CVE-2018-14609,
-Patch-mainline: v4.15-rc1
+Subject: [PATCH] btrfs: Add checker for EXTENT_CSUM
+Patch-mainline: 4.4.171
+References: bnc#1012382 bsc#1102875 bsc#1102877 bsc#1102879 bsc#1102882 bsc#1102896
Git-commit: 4b865cab96fe2a30ed512cf667b354bd291b3b0a
-Subject: [PATCH 4/4] btrfs: Add checker for EXTENT_CSUM
+
+commit 4b865cab96fe2a30ed512cf667b354bd291b3b0a upstream.
EXTENT_CSUM checker is a relatively easy one, only needs to check:
@@ -21,15 +22,20 @@ Signed-off-by: Qu Wenruo <quwenruo.btrfs@gmx.com>
Reviewed-by: Nikolay Borisov <nborisov@suse.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
+[bwh: Backported to 4.4: Use root->sectorsize instead of
+ root->fs_info->sectorsize]
+Signed-off-by: Ben Hutchings <ben.hutchings@codethink.co.uk>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
fs/btrfs/disk-io.c | 24 ++++++++++++++++++++++++
1 file changed, 24 insertions(+)
diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c
-index b863d41f7d0a..c8633f2abdf1 100644
+index 80ebcfdf6051..e1ac4b8de251 100644
--- a/fs/btrfs/disk-io.c
+++ b/fs/btrfs/disk-io.c
-@@ -626,6 +626,27 @@ static int check_extent_data_item(struct btrfs_root *root,
+@@ -605,6 +605,27 @@ static int check_extent_data_item(struct btrfs_root *root,
return 0;
}
@@ -57,7 +63,7 @@ index b863d41f7d0a..c8633f2abdf1 100644
/*
* Common point to switch the item-specific validation.
*/
-@@ -639,6 +660,9 @@ static int check_leaf_item(struct btrfs_root *root,
+@@ -618,6 +639,9 @@ static int check_leaf_item(struct btrfs_root *root,
case BTRFS_EXTENT_DATA_KEY:
ret = check_extent_data_item(root, leaf, key, slot);
break;
@@ -68,5 +74,5 @@ index b863d41f7d0a..c8633f2abdf1 100644
return ret;
}
--
-2.18.0
+2.20.1
diff --git a/patches.suse/0005-btrfs-Move-leaf-and-node-validation-checker-to-tree-.patch b/patches.kernel.org/4.4.171-020-btrfs-Move-leaf-and-node-validation-checker-t.patch
index 77f2f45f95..d3a3c41a7c 100644
--- a/patches.suse/0005-btrfs-Move-leaf-and-node-validation-checker-to-tree-.patch
+++ b/patches.kernel.org/4.4.171-020-btrfs-Move-leaf-and-node-validation-checker-t.patch
@@ -1,11 +1,12 @@
From: Qu Wenruo <quwenruo.btrfs@gmx.com>
Date: Mon, 9 Oct 2017 01:51:02 +0000
-References: bsc#1102882, bsc#1102896, bsc#1102879, bsc#1102877, bsc#1102875,
- CVE-2018-14613, CVE-2018-14612, CVE-2018-14611, CVE-2018-14610, CVE-2018-14609,
-Patch-mainline: v4.15-rc1
-Git-commit: 557ea5dd003d371536f6b4e8f7c8209a2b6fd4e3
-Subject: [PATCH 1/5] btrfs: Move leaf and node validation checker to
+Subject: [PATCH] btrfs: Move leaf and node validation checker to
tree-checker.c
+Patch-mainline: 4.4.171
+References: bnc#1012382 bsc#1102875 bsc#1102877 bsc#1102879 bsc#1102882 bsc#1102896
+Git-commit: 557ea5dd003d371536f6b4e8f7c8209a2b6fd4e3
+
+commit 557ea5dd003d371536f6b4e8f7c8209a2b6fd4e3 upstream.
It's no doubt the comprehensive tree block checker will become larger,
so moving them into their own files is quite reasonable.
@@ -13,18 +14,26 @@ so moving them into their own files is quite reasonable.
Signed-off-by: Qu Wenruo <quwenruo.btrfs@gmx.com>
[ wording adjustments ]
Signed-off-by: David Sterba <dsterba@suse.com>
+[bwh: Backported to 4.4:
+ - The moved code is slightly different
+ - Adjust context]
+Signed-off-by: Ben Hutchings <ben.hutchings@codethink.co.uk>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
- fs/btrfs/Makefile | 2
- fs/btrfs/disk-io.c | 284 --------------------------------------------
- fs/btrfs/tree-checker.c | 309 ++++++++++++++++++++++++++++++++++++++++++++++++
- fs/btrfs/tree-checker.h | 26 ++++
+ fs/btrfs/Makefile | 2 +-
+ fs/btrfs/disk-io.c | 284 +-----------------------------------
+ fs/btrfs/tree-checker.c | 309 ++++++++++++++++++++++++++++++++++++++++
+ fs/btrfs/tree-checker.h | 26 ++++
4 files changed, 340 insertions(+), 281 deletions(-)
create mode 100644 fs/btrfs/tree-checker.c
create mode 100644 fs/btrfs/tree-checker.h
+diff --git a/fs/btrfs/Makefile b/fs/btrfs/Makefile
+index 6d1d0b93b1aa..c792df826e12 100644
--- a/fs/btrfs/Makefile
+++ b/fs/btrfs/Makefile
-@@ -9,7 +9,7 @@ btrfs-y += super.o ctree.o extent-tree.o
+@@ -9,7 +9,7 @@ btrfs-y += super.o ctree.o extent-tree.o print-tree.o root-tree.o dir-item.o \
export.o tree-log.o free-space-cache.o zlib.o lzo.o \
compression.o delayed-ref.o relocation.o delayed-inode.o scrub.o \
reada.o backref.o ulist.o qgroup.o send.o dev-replace.o raid56.o \
@@ -33,6 +42,8 @@ Signed-off-by: David Sterba <dsterba@suse.com>
btrfs-$(CONFIG_BTRFS_FS_POSIX_ACL) += acl.o
btrfs-$(CONFIG_BTRFS_FS_CHECK_INTEGRITY) += check-integrity.o
+diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c
+index e1ac4b8de251..2a93930ec103 100644
--- a/fs/btrfs/disk-io.c
+++ b/fs/btrfs/disk-io.c
@@ -49,6 +49,7 @@
@@ -43,7 +54,7 @@ Signed-off-by: David Sterba <dsterba@suse.com>
#ifdef CONFIG_X86
#include <asm/cpufeature.h>
-@@ -603,283 +604,6 @@ static int check_tree_block_fsid(struct
+@@ -522,283 +523,6 @@ static int check_tree_block_fsid(struct btrfs_fs_info *fs_info,
return ret;
}
@@ -327,7 +338,7 @@ Signed-off-by: David Sterba <dsterba@suse.com>
static int btree_readpage_end_io_hook(struct btrfs_io_bio *io_bio,
u64 phy_offset, struct page *page,
u64 start, u64 end, int mirror)
-@@ -945,12 +669,12 @@ static int btree_readpage_end_io_hook(st
+@@ -865,12 +589,12 @@ static int btree_readpage_end_io_hook(struct btrfs_io_bio *io_bio,
* that we don't try and read the other copies of this block, just
* return -EIO.
*/
@@ -342,7 +353,7 @@ Signed-off-by: David Sterba <dsterba@suse.com>
ret = -EIO;
if (!ret)
-@@ -4244,7 +3968,7 @@ void btrfs_mark_buffer_dirty(struct exte
+@@ -4172,7 +3896,7 @@ void btrfs_mark_buffer_dirty(struct extent_buffer *buf)
buf->len,
root->fs_info->dirty_metadata_batch);
#ifdef CONFIG_BTRFS_FS_CHECK_INTEGRITY
@@ -351,6 +362,9 @@ Signed-off-by: David Sterba <dsterba@suse.com>
btrfs_print_leaf(root, buf);
ASSERT(0);
}
+diff --git a/fs/btrfs/tree-checker.c b/fs/btrfs/tree-checker.c
+new file mode 100644
+index 000000000000..dfba9f6b79a2
--- /dev/null
+++ b/fs/btrfs/tree-checker.c
@@ -0,0 +1,309 @@
@@ -663,6 +677,9 @@ Signed-off-by: David Sterba <dsterba@suse.com>
+out:
+ return ret;
+}
+diff --git a/fs/btrfs/tree-checker.h b/fs/btrfs/tree-checker.h
+new file mode 100644
+index 000000000000..96c486e95d70
--- /dev/null
+++ b/fs/btrfs/tree-checker.h
@@ -0,0 +1,26 @@
@@ -692,3 +709,6 @@ Signed-off-by: David Sterba <dsterba@suse.com>
+int btrfs_check_node(struct btrfs_root *root, struct extent_buffer *node);
+
+#endif
+--
+2.20.1
+
diff --git a/patches.suse/0006-btrfs-tree-checker-Enhance-btrfs_check_node-output.patch b/patches.kernel.org/4.4.171-021-btrfs-tree-checker-Enhance-btrfs_check_node-o.patch
index e33cf3174c..73a0e4f3c5 100644
--- a/patches.suse/0006-btrfs-tree-checker-Enhance-btrfs_check_node-output.patch
+++ b/patches.kernel.org/4.4.171-021-btrfs-tree-checker-Enhance-btrfs_check_node-o.patch
@@ -1,10 +1,11 @@
From: Qu Wenruo <quwenruo.btrfs@gmx.com>
Date: Mon, 9 Oct 2017 01:51:03 +0000
-References: bsc#1102882, bsc#1102896, bsc#1102879, bsc#1102877, bsc#1102875,
- CVE-2018-14613, CVE-2018-14612, CVE-2018-14611, CVE-2018-14610, CVE-2018-14609,
-Patch-mainline: v4.15-rc1
+Subject: [PATCH] btrfs: tree-checker: Enhance btrfs_check_node output
+Patch-mainline: 4.4.171
+References: bnc#1012382 bsc#1102875 bsc#1102877 bsc#1102879 bsc#1102882 bsc#1102896
Git-commit: bba4f29896c986c4cec17bc0f19f2ce644fceae1
-Subject: [PATCH 2/5] btrfs: tree-checker: Enhance btrfs_check_node output
+
+commit bba4f29896c986c4cec17bc0f19f2ce644fceae1 upstream.
Use inline function to replace macro since we don't need
stringification.
@@ -23,10 +24,19 @@ obvious.
Signed-off-by: Qu Wenruo <quwenruo.btrfs@gmx.com>
[ wording adjustments, unindented long strings ]
Signed-off-by: David Sterba <dsterba@suse.com>
+[bwh: Backported to 4.4:
+ - Use root->sectorsize instead of root->fs_info->sectorsize
+ - BTRFS_NODEPTRS_PER_BLOCK() takes a root instead of an fs_info, and yields
+ a value of type size_t instead of unsigned int]
+Signed-off-by: Ben Hutchings <ben.hutchings@codethink.co.uk>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
- fs/btrfs/tree-checker.c | 68 +++++++++++++++++++++++++++++++++++++++++++-----
+ fs/btrfs/tree-checker.c | 68 ++++++++++++++++++++++++++++++++++++-----
1 file changed, 61 insertions(+), 7 deletions(-)
+diff --git a/fs/btrfs/tree-checker.c b/fs/btrfs/tree-checker.c
+index dfba9f6b79a2..c3f971194bd1 100644
--- a/fs/btrfs/tree-checker.c
+++ b/fs/btrfs/tree-checker.c
@@ -37,6 +37,46 @@
@@ -55,7 +65,7 @@ Signed-off-by: David Sterba <dsterba@suse.com>
+ */
+__printf(4, 5)
+static void generic_err(const struct btrfs_root *root,
-+ struct extent_buffer *eb, int slot,
++ const struct extent_buffer *eb, int slot,
+ const char *fmt, ...)
+{
+ struct va_format vaf;
@@ -76,14 +86,14 @@ Signed-off-by: David Sterba <dsterba@suse.com>
static int check_extent_data_item(struct btrfs_root *root,
struct extent_buffer *leaf,
struct btrfs_key *key, int slot)
-@@ -282,9 +322,11 @@ int btrfs_check_node(struct btrfs_root *
+@@ -282,9 +322,11 @@ int btrfs_check_node(struct btrfs_root *root, struct extent_buffer *node)
if (nr == 0 || nr > BTRFS_NODEPTRS_PER_BLOCK(root)) {
btrfs_crit(root->fs_info,
- "corrupt node: block %llu root %llu nritems %lu",
- node->start, root->objectid, nr);
- return -EIO;
-+"corrupt node: root=%llu block=%llu, nritems too %s, have %lu expect range [1,%u]",
++"corrupt node: root=%llu block=%llu, nritems too %s, have %lu expect range [1,%zu]",
+ root->objectid, node->start,
+ nr == 0 ? "small" : "large", nr,
+ BTRFS_NODEPTRS_PER_BLOCK(root));
@@ -91,7 +101,7 @@ Signed-off-by: David Sterba <dsterba@suse.com>
}
for (slot = 0; slot < nr - 1; slot++) {
-@@ -293,14 +335,26 @@ int btrfs_check_node(struct btrfs_root *
+@@ -293,14 +335,26 @@ int btrfs_check_node(struct btrfs_root *root, struct extent_buffer *node)
btrfs_node_key_to_cpu(node, &next_key, slot + 1);
if (!bytenr) {
@@ -122,3 +132,6 @@ Signed-off-by: David Sterba <dsterba@suse.com>
goto out;
}
}
+--
+2.20.1
+
diff --git a/patches.suse/0011-btrfs-tree-checker-Fix-false-panic-for-sanity-test.patch b/patches.kernel.org/4.4.171-022-btrfs-tree-checker-Fix-false-panic-for-sanity.patch
index 665f897492..a3f6738d0f 100644
--- a/patches.suse/0011-btrfs-tree-checker-Fix-false-panic-for-sanity-test.patch
+++ b/patches.kernel.org/4.4.171-022-btrfs-tree-checker-Fix-false-panic-for-sanity.patch
@@ -1,10 +1,11 @@
From: Qu Wenruo <wqu@suse.com>
Date: Wed, 8 Nov 2017 08:54:24 +0800
-References: bsc#1102882, bsc#1102896, bsc#1102879, bsc#1102877, bsc#1102875,
- CVE-2018-14613, CVE-2018-14612, CVE-2018-14611, CVE-2018-14610, CVE-2018-14609,
-Patch-mainline: v4.15-rc2
-Git-commit: 69fc6cbbac542c349b3d350d10f6e394c253c81d
Subject: [PATCH] btrfs: tree-checker: Fix false panic for sanity test
+Patch-mainline: 4.4.171
+References: bnc#1012382 bsc#1102875 bsc#1102877 bsc#1102879 bsc#1102882 bsc#1102896
+Git-commit: 69fc6cbbac542c349b3d350d10f6e394c253c81d
+
+commit 69fc6cbbac542c349b3d350d10f6e394c253c81d upstream.
[BUG]
If we run btrfs with CONFIG_BTRFS_FS_RUN_SANITY_TESTS=y, it will
@@ -51,15 +52,21 @@ Signed-off-by: Qu Wenruo <wqu@suse.com>
Reviewed-by: Liu Bo <bo.li.liu@oracle.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
+[bwh: Backported to 4.4: adjust context]
+Signed-off-by: Ben Hutchings <ben.hutchings@codethink.co.uk>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
- fs/btrfs/disk-io.c | 10 ++++++++--
- fs/btrfs/tree-checker.c | 27 ++++++++++++++++++++++-----
- fs/btrfs/tree-checker.h | 14 +++++++++++++-
+ fs/btrfs/disk-io.c | 10 ++++++++--
+ fs/btrfs/tree-checker.c | 27 ++++++++++++++++++++++-----
+ fs/btrfs/tree-checker.h | 14 +++++++++++++-
3 files changed, 43 insertions(+), 8 deletions(-)
+diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c
+index 2a93930ec103..f80a0af68736 100644
--- a/fs/btrfs/disk-io.c
+++ b/fs/btrfs/disk-io.c
-@@ -669,7 +669,7 @@ static int btree_readpage_end_io_hook(st
+@@ -589,7 +589,7 @@ static int btree_readpage_end_io_hook(struct btrfs_io_bio *io_bio,
* that we don't try and read the other copies of this block, just
* return -EIO.
*/
@@ -68,7 +75,7 @@ Signed-off-by: David Sterba <dsterba@suse.com>
set_bit(EXTENT_BUFFER_CORRUPT, &eb->bflags);
ret = -EIO;
}
-@@ -3968,7 +3968,13 @@ void btrfs_mark_buffer_dirty(struct exte
+@@ -3896,7 +3896,13 @@ void btrfs_mark_buffer_dirty(struct extent_buffer *buf)
buf->len,
root->fs_info->dirty_metadata_batch);
#ifdef CONFIG_BTRFS_FS_CHECK_INTEGRITY
@@ -83,9 +90,11 @@ Signed-off-by: David Sterba <dsterba@suse.com>
btrfs_print_leaf(root, buf);
ASSERT(0);
}
+diff --git a/fs/btrfs/tree-checker.c b/fs/btrfs/tree-checker.c
+index c3f971194bd1..7bd2ab47f422 100644
--- a/fs/btrfs/tree-checker.c
+++ b/fs/btrfs/tree-checker.c
-@@ -242,7 +242,8 @@ static int check_leaf_item(struct btrfs_
+@@ -195,7 +195,8 @@ static int check_leaf_item(struct btrfs_root *root,
return ret;
}
@@ -95,7 +104,7 @@ Signed-off-by: David Sterba <dsterba@suse.com>
{
struct btrfs_fs_info *fs_info = root->fs_info;
/* No valid key type is 0, so all key should be larger than this key */
-@@ -361,10 +362,15 @@ int btrfs_check_leaf(struct btrfs_root *
+@@ -299,10 +300,15 @@ int btrfs_check_leaf(struct btrfs_root *root, struct extent_buffer *leaf)
return -EUCLEAN;
}
@@ -115,7 +124,7 @@ Signed-off-by: David Sterba <dsterba@suse.com>
prev_key.objectid = key.objectid;
prev_key.type = key.type;
-@@ -374,6 +380,17 @@ int btrfs_check_leaf(struct btrfs_root *
+@@ -312,6 +318,17 @@ int btrfs_check_leaf(struct btrfs_root *root, struct extent_buffer *leaf)
return 0;
}
@@ -133,6 +142,8 @@ Signed-off-by: David Sterba <dsterba@suse.com>
int btrfs_check_node(struct btrfs_root *root, struct extent_buffer *node)
{
unsigned long nr = btrfs_header_nritems(node);
+diff --git a/fs/btrfs/tree-checker.h b/fs/btrfs/tree-checker.h
+index 96c486e95d70..3d53e8d6fda0 100644
--- a/fs/btrfs/tree-checker.h
+++ b/fs/btrfs/tree-checker.h
@@ -20,7 +20,19 @@
@@ -156,3 +167,6 @@ Signed-off-by: David Sterba <dsterba@suse.com>
int btrfs_check_node(struct btrfs_root *root, struct extent_buffer *node);
#endif
+--
+2.20.1
+
diff --git a/patches.suse/0012-btrfs-tree-checker-Add-checker-for-dir-item.patch b/patches.kernel.org/4.4.171-023-btrfs-tree-checker-Add-checker-for-dir-item.patch
index a4e5b4a207..a3b6e02fd8 100644
--- a/patches.suse/0012-btrfs-tree-checker-Add-checker-for-dir-item.patch
+++ b/patches.kernel.org/4.4.171-023-btrfs-tree-checker-Add-checker-for-dir-item.patch
@@ -1,10 +1,11 @@
From: Qu Wenruo <wqu@suse.com>
Date: Wed, 8 Nov 2017 08:54:25 +0800
-References: bsc#1102882, bsc#1102896, bsc#1102879, bsc#1102877, bsc#1102875,
- CVE-2018-14613, CVE-2018-14612, CVE-2018-14611, CVE-2018-14610, CVE-2018-14609,
-Patch-mainline: v4.16-rc1
-Git-commit: ad7b0368f33cffe67fecd302028915926e50ef7e
Subject: [PATCH] btrfs: tree-checker: Add checker for dir item
+Patch-mainline: 4.4.171
+References: bnc#1012382 bsc#1102875 bsc#1102877 bsc#1102879 bsc#1102882 bsc#1102896
+Git-commit: ad7b0368f33cffe67fecd302028915926e50ef7e
+
+commit ad7b0368f33cffe67fecd302028915926e50ef7e upstream.
Add checker for dir item, for key types DIR_ITEM, DIR_INDEX and
XATTR_ITEM.
@@ -34,12 +35,17 @@ Reviewed-by: Nikolay Borisov <nborisov@suse.com>
Reviewed-by: Su Yue <suy.fnst@cn.fujitsu.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
+[bwh: Backported to 4.4: BTRFS_MAX_XATTR_SIZE() takes a root instead of an
+ fs_info, and yields a value of type size_t instead of unsigned int]
+Signed-off-by: Ben Hutchings <ben.hutchings@codethink.co.uk>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
fs/btrfs/tree-checker.c | 141 ++++++++++++++++++++++++++++++++++++++++
1 file changed, 141 insertions(+)
diff --git a/fs/btrfs/tree-checker.c b/fs/btrfs/tree-checker.c
-index ce4ed6ec8f39..66dac0a4b01f 100644
+index 7bd2ab47f422..0715b39afa5d 100644
--- a/fs/btrfs/tree-checker.c
+++ b/fs/btrfs/tree-checker.c
@@ -30,6 +30,7 @@
@@ -48,9 +54,9 @@ index ce4ed6ec8f39..66dac0a4b01f 100644
#include "compression.h"
+#include "hash.h"
- /*
- * Error message should follow the following format:
-@@ -222,6 +223,141 @@ static int check_csum_item(struct btrfs_root *root, struct extent_buffer *leaf,
+ #define CORRUPT(reason, eb, root, slot) \
+ btrfs_crit(root->fs_info, \
+@@ -175,6 +176,141 @@ static int check_csum_item(struct btrfs_root *root, struct extent_buffer *leaf,
return 0;
}
@@ -144,7 +150,7 @@ index ce4ed6ec8f39..66dac0a4b01f 100644
+ }
+ if (name_len + data_len > BTRFS_MAX_XATTR_SIZE(root)) {
+ dir_item_err(root, leaf, slot,
-+ "dir item name and data len too long, have %u max %u",
++ "dir item name and data len too long, have %u max %zu",
+ name_len + data_len,
+ BTRFS_MAX_XATTR_SIZE(root));
+ return -EUCLEAN;
@@ -192,7 +198,7 @@ index ce4ed6ec8f39..66dac0a4b01f 100644
/*
* Common point to switch the item-specific validation.
*/
-@@ -238,6 +374,11 @@ static int check_leaf_item(struct btrfs_root *root,
+@@ -191,6 +327,11 @@ static int check_leaf_item(struct btrfs_root *root,
case BTRFS_EXTENT_CSUM_KEY:
ret = check_csum_item(root, leaf, key, slot);
break;
@@ -205,5 +211,5 @@ index ce4ed6ec8f39..66dac0a4b01f 100644
return ret;
}
--
-2.18.0
+2.20.1
diff --git a/patches.suse/0013-btrfs-tree-checker-use-zu-format-string-for-size_t.patch b/patches.kernel.org/4.4.171-024-btrfs-tree-checker-use-zu-format-string-for-s.patch
index 60ecdb3a0a..2b2f18a44c 100644
--- a/patches.suse/0013-btrfs-tree-checker-use-zu-format-string-for-size_t.patch
+++ b/patches.kernel.org/4.4.171-024-btrfs-tree-checker-use-zu-format-string-for-s.patch
@@ -1,10 +1,11 @@
From: Arnd Bergmann <arnd@arndb.de>
-References: bsc#1102882, bsc#1102896, bsc#1102879, bsc#1102877, bsc#1102875,
- CVE-2018-14613, CVE-2018-14612, CVE-2018-14611, CVE-2018-14610, CVE-2018-14609,
-Patch-mainline: v4.16-rc1
-Git-commit: 7cfad65297bfe0aa2996cd72d21c898aa84436d9
Date: Wed, 6 Dec 2017 15:18:14 +0100
Subject: [PATCH] btrfs: tree-checker: use %zu format string for size_t
+Patch-mainline: 4.4.171
+References: bnc#1012382 bsc#1102875 bsc#1102877 bsc#1102879 bsc#1102882 bsc#1102896
+Git-commit: 7cfad65297bfe0aa2996cd72d21c898aa84436d9
+
+commit 7cfad65297bfe0aa2996cd72d21c898aa84436d9 upstream.
The return value of sizeof() is of type size_t, so we must print it
using the %z format modifier rather than %l to avoid this warning
@@ -17,15 +18,18 @@ Fixes: 005887f2e3e0 ("btrfs: tree-checker: Add checker for dir item")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
+Signed-off-by: Ben Hutchings <ben.hutchings@codethink.co.uk>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
fs/btrfs/tree-checker.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/fs/btrfs/tree-checker.c b/fs/btrfs/tree-checker.c
-index 66dac0a4b01f..7c55e3ba5a6c 100644
+index 0715b39afa5d..71997af35f3e 100644
--- a/fs/btrfs/tree-checker.c
+++ b/fs/btrfs/tree-checker.c
-@@ -270,7 +270,7 @@ static int check_dir_item(struct btrfs_root *root,
+@@ -223,7 +223,7 @@ static int check_dir_item(struct btrfs_root *root,
/* header itself should not cross item boundary */
if (cur + sizeof(*di) > item_size) {
dir_item_err(root, leaf, slot,
@@ -35,5 +39,5 @@ index 66dac0a4b01f..7c55e3ba5a6c 100644
return -EUCLEAN;
}
--
-2.18.0
+2.20.1
diff --git a/patches.kernel.org/4.4.171-025-btrfs-tree-check-reduce-stack-consumption-in-.patch b/patches.kernel.org/4.4.171-025-btrfs-tree-check-reduce-stack-consumption-in-.patch
new file mode 100644
index 0000000000..0d4fdb79df
--- /dev/null
+++ b/patches.kernel.org/4.4.171-025-btrfs-tree-check-reduce-stack-consumption-in-.patch
@@ -0,0 +1,55 @@
+From: David Sterba <dsterba@suse.com>
+Date: Wed, 10 Jan 2018 15:13:07 +0100
+Subject: [PATCH] btrfs: tree-check: reduce stack consumption in check_dir_item
+References: bnc#1012382
+Patch-mainline: 4.4.171
+Git-commit: e2683fc9d219430f5b78889b50cde7f40efeba7b
+
+commit e2683fc9d219430f5b78889b50cde7f40efeba7b upstream.
+
+I've noticed that the updated item checker stack consumption increased
+dramatically in 542f5385e20cf97447 ("btrfs: tree-checker: Add checker
+for dir item")
+
+tree-checker.c:check_leaf +552 (176 -> 728)
+
+The array is 255 bytes long, dynamic allocation would slow down the
+sanity checks so it's more reasonable to keep it on-stack. Moving the
+variable to the scope of use reduces the stack usage again
+
+tree-checker.c:check_leaf -264 (728 -> 464)
+
+Reviewed-by: Josef Bacik <jbacik@fb.com>
+Reviewed-by: Qu Wenruo <wqu@suse.com>
+Signed-off-by: David Sterba <dsterba@suse.com>
+Signed-off-by: Ben Hutchings <ben.hutchings@codethink.co.uk>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+Signed-off-by: Jiri Slaby <jslaby@suse.cz>
+---
+ fs/btrfs/tree-checker.c | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/fs/btrfs/tree-checker.c b/fs/btrfs/tree-checker.c
+index 71997af35f3e..7d4e4fe69762 100644
+--- a/fs/btrfs/tree-checker.c
++++ b/fs/btrfs/tree-checker.c
+@@ -212,7 +212,6 @@ static int check_dir_item(struct btrfs_root *root,
+
+ di = btrfs_item_ptr(leaf, slot, struct btrfs_dir_item);
+ while (cur < item_size) {
+- char namebuf[max(BTRFS_NAME_LEN, XATTR_NAME_MAX)];
+ u32 name_len;
+ u32 data_len;
+ u32 max_name_len;
+@@ -295,6 +294,8 @@ static int check_dir_item(struct btrfs_root *root,
+ */
+ if (key->type == BTRFS_DIR_ITEM_KEY ||
+ key->type == BTRFS_XATTR_ITEM_KEY) {
++ char namebuf[max(BTRFS_NAME_LEN, XATTR_NAME_MAX)];
++
+ read_extent_buffer(leaf, namebuf,
+ (unsigned long)(di + 1), name_len);
+ name_hash = btrfs_name_hash(namebuf, name_len);
+--
+2.20.1
+
diff --git a/patches.suse/0015-btrfs-tree-checker-Verify-block_group_item.patch b/patches.kernel.org/4.4.171-026-btrfs-tree-checker-Verify-block_group_item.patch
index fd260f8696..24d216622d 100644
--- a/patches.suse/0015-btrfs-tree-checker-Verify-block_group_item.patch
+++ b/patches.kernel.org/4.4.171-026-btrfs-tree-checker-Verify-block_group_item.patch
@@ -1,11 +1,11 @@
-From fce466eab7ac6baa9d2dcd88abcf945be3d4a089 Mon Sep 17 00:00:00 2001
From: Qu Wenruo <wqu@suse.com>
Date: Tue, 3 Jul 2018 17:10:05 +0800
-References: bsc#1102882, bsc#1102896, bsc#1102879, bsc#1102877, bsc#1102875,
- CVE-2018-14613, CVE-2018-14612, CVE-2018-14611, CVE-2018-14610, CVE-2018-14609,
-Patch-mainline: v4.19-rc1
+Subject: [PATCH] btrfs: tree-checker: Verify block_group_item
+Patch-mainline: 4.4.171
+References: bnc#1012382 bsc#1102875 bsc#1102877 bsc#1102879 bsc#1102882 bsc#1102896
Git-commit: fce466eab7ac6baa9d2dcd88abcf945be3d4a089
-Subject: [PATCH 1/2] btrfs: tree-checker: Verify block_group_item
+
+commit fce466eab7ac6baa9d2dcd88abcf945be3d4a089 upstream.
A crafted image with invalid block group items could make free space cache
code to cause panic.
@@ -33,12 +33,34 @@ Reviewed-by: Nikolay Borisov <nborisov@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>
+[bwh: Backported to 4.4:
+ - In check_leaf_item(), pass root->fs_info to check_block_group_item()
+ - Include <linux/sizes.h> (in ctree.h, to match upstream)
+ - Adjust context]
+Signed-off-by: Ben Hutchings <ben.hutchings@codethink.co.uk>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
- fs/btrfs/tree-checker.c | 100 ++++++++++++++++++++++++++++++++++++++++++++++++
- fs/btrfs/volumes.c | 2
- fs/btrfs/volumes.h | 3 +
- 3 files changed, 104 insertions(+), 1 deletion(-)
+ fs/btrfs/ctree.h | 1 +
+ fs/btrfs/tree-checker.c | 100 ++++++++++++++++++++++++++++++++++++++++
+ fs/btrfs/volumes.c | 2 +-
+ fs/btrfs/volumes.h | 2 +
+ 4 files changed, 104 insertions(+), 1 deletion(-)
+diff --git a/fs/btrfs/ctree.h b/fs/btrfs/ctree.h
+index 3a162ddbe8b7..4a91d3119e59 100644
+--- a/fs/btrfs/ctree.h
++++ b/fs/btrfs/ctree.h
+@@ -35,6 +35,7 @@
+ #include <linux/btrfs.h>
+ #include <linux/workqueue.h>
+ #include <linux/security.h>
++#include <linux/sizes.h>
+ #include "extent_io.h"
+ #include "extent_map.h"
+ #include "async-thread.h"
+diff --git a/fs/btrfs/tree-checker.c b/fs/btrfs/tree-checker.c
+index 7d4e4fe69762..cd7064e0c3c5 100644
--- a/fs/btrfs/tree-checker.c
+++ b/fs/btrfs/tree-checker.c
@@ -31,6 +31,7 @@
@@ -47,16 +69,16 @@ Signed-off-by: David Sterba <dsterba@suse.com>
#include "hash.h"
+#include "volumes.h"
- /*
- * Error message should follow the following format:
-@@ -364,6 +365,102 @@ static int check_dir_item(struct btrfs_f
+ #define CORRUPT(reason, eb, root, slot) \
+ btrfs_crit(root->fs_info, \
+@@ -312,6 +313,102 @@ static int check_dir_item(struct btrfs_root *root,
return 0;
}
+__printf(4, 5)
+__cold
+static void block_group_err(const struct btrfs_fs_info *fs_info,
-+ struct extent_buffer *eb, int slot,
++ const struct extent_buffer *eb, int slot,
+ const char *fmt, ...)
+{
+ struct btrfs_key key;
@@ -152,19 +174,21 @@ Signed-off-by: David Sterba <dsterba@suse.com>
/*
* Common point to switch the item-specific validation.
*/
-@@ -385,6 +482,9 @@ static int check_leaf_item(struct btrfs_
+@@ -333,6 +430,9 @@ static int check_leaf_item(struct btrfs_root *root,
case BTRFS_XATTR_ITEM_KEY:
- ret = check_dir_item(fs_info, leaf, key, slot);
+ ret = check_dir_item(root, leaf, key, slot);
break;
+ case BTRFS_BLOCK_GROUP_ITEM_KEY:
-+ ret = check_block_group_item(fs_info, leaf, key, slot);
++ ret = check_block_group_item(root->fs_info, leaf, key, slot);
+ break;
}
return ret;
}
+diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c
+index 75211630a864..da94d2fc1419 100644
--- a/fs/btrfs/volumes.c
+++ b/fs/btrfs/volumes.c
-@@ -4659,7 +4659,7 @@ static int __btrfs_alloc_chunk(struct bt
+@@ -4540,7 +4540,7 @@ static int __btrfs_alloc_chunk(struct btrfs_trans_handle *trans,
if (type & BTRFS_BLOCK_GROUP_DATA) {
max_stripe_size = 1024 * 1024 * 1024;
@@ -173,13 +197,12 @@ Signed-off-by: David Sterba <dsterba@suse.com>
if (!devs_max)
devs_max = BTRFS_MAX_DEVS(info->chunk_root);
} else if (type & BTRFS_BLOCK_GROUP_METADATA) {
+diff --git a/fs/btrfs/volumes.h b/fs/btrfs/volumes.h
+index d5c84f6b1353..3c651df420be 100644
--- a/fs/btrfs/volumes.h
+++ b/fs/btrfs/volumes.h
-@@ -22,8 +22,11 @@
- #include <linux/bio.h>
- #include <linux/sort.h>
+@@ -24,6 +24,8 @@
#include <linux/btrfs.h>
-+#include <linux/sizes.h>
#include "async-thread.h"
+#define BTRFS_MAX_DATA_CHUNK_SIZE (10ULL * SZ_1G)
@@ -187,3 +210,6 @@ Signed-off-by: David Sterba <dsterba@suse.com>
extern struct mutex uuid_mutex;
#define BTRFS_STRIPE_LEN (64 * 1024)
+--
+2.20.1
+
diff --git a/patches.suse/0016-btrfs-tree-checker-Detect-invalid-and-empty-essentia.patch b/patches.kernel.org/4.4.171-027-btrfs-tree-checker-Detect-invalid-and-empty-e.patch
index 50c266bdab..e2084f8b6a 100644
--- a/patches.suse/0016-btrfs-tree-checker-Detect-invalid-and-empty-essentia.patch
+++ b/patches.kernel.org/4.4.171-027-btrfs-tree-checker-Detect-invalid-and-empty-e.patch
@@ -1,12 +1,11 @@
-From ba480dd4db9f1798541eb2d1c423fc95feee8d36 Mon Sep 17 00:00:00 2001
From: Qu Wenruo <wqu@suse.com>
Date: Tue, 3 Jul 2018 17:10:06 +0800
-References: bsc#1102882, bsc#1102896, bsc#1102879, bsc#1102877, bsc#1102875,
- CVE-2018-14613, CVE-2018-14612, CVE-2018-14611, CVE-2018-14610, CVE-2018-14609,
-Patch-mainline: v4.19-rc1
+Subject: [PATCH] btrfs: tree-checker: Detect invalid and empty essential trees
+Patch-mainline: 4.4.171
+References: bnc#1012382 bsc#1102875 bsc#1102877 bsc#1102879 bsc#1102882 bsc#1102896
Git-commit: ba480dd4db9f1798541eb2d1c423fc95feee8d36
-Subject: [PATCH 2/2] btrfs: tree-checker: Detect invalid and empty essential
- trees
+
+commit ba480dd4db9f1798541eb2d1c423fc95feee8d36 upstream.
A crafted image has empty root tree block, which will later cause NULL
pointer dereference.
@@ -37,15 +36,19 @@ 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>
+[bwh: Backported to 4.4: Pass root instead of fs_info to generic_err()]
+Signed-off-by: Ben Hutchings <ben.hutchings@codethink.co.uk>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
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 3bade2ad39e8..db835635372f 100644
+index cd7064e0c3c5..f26659aa5fd5 100644
--- a/fs/btrfs/tree-checker.c
+++ b/fs/btrfs/tree-checker.c
-@@ -496,9 +496,22 @@ static int check_leaf(struct btrfs_fs_info *fs_info, struct extent_buffer *leaf,
+@@ -456,9 +456,22 @@ static int check_leaf(struct btrfs_root *root, struct extent_buffer *leaf,
* skip this check for relocation trees.
*/
if (nritems == 0 && !btrfs_header_flag(leaf, BTRFS_HEADER_FLAG_RELOC)) {
@@ -60,7 +63,7 @@ index 3bade2ad39e8..db835635372f 100644
+ owner == BTRFS_DEV_TREE_OBJECTID ||
+ owner == BTRFS_FS_TREE_OBJECTID ||
+ owner == BTRFS_DATA_RELOC_TREE_OBJECTID) {
-+ generic_err(fs_info, leaf, 0,
++ generic_err(root, leaf, 0,
+ "invalid root, root %llu must never be empty",
+ owner);
+ return -EUCLEAN;
@@ -70,5 +73,5 @@ index 3bade2ad39e8..db835635372f 100644
key.offset = (u64)-1;
--
-2.18.0
+2.20.1
diff --git a/patches.kernel.org/4.4.171-028-btrfs-validate-type-when-reading-a-chunk.patch b/patches.kernel.org/4.4.171-028-btrfs-validate-type-when-reading-a-chunk.patch
new file mode 100644
index 0000000000..209541e99f
--- /dev/null
+++ b/patches.kernel.org/4.4.171-028-btrfs-validate-type-when-reading-a-chunk.patch
@@ -0,0 +1,77 @@
+From: Gu Jinxiang <gujx@cn.fujitsu.com>
+Date: Wed, 4 Jul 2018 18:16:39 +0800
+Subject: [PATCH] btrfs: validate type when reading a chunk
+References: bnc#1012382
+Patch-mainline: 4.4.171
+Git-commit: 315409b0098fb2651d86553f0436b70502b29bb2
+
+commit 315409b0098fb2651d86553f0436b70502b29bb2 upstream.
+
+Reported in https://bugzilla.kernel.org/show_bug.cgi?id=199839, with an
+image that has an invalid chunk type but does not return an error.
+
+Add chunk type check in btrfs_check_chunk_valid, to detect the wrong
+type combinations.
+
+Link: https://bugzilla.kernel.org/show_bug.cgi?id=199839
+Reported-by: Xu Wen <wen.xu@gatech.edu>
+Reviewed-by: Qu Wenruo <wqu@suse.com>
+Signed-off-by: Gu Jinxiang <gujx@cn.fujitsu.com>
+Signed-off-by: David Sterba <dsterba@suse.com>
+[bwh: Backported to 4.4: Use root->fs_info instead of fs_info]
+Signed-off-by: Ben Hutchings <ben.hutchings@codethink.co.uk>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+Signed-off-by: Jiri Slaby <jslaby@suse.cz>
+---
+ fs/btrfs/volumes.c | 28 ++++++++++++++++++++++++++++
+ 1 file changed, 28 insertions(+)
+
+diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c
+index da94d2fc1419..5e8fe8f3942d 100644
+--- a/fs/btrfs/volumes.c
++++ b/fs/btrfs/volumes.c
+@@ -6218,6 +6218,8 @@ static int btrfs_check_chunk_valid(struct btrfs_root *root,
+ u16 num_stripes;
+ u16 sub_stripes;
+ u64 type;
++ u64 features;
++ bool mixed = false;
+
+ length = btrfs_chunk_length(leaf, chunk);
+ stripe_len = btrfs_chunk_stripe_len(leaf, chunk);
+@@ -6258,6 +6260,32 @@ static int btrfs_check_chunk_valid(struct btrfs_root *root,
+ btrfs_chunk_type(leaf, chunk));
+ return -EIO;
+ }
++
++ if ((type & BTRFS_BLOCK_GROUP_TYPE_MASK) == 0) {
++ btrfs_err(root->fs_info, "missing chunk type flag: 0x%llx", type);
++ return -EIO;
++ }
++
++ if ((type & BTRFS_BLOCK_GROUP_SYSTEM) &&
++ (type & (BTRFS_BLOCK_GROUP_METADATA | BTRFS_BLOCK_GROUP_DATA))) {
++ btrfs_err(root->fs_info,
++ "system chunk with data or metadata type: 0x%llx", type);
++ return -EIO;
++ }
++
++ features = btrfs_super_incompat_flags(root->fs_info->super_copy);
++ if (features & BTRFS_FEATURE_INCOMPAT_MIXED_GROUPS)
++ mixed = true;
++
++ if (!mixed) {
++ if ((type & BTRFS_BLOCK_GROUP_METADATA) &&
++ (type & BTRFS_BLOCK_GROUP_DATA)) {
++ btrfs_err(root->fs_info,
++ "mixed chunk type in non-mixed mode: 0x%llx", type);
++ return -EIO;
++ }
++ }
++
+ if ((type & BTRFS_BLOCK_GROUP_RAID10 && sub_stripes != 2) ||
+ (type & BTRFS_BLOCK_GROUP_RAID1 && num_stripes < 1) ||
+ (type & BTRFS_BLOCK_GROUP_RAID5 && num_stripes < 2) ||
+--
+2.20.1
+
diff --git a/patches.suse/0017-btrfs-Check-that-each-block-group-has-corresponding-.patch b/patches.kernel.org/4.4.171-029-btrfs-Check-that-each-block-group-has-corresp.patch
index 6a82a04980..e8b3b79d6a 100644
--- a/patches.suse/0017-btrfs-Check-that-each-block-group-has-corresponding-.patch
+++ b/patches.kernel.org/4.4.171-029-btrfs-Check-that-each-block-group-has-corresp.patch
@@ -1,12 +1,12 @@
-From 514c7dca85a0bf40be984dab0b477403a6db901f Mon Sep 17 00:00:00 2001
From: Qu Wenruo <wqu@suse.com>
Date: Wed, 1 Aug 2018 10:37:16 +0800
-References: bsc#1102882, bsc#1102896, bsc#1102879, bsc#1102877, bsc#1102875,
- CVE-2018-14613, CVE-2018-14612, CVE-2018-14611, CVE-2018-14610, CVE-2018-14609,
-Patch-mainline: v4.19-rc1
+Subject: [PATCH] btrfs: Check that each block group has corresponding chunk at
+ mount time
+Patch-mainline: 4.4.171
+References: bnc#1012382 bsc#1102875 bsc#1102877 bsc#1102879 bsc#1102882 bsc#1102896
Git-commit: 514c7dca85a0bf40be984dab0b477403a6db901f
-Subject: [PATCH 1/3] btrfs: Check that each block group has corresponding
- chunk at mount time
+
+commit 514c7dca85a0bf40be984dab0b477403a6db901f upstream.
A crafted btrfs image with incorrect chunk<->block group mapping will
trigger a lot of unexpected things as the mapping is essential.
@@ -30,15 +30,19 @@ Signed-off-by: Qu Wenruo <wqu@suse.com>
Reviewed-by: Su Yue <suy.fnst@cn.fujitsu.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
+[bwh: Backported to 4.4: Use root->fs_info instead of fs_info]
+Signed-off-by: Ben Hutchings <ben.hutchings@codethink.co.uk>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
fs/btrfs/extent-tree.c | 28 +++++++++++++++++++++++++++-
1 file changed, 27 insertions(+), 1 deletion(-)
diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c
-index 9e7b237b9547..54a0cfef5c5c 100644
+index 14549387b518..f0f95381ae80 100644
--- a/fs/btrfs/extent-tree.c
+++ b/fs/btrfs/extent-tree.c
-@@ -9532,6 +9532,8 @@ static int find_first_block_group(struct btrfs_fs_info *fs_info,
+@@ -9487,6 +9487,8 @@ static int find_first_block_group(struct btrfs_root *root,
int ret = 0;
struct btrfs_key found_key;
struct extent_buffer *leaf;
@@ -47,7 +51,7 @@ index 9e7b237b9547..54a0cfef5c5c 100644
int slot;
ret = btrfs_search_slot(NULL, root, key, path, 0, 0);
-@@ -9566,8 +9568,32 @@ static int find_first_block_group(struct btrfs_fs_info *fs_info,
+@@ -9521,8 +9523,32 @@ static int find_first_block_group(struct btrfs_root *root,
"logical %llu len %llu found bg but no related chunk",
found_key.objectid, found_key.offset);
ret = -ENOENT;
@@ -82,5 +86,5 @@ index 9e7b237b9547..54a0cfef5c5c 100644
free_extent_map(em);
goto out;
--
-2.18.0
+2.20.1
diff --git a/patches.suse/0018-btrfs-Verify-that-every-chunk-has-corresponding-bloc.patch b/patches.kernel.org/4.4.171-030-btrfs-Verify-that-every-chunk-has-correspondi.patch
index 702d3a3561..4880a29a43 100644
--- a/patches.suse/0018-btrfs-Verify-that-every-chunk-has-corresponding-bloc.patch
+++ b/patches.kernel.org/4.4.171-030-btrfs-Verify-that-every-chunk-has-correspondi.patch
@@ -1,12 +1,12 @@
-From 7ef49515fa6727cb4b6f2f5b0ffbc5fc20a9f8c6 Mon Sep 17 00:00:00 2001
From: Qu Wenruo <wqu@suse.com>
Date: Wed, 1 Aug 2018 10:37:17 +0800
-References: bsc#1102882, bsc#1102896, bsc#1102879, bsc#1102877, bsc#1102875,
- CVE-2018-14613, CVE-2018-14612, CVE-2018-14611, CVE-2018-14610, CVE-2018-14609,
-Patch-mainline: v4.19-rc1
+Subject: [PATCH] btrfs: Verify that every chunk has corresponding block group
+ at mount time
+Patch-mainline: 4.4.171
+References: bnc#1012382 bsc#1102875 bsc#1102877 bsc#1102879 bsc#1102882 bsc#1102896
Git-commit: 7ef49515fa6727cb4b6f2f5b0ffbc5fc20a9f8c6
-Subject: [PATCH 2/3] btrfs: Verify that every chunk has corresponding block
- group at mount time
+
+commit 7ef49515fa6727cb4b6f2f5b0ffbc5fc20a9f8c6 upstream.
If a crafted image has missing block group items, it could cause
unexpected behavior and breaks the assumption of 1:1 chunk<->block group
@@ -24,16 +24,23 @@ Signed-off-by: Qu Wenruo <wqu@suse.com>
Reviewed-by: Gu Jinxiang <gujx@cn.fujitsu.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
+[bwh: Backported to 4.4: adjust context]
+Signed-off-by: Ben Hutchings <ben.hutchings@codethink.co.uk>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
- fs/btrfs/extent-tree.c | 57 ++++++++++++++++++++++++++++++++++++++++++++++++-
- 1 file changed, 56 insertions(+), 1 deletion(-)
+ fs/btrfs/extent-tree.c | 58 +++++++++++++++++++++++++++++++++++++++++-
+ 1 file changed, 57 insertions(+), 1 deletion(-)
+diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c
+index f0f95381ae80..978bbfed5a2c 100644
--- a/fs/btrfs/extent-tree.c
+++ b/fs/btrfs/extent-tree.c
-@@ -9945,6 +9945,61 @@ btrfs_create_block_group_cache(struct bt
+@@ -9765,6 +9765,62 @@ btrfs_create_block_group_cache(struct btrfs_root *root, u64 start, u64 size)
return cache;
}
++
+/*
+ * Iterate all chunks and verify that each of them has the corresponding block
+ * group
@@ -92,7 +99,7 @@ Signed-off-by: David Sterba <dsterba@suse.com>
int btrfs_read_block_groups(struct btrfs_root *root)
{
struct btrfs_path *path;
-@@ -10129,7 +10184,7 @@ int btrfs_read_block_groups(struct btrfs
+@@ -9951,7 +10007,7 @@ int btrfs_read_block_groups(struct btrfs_root *root)
}
init_global_block_rsv(info);
@@ -101,3 +108,6 @@ Signed-off-by: David Sterba <dsterba@suse.com>
error:
btrfs_free_path(path);
return ret;
+--
+2.20.1
+
diff --git a/patches.kernel.org/4.4.171-031-btrfs-tree-checker-Check-level-for-leaves-and.patch b/patches.kernel.org/4.4.171-031-btrfs-tree-checker-Check-level-for-leaves-and.patch
new file mode 100644
index 0000000000..e7aa4a386f
--- /dev/null
+++ b/patches.kernel.org/4.4.171-031-btrfs-tree-checker-Check-level-for-leaves-and.patch
@@ -0,0 +1,69 @@
+From: Qu Wenruo <wqu@suse.com>
+Date: Fri, 28 Sep 2018 07:59:34 +0800
+Subject: [PATCH] btrfs: tree-checker: Check level for leaves and nodes
+References: bnc#1012382
+Patch-mainline: 4.4.171
+Git-commit: f556faa46eb4e96d0d0772e74ecf66781e132f72
+
+commit f556faa46eb4e96d0d0772e74ecf66781e132f72 upstream.
+
+Although we have tree level check at tree read runtime, it's completely
+based on its parent level.
+We still need to do accurate level check to avoid invalid tree blocks
+sneak into kernel space.
+
+The check itself is simple, for leaf its level should always be 0.
+For nodes its level should be in range [1, BTRFS_MAX_LEVEL - 1].
+
+Signed-off-by: Qu Wenruo <wqu@suse.com>
+Reviewed-by: Su Yue <suy.fnst@cn.fujitsu.com>
+Reviewed-by: David Sterba <dsterba@suse.com>
+Signed-off-by: David Sterba <dsterba@suse.com>
+[bwh: Backported to 4.4:
+ - Pass root instead of fs_info to generic_err()
+ - Adjust context]
+Signed-off-by: Ben Hutchings <ben.hutchings@codethink.co.uk>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+Signed-off-by: Jiri Slaby <jslaby@suse.cz>
+---
+ fs/btrfs/tree-checker.c | 14 ++++++++++++++
+ 1 file changed, 14 insertions(+)
+
+diff --git a/fs/btrfs/tree-checker.c b/fs/btrfs/tree-checker.c
+index f26659aa5fd5..03936164a8eb 100644
+--- a/fs/btrfs/tree-checker.c
++++ b/fs/btrfs/tree-checker.c
+@@ -447,6 +447,13 @@ static int check_leaf(struct btrfs_root *root, struct extent_buffer *leaf,
+ u32 nritems = btrfs_header_nritems(leaf);
+ int slot;
+
++ if (btrfs_header_level(leaf) != 0) {
++ generic_err(root, leaf, 0,
++ "invalid level for leaf, have %d expect 0",
++ btrfs_header_level(leaf));
++ return -EUCLEAN;
++ }
++
+ /*
+ * Extent buffers from a relocation tree have a owner field that
+ * corresponds to the subvolume tree they are based on. So just from an
+@@ -589,9 +596,16 @@ int btrfs_check_node(struct btrfs_root *root, struct extent_buffer *node)
+ unsigned long nr = btrfs_header_nritems(node);
+ struct btrfs_key key, next_key;
+ int slot;
++ int level = btrfs_header_level(node);
+ u64 bytenr;
+ int ret = 0;
+
++ if (level <= 0 || level >= BTRFS_MAX_LEVEL) {
++ generic_err(root, node, 0,
++ "invalid level for node, have %d expect [1, %d]",
++ level, BTRFS_MAX_LEVEL - 1);
++ return -EUCLEAN;
++ }
+ if (nr == 0 || nr > BTRFS_NODEPTRS_PER_BLOCK(root)) {
+ btrfs_crit(root->fs_info,
+ "corrupt node: root=%llu block=%llu, nritems too %s, have %lu expect range [1,%zu]",
+--
+2.20.1
+
diff --git a/patches.kernel.org/4.4.171-032-btrfs-tree-checker-Fix-misleading-group-syste.patch b/patches.kernel.org/4.4.171-032-btrfs-tree-checker-Fix-misleading-group-syste.patch
new file mode 100644
index 0000000000..fe87e6991e
--- /dev/null
+++ b/patches.kernel.org/4.4.171-032-btrfs-tree-checker-Fix-misleading-group-syste.patch
@@ -0,0 +1,43 @@
+From: Shaokun Zhang <zhangshaokun@hisilicon.com>
+Date: Mon, 5 Nov 2018 18:49:09 +0800
+Subject: [PATCH] btrfs: tree-checker: Fix misleading group system information
+References: bnc#1012382
+Patch-mainline: 4.4.171
+Git-commit: 761333f2f50ccc887aa9957ae829300262c0d15b
+
+commit 761333f2f50ccc887aa9957ae829300262c0d15b upstream.
+
+block_group_err shows the group system as a decimal value with a '0x'
+prefix, which is somewhat misleading.
+
+Fix it to print hexadecimal, as was intended.
+
+Fixes: fce466eab7ac6 ("btrfs: tree-checker: Verify block_group_item")
+Reviewed-by: Nikolay Borisov <nborisov@suse.com>
+Reviewed-by: Qu Wenruo <wqu@suse.com>
+Signed-off-by: Shaokun Zhang <zhangshaokun@hisilicon.com>
+Reviewed-by: David Sterba <dsterba@suse.com>
+Signed-off-by: David Sterba <dsterba@suse.com>
+Signed-off-by: Ben Hutchings <ben.hutchings@codethink.co.uk>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+Signed-off-by: Jiri Slaby <jslaby@suse.cz>
+---
+ fs/btrfs/tree-checker.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/fs/btrfs/tree-checker.c b/fs/btrfs/tree-checker.c
+index 03936164a8eb..5b98f3c76ce4 100644
+--- a/fs/btrfs/tree-checker.c
++++ b/fs/btrfs/tree-checker.c
+@@ -399,7 +399,7 @@ static int check_block_group_item(struct btrfs_fs_info *fs_info,
+ type != (BTRFS_BLOCK_GROUP_METADATA |
+ BTRFS_BLOCK_GROUP_DATA)) {
+ block_group_err(fs_info, leaf, slot,
+-"invalid type, have 0x%llx (%lu bits set) expect either 0x%llx, 0x%llx, 0x%llu or 0x%llx",
++"invalid type, have 0x%llx (%lu bits set) expect either 0x%llx, 0x%llx, 0x%llx or 0x%llx",
+ type, hweight64(type),
+ BTRFS_BLOCK_GROUP_DATA, BTRFS_BLOCK_GROUP_METADATA,
+ BTRFS_BLOCK_GROUP_SYSTEM,
+--
+2.20.1
+
diff --git a/patches.kernel.org/4.4.171-033-CIFS-Do-not-hide-EINTR-after-sending-network-.patch b/patches.kernel.org/4.4.171-033-CIFS-Do-not-hide-EINTR-after-sending-network-.patch
new file mode 100644
index 0000000000..0bcbe49c6e
--- /dev/null
+++ b/patches.kernel.org/4.4.171-033-CIFS-Do-not-hide-EINTR-after-sending-network-.patch
@@ -0,0 +1,40 @@
+From: Pavel Shilovsky <pshilov@microsoft.com>
+Date: Thu, 10 Jan 2019 11:27:28 -0800
+Subject: [PATCH] CIFS: Do not hide EINTR after sending network packets
+References: bnc#1012382
+Patch-mainline: 4.4.171
+Git-commit: ee13919c2e8d1f904e035ad4b4239029a8994131
+
+commit ee13919c2e8d1f904e035ad4b4239029a8994131 upstream.
+
+Currently we hide EINTR code returned from sock_sendmsg()
+and return 0 instead. This makes a caller think that we
+successfully completed the network operation which is not
+true. Fix this by properly returning EINTR to callers.
+
+Cc: <stable@vger.kernel.org>
+Signed-off-by: Pavel Shilovsky <pshilov@microsoft.com>
+Reviewed-by: Jeff Layton <jlayton@kernel.org>
+Signed-off-by: Steve French <stfrench@microsoft.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+Signed-off-by: Jiri Slaby <jslaby@suse.cz>
+---
+ fs/cifs/transport.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/fs/cifs/transport.c b/fs/cifs/transport.c
+index 54af10204e83..1cf0a336ec06 100644
+--- a/fs/cifs/transport.c
++++ b/fs/cifs/transport.c
+@@ -360,7 +360,7 @@ smb_send_rqst(struct TCP_Server_Info *server, struct smb_rqst *rqst)
+ if (rc < 0 && rc != -EINTR)
+ cifs_dbg(VFS, "Error %d sending data on socket to server\n",
+ rc);
+- else
++ else if (rc > 0)
+ rc = 0;
+
+ return rc;
+--
+2.20.1
+
diff --git a/patches.kernel.org/4.4.171-034-cifs-Fix-potential-OOB-access-of-lock-element.patch b/patches.kernel.org/4.4.171-034-cifs-Fix-potential-OOB-access-of-lock-element.patch
new file mode 100644
index 0000000000..1b7a1e9bde
--- /dev/null
+++ b/patches.kernel.org/4.4.171-034-cifs-Fix-potential-OOB-access-of-lock-element.patch
@@ -0,0 +1,72 @@
+From: Ross Lagerwall <ross.lagerwall@citrix.com>
+Date: Tue, 8 Jan 2019 18:30:57 +0000
+Subject: [PATCH] cifs: Fix potential OOB access of lock element array
+References: bnc#1012382
+Patch-mainline: 4.4.171
+Git-commit: b9a74cde94957d82003fb9f7ab4777938ca851cd
+
+commit b9a74cde94957d82003fb9f7ab4777938ca851cd upstream.
+
+If maxBuf is small but non-zero, it could result in a zero sized lock
+element array which we would then try and access OOB.
+
+Signed-off-by: Ross Lagerwall <ross.lagerwall@citrix.com>
+Signed-off-by: Steve French <stfrench@microsoft.com>
+CC: Stable <stable@vger.kernel.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+Signed-off-by: Jiri Slaby <jslaby@suse.cz>
+---
+ fs/cifs/file.c | 8 ++++----
+ fs/cifs/smb2file.c | 4 ++--
+ 2 files changed, 6 insertions(+), 6 deletions(-)
+
+diff --git a/fs/cifs/file.c b/fs/cifs/file.c
+index 0141aba9eca6..026b399af215 100644
+--- a/fs/cifs/file.c
++++ b/fs/cifs/file.c
+@@ -1073,10 +1073,10 @@ cifs_push_mandatory_locks(struct cifsFileInfo *cfile)
+
+ /*
+ * Accessing maxBuf is racy with cifs_reconnect - need to store value
+- * and check it for zero before using.
++ * and check it before using.
+ */
+ max_buf = tcon->ses->server->maxBuf;
+- if (!max_buf) {
++ if (max_buf < (sizeof(struct smb_hdr) + sizeof(LOCKING_ANDX_RANGE))) {
+ free_xid(xid);
+ return -EINVAL;
+ }
+@@ -1404,10 +1404,10 @@ cifs_unlock_range(struct cifsFileInfo *cfile, struct file_lock *flock,
+
+ /*
+ * Accessing maxBuf is racy with cifs_reconnect - need to store value
+- * and check it for zero before using.
++ * and check it before using.
+ */
+ max_buf = tcon->ses->server->maxBuf;
+- if (!max_buf)
++ if (max_buf < (sizeof(struct smb_hdr) + sizeof(LOCKING_ANDX_RANGE)))
+ return -EINVAL;
+
+ max_num = (max_buf - sizeof(struct smb_hdr)) /
+diff --git a/fs/cifs/smb2file.c b/fs/cifs/smb2file.c
+index b2aff0c6f22c..b7885dc0d9bb 100644
+--- a/fs/cifs/smb2file.c
++++ b/fs/cifs/smb2file.c
+@@ -123,10 +123,10 @@ smb2_unlock_range(struct cifsFileInfo *cfile, struct file_lock *flock,
+
+ /*
+ * Accessing maxBuf is racy with cifs_reconnect - need to store value
+- * and check it for zero before using.
++ * and check it before using.
+ */
+ max_buf = tcon->ses->server->maxBuf;
+- if (!max_buf)
++ if (max_buf < sizeof(struct smb2_lock_element))
+ return -EINVAL;
+
+ max_num = max_buf / sizeof(struct smb2_lock_element);
+--
+2.20.1
+
diff --git a/patches.kernel.org/4.4.171-035-usb-cdc-acm-send-ZLP-for-Telit-3G-Intel-based.patch b/patches.kernel.org/4.4.171-035-usb-cdc-acm-send-ZLP-for-Telit-3G-Intel-based.patch
new file mode 100644
index 0000000000..79a7e0b0d7
--- /dev/null
+++ b/patches.kernel.org/4.4.171-035-usb-cdc-acm-send-ZLP-for-Telit-3G-Intel-based.patch
@@ -0,0 +1,41 @@
+From: Daniele Palmas <dnlplm@gmail.com>
+Date: Fri, 28 Dec 2018 16:15:41 +0100
+Subject: [PATCH] usb: cdc-acm: send ZLP for Telit 3G Intel based modems
+References: bnc#1012382
+Patch-mainline: 4.4.171
+Git-commit: 34aabf918717dd14e05051896aaecd3b16b53d95
+
+commit 34aabf918717dd14e05051896aaecd3b16b53d95 upstream.
+
+Telit 3G Intel based modems require zero packet to be sent if
+out data size is equal to the endpoint max packet size.
+
+Signed-off-by: Daniele Palmas <dnlplm@gmail.com>
+Cc: stable <stable@vger.kernel.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+Signed-off-by: Jiri Slaby <jslaby@suse.cz>
+---
+ drivers/usb/class/cdc-acm.c | 7 +++++++
+ 1 file changed, 7 insertions(+)
+
+diff --git a/drivers/usb/class/cdc-acm.c b/drivers/usb/class/cdc-acm.c
+index 3919ea066bf9..736de1021d8b 100644
+--- a/drivers/usb/class/cdc-acm.c
++++ b/drivers/usb/class/cdc-acm.c
+@@ -1885,6 +1885,13 @@ static const struct usb_device_id acm_ids[] = {
+ .driver_info = IGNORE_DEVICE,
+ },
+
++ { USB_DEVICE(0x1bc7, 0x0021), /* Telit 3G ACM only composition */
++ .driver_info = SEND_ZERO_PACKET,
++ },
++ { USB_DEVICE(0x1bc7, 0x0023), /* Telit 3G ACM + ECM composition */
++ .driver_info = SEND_ZERO_PACKET,
++ },
++
+ /* control interfaces without any protocol set */
+ { USB_INTERFACE_INFO(USB_CLASS_COMM, USB_CDC_SUBCLASS_ACM,
+ USB_CDC_PROTO_NONE) },
+--
+2.20.1
+
diff --git a/patches.kernel.org/4.4.171-036-USB-storage-don-t-insert-sane-sense-for-SPC3-.patch b/patches.kernel.org/4.4.171-036-USB-storage-don-t-insert-sane-sense-for-SPC3-.patch
new file mode 100644
index 0000000000..8f225a0d98
--- /dev/null
+++ b/patches.kernel.org/4.4.171-036-USB-storage-don-t-insert-sane-sense-for-SPC3-.patch
@@ -0,0 +1,50 @@
+From: Icenowy Zheng <icenowy@aosc.io>
+Date: Thu, 3 Jan 2019 11:26:17 +0800
+Subject: [PATCH] USB: storage: don't insert sane sense for SPC3+ when bad
+ sense specified
+References: bnc#1012382
+Patch-mainline: 4.4.171
+Git-commit: c5603d2fdb424849360fe7e3f8c1befc97571b8c
+
+commit c5603d2fdb424849360fe7e3f8c1befc97571b8c upstream.
+
+Currently the code will set US_FL_SANE_SENSE flag unconditionally if
+device claims SPC3+, however we should allow US_FL_BAD_SENSE flag to
+prevent this behavior, because SMI SM3350 UFS-USB bridge controller,
+which claims SPC4, will show strange behavior with 96-byte sense
+(put the chip into a wrong state that cannot read/write anything).
+
+Check the presence of US_FL_BAD_SENSE when assuming US_FL_SANE_SENSE on
+SPC4+ devices.
+
+Signed-off-by: Icenowy Zheng <icenowy@aosc.io>
+Cc: stable <stable@vger.kernel.org>
+Acked-by: Alan Stern <stern@rowland.harvard.edu>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+Signed-off-by: Jiri Slaby <jslaby@suse.cz>
+---
+ drivers/usb/storage/scsiglue.c | 8 ++++++--
+ 1 file changed, 6 insertions(+), 2 deletions(-)
+
+diff --git a/drivers/usb/storage/scsiglue.c b/drivers/usb/storage/scsiglue.c
+index 6c186b4df94a..b3344a77dcce 100644
+--- a/drivers/usb/storage/scsiglue.c
++++ b/drivers/usb/storage/scsiglue.c
+@@ -223,8 +223,12 @@ static int slave_configure(struct scsi_device *sdev)
+ if (!(us->fflags & US_FL_NEEDS_CAP16))
+ sdev->try_rc_10_first = 1;
+
+- /* assume SPC3 or latter devices support sense size > 18 */
+- if (sdev->scsi_level > SCSI_SPC_2)
++ /*
++ * assume SPC3 or latter devices support sense size > 18
++ * unless US_FL_BAD_SENSE quirk is specified.
++ */
++ if (sdev->scsi_level > SCSI_SPC_2 &&
++ !(us->fflags & US_FL_BAD_SENSE))
+ us->fflags |= US_FL_SANE_SENSE;
+
+ /* USB-IDE bridges tend to report SK = 0x04 (Non-recoverable
+--
+2.20.1
+
diff --git a/patches.kernel.org/4.4.171-037-USB-storage-add-quirk-for-SMI-SM3350.patch b/patches.kernel.org/4.4.171-037-USB-storage-add-quirk-for-SMI-SM3350.patch
new file mode 100644
index 0000000000..8c44bf982e
--- /dev/null
+++ b/patches.kernel.org/4.4.171-037-USB-storage-add-quirk-for-SMI-SM3350.patch
@@ -0,0 +1,50 @@
+From: Icenowy Zheng <icenowy@aosc.io>
+Date: Thu, 3 Jan 2019 11:26:18 +0800
+Subject: [PATCH] USB: storage: add quirk for SMI SM3350
+References: bnc#1012382
+Patch-mainline: 4.4.171
+Git-commit: 0a99cc4b8ee83885ab9f097a3737d1ab28455ac0
+
+commit 0a99cc4b8ee83885ab9f097a3737d1ab28455ac0 upstream.
+
+The SMI SM3350 USB-UFS bridge controller cannot handle long sense request
+correctly and will make the chip refuse to do read/write when requested
+long sense.
+
+Add a bad sense quirk for it.
+
+Signed-off-by: Icenowy Zheng <icenowy@aosc.io>
+Cc: stable <stable@vger.kernel.org>
+Acked-by: Alan Stern <stern@rowland.harvard.edu>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+Signed-off-by: Jiri Slaby <jslaby@suse.cz>
+---
+ drivers/usb/storage/unusual_devs.h | 12 ++++++++++++
+ 1 file changed, 12 insertions(+)
+
+diff --git a/drivers/usb/storage/unusual_devs.h b/drivers/usb/storage/unusual_devs.h
+index 898215cad351..d92b974f0635 100644
+--- a/drivers/usb/storage/unusual_devs.h
++++ b/drivers/usb/storage/unusual_devs.h
+@@ -1392,6 +1392,18 @@ UNUSUAL_DEV( 0x0d49, 0x7310, 0x0000, 0x9999,
+ USB_SC_DEVICE, USB_PR_DEVICE, NULL,
+ US_FL_SANE_SENSE),
+
++/*
++ * Reported by Icenowy Zheng <icenowy@aosc.io>
++ * The SMI SM3350 USB-UFS bridge controller will enter a wrong state
++ * that do not process read/write command if a long sense is requested,
++ * so force to use 18-byte sense.
++ */
++UNUSUAL_DEV( 0x090c, 0x3350, 0x0000, 0xffff,
++ "SMI",
++ "SM3350 UFS-to-USB-Mass-Storage bridge",
++ USB_SC_DEVICE, USB_PR_DEVICE, NULL,
++ US_FL_BAD_SENSE ),
++
+ /*
+ * Pete Zaitcev <zaitcev@yahoo.com>, bz#164688.
+ * The device blatantly ignores LUN and returns 1 in GetMaxLUN.
+--
+2.20.1
+
diff --git a/patches.kernel.org/4.4.171-038-USB-Add-USB_QUIRK_DELAY_CTRL_MSG-quirk-for-Co.patch b/patches.kernel.org/4.4.171-038-USB-Add-USB_QUIRK_DELAY_CTRL_MSG-quirk-for-Co.patch
new file mode 100644
index 0000000000..5594bec8c3
--- /dev/null
+++ b/patches.kernel.org/4.4.171-038-USB-Add-USB_QUIRK_DELAY_CTRL_MSG-quirk-for-Co.patch
@@ -0,0 +1,45 @@
+From: Jack Stocker <jackstocker.93@gmail.com>
+Date: Thu, 3 Jan 2019 21:56:53 +0000
+Subject: [PATCH] USB: Add USB_QUIRK_DELAY_CTRL_MSG quirk for Corsair K70 RGB
+References: bnc#1012382
+Patch-mainline: 4.4.171
+Git-commit: 3483254b89438e60f719937376c5e0ce2bc46761
+
+commit 3483254b89438e60f719937376c5e0ce2bc46761 upstream.
+
+To match the Corsair Strafe RGB, the Corsair K70 RGB also requires
+USB_QUIRK_DELAY_CTRL_MSG to completely resolve boot connection issues
+discussed here: https://github.com/ckb-next/ckb-next/issues/42.
+Otherwise roughly 1 in 10 boots the keyboard will fail to be detected.
+
+Patch that applied delay control quirk for Corsair Strafe RGB:
+cb88a0588717 ("usb: quirks: add control message delay for 1b1c:1b20")
+
+Previous K70 RGB patch to add delay-init quirk:
+7a1646d92257 ("Add delay-init quirk for Corsair K70 RGB keyboards")
+
+Signed-off-by: Jack Stocker <jackstocker.93@gmail.com>
+Cc: stable <stable@vger.kernel.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+Signed-off-by: Jiri Slaby <jslaby@suse.cz>
+---
+ drivers/usb/core/quirks.c | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/drivers/usb/core/quirks.c b/drivers/usb/core/quirks.c
+index cf378b1ed373..733479ddf8a7 100644
+--- a/drivers/usb/core/quirks.c
++++ b/drivers/usb/core/quirks.c
+@@ -240,7 +240,8 @@ static const struct usb_device_id usb_quirk_list[] = {
+ USB_QUIRK_LINEAR_UFRAME_INTR_BINTERVAL },
+
+ /* Corsair K70 RGB */
+- { USB_DEVICE(0x1b1c, 0x1b13), .driver_info = USB_QUIRK_DELAY_INIT },
++ { USB_DEVICE(0x1b1c, 0x1b13), .driver_info = USB_QUIRK_DELAY_INIT |
++ USB_QUIRK_DELAY_CTRL_MSG },
+
+ /* Corsair Strafe */
+ { USB_DEVICE(0x1b1c, 0x1b15), .driver_info = USB_QUIRK_DELAY_INIT |
+--
+2.20.1
+
diff --git a/patches.kernel.org/4.4.171-039-slab-alien-caches-must-not-be-initialized-if-.patch b/patches.kernel.org/4.4.171-039-slab-alien-caches-must-not-be-initialized-if-.patch
new file mode 100644
index 0000000000..095d1c623f
--- /dev/null
+++ b/patches.kernel.org/4.4.171-039-slab-alien-caches-must-not-be-initialized-if-.patch
@@ -0,0 +1,52 @@
+From: Christoph Lameter <cl@linux.com>
+Date: Tue, 8 Jan 2019 15:23:00 -0800
+Subject: [PATCH] slab: alien caches must not be initialized if the allocation
+ of the alien cache failed
+References: bnc#1012382
+Patch-mainline: 4.4.171
+Git-commit: 09c2e76ed734a1d36470d257a778aaba28e86531
+
+commit 09c2e76ed734a1d36470d257a778aaba28e86531 upstream.
+
+Callers of __alloc_alien() check for NULL. We must do the same check in
+__alloc_alien_cache to avoid NULL pointer dereferences on allocation
+failures.
+
+Link: http://lkml.kernel.org/r/010001680f42f192-82b4e12e-1565-4ee0-ae1f-1e98974906aa-000000@email.amazonses.com
+Fixes: 49dfc304ba241 ("slab: use the lock on alien_cache, instead of the lock on array_cache")
+Fixes: c8522a3a5832b ("Slab: introduce alloc_alien")
+Signed-off-by: Christoph Lameter <cl@linux.com>
+Reported-by: syzbot+d6ed4ec679652b4fd4e4@syzkaller.appspotmail.com
+Reviewed-by: Andrew Morton <akpm@linux-foundation.org>
+Cc: Pekka Enberg <penberg@kernel.org>
+Cc: David Rientjes <rientjes@google.com>
+Cc: Joonsoo Kim <iamjoonsoo.kim@lge.com>
+Cc: <stable@vger.kernel.org>
+Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
+Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+Signed-off-by: Jiri Slaby <jslaby@suse.cz>
+---
+ mm/slab.c | 6 ++++--
+ 1 file changed, 4 insertions(+), 2 deletions(-)
+
+diff --git a/mm/slab.c b/mm/slab.c
+index fa49c01225a7..92df044f5e00 100644
+--- a/mm/slab.c
++++ b/mm/slab.c
+@@ -875,8 +875,10 @@ static struct alien_cache *__alloc_alien_cache(int node, int entries,
+ struct alien_cache *alc = NULL;
+
+ alc = kmalloc_node(memsize, gfp, node);
+- init_arraycache(&alc->ac, entries, batch);
+- spin_lock_init(&alc->lock);
++ if (alc) {
++ init_arraycache(&alc->ac, entries, batch);
++ spin_lock_init(&alc->lock);
++ }
+ return alc;
+ }
+
+--
+2.20.1
+
diff --git a/patches.kernel.org/4.4.171-040-PCI-altera-Fix-altera_pcie_link_is_up.patch b/patches.kernel.org/4.4.171-040-PCI-altera-Fix-altera_pcie_link_is_up.patch
new file mode 100644
index 0000000000..07ce552c61
--- /dev/null
+++ b/patches.kernel.org/4.4.171-040-PCI-altera-Fix-altera_pcie_link_is_up.patch
@@ -0,0 +1,47 @@
+From: Ley Foon Tan <lftan@altera.com>
+Date: Wed, 2 Mar 2016 17:43:07 +0800
+Subject: [PATCH] PCI: altera: Fix altera_pcie_link_is_up()
+References: bnc#1012382
+Patch-mainline: 4.4.171
+Git-commit: eff31f4002c4e25b9b8c39d0a3a551c6c64c77e8
+
+commit eff31f4002c4e25b9b8c39d0a3a551c6c64c77e8 upstream.
+
+Originally altera_pcie_link_is_up() decided the link was up if any of the
+low four bits of the LTSSM register were set. But the link is only up if
+the LTSSM state is L0, so check for that exact value.
+
+[bhelgaas: changelog]
+Signed-off-by: Ley Foon Tan <lftan@altera.com>
+Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
+Cc: Claudius Heine <claudius.heine.ext@siemens.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+Signed-off-by: Jiri Slaby <jslaby@suse.cz>
+---
+ drivers/pci/host/pcie-altera.c | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/drivers/pci/host/pcie-altera.c b/drivers/pci/host/pcie-altera.c
+index 99da549d5d06..dbac6fb3f0bd 100644
+--- a/drivers/pci/host/pcie-altera.c
++++ b/drivers/pci/host/pcie-altera.c
+@@ -40,6 +40,7 @@
+ #define P2A_INT_ENABLE 0x3070
+ #define P2A_INT_ENA_ALL 0xf
+ #define RP_LTSSM 0x3c64
++#define RP_LTSSM_MASK 0x1f
+ #define LTSSM_L0 0xf
+
+ /* TLP configuration type 0 and 1 */
+@@ -140,7 +141,7 @@ static void tlp_write_tx(struct altera_pcie *pcie,
+
+ static bool altera_pcie_link_is_up(struct altera_pcie *pcie)
+ {
+- return !!(cra_readl(pcie, RP_LTSSM) & LTSSM_L0);
++ return !!((cra_readl(pcie, RP_LTSSM) & RP_LTSSM_MASK) == LTSSM_L0);
+ }
+
+ static bool altera_pcie_valid_config(struct altera_pcie *pcie,
+--
+2.20.1
+
diff --git a/patches.kernel.org/4.4.171-041-PCI-altera-Reorder-read-write-functions.patch b/patches.kernel.org/4.4.171-041-PCI-altera-Reorder-read-write-functions.patch
new file mode 100644
index 0000000000..e44571d144
--- /dev/null
+++ b/patches.kernel.org/4.4.171-041-PCI-altera-Reorder-read-write-functions.patch
@@ -0,0 +1,81 @@
+From: Bjorn Helgaas <bhelgaas@google.com>
+Date: Fri, 22 Jul 2016 15:54:41 -0500
+Subject: [PATCH] PCI: altera: Reorder read/write functions
+References: bnc#1012382
+Patch-mainline: 4.4.171
+Git-commit: f8be11ae3d2c9a1338da37ff91ff4c65922d21be
+
+commit f8be11ae3d2c9a1338da37ff91ff4c65922d21be upstream.
+
+Move cra_writel(), cra_readl(), and altera_pcie_link_is_up() so a future
+patch can use them in altera_pcie_retrain(). No functional change
+intended.
+
+Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
+Cc: Claudius Heine <claudius.heine.ext@siemens.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+Signed-off-by: Jiri Slaby <jslaby@suse.cz>
+---
+ drivers/pci/host/pcie-altera.c | 32 ++++++++++++++++----------------
+ 1 file changed, 16 insertions(+), 16 deletions(-)
+
+diff --git a/drivers/pci/host/pcie-altera.c b/drivers/pci/host/pcie-altera.c
+index dbac6fb3f0bd..a1e782263dec 100644
+--- a/drivers/pci/host/pcie-altera.c
++++ b/drivers/pci/host/pcie-altera.c
+@@ -81,6 +81,22 @@ struct tlp_rp_regpair_t {
+ u32 reg1;
+ };
+
++static inline void cra_writel(struct altera_pcie *pcie, const u32 value,
++ const u32 reg)
++{
++ writel_relaxed(value, pcie->cra_base + reg);
++}
++
++static inline u32 cra_readl(struct altera_pcie *pcie, const u32 reg)
++{
++ return readl_relaxed(pcie->cra_base + reg);
++}
++
++static bool altera_pcie_link_is_up(struct altera_pcie *pcie)
++{
++ return !!((cra_readl(pcie, RP_LTSSM) & RP_LTSSM_MASK) == LTSSM_L0);
++}
++
+ static void altera_pcie_retrain(struct pci_dev *dev)
+ {
+ u16 linkcap, linkstat;
+@@ -120,17 +136,6 @@ static bool altera_pcie_hide_rc_bar(struct pci_bus *bus, unsigned int devfn,
+ return false;
+ }
+
+-static inline void cra_writel(struct altera_pcie *pcie, const u32 value,
+- const u32 reg)
+-{
+- writel_relaxed(value, pcie->cra_base + reg);
+-}
+-
+-static inline u32 cra_readl(struct altera_pcie *pcie, const u32 reg)
+-{
+- return readl_relaxed(pcie->cra_base + reg);
+-}
+-
+ static void tlp_write_tx(struct altera_pcie *pcie,
+ struct tlp_rp_regpair_t *tlp_rp_regdata)
+ {
+@@ -139,11 +144,6 @@ static void tlp_write_tx(struct altera_pcie *pcie,
+ cra_writel(pcie, tlp_rp_regdata->ctrl, RP_TX_CNTRL);
+ }
+
+-static bool altera_pcie_link_is_up(struct altera_pcie *pcie)
+-{
+- return !!((cra_readl(pcie, RP_LTSSM) & RP_LTSSM_MASK) == LTSSM_L0);
+-}
+-
+ static bool altera_pcie_valid_config(struct altera_pcie *pcie,
+ struct pci_bus *bus, int dev)
+ {
+--
+2.20.1
+
diff --git a/patches.kernel.org/4.4.171-042-PCI-altera-Check-link-status-before-retrain-l.patch b/patches.kernel.org/4.4.171-042-PCI-altera-Check-link-status-before-retrain-l.patch
new file mode 100644
index 0000000000..7afdf337df
--- /dev/null
+++ b/patches.kernel.org/4.4.171-042-PCI-altera-Check-link-status-before-retrain-l.patch
@@ -0,0 +1,40 @@
+From: Ley Foon Tan <lftan@altera.com>
+Date: Tue, 21 Jun 2016 16:53:12 +0800
+Subject: [PATCH] PCI: altera: Check link status before retrain link
+References: bnc#1012382
+Patch-mainline: 4.4.171
+Git-commit: c622032ebc538cb3869c312ae3ad235a99da84b6
+
+commit c622032ebc538cb3869c312ae3ad235a99da84b6 upstream.
+
+Check the link status before retraining. If the link is not up, don't
+bother trying to retrain it.
+
+[bhelgaas: split code move to separate patch, changelog]
+Signed-off-by: Ley Foon Tan <lftan@altera.com>
+Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
+Cc: Claudius Heine <claudius.heine.ext@siemens.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+Signed-off-by: Jiri Slaby <jslaby@suse.cz>
+---
+ drivers/pci/host/pcie-altera.c | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/drivers/pci/host/pcie-altera.c b/drivers/pci/host/pcie-altera.c
+index a1e782263dec..b61025ee07de 100644
+--- a/drivers/pci/host/pcie-altera.c
++++ b/drivers/pci/host/pcie-altera.c
+@@ -100,6 +100,10 @@ static bool altera_pcie_link_is_up(struct altera_pcie *pcie)
+ static void altera_pcie_retrain(struct pci_dev *dev)
+ {
+ u16 linkcap, linkstat;
++ struct altera_pcie *pcie = dev->bus->sysdata;
++
++ if (!altera_pcie_link_is_up(pcie))
++ return;
+
+ /*
+ * Set the retrain bit if the PCIe rootport support > 2.5GB/s, but
+--
+2.20.1
+
diff --git a/patches.kernel.org/4.4.171-043-PCI-altera-Poll-for-link-up-status-after-retr.patch b/patches.kernel.org/4.4.171-043-PCI-altera-Poll-for-link-up-status-after-retr.patch
new file mode 100644
index 0000000000..218ea4384b
--- /dev/null
+++ b/patches.kernel.org/4.4.171-043-PCI-altera-Poll-for-link-up-status-after-retr.patch
@@ -0,0 +1,66 @@
+From: Ley Foon Tan <lftan@altera.com>
+Date: Tue, 21 Jun 2016 16:53:13 +0800
+Subject: [PATCH] PCI: altera: Poll for link up status after retraining the
+ link
+References: bnc#1012382
+Patch-mainline: 4.4.171
+Git-commit: 3a928e98a833e1a470a60d2fedf3c55502185fb7
+
+commit 3a928e98a833e1a470a60d2fedf3c55502185fb7 upstream.
+
+Some PCIe devices take a long time to reach link up state after retrain.
+Poll for link up status after retraining the link. This is to make sure
+the link is up before we access configuration space.
+
+[bhelgaas: changelog]
+Signed-off-by: Ley Foon Tan <lftan@altera.com>
+Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
+Cc: Claudius Heine <claudius.heine.ext@siemens.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+Signed-off-by: Jiri Slaby <jslaby@suse.cz>
+---
+ drivers/pci/host/pcie-altera.c | 12 +++++++++++-
+ 1 file changed, 11 insertions(+), 1 deletion(-)
+
+diff --git a/drivers/pci/host/pcie-altera.c b/drivers/pci/host/pcie-altera.c
+index b61025ee07de..e4154b2a23ce 100644
+--- a/drivers/pci/host/pcie-altera.c
++++ b/drivers/pci/host/pcie-altera.c
+@@ -61,6 +61,8 @@
+ #define TLP_LOOP 500
+ #define RP_DEVFN 0
+
++#define LINK_UP_TIMEOUT 5000
++
+ #define INTX_NUM 4
+
+ #define DWORD_MASK 3
+@@ -101,6 +103,7 @@ static void altera_pcie_retrain(struct pci_dev *dev)
+ {
+ u16 linkcap, linkstat;
+ struct altera_pcie *pcie = dev->bus->sysdata;
++ int timeout = 0;
+
+ if (!altera_pcie_link_is_up(pcie))
+ return;
+@@ -115,9 +118,16 @@ static void altera_pcie_retrain(struct pci_dev *dev)
+ return;
+
+ pcie_capability_read_word(dev, PCI_EXP_LNKSTA, &linkstat);
+- if ((linkstat & PCI_EXP_LNKSTA_CLS) == PCI_EXP_LNKSTA_CLS_2_5GB)
++ if ((linkstat & PCI_EXP_LNKSTA_CLS) == PCI_EXP_LNKSTA_CLS_2_5GB) {
+ pcie_capability_set_word(dev, PCI_EXP_LNKCTL,
+ PCI_EXP_LNKCTL_RL);
++ while (!altera_pcie_link_is_up(pcie)) {
++ timeout++;
++ if (timeout > LINK_UP_TIMEOUT)
++ break;
++ udelay(5);
++ }
++ }
+ }
+ DECLARE_PCI_FIXUP_EARLY(0x1172, PCI_ANY_ID, altera_pcie_retrain);
+
+--
+2.20.1
+
diff --git a/patches.kernel.org/4.4.171-044-PCI-altera-Poll-for-link-training-status-afte.patch b/patches.kernel.org/4.4.171-044-PCI-altera-Poll-for-link-training-status-afte.patch
new file mode 100644
index 0000000000..746d31f116
--- /dev/null
+++ b/patches.kernel.org/4.4.171-044-PCI-altera-Poll-for-link-training-status-afte.patch
@@ -0,0 +1,100 @@
+From: Ley Foon Tan <lftan@altera.com>
+Date: Mon, 15 Aug 2016 14:06:02 +0800
+Subject: [PATCH] PCI: altera: Poll for link training status after retraining
+ the link
+References: bnc#1012382
+Patch-mainline: 4.4.171
+Git-commit: 411dc32d8810e0a204c799ce5c97cb56990de1cb
+
+commit 411dc32d8810e0a204c799ce5c97cb56990de1cb upstream.
+
+Poll for link training status is cleared before poll for link up status.
+This can help to get the reliable link up status, especially when PCIe is
+in Gen 3 speed.
+
+Signed-off-by: Ley Foon Tan <lftan@altera.com>
+Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
+Cc: Claudius Heine <claudius.heine.ext@siemens.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+Signed-off-by: Jiri Slaby <jslaby@suse.cz>
+---
+ drivers/pci/host/pcie-altera.c | 45 ++++++++++++++++++++++++++++------
+ 1 file changed, 37 insertions(+), 8 deletions(-)
+
+diff --git a/drivers/pci/host/pcie-altera.c b/drivers/pci/host/pcie-altera.c
+index e4154b2a23ce..e0be9ac5701a 100644
+--- a/drivers/pci/host/pcie-altera.c
++++ b/drivers/pci/host/pcie-altera.c
+@@ -61,7 +61,8 @@
+ #define TLP_LOOP 500
+ #define RP_DEVFN 0
+
+-#define LINK_UP_TIMEOUT 5000
++#define LINK_UP_TIMEOUT HZ
++#define LINK_RETRAIN_TIMEOUT HZ
+
+ #define INTX_NUM 4
+
+@@ -99,11 +100,44 @@ static bool altera_pcie_link_is_up(struct altera_pcie *pcie)
+ return !!((cra_readl(pcie, RP_LTSSM) & RP_LTSSM_MASK) == LTSSM_L0);
+ }
+
++static void altera_wait_link_retrain(struct pci_dev *dev)
++{
++ u16 reg16;
++ unsigned long start_jiffies;
++ struct altera_pcie *pcie = dev->bus->sysdata;
++
++ /* Wait for link training end. */
++ start_jiffies = jiffies;
++ for (;;) {
++ pcie_capability_read_word(dev, PCI_EXP_LNKSTA, &reg16);
++ if (!(reg16 & PCI_EXP_LNKSTA_LT))
++ break;
++
++ if (time_after(jiffies, start_jiffies + LINK_RETRAIN_TIMEOUT)) {
++ dev_err(&pcie->pdev->dev, "link retrain timeout\n");
++ break;
++ }
++ udelay(100);
++ }
++
++ /* Wait for link is up */
++ start_jiffies = jiffies;
++ for (;;) {
++ if (altera_pcie_link_is_up(pcie))
++ break;
++
++ if (time_after(jiffies, start_jiffies + LINK_UP_TIMEOUT)) {
++ dev_err(&pcie->pdev->dev, "link up timeout\n");
++ break;
++ }
++ udelay(100);
++ }
++}
++
+ static void altera_pcie_retrain(struct pci_dev *dev)
+ {
+ u16 linkcap, linkstat;
+ struct altera_pcie *pcie = dev->bus->sysdata;
+- int timeout = 0;
+
+ if (!altera_pcie_link_is_up(pcie))
+ return;
+@@ -121,12 +155,7 @@ static void altera_pcie_retrain(struct pci_dev *dev)
+ if ((linkstat & PCI_EXP_LNKSTA_CLS) == PCI_EXP_LNKSTA_CLS_2_5GB) {
+ pcie_capability_set_word(dev, PCI_EXP_LNKCTL,
+ PCI_EXP_LNKCTL_RL);
+- while (!altera_pcie_link_is_up(pcie)) {
+- timeout++;
+- if (timeout > LINK_UP_TIMEOUT)
+- break;
+- udelay(5);
+- }
++ altera_wait_link_retrain(dev);
+ }
+ }
+ DECLARE_PCI_FIXUP_EARLY(0x1172, PCI_ANY_ID, altera_pcie_retrain);
+--
+2.20.1
+
diff --git a/patches.kernel.org/4.4.171-045-PCI-altera-Rework-config-accessors-for-use-wi.patch b/patches.kernel.org/4.4.171-045-PCI-altera-Rework-config-accessors-for-use-wi.patch
new file mode 100644
index 0000000000..0239dcdc88
--- /dev/null
+++ b/patches.kernel.org/4.4.171-045-PCI-altera-Rework-config-accessors-for-use-wi.patch
@@ -0,0 +1,131 @@
+From: Ley Foon Tan <lftan@altera.com>
+Date: Fri, 26 Aug 2016 09:47:24 +0800
+Subject: [PATCH] PCI: altera: Rework config accessors for use without a struct
+ pci_bus
+References: bnc#1012382
+Patch-mainline: 4.4.171
+Git-commit: 31fc0ad47e2e0b8417616aa0f1ddcc67edf1e109
+
+commit 31fc0ad47e2e0b8417616aa0f1ddcc67edf1e109 upstream.
+
+Rework configs accessors so a future patch can use them in _probe() with
+struct altera_pcie instead of struct pci_bus.
+
+Signed-off-by: Ley Foon Tan <lftan@altera.com>
+Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
+Cc: Claudius Heine <claudius.heine.ext@siemens.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+Signed-off-by: Jiri Slaby <jslaby@suse.cz>
+---
+ drivers/pci/host/pcie-altera.c | 64 ++++++++++++++++++++++------------
+ 1 file changed, 41 insertions(+), 23 deletions(-)
+
+diff --git a/drivers/pci/host/pcie-altera.c b/drivers/pci/host/pcie-altera.c
+index e0be9ac5701a..a95c9c4e03c7 100644
+--- a/drivers/pci/host/pcie-altera.c
++++ b/drivers/pci/host/pcie-altera.c
+@@ -330,22 +330,14 @@ static int tlp_cfg_dword_write(struct altera_pcie *pcie, u8 bus, u32 devfn,
+ return PCIBIOS_SUCCESSFUL;
+ }
+
+-static int altera_pcie_cfg_read(struct pci_bus *bus, unsigned int devfn,
+- int where, int size, u32 *value)
++static int _altera_pcie_cfg_read(struct altera_pcie *pcie, u8 busno,
++ unsigned int devfn, int where, int size,
++ u32 *value)
+ {
+- struct altera_pcie *pcie = bus->sysdata;
+ int ret;
+ u32 data;
+ u8 byte_en;
+
+- if (altera_pcie_hide_rc_bar(bus, devfn, where))
+- return PCIBIOS_BAD_REGISTER_NUMBER;
+-
+- if (!altera_pcie_valid_config(pcie, bus, PCI_SLOT(devfn))) {
+- *value = 0xffffffff;
+- return PCIBIOS_DEVICE_NOT_FOUND;
+- }
+-
+ switch (size) {
+ case 1:
+ byte_en = 1 << (where & 3);
+@@ -358,7 +350,7 @@ static int altera_pcie_cfg_read(struct pci_bus *bus, unsigned int devfn,
+ break;
+ }
+
+- ret = tlp_cfg_dword_read(pcie, bus->number, devfn,
++ ret = tlp_cfg_dword_read(pcie, busno, devfn,
+ (where & ~DWORD_MASK), byte_en, &data);
+ if (ret != PCIBIOS_SUCCESSFUL)
+ return ret;
+@@ -378,20 +370,14 @@ static int altera_pcie_cfg_read(struct pci_bus *bus, unsigned int devfn,
+ return PCIBIOS_SUCCESSFUL;
+ }
+
+-static int altera_pcie_cfg_write(struct pci_bus *bus, unsigned int devfn,
+- int where, int size, u32 value)
++static int _altera_pcie_cfg_write(struct altera_pcie *pcie, u8 busno,
++ unsigned int devfn, int where, int size,
++ u32 value)
+ {
+- struct altera_pcie *pcie = bus->sysdata;
+ u32 data32;
+ u32 shift = 8 * (where & 3);
+ u8 byte_en;
+
+- if (altera_pcie_hide_rc_bar(bus, devfn, where))
+- return PCIBIOS_BAD_REGISTER_NUMBER;
+-
+- if (!altera_pcie_valid_config(pcie, bus, PCI_SLOT(devfn)))
+- return PCIBIOS_DEVICE_NOT_FOUND;
+-
+ switch (size) {
+ case 1:
+ data32 = (value & 0xff) << shift;
+@@ -407,8 +393,40 @@ static int altera_pcie_cfg_write(struct pci_bus *bus, unsigned int devfn,
+ break;
+ }
+
+- return tlp_cfg_dword_write(pcie, bus->number, devfn,
+- (where & ~DWORD_MASK), byte_en, data32);
++ return tlp_cfg_dword_write(pcie, busno, devfn, (where & ~DWORD_MASK),
++ byte_en, data32);
++}
++
++static int altera_pcie_cfg_read(struct pci_bus *bus, unsigned int devfn,
++ int where, int size, u32 *value)
++{
++ struct altera_pcie *pcie = bus->sysdata;
++
++ if (altera_pcie_hide_rc_bar(bus, devfn, where))
++ return PCIBIOS_BAD_REGISTER_NUMBER;
++
++ if (!altera_pcie_valid_config(pcie, bus, PCI_SLOT(devfn))) {
++ *value = 0xffffffff;
++ return PCIBIOS_DEVICE_NOT_FOUND;
++ }
++
++ return _altera_pcie_cfg_read(pcie, bus->number, devfn, where, size,
++ value);
++}
++
++static int altera_pcie_cfg_write(struct pci_bus *bus, unsigned int devfn,
++ int where, int size, u32 value)
++{
++ struct altera_pcie *pcie = bus->sysdata;
++
++ if (altera_pcie_hide_rc_bar(bus, devfn, where))
++ return PCIBIOS_BAD_REGISTER_NUMBER;
++
++ if (!altera_pcie_valid_config(pcie, bus, PCI_SLOT(devfn)))
++ return PCIBIOS_DEVICE_NOT_FOUND;
++
++ return _altera_pcie_cfg_write(pcie, bus->number, devfn, where, size,
++ value);
+ }
+
+ static struct pci_ops altera_pcie_ops = {
+--
+2.20.1
+
diff --git a/patches.kernel.org/4.4.171-046-PCI-altera-Move-retrain-from-fixup-to-altera_.patch b/patches.kernel.org/4.4.171-046-PCI-altera-Move-retrain-from-fixup-to-altera_.patch
new file mode 100644
index 0000000000..3221d40b13
--- /dev/null
+++ b/patches.kernel.org/4.4.171-046-PCI-altera-Move-retrain-from-fixup-to-altera_.patch
@@ -0,0 +1,222 @@
+From: Ley Foon Tan <lftan@altera.com>
+Date: Fri, 26 Aug 2016 09:47:25 +0800
+Subject: [PATCH] PCI: altera: Move retrain from fixup to
+ altera_pcie_host_init()
+References: bnc#1012382
+Patch-mainline: 4.4.171
+Git-commit: ce4f1c7ad490aa7129bde5632d6e53943f8a866c
+
+commit ce4f1c7ad490aa7129bde5632d6e53943f8a866c upstream.
+
+Previously we used a PCI early fixup to initiate a link retrain on Altera
+devices. But Altera PCIe IP can be configured as either a Root Port or an
+Endpoint, and they might have same vendor ID, so the fixup would be run for
+both.
+
+We only want to initiate a link retrain for Altera Root Port devices, not
+for Endpoints, so move the link retrain functionality from the fixup to
+altera_pcie_host_init().
+
+[bhelgaas: changelog]
+Signed-off-by: Ley Foon Tan <lftan@altera.com>
+Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
+Cc: Claudius Heine <claudius.heine.ext@siemens.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+Signed-off-by: Jiri Slaby <jslaby@suse.cz>
+---
+ drivers/pci/host/pcie-altera.c | 151 ++++++++++++++++++++-------------
+ 1 file changed, 91 insertions(+), 60 deletions(-)
+
+diff --git a/drivers/pci/host/pcie-altera.c b/drivers/pci/host/pcie-altera.c
+index a95c9c4e03c7..0118287a8a10 100644
+--- a/drivers/pci/host/pcie-altera.c
++++ b/drivers/pci/host/pcie-altera.c
+@@ -43,6 +43,7 @@
+ #define RP_LTSSM_MASK 0x1f
+ #define LTSSM_L0 0xf
+
++#define PCIE_CAP_OFFSET 0x80
+ /* TLP configuration type 0 and 1 */
+ #define TLP_FMTTYPE_CFGRD0 0x04 /* Configuration Read Type 0 */
+ #define TLP_FMTTYPE_CFGWR0 0x44 /* Configuration Write Type 0 */
+@@ -100,66 +101,6 @@ static bool altera_pcie_link_is_up(struct altera_pcie *pcie)
+ return !!((cra_readl(pcie, RP_LTSSM) & RP_LTSSM_MASK) == LTSSM_L0);
+ }
+
+-static void altera_wait_link_retrain(struct pci_dev *dev)
+-{
+- u16 reg16;
+- unsigned long start_jiffies;
+- struct altera_pcie *pcie = dev->bus->sysdata;
+-
+- /* Wait for link training end. */
+- start_jiffies = jiffies;
+- for (;;) {
+- pcie_capability_read_word(dev, PCI_EXP_LNKSTA, &reg16);
+- if (!(reg16 & PCI_EXP_LNKSTA_LT))
+- break;
+-
+- if (time_after(jiffies, start_jiffies + LINK_RETRAIN_TIMEOUT)) {
+- dev_err(&pcie->pdev->dev, "link retrain timeout\n");
+- break;
+- }
+- udelay(100);
+- }
+-
+- /* Wait for link is up */
+- start_jiffies = jiffies;
+- for (;;) {
+- if (altera_pcie_link_is_up(pcie))
+- break;
+-
+- if (time_after(jiffies, start_jiffies + LINK_UP_TIMEOUT)) {
+- dev_err(&pcie->pdev->dev, "link up timeout\n");
+- break;
+- }
+- udelay(100);
+- }
+-}
+-
+-static void altera_pcie_retrain(struct pci_dev *dev)
+-{
+- u16 linkcap, linkstat;
+- struct altera_pcie *pcie = dev->bus->sysdata;
+-
+- if (!altera_pcie_link_is_up(pcie))
+- return;
+-
+- /*
+- * Set the retrain bit if the PCIe rootport support > 2.5GB/s, but
+- * current speed is 2.5 GB/s.
+- */
+- pcie_capability_read_word(dev, PCI_EXP_LNKCAP, &linkcap);
+-
+- if ((linkcap & PCI_EXP_LNKCAP_SLS) <= PCI_EXP_LNKCAP_SLS_2_5GB)
+- return;
+-
+- pcie_capability_read_word(dev, PCI_EXP_LNKSTA, &linkstat);
+- if ((linkstat & PCI_EXP_LNKSTA_CLS) == PCI_EXP_LNKSTA_CLS_2_5GB) {
+- pcie_capability_set_word(dev, PCI_EXP_LNKCTL,
+- PCI_EXP_LNKCTL_RL);
+- altera_wait_link_retrain(dev);
+- }
+-}
+-DECLARE_PCI_FIXUP_EARLY(0x1172, PCI_ANY_ID, altera_pcie_retrain);
+-
+ /*
+ * Altera PCIe port uses BAR0 of RC's configuration space as the translation
+ * from PCI bus to native BUS. Entire DDR region is mapped into PCIe space
+@@ -434,6 +375,90 @@ static struct pci_ops altera_pcie_ops = {
+ .write = altera_pcie_cfg_write,
+ };
+
++static int altera_read_cap_word(struct altera_pcie *pcie, u8 busno,
++ unsigned int devfn, int offset, u16 *value)
++{
++ u32 data;
++ int ret;
++
++ ret = _altera_pcie_cfg_read(pcie, busno, devfn,
++ PCIE_CAP_OFFSET + offset, sizeof(*value),
++ &data);
++ *value = data;
++ return ret;
++}
++
++static int altera_write_cap_word(struct altera_pcie *pcie, u8 busno,
++ unsigned int devfn, int offset, u16 value)
++{
++ return _altera_pcie_cfg_write(pcie, busno, devfn,
++ PCIE_CAP_OFFSET + offset, sizeof(value),
++ value);
++}
++
++static void altera_wait_link_retrain(struct altera_pcie *pcie)
++{
++ u16 reg16;
++ unsigned long start_jiffies;
++
++ /* Wait for link training end. */
++ start_jiffies = jiffies;
++ for (;;) {
++ altera_read_cap_word(pcie, pcie->root_bus_nr, RP_DEVFN,
++ PCI_EXP_LNKSTA, &reg16);
++ if (!(reg16 & PCI_EXP_LNKSTA_LT))
++ break;
++
++ if (time_after(jiffies, start_jiffies + LINK_RETRAIN_TIMEOUT)) {
++ dev_err(&pcie->pdev->dev, "link retrain timeout\n");
++ break;
++ }
++ udelay(100);
++ }
++
++ /* Wait for link is up */
++ start_jiffies = jiffies;
++ for (;;) {
++ if (altera_pcie_link_is_up(pcie))
++ break;
++
++ if (time_after(jiffies, start_jiffies + LINK_UP_TIMEOUT)) {
++ dev_err(&pcie->pdev->dev, "link up timeout\n");
++ break;
++ }
++ udelay(100);
++ }
++}
++
++static void altera_pcie_retrain(struct altera_pcie *pcie)
++{
++ u16 linkcap, linkstat, linkctl;
++
++ if (!altera_pcie_link_is_up(pcie))
++ return;
++
++ /*
++ * Set the retrain bit if the PCIe rootport support > 2.5GB/s, but
++ * current speed is 2.5 GB/s.
++ */
++ altera_read_cap_word(pcie, pcie->root_bus_nr, RP_DEVFN, PCI_EXP_LNKCAP,
++ &linkcap);
++ if ((linkcap & PCI_EXP_LNKCAP_SLS) <= PCI_EXP_LNKCAP_SLS_2_5GB)
++ return;
++
++ altera_read_cap_word(pcie, pcie->root_bus_nr, RP_DEVFN, PCI_EXP_LNKSTA,
++ &linkstat);
++ if ((linkstat & PCI_EXP_LNKSTA_CLS) == PCI_EXP_LNKSTA_CLS_2_5GB) {
++ altera_read_cap_word(pcie, pcie->root_bus_nr, RP_DEVFN,
++ PCI_EXP_LNKCTL, &linkctl);
++ linkctl |= PCI_EXP_LNKCTL_RL;
++ altera_write_cap_word(pcie, pcie->root_bus_nr, RP_DEVFN,
++ PCI_EXP_LNKCTL, linkctl);
++
++ altera_wait_link_retrain(pcie);
++ }
++}
++
+ static int altera_pcie_intx_map(struct irq_domain *domain, unsigned int irq,
+ irq_hw_number_t hwirq)
+ {
+@@ -568,6 +593,11 @@ static int altera_pcie_parse_dt(struct altera_pcie *pcie)
+ return 0;
+ }
+
++static void altera_pcie_host_init(struct altera_pcie *pcie)
++{
++ altera_pcie_retrain(pcie);
++}
++
+ static int altera_pcie_probe(struct platform_device *pdev)
+ {
+ struct altera_pcie *pcie;
+@@ -605,6 +635,7 @@ static int altera_pcie_probe(struct platform_device *pdev)
+ cra_writel(pcie, P2A_INT_STS_ALL, P2A_INT_STATUS);
+ /* enable all interrupts */
+ cra_writel(pcie, P2A_INT_ENA_ALL, P2A_INT_ENABLE);
++ altera_pcie_host_init(pcie);
+
+ bus = pci_scan_root_bus(&pdev->dev, pcie->root_bus_nr, &altera_pcie_ops,
+ pcie, &pcie->resources);
+--
+2.20.1
+
diff --git a/patches.kernel.org/4.4.171-047-ACPI-power-Skip-duplicate-power-resource-refe.patch b/patches.kernel.org/4.4.171-047-ACPI-power-Skip-duplicate-power-resource-refe.patch
new file mode 100644
index 0000000000..a627d9381d
--- /dev/null
+++ b/patches.kernel.org/4.4.171-047-ACPI-power-Skip-duplicate-power-resource-refe.patch
@@ -0,0 +1,92 @@
+From: Hans de Goede <hdegoede@redhat.com>
+Date: Sun, 30 Dec 2018 18:25:00 +0100
+Subject: [PATCH] ACPI: power: Skip duplicate power resource references in _PRx
+References: bnc#1012382
+Patch-mainline: 4.4.171
+Git-commit: 7d7b467cb95bf29597b417d4990160d4ea6d69b9
+
+commit 7d7b467cb95bf29597b417d4990160d4ea6d69b9 upstream.
+
+Some ACPI tables contain duplicate power resource references like this:
+
+ Name (_PR0, Package (0x04) // _PR0: Power Resources for D0
+ {
+ P28P,
+ P18P,
+ P18P,
+ CLK4
+ })
+
+This causes a WARN_ON in sysfs_add_link_to_group() because we end up
+adding a link to the same acpi_device twice:
+
+sysfs: cannot create duplicate filename '/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/808622C1:00/OVTI2680:00/power_resources_D0/LNXPOWER:0a'
+CPU: 0 PID: 1 Comm: swapper/0 Not tainted 4.19.12-301.fc29.x86_64 #1
+Hardware name: Insyde CherryTrail/Type2 - Board Product Name, BIOS jumperx.T87.KFBNEEA02 04/13/2016
+Call Trace:
+ dump_stack+0x5c/0x80
+ sysfs_warn_dup.cold.3+0x17/0x2a
+ sysfs_do_create_link_sd.isra.2+0xa9/0xb0
+ sysfs_add_link_to_group+0x30/0x50
+ acpi_power_expose_list+0x74/0xa0
+ acpi_power_add_remove_device+0x50/0xa0
+ acpi_add_single_object+0x26b/0x5f0
+ acpi_bus_check_add+0xc4/0x250
+ ...
+
+To address this issue, make acpi_extract_power_resources() check for
+duplicates and simply skip them when found.
+
+Cc: All applicable <stable@vger.kernel.org>
+Signed-off-by: Hans de Goede <hdegoede@redhat.com>
+[ rjw: Subject & changelog, comments ]
+Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+Signed-off-by: Jiri Slaby <jslaby@suse.cz>
+---
+ drivers/acpi/power.c | 22 ++++++++++++++++++++++
+ 1 file changed, 22 insertions(+)
+
+diff --git a/drivers/acpi/power.c b/drivers/acpi/power.c
+index 1c2b846c5776..f28b4949cb9d 100644
+--- a/drivers/acpi/power.c
++++ b/drivers/acpi/power.c
+@@ -131,6 +131,23 @@ void acpi_power_resources_list_free(struct list_head *list)
+ }
+ }
+
++static bool acpi_power_resource_is_dup(union acpi_object *package,
++ unsigned int start, unsigned int i)
++{
++ acpi_handle rhandle, dup;
++ unsigned int j;
++
++ /* The caller is expected to check the package element types */
++ rhandle = package->package.elements[i].reference.handle;
++ for (j = start; j < i; j++) {
++ dup = package->package.elements[j].reference.handle;
++ if (dup == rhandle)
++ return true;
++ }
++
++ return false;
++}
++
+ int acpi_extract_power_resources(union acpi_object *package, unsigned int start,
+ struct list_head *list)
+ {
+@@ -150,6 +167,11 @@ int acpi_extract_power_resources(union acpi_object *package, unsigned int start,
+ err = -ENODEV;
+ break;
+ }
++
++ /* Some ACPI tables contain duplicate power resource references */
++ if (acpi_power_resource_is_dup(package, start, i))
++ continue;
++
+ err = acpi_add_power_resource(rhandle);
+ if (err)
+ break;
+--
+2.20.1
+
diff --git a/patches.kernel.org/4.4.171-048-i2c-dev-prevent-adapter-retries-and-timeout-b.patch b/patches.kernel.org/4.4.171-048-i2c-dev-prevent-adapter-retries-and-timeout-b.patch
new file mode 100644
index 0000000000..2172c4f125
--- /dev/null
+++ b/patches.kernel.org/4.4.171-048-i2c-dev-prevent-adapter-retries-and-timeout-b.patch
@@ -0,0 +1,56 @@
+From: Yi Zeng <yizeng@asrmicro.com>
+Date: Wed, 9 Jan 2019 15:33:07 +0800
+Subject: [PATCH] i2c: dev: prevent adapter retries and timeout being set as
+ minus value
+References: bnc#1012382
+Patch-mainline: 4.4.171
+Git-commit: 6ebec961d59bccf65d08b13fc1ad4e6272a89338
+
+commit 6ebec961d59bccf65d08b13fc1ad4e6272a89338 upstream.
+
+If adapter->retries is set to a minus value from user space via ioctl,
+it will make __i2c_transfer and __i2c_smbus_xfer skip the calling to
+adapter->algo->master_xfer and adapter->algo->smbus_xfer that is
+registered by the underlying bus drivers, and return value 0 to all the
+callers. The bus driver will never be accessed anymore by all users,
+besides, the users may still get successful return value without any
+error or information log print out.
+
+If adapter->timeout is set to minus value from user space via ioctl,
+it will make the retrying loop in __i2c_transfer and __i2c_smbus_xfer
+always break after the the first try, due to the time_after always
+returns true.
+
+Signed-off-by: Yi Zeng <yizeng@asrmicro.com>
+[wsa: minor grammar updates to commit message]
+Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
+Cc: stable@kernel.org
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+Signed-off-by: Jiri Slaby <jslaby@suse.cz>
+---
+ drivers/i2c/i2c-dev.c | 6 ++++++
+ 1 file changed, 6 insertions(+)
+
+diff --git a/drivers/i2c/i2c-dev.c b/drivers/i2c/i2c-dev.c
+index 94c837046786..57e3790c87b1 100644
+--- a/drivers/i2c/i2c-dev.c
++++ b/drivers/i2c/i2c-dev.c
+@@ -459,9 +459,15 @@ static long i2cdev_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
+ return i2cdev_ioctl_smbus(client, arg);
+
+ case I2C_RETRIES:
++ if (arg > INT_MAX)
++ return -EINVAL;
++
+ client->adapter->retries = arg;
+ break;
+ case I2C_TIMEOUT:
++ if (arg > INT_MAX)
++ return -EINVAL;
++
+ /* For historical reasons, user-space sets the timeout
+ * value in units of 10 ms.
+ */
+--
+2.20.1
+
diff --git a/patches.kernel.org/4.4.171-049-crypto-cts-fix-crash-on-short-inputs.patch b/patches.kernel.org/4.4.171-049-crypto-cts-fix-crash-on-short-inputs.patch
new file mode 100644
index 0000000000..288fab941a
--- /dev/null
+++ b/patches.kernel.org/4.4.171-049-crypto-cts-fix-crash-on-short-inputs.patch
@@ -0,0 +1,60 @@
+From: Eric Biggers <ebiggers@google.com>
+Date: Mon, 14 Jan 2019 15:21:45 -0800
+Subject: [PATCH] crypto: cts - fix crash on short inputs
+References: bnc#1012382
+Patch-mainline: 4.4.171
+Git-commit: 6b22de54346b5d00e3fcf3b0bd0bc2958cc52c41
+
+[It's a minimal fix for a bug that was fixed incidentally by a large
+refactoring in v4.8.]
+
+In the CTS template, when the input length is <= one block cipher block
+(e.g. <= 16 bytes for AES) pass the correct length to the underlying CBC
+transform rather than one block. This matches the upstream behavior and
+makes the encryption/decryption operation correctly return -EINVAL when
+1 <= nbytes < bsize or succeed when nbytes == 0, rather than crashing.
+
+This was fixed upstream incidentally by a large refactoring,
+commit 0605c41cc53c ("crypto: cts - Convert to skcipher"). But
+syzkaller easily trips over this when running on older kernels, as it's
+easily reachable via AF_ALG. Therefore, this patch makes the minimal
+fix for older kernels.
+
+Cc: linux-crypto@vger.kernel.org
+Fixes: 76cb9521795a ("[CRYPTO] cts: Add CTS mode required for Kerberos AES support")
+Signed-off-by: Eric Biggers <ebiggers@google.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+Signed-off-by: Jiri Slaby <jslaby@suse.cz>
+---
+ crypto/cts.c | 8 ++++----
+ 1 file changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/crypto/cts.c b/crypto/cts.c
+index e467ec0acf9f..e65688d6a4ca 100644
+--- a/crypto/cts.c
++++ b/crypto/cts.c
+@@ -137,8 +137,8 @@ static int crypto_cts_encrypt(struct blkcipher_desc *desc,
+ lcldesc.info = desc->info;
+ lcldesc.flags = desc->flags;
+
+- if (tot_blocks == 1) {
+- err = crypto_blkcipher_encrypt_iv(&lcldesc, dst, src, bsize);
++ if (tot_blocks <= 1) {
++ err = crypto_blkcipher_encrypt_iv(&lcldesc, dst, src, nbytes);
+ } else if (nbytes <= bsize * 2) {
+ err = cts_cbc_encrypt(ctx, desc, dst, src, 0, nbytes);
+ } else {
+@@ -232,8 +232,8 @@ static int crypto_cts_decrypt(struct blkcipher_desc *desc,
+ lcldesc.info = desc->info;
+ lcldesc.flags = desc->flags;
+
+- if (tot_blocks == 1) {
+- err = crypto_blkcipher_decrypt_iv(&lcldesc, dst, src, bsize);
++ if (tot_blocks <= 1) {
++ err = crypto_blkcipher_decrypt_iv(&lcldesc, dst, src, nbytes);
+ } else if (nbytes <= bsize * 2) {
+ err = cts_cbc_decrypt(ctx, desc, dst, src, 0, nbytes);
+ } else {
+--
+2.20.1
+
diff --git a/patches.kernel.org/4.4.171-050-ext4-fix-a-potential-fiemap-page-fault-deadlo.patch b/patches.kernel.org/4.4.171-050-ext4-fix-a-potential-fiemap-page-fault-deadlo.patch
new file mode 100644
index 0000000000..56d1f818b4
--- /dev/null
+++ b/patches.kernel.org/4.4.171-050-ext4-fix-a-potential-fiemap-page-fault-deadlo.patch
@@ -0,0 +1,52 @@
+From: Theodore Ts'o <tytso@mit.edu>
+Date: Tue, 25 Dec 2018 00:56:33 -0500
+Subject: [PATCH] ext4: fix a potential fiemap/page fault deadlock w/
+ inline_data
+References: bnc#1012382
+Patch-mainline: 4.4.171
+Git-commit: 2b08b1f12cd664dc7d5c84ead9ff25ae97ad5491
+
+commit 2b08b1f12cd664dc7d5c84ead9ff25ae97ad5491 upstream.
+
+The ext4_inline_data_fiemap() function calls fiemap_fill_next_extent()
+while still holding the xattr semaphore. This is not necessary and it
+triggers a circular lockdep warning. This is because
+fiemap_fill_next_extent() could trigger a page fault when it writes
+into page which triggers a page fault. If that page is mmaped from
+the inline file in question, this could very well result in a
+deadlock.
+
+This problem can be reproduced using generic/519 with a file system
+configuration which has the inline_data feature enabled.
+
+Signed-off-by: Theodore Ts'o <tytso@mit.edu>
+Cc: stable@kernel.org
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+Signed-off-by: Jiri Slaby <jslaby@suse.cz>
+---
+ fs/ext4/inline.c | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/fs/ext4/inline.c b/fs/ext4/inline.c
+index 46d4fac48cf4..0dcd33f62637 100644
+--- a/fs/ext4/inline.c
++++ b/fs/ext4/inline.c
+@@ -1861,12 +1861,12 @@ int ext4_inline_data_fiemap(struct inode *inode,
+ physical += (char *)ext4_raw_inode(&iloc) - iloc.bh->b_data;
+ physical += offsetof(struct ext4_inode, i_block);
+
+- if (physical)
+- error = fiemap_fill_next_extent(fieinfo, start, physical,
+- inline_len, flags);
+ brelse(iloc.bh);
+ out:
+ up_read(&EXT4_I(inode)->xattr_sem);
++ if (physical)
++ error = fiemap_fill_next_extent(fieinfo, start, physical,
++ inline_len, flags);
+ return (error < 0 ? error : 0);
+ }
+
+--
+2.20.1
+
diff --git a/patches.fixes/sunrpc-use-after-free-in-svc_process_common.patch b/patches.kernel.org/4.4.171-051-sunrpc-use-after-free-in-svc_process_common.patch
index 1adedb3348..cf44df566e 100644
--- a/patches.fixes/sunrpc-use-after-free-in-svc_process_common.patch
+++ b/patches.kernel.org/4.4.171-051-sunrpc-use-after-free-in-svc_process_common.patch
@@ -1,9 +1,11 @@
From: Vasily Averin <vvs@virtuozzo.com>
Date: Mon, 24 Dec 2018 14:44:52 +0300
Subject: [PATCH] sunrpc: use-after-free in svc_process_common()
-Patch-mainline: Submitted, Mon, 24 Dec 2018 14:44:42 +0300 - linux-nfs@vger.kernel.org
-References: bsc#1119946 CVE-2018-16884
+References: bnc#1012382 bsc#1119946 CVE-2018-16884
+Patch-mainline: 4.4.171
+Git-commit: d4b09acf924b84bae77cad090a9d108e70b43643
+commit d4b09acf924b84bae77cad090a9d108e70b43643 upstream.
if node have NFSv41+ mounts inside several net namespaces
it can lead to use-after-free in svc_process_common()
@@ -42,15 +44,24 @@ svc_rqst->rq_bc_net and adjust SVC_NET() definition.
Some other function was also adopted to properly handle described case.
Signed-off-by: Vasily Averin <vvs@virtuozzo.com>
-Signed-off-by: NeilBrown <neilb@suse.com>
-Acked-by: NeilBrown <neilb@suse.com>
-
+Cc: stable@vger.kernel.org
+Fixes: 23c20ecd4475 ("NFS: callback up - users counting cleanup")
+Signed-off-by: J. Bruce Fields <bfields@redhat.com>
+v2: - added lost extern svc_tcp_prep_reply_hdr()
+ - dropped trace_svc_process() changes
+ - context fixes in svc_process_common()
+Signed-off-by: Vasily Averin <vvs@virtuozzo.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
- include/linux/sunrpc/svc.h | 5 ++++-
- net/sunrpc/svc.c | 11 ++++++++---
- net/sunrpc/svc_xprt.c | 5 +++--
- 3 files changed, 15 insertions(+), 6 deletions(-)
+ include/linux/sunrpc/svc.h | 5 ++++-
+ net/sunrpc/svc.c | 10 +++++++---
+ net/sunrpc/svc_xprt.c | 5 +++--
+ net/sunrpc/svcsock.c | 2 +-
+ 4 files changed, 15 insertions(+), 7 deletions(-)
+diff --git a/include/linux/sunrpc/svc.h b/include/linux/sunrpc/svc.h
+index cc0fc712bb82..a8ac3f25b4ec 100644
--- a/include/linux/sunrpc/svc.h
+++ b/include/linux/sunrpc/svc.h
@@ -290,9 +290,12 @@ struct svc_rqst {
@@ -67,32 +78,40 @@ Acked-by: NeilBrown <neilb@suse.com>
/*
* Rigorous type checking on sockaddr type conversions
+diff --git a/net/sunrpc/svc.c b/net/sunrpc/svc.c
+index c5b0cb4f4056..41f6e964fe91 100644
--- a/net/sunrpc/svc.c
+++ b/net/sunrpc/svc.c
-@@ -1091,7 +1091,12 @@ svc_process_common(struct svc_rqst *rqst
+@@ -1062,6 +1062,8 @@ void svc_printk(struct svc_rqst *rqstp, const char *fmt, ...)
+ static __printf(2,3) void svc_printk(struct svc_rqst *rqstp, const char *fmt, ...) {}
+ #endif
+
++extern void svc_tcp_prep_reply_hdr(struct svc_rqst *);
++
+ /*
+ * Common routine for processing the RPC request.
+ */
+@@ -1091,7 +1093,8 @@ svc_process_common(struct svc_rqst *rqstp, struct kvec *argv, struct kvec *resv)
clear_bit(RQ_DROPME, &rqstp->rq_flags);
/* Setup reply header */
- rqstp->rq_xprt->xpt_ops->xpo_prep_reply_hdr(rqstp);
-+ if (rqstp->rq_prot == IPPROTO_TCP) {
-+ struct kvec *resv = &rqstp->rq_res.head[0];
-+
-+ /* tcp needs a space for the record length... */
-+ svc_putnl(resv, 0);
-+ }
++ if (rqstp->rq_prot == IPPROTO_TCP)
++ svc_tcp_prep_reply_hdr(rqstp);
svc_putu32(resv, rqstp->rq_xid);
-@@ -1138,7 +1143,7 @@ svc_process_common(struct svc_rqst *rqst
+@@ -1138,7 +1141,8 @@ svc_process_common(struct svc_rqst *rqstp, struct kvec *argv, struct kvec *resv)
case SVC_DENIED:
goto err_bad_auth;
case SVC_CLOSE:
- if (test_bit(XPT_TEMP, &rqstp->rq_xprt->xpt_flags))
-+ if (rqstp->rq_xprt && test_bit(XPT_TEMP, &rqstp->rq_xprt->xpt_flags))
++ if (rqstp->rq_xprt &&
++ test_bit(XPT_TEMP, &rqstp->rq_xprt->xpt_flags))
svc_close_xprt(rqstp->rq_xprt);
case SVC_DROP:
goto dropit;
-@@ -1360,10 +1365,10 @@ bc_svc_process(struct svc_serv *serv, st
+@@ -1360,10 +1364,10 @@ bc_svc_process(struct svc_serv *serv, struct rpc_rqst *req,
dprintk("svc: %s(%p)\n", __func__, req);
/* Build the svc_rqst used by the common processing routine */
@@ -104,9 +123,11 @@ Acked-by: NeilBrown <neilb@suse.com>
rqstp->rq_addrlen = sizeof(req->rq_xprt->addr);
memcpy(&rqstp->rq_addr, &req->rq_xprt->addr, rqstp->rq_addrlen);
+diff --git a/net/sunrpc/svc_xprt.c b/net/sunrpc/svc_xprt.c
+index 71f15da72f02..2b8e80c721db 100644
--- a/net/sunrpc/svc_xprt.c
+++ b/net/sunrpc/svc_xprt.c
-@@ -454,10 +454,11 @@ out:
+@@ -454,10 +454,11 @@ static struct svc_xprt *svc_xprt_dequeue(struct svc_pool *pool)
*/
void svc_reserve(struct svc_rqst *rqstp, int space)
{
@@ -120,3 +141,19 @@ Acked-by: NeilBrown <neilb@suse.com>
atomic_sub((rqstp->rq_reserved - space), &xprt->xpt_reserved);
rqstp->rq_reserved = space;
+diff --git a/net/sunrpc/svcsock.c b/net/sunrpc/svcsock.c
+index 9701fcca002c..0a9fe033132c 100644
+--- a/net/sunrpc/svcsock.c
++++ b/net/sunrpc/svcsock.c
+@@ -1240,7 +1240,7 @@ static int svc_tcp_sendto(struct svc_rqst *rqstp)
+ /*
+ * Setup response header. TCP has a 4B record length field.
+ */
+-static void svc_tcp_prep_reply_hdr(struct svc_rqst *rqstp)
++void svc_tcp_prep_reply_hdr(struct svc_rqst *rqstp)
+ {
+ struct kvec *resv = &rqstp->rq_res.head[0];
+
+--
+2.20.1
+
diff --git a/patches.kernel.org/4.4.171-052-Linux-4.4.171.patch b/patches.kernel.org/4.4.171-052-Linux-4.4.171.patch
new file mode 100644
index 0000000000..6ec5296e4b
--- /dev/null
+++ b/patches.kernel.org/4.4.171-052-Linux-4.4.171.patch
@@ -0,0 +1,27 @@
+From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+Date: Wed, 16 Jan 2019 22:16:12 +0100
+Subject: [PATCH] Linux 4.4.171
+References: bnc#1012382
+Patch-mainline: 4.4.171
+Git-commit: c5feba4358ed485b91c2f535d703758aa6d8872f
+
+Signed-off-by: Jiri Slaby <jslaby@suse.cz>
+---
+ Makefile | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/Makefile b/Makefile
+index bc58f206c0da..c6b680faedd8 100644
+--- a/Makefile
++++ b/Makefile
+@@ -1,6 +1,6 @@
+ VERSION = 4
+ PATCHLEVEL = 4
+-SUBLEVEL = 170
++SUBLEVEL = 171
+ EXTRAVERSION =
+ NAME = Blurry Fish Butt
+
+--
+2.20.1
+
diff --git a/patches.suse/0004-mm-memory_hotplug-get-rid-of-is_zone_device_section.patch b/patches.suse/0004-mm-memory_hotplug-get-rid-of-is_zone_device_section.patch
index 8fcef66cf7..75a784f41a 100644
--- a/patches.suse/0004-mm-memory_hotplug-get-rid-of-is_zone_device_section.patch
+++ b/patches.suse/0004-mm-memory_hotplug-get-rid-of-is_zone_device_section.patch
@@ -45,7 +45,7 @@ Signed-off-by: Michal Hocko <mhocko@suse.com>
--- a/arch/ia64/mm/init.c
+++ b/arch/ia64/mm/init.c
-@@ -651,7 +651,7 @@ int arch_add_memory(int nid, u64 start,
+@@ -657,7 +657,7 @@ int arch_add_memory(int nid, u64 start,
zone = pgdat->node_zones +
zone_for_memory(nid, start, size, ZONE_NORMAL, for_device);
@@ -56,7 +56,7 @@ Signed-off-by: Michal Hocko <mhocko@suse.com>
printk("%s: Problem encountered in __add_pages() as ret=%d\n",
--- a/arch/powerpc/mm/mem.c
+++ b/arch/powerpc/mm/mem.c
-@@ -122,7 +122,7 @@ int arch_add_memory(int nid, u64 start,
+@@ -130,7 +130,7 @@ int arch_add_memory(int nid, u64 start,
zone = pgdata->node_zones +
zone_for_memory(nid, start, size, 0, for_device);
@@ -67,7 +67,7 @@ Signed-off-by: Michal Hocko <mhocko@suse.com>
#ifdef CONFIG_MEMORY_HOTREMOVE
--- a/arch/s390/mm/init.c
+++ b/arch/s390/mm/init.c
-@@ -156,7 +156,7 @@ int arch_add_memory(int nid, u64 start,
+@@ -178,7 +178,7 @@ int arch_add_memory(int nid, u64 start,
continue;
nr_pages = (start_pfn + size_pages > zone_end_pfn) ?
zone_end_pfn - start_pfn : size_pages;
@@ -78,7 +78,7 @@ Signed-off-by: Michal Hocko <mhocko@suse.com>
start_pfn += nr_pages;
--- a/arch/sh/mm/init.c
+++ b/arch/sh/mm/init.c
-@@ -492,7 +492,7 @@ int arch_add_memory(int nid, u64 start,
+@@ -498,7 +498,7 @@ int arch_add_memory(int nid, u64 start,
ret = __add_pages(nid, pgdat->node_zones +
zone_for_memory(nid, start, size, ZONE_NORMAL,
for_device),
@@ -89,7 +89,7 @@ Signed-off-by: Michal Hocko <mhocko@suse.com>
--- a/arch/x86/mm/init_32.c
+++ b/arch/x86/mm/init_32.c
-@@ -828,7 +828,7 @@ int arch_add_memory(int nid, u64 start,
+@@ -831,7 +831,7 @@ int arch_add_memory(int nid, u64 start,
unsigned long start_pfn = start >> PAGE_SHIFT;
unsigned long nr_pages = size >> PAGE_SHIFT;
@@ -100,7 +100,7 @@ Signed-off-by: Michal Hocko <mhocko@suse.com>
#ifdef CONFIG_MEMORY_HOTREMOVE
--- a/arch/x86/mm/init_64.c
+++ b/arch/x86/mm/init_64.c
-@@ -695,7 +695,7 @@ int arch_add_memory(int nid, u64 start,
+@@ -710,7 +710,7 @@ int arch_add_memory(int nid, u64 start,
init_memory_mapping(start, start + size);
@@ -111,7 +111,7 @@ Signed-off-by: Michal Hocko <mhocko@suse.com>
/* update max_pfn, max_low_pfn and high_memory */
--- a/drivers/base/memory.c
+++ b/drivers/base/memory.c
-@@ -662,14 +662,6 @@ static int add_memory_block(int base_sec
+@@ -647,14 +647,6 @@ static int add_memory_block(int base_sec
return 0;
}
@@ -126,7 +126,7 @@ Signed-off-by: Michal Hocko <mhocko@suse.com>
/*
* need an interface for the VM to add new memory regions,
* but without onlining it.
-@@ -679,9 +671,6 @@ int register_new_memory(int nid, struct
+@@ -664,9 +656,6 @@ int register_new_memory(int nid, struct
int ret = 0;
struct memory_block *mem;
@@ -136,7 +136,7 @@ Signed-off-by: Michal Hocko <mhocko@suse.com>
mutex_lock(&mem_sysfs_mutex);
mem = find_memory_block(section);
-@@ -717,11 +706,16 @@ static int remove_memory_block(unsigned
+@@ -702,11 +691,16 @@ static int remove_memory_block(unsigned
{
struct memory_block *mem;
@@ -156,7 +156,7 @@ Signed-off-by: Michal Hocko <mhocko@suse.com>
unregister_mem_sect_under_nodes(mem, __section_nr(section));
mem->section_count--;
-@@ -724,6 +724,7 @@ static int remove_memory_block(unsigned
+@@ -715,6 +709,7 @@ static int remove_memory_block(unsigned
else
put_device(&mem->dev);
@@ -177,7 +177,7 @@ Signed-off-by: Michal Hocko <mhocko@suse.com>
extern int memory_add_physaddr_to_nid(u64 start);
--- a/mm/memory_hotplug.c
+++ b/mm/memory_hotplug.c
-@@ -286,7 +286,7 @@ void register_page_bootmem_info_node(str
+@@ -462,7 +462,7 @@ static int __meminit __add_zone(struct z
}
static int __meminit __add_section(int nid, struct zone *zone,
@@ -186,7 +186,7 @@ Signed-off-by: Michal Hocko <mhocko@suse.com>
{
int ret;
-@@ -316,6 +317,9 @@ static int __meminit __add_section(int n
+@@ -479,6 +479,9 @@ static int __meminit __add_section(int n
if (ret < 0)
return ret;
@@ -196,7 +196,7 @@ Signed-off-by: Michal Hocko <mhocko@suse.com>
return register_new_memory(nid, __pfn_to_section(phys_start_pfn));
}
-@@ -326,7 +330,7 @@ static int __meminit __add_section(int n
+@@ -489,7 +492,7 @@ static int __meminit __add_section(int n
* add the new pages.
*/
int __ref __add_pages(int nid, struct zone *zone, unsigned long phys_start_pfn,
@@ -205,7 +205,7 @@ Signed-off-by: Michal Hocko <mhocko@suse.com>
{
unsigned long i;
int err = 0;
-@@ -337,7 +341,7 @@ int __ref __add_pages(int nid, unsigned
+@@ -516,7 +519,7 @@ int __ref __add_pages(int nid, struct zo
}
for (i = start_sec; i <= end_sec; i++) {
diff --git a/patches.suse/0009-btrfs-tree-checker-Enhance-output-for-check_extent_d.patch b/patches.suse/0009-btrfs-tree-checker-Enhance-output-for-check_extent_d.patch
index 974a9b7f60..06d94103ce 100644
--- a/patches.suse/0009-btrfs-tree-checker-Enhance-output-for-check_extent_d.patch
+++ b/patches.suse/0009-btrfs-tree-checker-Enhance-output-for-check_extent_d.patch
@@ -13,16 +13,14 @@ expected value range or alignment.
Signed-off-by: Qu Wenruo <quwenruo.btrfs@gmx.com>
Signed-off-by: David Sterba <dsterba@suse.com>
---
- fs/btrfs/tree-checker.c | 97 +++++++++++++++++++++++++++++------------
+ fs/btrfs/tree-checker.c | 97 ++++++++++++++++++++++++++++++++++--------------
1 file changed, 69 insertions(+), 28 deletions(-)
-diff --git a/fs/btrfs/tree-checker.c b/fs/btrfs/tree-checker.c
-index 3d1ae839a367..0de114179676 100644
--- a/fs/btrfs/tree-checker.c
+++ b/fs/btrfs/tree-checker.c
-@@ -31,12 +31,6 @@
- #include "disk-io.h"
- #include "compression.h"
+@@ -33,12 +33,6 @@
+ #include "hash.h"
+ #include "volumes.h"
-#define CORRUPT(reason, eb, root, slot) \
- btrfs_crit(root->fs_info, \
@@ -33,7 +31,7 @@ index 3d1ae839a367..0de114179676 100644
/*
* Error message should follow the following format:
* corrupt <type>: <identifier>, <reason>[, <bad_value>]
-@@ -77,6 +71,46 @@ static void generic_err(const struct btrfs_root *root,
+@@ -79,6 +73,46 @@ static void generic_err(const struct btr
va_end(args);
}
@@ -80,7 +78,7 @@ index 3d1ae839a367..0de114179676 100644
static int check_extent_data_item(struct btrfs_root *root,
struct extent_buffer *leaf,
struct btrfs_key *key, int slot)
-@@ -86,15 +120,19 @@ static int check_extent_data_item(struct btrfs_root *root,
+@@ -88,15 +122,19 @@ static int check_extent_data_item(struct
u32 item_size = btrfs_item_size_nr(leaf, slot);
if (!IS_ALIGNED(key->offset, sectorsize)) {
@@ -103,7 +101,7 @@ index 3d1ae839a367..0de114179676 100644
return -EUCLEAN;
}
-@@ -103,18 +141,24 @@ static int check_extent_data_item(struct btrfs_root *root,
+@@ -105,18 +143,24 @@ static int check_extent_data_item(struct
* and must be caught in open_ctree().
*/
if (btrfs_file_extent_compression(leaf, fi) > BTRFS_COMPRESS_TYPES) {
@@ -132,7 +130,7 @@ index 3d1ae839a367..0de114179676 100644
return -EUCLEAN;
}
-@@ -126,8 +170,10 @@ static int check_extent_data_item(struct btrfs_root *root,
+@@ -128,8 +172,10 @@ static int check_extent_data_item(struct
/* Uncompressed inline extent size must match item size */
if (item_size != BTRFS_FILE_EXTENT_INLINE_DATA_START +
btrfs_file_extent_ram_bytes(leaf, fi)) {
@@ -145,7 +143,7 @@ index 3d1ae839a367..0de114179676 100644
return -EUCLEAN;
}
return 0;
-@@ -135,22 +181,17 @@ static int check_extent_data_item(struct btrfs_root *root,
+@@ -137,22 +183,17 @@ static int check_extent_data_item(struct
/* Regular or preallocated extent has fixed item size */
if (item_size != sizeof(*fi)) {
@@ -176,6 +174,3 @@ index 3d1ae839a367..0de114179676 100644
return 0;
}
---
-2.18.0
-
diff --git a/patches.suse/0014-btrfs-tree-checker-Replace-root-parameter-with-fs_in.patch b/patches.suse/0014-btrfs-tree-checker-Replace-root-parameter-with-fs_in.patch
index 3e920448e0..bd40b85c94 100644
--- a/patches.suse/0014-btrfs-tree-checker-Replace-root-parameter-with-fs_in.patch
+++ b/patches.suse/0014-btrfs-tree-checker-Replace-root-parameter-with-fs_in.patch
@@ -22,14 +22,14 @@ To get the owner, we can only rely on btrfs_header_owner() now.
Signed-off-by: Qu Wenruo <wqu@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
---
- fs/btrfs/disk-io.c | 6 +-
- fs/btrfs/tree-checker.c | 140 +++++++++++++++++++++++++-----------------------
+ fs/btrfs/disk-io.c | 6 -
+ fs/btrfs/tree-checker.c | 148 +++++++++++++++++++++++++-----------------------
fs/btrfs/tree-checker.h | 7 +-
- 3 files changed, 81 insertions(+), 72 deletions(-)
+ 3 files changed, 85 insertions(+), 76 deletions(-)
--- a/fs/btrfs/disk-io.c
+++ b/fs/btrfs/disk-io.c
-@@ -669,12 +669,12 @@ static int btree_readpage_end_io_hook(st
+@@ -602,12 +602,12 @@ static int btree_readpage_end_io_hook(st
* that we don't try and read the other copies of this block, just
* return -EIO.
*/
@@ -44,7 +44,7 @@ Signed-off-by: David Sterba <dsterba@suse.com>
ret = -EIO;
if (!ret)
-@@ -3974,7 +3974,7 @@ void btrfs_mark_buffer_dirty(struct exte
+@@ -3887,7 +3887,7 @@ void btrfs_mark_buffer_dirty(struct exte
* So here we should only check item pointers, not item data.
*/
if (btrfs_header_level(buf) == 0 &&
@@ -55,16 +55,16 @@ Signed-off-by: David Sterba <dsterba@suse.com>
}
--- a/fs/btrfs/tree-checker.c
+++ b/fs/btrfs/tree-checker.c
-@@ -53,7 +53,7 @@
+@@ -54,7 +54,7 @@
* Allows callers to customize the output.
*/
__printf(4, 5)
-static void generic_err(const struct btrfs_root *root,
+static void generic_err(const struct btrfs_fs_info *fs_info,
- struct extent_buffer *eb, int slot,
+ const struct extent_buffer *eb, int slot,
const char *fmt, ...)
{
-@@ -65,10 +65,10 @@ static void generic_err(const struct btr
+@@ -66,10 +66,10 @@ static void generic_err(const struct btr
vaf.fmt = fmt;
vaf.va = &args;
@@ -77,7 +77,7 @@ Signed-off-by: David Sterba <dsterba@suse.com>
va_end(args);
}
-@@ -77,8 +77,8 @@ static void generic_err(const struct btr
+@@ -78,8 +78,8 @@ static void generic_err(const struct btr
* offset has its own meaning.
*/
__printf(4, 5)
@@ -88,7 +88,7 @@ Signed-off-by: David Sterba <dsterba@suse.com>
const char *fmt, ...)
{
struct btrfs_key key;
-@@ -91,10 +91,11 @@ static void file_extent_err(const struct
+@@ -92,10 +92,11 @@ static void file_extent_err(const struct
vaf.fmt = fmt;
vaf.va = &args;
@@ -103,7 +103,7 @@ Signed-off-by: David Sterba <dsterba@suse.com>
va_end(args);
}
-@@ -102,26 +103,27 @@ static void file_extent_err(const struct
+@@ -103,26 +104,27 @@ static void file_extent_err(const struct
* Return 0 if the btrfs_file_extent_##name is aligned to @alignment
* Else return 1
*/
@@ -135,7 +135,7 @@ Signed-off-by: David Sterba <dsterba@suse.com>
"unaligned file_offset for file extent, have %llu should be aligned to %u",
key->offset, sectorsize);
return -EUCLEAN;
-@@ -130,7 +132,7 @@ static int check_extent_data_item(struct
+@@ -131,7 +133,7 @@ static int check_extent_data_item(struct
fi = btrfs_item_ptr(leaf, slot, struct btrfs_file_extent_item);
if (btrfs_file_extent_type(leaf, fi) > BTRFS_FILE_EXTENT_TYPES) {
@@ -144,7 +144,7 @@ Signed-off-by: David Sterba <dsterba@suse.com>
"invalid type for file extent, have %u expect range [0, %u]",
btrfs_file_extent_type(leaf, fi),
BTRFS_FILE_EXTENT_TYPES);
-@@ -142,14 +144,14 @@ static int check_extent_data_item(struct
+@@ -143,14 +145,14 @@ static int check_extent_data_item(struct
* and must be caught in open_ctree().
*/
if (btrfs_file_extent_compression(leaf, fi) > BTRFS_COMPRESS_TYPES) {
@@ -161,7 +161,7 @@ Signed-off-by: David Sterba <dsterba@suse.com>
"invalid encryption for file extent, have %u expect 0",
btrfs_file_extent_encryption(leaf, fi));
return -EUCLEAN;
-@@ -157,7 +159,7 @@ static int check_extent_data_item(struct
+@@ -158,7 +160,7 @@ static int check_extent_data_item(struct
if (btrfs_file_extent_type(leaf, fi) == BTRFS_FILE_EXTENT_INLINE) {
/* Inline extent must have 0 as key offset */
if (key->offset) {
@@ -170,7 +170,7 @@ Signed-off-by: David Sterba <dsterba@suse.com>
"invalid file_offset for inline file extent, have %llu expect 0",
key->offset);
return -EUCLEAN;
-@@ -171,7 +173,7 @@ static int check_extent_data_item(struct
+@@ -172,7 +174,7 @@ static int check_extent_data_item(struct
/* Uncompressed inline extent size must match item size */
if (item_size != BTRFS_FILE_EXTENT_INLINE_DATA_START +
btrfs_file_extent_ram_bytes(leaf, fi)) {
@@ -179,7 +179,7 @@ Signed-off-by: David Sterba <dsterba@suse.com>
"invalid ram_bytes for uncompressed inline extent, have %u expect %llu",
item_size, BTRFS_FILE_EXTENT_INLINE_DATA_START +
btrfs_file_extent_ram_bytes(leaf, fi));
-@@ -182,40 +184,42 @@ static int check_extent_data_item(struct
+@@ -183,40 +185,42 @@ static int check_extent_data_item(struct
/* Regular or preallocated extent has fixed item size */
if (item_size != sizeof(*fi)) {
@@ -234,7 +234,7 @@ Signed-off-by: David Sterba <dsterba@suse.com>
"unaligned item size for csum item, have %u should be aligned to %u",
btrfs_item_size_nr(leaf, slot), csumsize);
return -EUCLEAN;
-@@ -228,8 +232,8 @@ static int check_csum_item(struct btrfs_
+@@ -229,8 +233,8 @@ static int check_csum_item(struct btrfs_
* which represents inode number
*/
__printf(4, 5)
@@ -245,7 +245,7 @@ Signed-off-by: David Sterba <dsterba@suse.com>
const char *fmt, ...)
{
struct btrfs_key key;
-@@ -242,17 +246,19 @@ static void dir_item_err(const struct bt
+@@ -243,17 +247,19 @@ static void dir_item_err(const struct bt
vaf.fmt = fmt;
vaf.va = &args;
@@ -338,7 +338,7 @@ Signed-off-by: David Sterba <dsterba@suse.com>
"dir item data crosses item boundary, have %u boundary %u",
cur + total_size, item_size);
return -EUCLEAN;
-@@ -346,7 +352,7 @@ static int check_dir_item(struct btrfs_r
+@@ -348,7 +354,7 @@ static int check_dir_item(struct btrfs_r
(unsigned long)(di + 1), name_len);
name_hash = btrfs_name_hash(namebuf, name_len);
if (key->offset != name_hash) {
@@ -347,7 +347,7 @@ Signed-off-by: David Sterba <dsterba@suse.com>
"name hash mismatch with key, have 0x%016x expect 0x%016llx",
name_hash, key->offset);
return -EUCLEAN;
-@@ -361,7 +367,7 @@ static int check_dir_item(struct btrfs_r
+@@ -459,7 +465,7 @@ static int check_block_group_item(struct
/*
* Common point to switch the item-specific validation.
*/
@@ -356,7 +356,7 @@ Signed-off-by: David Sterba <dsterba@suse.com>
struct extent_buffer *leaf,
struct btrfs_key *key, int slot)
{
-@@ -369,27 +375,27 @@ static int check_leaf_item(struct btrfs_
+@@ -467,35 +473,35 @@ static int check_leaf_item(struct btrfs_
switch (key->type) {
case BTRFS_EXTENT_DATA_KEY:
@@ -373,6 +373,10 @@ Signed-off-by: David Sterba <dsterba@suse.com>
- ret = check_dir_item(root, leaf, key, slot);
+ ret = check_dir_item(fs_info, leaf, key, slot);
break;
+ case BTRFS_BLOCK_GROUP_ITEM_KEY:
+- ret = check_block_group_item(root->fs_info, leaf, key, slot);
++ ret = check_block_group_item(fs_info, leaf, key, slot);
+ break;
}
return ret;
}
@@ -389,7 +393,22 @@ Signed-off-by: David Sterba <dsterba@suse.com>
u32 nritems = btrfs_header_nritems(leaf);
int slot;
-@@ -419,7 +425,7 @@ static int check_leaf(struct btrfs_root
+ if (btrfs_header_level(leaf) != 0) {
+- generic_err(root, leaf, 0,
++ generic_err(fs_info, leaf, 0,
+ "invalid level for leaf, have %d expect 0",
+ btrfs_header_level(leaf));
+ return -EUCLEAN;
+@@ -520,7 +526,7 @@ static int check_leaf(struct btrfs_root
+ owner == BTRFS_DEV_TREE_OBJECTID ||
+ owner == BTRFS_FS_TREE_OBJECTID ||
+ owner == BTRFS_DATA_RELOC_TREE_OBJECTID) {
+- generic_err(root, leaf, 0,
++ generic_err(fs_info, leaf, 0,
+ "invalid root, root %llu must never be empty",
+ owner);
+ return -EUCLEAN;
+@@ -540,7 +546,7 @@ static int check_leaf(struct btrfs_root
eb = btrfs_root_node(check_root);
/* if leaf is the root, then it's fine */
if (leaf != eb) {
@@ -398,7 +417,7 @@ Signed-off-by: David Sterba <dsterba@suse.com>
"invalid nritems, have %u should not be 0 for non-root leaf",
nritems);
free_extent_buffer(eb);
-@@ -452,7 +458,7 @@ static int check_leaf(struct btrfs_root
+@@ -573,7 +579,7 @@ static int check_leaf(struct btrfs_root
/* Make sure the keys are in the right order */
if (btrfs_comp_cpu_keys(&prev_key, &key) >= 0) {
@@ -407,7 +426,7 @@ Signed-off-by: David Sterba <dsterba@suse.com>
"bad key order, prev (%llu %u %llu) current (%llu %u %llu)",
prev_key.objectid, prev_key.type,
prev_key.offset, key.objectid, key.type,
-@@ -471,7 +477,7 @@ static int check_leaf(struct btrfs_root
+@@ -592,7 +598,7 @@ static int check_leaf(struct btrfs_root
item_end_expected = btrfs_item_offset_nr(leaf,
slot - 1);
if (btrfs_item_end_nr(leaf, slot) != item_end_expected) {
@@ -416,7 +435,7 @@ Signed-off-by: David Sterba <dsterba@suse.com>
"unexpected item end, have %u expect %u",
btrfs_item_end_nr(leaf, slot),
item_end_expected);
-@@ -485,7 +491,7 @@ static int check_leaf(struct btrfs_root
+@@ -606,7 +612,7 @@ static int check_leaf(struct btrfs_root
*/
if (btrfs_item_end_nr(leaf, slot) >
BTRFS_LEAF_DATA_SIZE(root)) {
@@ -425,7 +444,7 @@ Signed-off-by: David Sterba <dsterba@suse.com>
"slot end outside of leaf, have %u expect range [0, %u]",
btrfs_item_end_nr(leaf, slot),
BTRFS_LEAF_DATA_SIZE(root));
-@@ -495,7 +501,7 @@ static int check_leaf(struct btrfs_root
+@@ -616,7 +622,7 @@ static int check_leaf(struct btrfs_root
/* Also check if the item pointer overlaps with btrfs item. */
if (btrfs_item_nr_offset(slot) + sizeof(struct btrfs_item) >
btrfs_item_ptr_offset(leaf, slot)) {
@@ -434,7 +453,7 @@ Signed-off-by: David Sterba <dsterba@suse.com>
"slot overlaps with its data, item end %lu data start %lu",
btrfs_item_nr_offset(slot) +
sizeof(struct btrfs_item),
-@@ -508,7 +514,7 @@ static int check_leaf(struct btrfs_root
+@@ -629,7 +635,7 @@ static int check_leaf(struct btrfs_root
* Check if the item size and content meet other
* criteria
*/
@@ -443,7 +462,7 @@ Signed-off-by: David Sterba <dsterba@suse.com>
if (ret < 0)
return ret;
}
-@@ -521,29 +527,31 @@ static int check_leaf(struct btrfs_root
+@@ -642,36 +648,38 @@ static int check_leaf(struct btrfs_root
return 0;
}
@@ -470,9 +489,17 @@ Signed-off-by: David Sterba <dsterba@suse.com>
struct btrfs_key key, next_key;
+ struct btrfs_root *root = fs_info->tree_root;
int slot;
+ int level = btrfs_header_level(node);
u64 bytenr;
int ret = 0;
+ if (level <= 0 || level >= BTRFS_MAX_LEVEL) {
+- generic_err(root, node, 0,
++ generic_err(fs_info, node, 0,
+ "invalid level for node, have %d expect [1, %d]",
+ level, BTRFS_MAX_LEVEL - 1);
+ return -EUCLEAN;
+ }
if (nr == 0 || nr > BTRFS_NODEPTRS_PER_BLOCK(root)) {
- btrfs_crit(root->fs_info,
+ btrfs_crit(fs_info,
@@ -482,7 +509,7 @@ Signed-off-by: David Sterba <dsterba@suse.com>
nr == 0 ? "small" : "large", nr,
BTRFS_NODEPTRS_PER_BLOCK(root));
return -EUCLEAN;
-@@ -555,13 +563,13 @@ int btrfs_check_node(struct btrfs_root *
+@@ -683,13 +691,13 @@ int btrfs_check_node(struct btrfs_root *
btrfs_node_key_to_cpu(node, &next_key, slot + 1);
if (!bytenr) {
@@ -498,7 +525,7 @@ Signed-off-by: David Sterba <dsterba@suse.com>
"unaligned pointer, have %llu should be aligned to %u",
bytenr, root->sectorsize);
ret = -EUCLEAN;
-@@ -569,7 +577,7 @@ int btrfs_check_node(struct btrfs_root *
+@@ -697,7 +705,7 @@ int btrfs_check_node(struct btrfs_root *
}
if (btrfs_comp_cpu_keys(&key, &next_key) >= 0) {
diff --git a/patches.suse/btrfs-0011-make-clear_extent_buffer_uptodate-return-void.patch b/patches.suse/btrfs-0011-make-clear_extent_buffer_uptodate-return-void.patch
index 582bf0e995..65c84f3da1 100644
--- a/patches.suse/btrfs-0011-make-clear_extent_buffer_uptodate-return-void.patch
+++ b/patches.suse/btrfs-0011-make-clear_extent_buffer_uptodate-return-void.patch
@@ -15,7 +15,7 @@ Signed-off-by: David Sterba <dsterba@suse.com>
--- a/fs/btrfs/extent_io.c
+++ b/fs/btrfs/extent_io.c
-@@ -5221,7 +5221,7 @@ int set_extent_buffer_dirty(struct exten
+@@ -5240,7 +5240,7 @@ int set_extent_buffer_dirty(struct exten
return was_dirty;
}
@@ -24,7 +24,7 @@ Signed-off-by: David Sterba <dsterba@suse.com>
{
unsigned long i;
struct page *page;
-@@ -5234,7 +5234,6 @@ int clear_extent_buffer_uptodate(struct
+@@ -5253,7 +5253,6 @@ int clear_extent_buffer_uptodate(struct
if (page)
ClearPageUptodate(page);
}
@@ -34,7 +34,7 @@ Signed-off-by: David Sterba <dsterba@suse.com>
void set_extent_buffer_uptodate(struct extent_buffer *eb)
--- a/fs/btrfs/extent_io.h
+++ b/fs/btrfs/extent_io.h
-@@ -331,7 +331,7 @@ void memset_extent_buffer(struct extent_
+@@ -330,7 +330,7 @@ void memset_extent_buffer(struct extent_
void clear_extent_buffer_dirty(struct extent_buffer *eb);
int set_extent_buffer_dirty(struct extent_buffer *eb);
void set_extent_buffer_uptodate(struct extent_buffer *eb);
@@ -42,4 +42,4 @@ Signed-off-by: David Sterba <dsterba@suse.com>
+void clear_extent_buffer_uptodate(struct extent_buffer *eb);
int extent_buffer_uptodate(struct extent_buffer *eb);
int extent_buffer_under_io(struct extent_buffer *eb);
- int map_private_extent_buffer(struct extent_buffer *eb, unsigned long offset,
+ int map_private_extent_buffer(const struct extent_buffer *eb,
diff --git a/patches.suse/btrfs-0012-make-extent_clear_unlock_delalloc-return-void.patch b/patches.suse/btrfs-0012-make-extent_clear_unlock_delalloc-return-void.patch
index 24911e0b19..670d37224c 100644
--- a/patches.suse/btrfs-0012-make-extent_clear_unlock_delalloc-return-void.patch
+++ b/patches.suse/btrfs-0012-make-extent_clear_unlock_delalloc-return-void.patch
@@ -43,8 +43,8 @@ Signed-off-by: David Sterba <dsterba@suse.com>
/*
--- a/fs/btrfs/extent_io.h
+++ b/fs/btrfs/extent_io.h
-@@ -340,7 +340,7 @@ int map_private_extent_buffer(struct ext
- unsigned long *map_len);
+@@ -339,7 +339,7 @@ int map_private_extent_buffer(const stru
+ unsigned long *map_len);
int extent_range_clear_dirty_for_io(struct inode *inode, u64 start, u64 end);
int extent_range_redirty_for_io(struct inode *inode, u64 start, u64 end);
-int extent_clear_unlock_delalloc(struct inode *inode, u64 start, u64 end,
diff --git a/patches.suse/btrfs-0014-make-extent_range_clear_dirty_for_io-return-vo.patch b/patches.suse/btrfs-0014-make-extent_range_clear_dirty_for_io-return-vo.patch
index a979d8da47..0fe75cdee8 100644
--- a/patches.suse/btrfs-0014-make-extent_range_clear_dirty_for_io-return-vo.patch
+++ b/patches.suse/btrfs-0014-make-extent_range_clear_dirty_for_io-return-vo.patch
@@ -37,10 +37,10 @@ Signed-off-by: David Sterba <dsterba@suse.com>
int extent_range_redirty_for_io(struct inode *inode, u64 start, u64 end)
--- a/fs/btrfs/extent_io.h
+++ b/fs/btrfs/extent_io.h
-@@ -338,7 +338,7 @@ int map_private_extent_buffer(struct ext
- unsigned long min_len, char **map,
- unsigned long *map_start,
- unsigned long *map_len);
+@@ -337,7 +337,7 @@ int map_private_extent_buffer(const stru
+ unsigned long offset, unsigned long min_len,
+ char **map, unsigned long *map_start,
+ unsigned long *map_len);
-int extent_range_clear_dirty_for_io(struct inode *inode, u64 start, u64 end);
+void extent_range_clear_dirty_for_io(struct inode *inode, u64 start, u64 end);
int extent_range_redirty_for_io(struct inode *inode, u64 start, u64 end);
diff --git a/patches.suse/btrfs-0015-make-extent_range_redirty_for_io-return-void.patch b/patches.suse/btrfs-0015-make-extent_range_redirty_for_io-return-void.patch
index ac1a3fc9f4..dbb4dfad96 100644
--- a/patches.suse/btrfs-0015-make-extent_range_redirty_for_io-return-void.patch
+++ b/patches.suse/btrfs-0015-make-extent_range_redirty_for_io-return-void.patch
@@ -36,9 +36,9 @@ Signed-off-by: David Sterba <dsterba@suse.com>
/*
--- a/fs/btrfs/extent_io.h
+++ b/fs/btrfs/extent_io.h
-@@ -339,7 +339,7 @@ int map_private_extent_buffer(struct ext
- unsigned long *map_start,
- unsigned long *map_len);
+@@ -338,7 +338,7 @@ int map_private_extent_buffer(const stru
+ char **map, unsigned long *map_start,
+ unsigned long *map_len);
void extent_range_clear_dirty_for_io(struct inode *inode, u64 start, u64 end);
-int extent_range_redirty_for_io(struct inode *inode, u64 start, u64 end);
+void extent_range_redirty_for_io(struct inode *inode, u64 start, u64 end);
diff --git a/patches.suse/btrfs-0273-uapi-linux-btrfs_tree.h-migration-item-types-a.patch b/patches.suse/btrfs-0273-uapi-linux-btrfs_tree.h-migration-item-types-a.patch
index 1789d45ad0..1308a64bd0 100644
--- a/patches.suse/btrfs-0273-uapi-linux-btrfs_tree.h-migration-item-types-a.patch
+++ b/patches.suse/btrfs-0273-uapi-linux-btrfs_tree.h-migration-item-types-a.patch
@@ -17,9 +17,9 @@ Reviewed-by: Liu Bo <bo.li.liu@oracle.com>
Reviewed-by: Josef Bacik <jbacik@fb.com>
Signed-off-by: David Sterba <dsterba@suse.com>
---
- fs/btrfs/ctree.h | 884 ------------------------------------
- include/uapi/linux/btrfs_tree.h | 966 ++++++++++++++++++++++++++++++++++++++++
- 2 files changed, 967 insertions(+), 883 deletions(-)
+ fs/btrfs/ctree.h | 885 ------------------------------------
+ include/uapi/linux/btrfs_tree.h | 967 ++++++++++++++++++++++++++++++++++++++++
+ 2 files changed, 968 insertions(+), 884 deletions(-)
create mode 100644 include/uapi/linux/btrfs_tree.h
--- a/fs/btrfs/ctree.h
@@ -31,8 +31,8 @@ Signed-off-by: David Sterba <dsterba@suse.com>
+#include <linux/btrfs_tree.h>
#include <linux/workqueue.h>
#include <linux/security.h>
- #include "extent_io.h"
-@@ -63,92 +64,6 @@ struct btrfs_ordered_sum;
+ #include <linux/sizes.h>
+@@ -64,92 +65,6 @@ struct btrfs_ordered_sum;
#define BTRFS_COMPAT_EXTENT_TREE_V0
@@ -125,7 +125,7 @@ Signed-off-by: David Sterba <dsterba@suse.com>
/*
* the max metadata block size. This limit is somewhat artificial,
* but the memmove costs go through the roof for larger blocks.
-@@ -168,12 +83,6 @@ struct btrfs_ordered_sum;
+@@ -169,12 +84,6 @@ struct btrfs_ordered_sum;
*/
#define BTRFS_LINK_MAX 65535U
@@ -138,7 +138,7 @@ Signed-off-by: David Sterba <dsterba@suse.com>
static int btrfs_csum_sizes[] = { 4 };
/* four bytes for CRC32 */
-@@ -182,17 +91,6 @@ static int btrfs_csum_sizes[] = { 4 };
+@@ -183,17 +92,6 @@ static int btrfs_csum_sizes[] = { 4 };
/* spefic to btrfs_map_block(), therefore not in include/linux/blk_types.h */
#define REQ_GET_READ_MIRRORS (1 << 30)
@@ -156,7 +156,7 @@ Signed-off-by: David Sterba <dsterba@suse.com>
/* ioprio of readahead is set to idle */
#define BTRFS_IOPRIO_READA (IOPRIO_PRIO_VALUE(IOPRIO_CLASS_IDLE, 0))
-@@ -200,138 +98,10 @@ static int btrfs_csum_sizes[] = { 4 };
+@@ -201,138 +99,10 @@ static int btrfs_csum_sizes[] = { 4 };
#define BTRFS_MAX_EXTENT_SIZE (128 * 1024 * 1024)
@@ -295,7 +295,7 @@ Signed-off-by: David Sterba <dsterba@suse.com>
static inline unsigned long btrfs_chunk_item_size(int num_stripes)
{
BUG_ON(num_stripes == 0);
-@@ -339,9 +109,6 @@ static inline unsigned long btrfs_chunk_
+@@ -340,9 +110,6 @@ static inline unsigned long btrfs_chunk_
sizeof(struct btrfs_stripe) * (num_stripes - 1);
}
@@ -305,7 +305,7 @@ Signed-off-by: David Sterba <dsterba@suse.com>
/*
* File system states
*/
-@@ -350,13 +117,6 @@ static inline unsigned long btrfs_chunk_
+@@ -351,13 +118,6 @@ static inline unsigned long btrfs_chunk_
#define BTRFS_FS_STATE_TRANS_ABORTED 2
#define BTRFS_FS_STATE_DEV_REPLACING 3
@@ -319,7 +319,7 @@ Signed-off-by: David Sterba <dsterba@suse.com>
#define BTRFS_BACKREF_REV_MAX 256
#define BTRFS_BACKREF_REV_SHIFT 56
#define BTRFS_BACKREF_REV_MASK (((u64)BTRFS_BACKREF_REV_MAX - 1) << \
-@@ -588,100 +348,9 @@ struct btrfs_path {
+@@ -589,100 +349,9 @@ struct btrfs_path {
unsigned int need_commit_sem:1;
unsigned int skip_release_on_error:1;
};
@@ -420,7 +420,7 @@ Signed-off-by: David Sterba <dsterba@suse.com>
enum btrfs_compression_type {
BTRFS_COMPRESS_NONE = 0,
BTRFS_COMPRESS_ZLIB = 1,
-@@ -690,263 +359,6 @@ enum btrfs_compression_type {
+@@ -691,264 +360,6 @@ enum btrfs_compression_type {
BTRFS_COMPRESS_LAST = 3,
};
@@ -608,6 +608,7 @@ Signed-off-by: David Sterba <dsterba@suse.com>
-#define BTRFS_FILE_EXTENT_INLINE 0
-#define BTRFS_FILE_EXTENT_REG 1
-#define BTRFS_FILE_EXTENT_PREALLOC 2
+-#define BTRFS_FILE_EXTENT_TYPES 2
-
-struct btrfs_file_extent_item {
- /*
@@ -684,7 +685,7 @@ Signed-off-by: David Sterba <dsterba@suse.com>
struct btrfs_dev_replace {
u64 replace_state; /* see #define above */
u64 time_started; /* seconds since 1-Jan-1970 */
-@@ -977,160 +389,6 @@ struct btrfs_dev_replace {
+@@ -979,160 +390,6 @@ struct btrfs_dev_replace {
struct btrfs_scrub_progress scrub_progress;
};
@@ -845,7 +846,7 @@ Signed-off-by: David Sterba <dsterba@suse.com>
/* For raid type sysfs entries */
struct raid_kobject {
int raid_type;
-@@ -1957,146 +1215,6 @@ struct btrfs_root {
+@@ -1959,146 +1216,6 @@ struct btrfs_root {
atomic_t qgroup_meta_rsv;
};
@@ -994,7 +995,7 @@ Signed-off-by: David Sterba <dsterba@suse.com>
*
--- /dev/null
+++ b/include/uapi/linux/btrfs_tree.h
-@@ -0,0 +1,966 @@
+@@ -0,0 +1,967 @@
+#ifndef _BTRFS_CTREE_H_
+#define _BTRFS_CTREE_H_
+
@@ -1726,6 +1727,7 @@ Signed-off-by: David Sterba <dsterba@suse.com>
+#define BTRFS_FILE_EXTENT_INLINE 0
+#define BTRFS_FILE_EXTENT_REG 1
+#define BTRFS_FILE_EXTENT_PREALLOC 2
++#define BTRFS_FILE_EXTENT_TYPES 2
+
+struct btrfs_file_extent_item {
+ /*
diff --git a/patches.suse/btrfs-0340-fix-error-handling-in-map_private_extent_buffe.patch b/patches.suse/btrfs-0340-fix-error-handling-in-map_private_extent_buffe.patch
index 4719811358..d7c70552e4 100644
--- a/patches.suse/btrfs-0340-fix-error-handling-in-map_private_extent_buffe.patch
+++ b/patches.suse/btrfs-0340-fix-error-handling-in-map_private_extent_buffe.patch
@@ -29,7 +29,7 @@ Signed-off-by: Chris Mason <clm@fb.com>
--- a/fs/btrfs/ctree.c
+++ b/fs/btrfs/ctree.c
-@@ -1784,10 +1784,12 @@ static noinline int generic_bin_search(s
+@@ -1770,10 +1770,12 @@ static noinline int generic_bin_search(s
if (!err) {
tmp = (struct btrfs_disk_key *)(kaddr + offset -
map_start);
@@ -43,7 +43,7 @@ Signed-off-by: Chris Mason <clm@fb.com>
}
} else {
-@@ -2828,6 +2830,8 @@ cow_done:
+@@ -2820,6 +2822,8 @@ cow_done:
}
ret = key_search(b, key, level, &prev_cmp, &slot);
@@ -54,7 +54,7 @@ Signed-off-by: Chris Mason <clm@fb.com>
int dec = 0;
--- a/fs/btrfs/extent_io.c
+++ b/fs/btrfs/extent_io.c
-@@ -5341,6 +5341,11 @@ int read_extent_buffer_to_user(struct ex
+@@ -5359,6 +5359,11 @@ int read_extent_buffer_to_user(const str
return ret;
}
@@ -63,10 +63,10 @@ Signed-off-by: Chris Mason <clm@fb.com>
+ * return 1 if the item spans two pages.
+ * return -EINVAL otherwise.
+ */
- int map_private_extent_buffer(struct extent_buffer *eb, unsigned long start,
- unsigned long min_len, char **map,
- unsigned long *map_start,
-@@ -5355,7 +5360,7 @@ int map_private_extent_buffer(struct ext
+ int map_private_extent_buffer(const struct extent_buffer *eb,
+ unsigned long start, unsigned long min_len,
+ char **map, unsigned long *map_start,
+@@ -5373,7 +5378,7 @@ int map_private_extent_buffer(const stru
PAGE_CACHE_SHIFT;
if (i != end_i)
diff --git a/patches.suse/btrfs-0453-convert-nodesize-macros-to-static-inlines.patch b/patches.suse/btrfs-0453-convert-nodesize-macros-to-static-inlines.patch
index 7f43698497..a2f241944c 100644
--- a/patches.suse/btrfs-0453-convert-nodesize-macros-to-static-inlines.patch
+++ b/patches.suse/btrfs-0453-convert-nodesize-macros-to-static-inlines.patch
@@ -11,12 +11,13 @@ size limits to static inlines. That way we get type checking for free.
Signed-off-by: Jeff Mahoney <jeffm@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
---
- fs/btrfs/ctree.h | 48 +++++++++++++++++++++++++++++++++---------------
- 1 file changed, 33 insertions(+), 15 deletions(-)
+ fs/btrfs/ctree.h | 48 +++++++++++++++++++++++++++++++++---------------
+ fs/btrfs/tree-checker.c | 4 ++--
+ 2 files changed, 35 insertions(+), 17 deletions(-)
--- a/fs/btrfs/ctree.h
+++ b/fs/btrfs/ctree.h
-@@ -143,21 +143,6 @@ struct btrfs_header {
+@@ -144,21 +144,6 @@ struct btrfs_header {
u8 level;
} __attribute__ ((__packed__));
@@ -38,7 +39,7 @@ Signed-off-by: David Sterba <dsterba@suse.com>
/*
* this is a very generous portion of the super block, giving us
* room to translate 14 chunks with 3 stripes each.
-@@ -1240,6 +1225,39 @@ struct btrfs_root {
+@@ -1241,6 +1226,39 @@ struct btrfs_root {
atomic_t qgroup_meta_rsv;
};
@@ -78,3 +79,23 @@ Signed-off-by: David Sterba <dsterba@suse.com>
/*
* Flags for mount options.
*
+--- a/fs/btrfs/tree-checker.c
++++ b/fs/btrfs/tree-checker.c
+@@ -266,7 +266,7 @@ static int check_dir_item(struct btrfs_r
+ }
+ if (name_len + data_len > BTRFS_MAX_XATTR_SIZE(root)) {
+ dir_item_err(root, leaf, slot,
+- "dir item name and data len too long, have %u max %zu",
++ "dir item name and data len too long, have %u max %u",
+ name_len + data_len,
+ BTRFS_MAX_XATTR_SIZE(root));
+ return -EUCLEAN;
+@@ -608,7 +608,7 @@ int btrfs_check_node(struct btrfs_root *
+ }
+ if (nr == 0 || nr > BTRFS_NODEPTRS_PER_BLOCK(root)) {
+ btrfs_crit(root->fs_info,
+-"corrupt node: root=%llu block=%llu, nritems too %s, have %lu expect range [1,%zu]",
++"corrupt node: root=%llu block=%llu, nritems too %s, have %lu expect range [1,%u]",
+ root->objectid, node->start,
+ nr == 0 ? "small" : "large", nr,
+ BTRFS_NODEPTRS_PER_BLOCK(root));
diff --git a/patches.suse/btrfs-0504-add-dynamic-debug-support.patch b/patches.suse/btrfs-0504-add-dynamic-debug-support.patch
index a5e138459d..ab348f1b09 100644
--- a/patches.suse/btrfs-0504-add-dynamic-debug-support.patch
+++ b/patches.suse/btrfs-0504-add-dynamic-debug-support.patch
@@ -22,15 +22,15 @@ Signed-off-by: David Sterba <dsterba@suse.com>
--- a/fs/btrfs/ctree.h
+++ b/fs/btrfs/ctree.h
-@@ -36,6 +36,7 @@
- #include <linux/btrfs_tree.h>
+@@ -37,6 +37,7 @@
#include <linux/workqueue.h>
#include <linux/security.h>
+ #include <linux/sizes.h>
+#include <linux/dynamic_debug.h>
#include "extent_io.h"
#include "extent_map.h"
#include "async-thread.h"
-@@ -3281,7 +3282,35 @@ void btrfs_printk(const struct btrfs_fs_
+@@ -3301,7 +3302,35 @@ void btrfs_printk(const struct btrfs_fs_
btrfs_printk_ratelimited(fs_info, KERN_NOTICE fmt, ##args)
#define btrfs_info_rl(fs_info, fmt, args...) \
btrfs_printk_ratelimited(fs_info, KERN_INFO fmt, ##args)
diff --git a/patches.suse/btrfs-8888-add-allow_unsupported-module-parameter.patch b/patches.suse/btrfs-8888-add-allow_unsupported-module-parameter.patch
index 12f6fa6881..c8c91f8459 100644
--- a/patches.suse/btrfs-8888-add-allow_unsupported-module-parameter.patch
+++ b/patches.suse/btrfs-8888-add-allow_unsupported-module-parameter.patch
@@ -29,15 +29,15 @@ Signed-off-by: David Sterba <dsterba@suse.cz>
--- a/fs/btrfs/ctree.h
+++ b/fs/btrfs/ctree.h
-@@ -37,6 +37,7 @@
- #include <linux/workqueue.h>
+@@ -38,6 +38,7 @@
#include <linux/security.h>
+ #include <linux/sizes.h>
#include <linux/dynamic_debug.h>
+#include <linux/unsupported-feature.h>
#include "extent_io.h"
#include "extent_map.h"
#include "async-thread.h"
-@@ -3620,4 +3621,11 @@ static inline int btrfs_is_testing(struc
+@@ -3653,4 +3654,11 @@ static inline int btrfs_is_testing(struc
#endif
return 0;
}
@@ -51,7 +51,7 @@ Signed-off-by: David Sterba <dsterba@suse.cz>
#endif
--- a/fs/btrfs/disk-io.c
+++ b/fs/btrfs/disk-io.c
-@@ -2750,6 +2750,14 @@ int open_ctree(struct super_block *sb,
+@@ -2736,6 +2736,14 @@ int open_ctree(struct super_block *sb,
if (btrfs_super_flags(disk_super) & BTRFS_SUPER_FLAG_ERROR)
set_bit(BTRFS_FS_STATE_ERROR, &fs_info->fs_state);
@@ -66,7 +66,7 @@ Signed-off-by: David Sterba <dsterba@suse.cz>
/*
* run through our array of backup supers and setup
* our ring pointer to the oldest one
-@@ -2816,6 +2824,13 @@ int open_ctree(struct super_block *sb,
+@@ -2802,6 +2810,13 @@ int open_ctree(struct super_block *sb,
goto fail_alloc;
}
@@ -82,7 +82,7 @@ Signed-off-by: David Sterba <dsterba@suse.cz>
* update the flag.
--- a/fs/btrfs/ioctl.c
+++ b/fs/btrfs/ioctl.c
-@@ -5630,6 +5630,7 @@ long btrfs_ioctl(struct file *file, unsi
+@@ -5649,6 +5649,7 @@ long btrfs_ioctl(struct file *file, unsi
{
struct btrfs_root *root = BTRFS_I(file_inode(file))->root;
void __user *argp = (void __user *)arg;
@@ -90,7 +90,7 @@ Signed-off-by: David Sterba <dsterba@suse.cz>
switch (cmd) {
case FS_IOC_GETFLAGS:
-@@ -5750,6 +5751,11 @@ long btrfs_ioctl(struct file *file, unsi
+@@ -5769,6 +5770,11 @@ long btrfs_ioctl(struct file *file, unsi
case BTRFS_IOC_QUOTA_RESCAN_WAIT:
return btrfs_ioctl_quota_rescan_wait(file, argp);
case BTRFS_IOC_DEV_REPLACE:
@@ -102,7 +102,7 @@ Signed-off-by: David Sterba <dsterba@suse.cz>
return btrfs_ioctl_dev_replace(root, argp);
case BTRFS_IOC_GET_FSLABEL:
return btrfs_ioctl_get_fslabel(file, argp);
-@@ -5765,7 +5771,7 @@ long btrfs_ioctl(struct file *file, unsi
+@@ -5784,7 +5790,7 @@ long btrfs_ioctl(struct file *file, unsi
return btrfs_ioctl_set_features(file, argp);
}
diff --git a/patches.suse/btrfs-backref-constify-some-arguments b/patches.suse/btrfs-backref-constify-some-arguments
index d016433616..729fc1816e 100644
--- a/patches.suse/btrfs-backref-constify-some-arguments
+++ b/patches.suse/btrfs-backref-constify-some-arguments
@@ -8,14 +8,13 @@ This constifies a few buffers used in the backref code.
Signed-off-by: Jeff Mahoney <jeffm@suse.com>
---
- fs/btrfs/backref.c | 29 ++++++++++++++++-------------
- 1 file changed, 16 insertions(+), 13 deletions(-)
+ fs/btrfs/backref.c | 29 ++++++++++++++++-------------
+ fs/btrfs/ctree.h | 2 +-
+ 2 files changed, 17 insertions(+), 14 deletions(-)
-diff --git a/fs/btrfs/backref.c b/fs/btrfs/backref.c
-index f723c11..9d6474d 100644
--- a/fs/btrfs/backref.c
+++ b/fs/btrfs/backref.c
-@@ -299,10 +299,11 @@ static int ref_tree_add(struct ref_root *ref_tree, u64 root_id, u64 object_id,
+@@ -294,10 +294,11 @@ static int ref_tree_add(struct ref_root
return 0;
}
@@ -31,7 +30,7 @@ index f723c11..9d6474d 100644
{
u64 offset = 0;
struct extent_inode_elem *e;
-@@ -344,9 +345,9 @@ static void free_inode_elem_list(struct extent_inode_elem *eie)
+@@ -339,9 +340,9 @@ static void free_inode_elem_list(struct
}
}
@@ -44,7 +43,7 @@ index f723c11..9d6474d 100644
{
u64 disk_byte;
struct btrfs_key key;
-@@ -456,7 +457,7 @@ void btrfs_prelim_ref_exit(void)
+@@ -452,7 +453,7 @@ void btrfs_prelim_ref_exit(void)
*/
static int __add_prelim_ref(struct list_head *head, u64 root_id,
@@ -53,7 +52,7 @@ index f723c11..9d6474d 100644
u64 parent, u64 wanted_disk_byte, int count,
gfp_t gfp_mask)
{
-@@ -1649,7 +1650,7 @@ int btrfs_find_one_extref(struct btrfs_root *root, u64 inode_objectid,
+@@ -1664,7 +1665,7 @@ int btrfs_find_one_extref(struct btrfs_r
struct btrfs_key key;
struct btrfs_key found_key;
struct btrfs_inode_extref *extref;
@@ -62,7 +61,7 @@ index f723c11..9d6474d 100644
unsigned long ptr;
key.objectid = inode_objectid;
-@@ -1806,7 +1807,7 @@ int extent_from_logical(struct btrfs_fs_info *fs_info, u64 logical,
+@@ -1821,7 +1822,7 @@ int extent_from_logical(struct btrfs_fs_
u64 flags;
u64 size = 0;
u32 item_size;
@@ -71,7 +70,7 @@ index f723c11..9d6474d 100644
struct btrfs_extent_item *ei;
struct btrfs_key key;
-@@ -1874,9 +1875,11 @@ int extent_from_logical(struct btrfs_fs_info *fs_info, u64 logical,
+@@ -1889,9 +1890,11 @@ int extent_from_logical(struct btrfs_fs_
* next ref. after the last ref was processed, 1 is returned.
* returns <0 on error
*/
@@ -86,14 +85,14 @@ index f723c11..9d6474d 100644
struct btrfs_extent_inline_ref **out_eiref,
int *out_type)
{
---
-2.10.2
-
---
-To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
-the body of a message to majordomo@vger.kernel.org
-More majordomo info at http://vger.kernel.org/majordomo-info.html
-
-
-
-
+--- a/fs/btrfs/ctree.h
++++ b/fs/btrfs/ctree.h
+@@ -2295,7 +2295,7 @@ static inline int btrfs_super_csum_size(
+ return btrfs_csum_sizes[t];
+ }
+
+-static inline unsigned long btrfs_leaf_data(struct extent_buffer *l)
++static inline unsigned long btrfs_leaf_data(const struct extent_buffer *l)
+ {
+ return offsetof(struct btrfs_leaf, items);
+ }
diff --git a/patches.suse/sched-core-Kill-sched_class-task_waking-to-clean-up-the-migration-logic.patch b/patches.suse/sched-core-Kill-sched_class-task_waking-to-clean-up-the-migration-logic.patch
index 29db3b31e8..3a7f37f236 100644
--- a/patches.suse/sched-core-Kill-sched_class-task_waking-to-clean-up-the-migration-logic.patch
+++ b/patches.suse/sched-core-Kill-sched_class-task_waking-to-clean-up-the-migration-logic.patch
@@ -33,7 +33,7 @@ Signed-off-by: Mike Galbraith <mgalbraith@suse.de>
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
-@@ -1840,11 +1840,8 @@ ttwu_do_activate(struct rq *rq, struct t
+@@ -1843,11 +1843,8 @@ ttwu_do_activate(struct rq *rq, struct t
if (p->sched_contributes_to_load)
rq->nr_uninterruptible--;
@@ -46,7 +46,7 @@ Signed-off-by: Mike Galbraith <mgalbraith@suse.de>
#endif
ttwu_activate(rq, p, en_flags);
-@@ -2084,10 +2081,6 @@ try_to_wake_up(struct task_struct *p, un
+@@ -2194,10 +2191,6 @@ try_to_wake_up(struct task_struct *p, un
cpu = select_task_rq(p, p->wake_cpu, SD_BALANCE_WAKE, wake_flags);
if (task_cpu(p) != cpu) {
wake_flags |= WF_MIGRATED;
@@ -59,7 +59,7 @@ Signed-off-by: Mike Galbraith <mgalbraith@suse.de>
#endif /* CONFIG_SMP */
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
-@@ -3210,7 +3210,7 @@ static inline void check_schedstat_requi
+@@ -3241,7 +3241,7 @@ static inline void check_schedstat_requi
*
* WAKEUP (remote)
*
@@ -68,7 +68,7 @@ Signed-off-by: Mike Galbraith <mgalbraith@suse.de>
* vruntime -= min_vruntime
*
* enqueue
-@@ -3229,7 +3229,7 @@ enqueue_entity(struct cfs_rq *cfs_rq, st
+@@ -3260,7 +3260,7 @@ enqueue_entity(struct cfs_rq *cfs_rq, st
* Update the normalized vruntime before updating min_vruntime
* through calling update_curr().
*/
@@ -77,7 +77,7 @@ Signed-off-by: Mike Galbraith <mgalbraith@suse.de>
se->vruntime += cfs_rq->min_vruntime;
/*
-@@ -4733,33 +4733,6 @@ static unsigned long cpu_avg_load_per_ta
+@@ -4807,33 +4807,6 @@ static unsigned long cpu_avg_load_per_ta
return 0;
}
@@ -111,7 +111,7 @@ Signed-off-by: Mike Galbraith <mgalbraith@suse.de>
#ifdef CONFIG_FAIR_GROUP_SCHED
/*
* effective_load() calculates the load change as seen from the root_task_group
-@@ -5278,6 +5251,32 @@ select_task_rq_fair(struct task_struct *
+@@ -5361,6 +5334,32 @@ select_task_rq_fair(struct task_struct *
static void migrate_task_rq_fair(struct task_struct *p)
{
/*
@@ -144,7 +144,7 @@ Signed-off-by: Mike Galbraith <mgalbraith@suse.de>
* We are supposed to update the task to "current" time, then its up to date
* and ready to go to new CPU/cfs_rq. But we have difficulty in getting
* what current time is, so simply throw away the out-of-date time. This
-@@ -8575,7 +8574,6 @@ const struct sched_class fair_sched_clas
+@@ -8649,7 +8648,6 @@ const struct sched_class fair_sched_clas
.rq_online = rq_online_fair,
.rq_offline = rq_offline_fair,
@@ -154,7 +154,7 @@ Signed-off-by: Mike Galbraith <mgalbraith@suse.de>
#endif
--- a/kernel/sched/sched.h
+++ b/kernel/sched/sched.h
-@@ -1168,7 +1168,7 @@ extern const u32 sched_prio_to_wmult[40];
+@@ -1167,7 +1167,7 @@ extern const u32 sched_prio_to_wmult[40]
*
* ENQUEUE_HEAD - place at front of runqueue (tail if not specified)
* ENQUEUE_REPLENISH - CBS (replenish runtime and postpone deadline)
@@ -163,7 +163,7 @@ Signed-off-by: Mike Galbraith <mgalbraith@suse.de>
*
*/
-@@ -1141,9 +1141,9 @@ extern const u32 sched_prio_to_wmult[40]
+@@ -1182,9 +1182,9 @@ extern const u32 sched_prio_to_wmult[40]
#define ENQUEUE_HEAD 0x08
#define ENQUEUE_REPLENISH 0x10
#ifdef CONFIG_SMP
@@ -175,7 +175,7 @@ Signed-off-by: Mike Galbraith <mgalbraith@suse.de>
#endif
#define RETRY_TASK ((void *)-1UL)
-@@ -1179,7 +1179,6 @@ struct sched_class {
+@@ -1215,7 +1215,6 @@ struct sched_class {
int (*select_task_rq)(struct task_struct *p, int task_cpu, int sd_flag, int flags);
void (*migrate_task_rq)(struct task_struct *p);
diff --git a/series.conf b/series.conf
index 94a4f1d051..6f2e723937 100644
--- a/series.conf
+++ b/series.conf
@@ -5251,6 +5251,58 @@
patches.kernel.org/4.4.170-084-intel_th-msu-Fix-an-off-by-one-in-attribute-s.patch
patches.kernel.org/4.4.170-085-power-supply-olpc_battery-correct-the-tempera.patch
patches.kernel.org/4.4.170-086-Linux-4.4.170.patch
+ patches.kernel.org/4.4.171-001-ALSA-hda-realtek-Disable-headset-Mic-VREF-for.patch
+ patches.kernel.org/4.4.171-002-btrfs-cleanup-stop-casting-for-extent_map-loo.patch
+ patches.kernel.org/4.4.171-003-btrfs-Enhance-chunk-validation-check.patch
+ patches.kernel.org/4.4.171-004-Btrfs-add-validadtion-checks-for-chunk-loadin.patch
+ patches.kernel.org/4.4.171-005-Btrfs-check-inconsistence-between-chunk-and-b.patch
+ patches.kernel.org/4.4.171-006-Btrfs-fix-em-leak-in-find_first_block_group.patch
+ patches.kernel.org/4.4.171-007-Btrfs-detect-corruption-when-non-root-leaf-ha.patch
+ patches.kernel.org/4.4.171-008-Btrfs-check-btree-node-s-nritems.patch
+ patches.kernel.org/4.4.171-009-Btrfs-fix-BUG_ON-in-btrfs_mark_buffer_dirty.patch
+ patches.kernel.org/4.4.171-010-Btrfs-memset-to-avoid-stale-content-in-btree-.patch
+ patches.kernel.org/4.4.171-011-Btrfs-improve-check_node-to-avoid-reading-cor.patch
+ patches.kernel.org/4.4.171-012-Btrfs-kill-BUG_ON-in-run_delayed_tree_ref.patch
+ patches.kernel.org/4.4.171-013-Btrfs-memset-to-avoid-stale-content-in-btree-.patch
+ patches.kernel.org/4.4.171-014-Btrfs-fix-emptiness-check-for-dirtied-extent-.patch
+ patches.kernel.org/4.4.171-015-btrfs-struct-funcs-constify-readers.patch
+ patches.kernel.org/4.4.171-016-btrfs-Refactor-check_leaf-function-for-later-.patch
+ patches.kernel.org/4.4.171-017-btrfs-Check-if-item-pointer-overlaps-with-the.patch
+ patches.kernel.org/4.4.171-018-btrfs-Add-sanity-check-for-EXTENT_DATA-when-r.patch
+ patches.kernel.org/4.4.171-019-btrfs-Add-checker-for-EXTENT_CSUM.patch
+ patches.kernel.org/4.4.171-020-btrfs-Move-leaf-and-node-validation-checker-t.patch
+ patches.kernel.org/4.4.171-021-btrfs-tree-checker-Enhance-btrfs_check_node-o.patch
+ patches.kernel.org/4.4.171-022-btrfs-tree-checker-Fix-false-panic-for-sanity.patch
+ patches.kernel.org/4.4.171-023-btrfs-tree-checker-Add-checker-for-dir-item.patch
+ patches.kernel.org/4.4.171-024-btrfs-tree-checker-use-zu-format-string-for-s.patch
+ patches.kernel.org/4.4.171-025-btrfs-tree-check-reduce-stack-consumption-in-.patch
+ patches.kernel.org/4.4.171-026-btrfs-tree-checker-Verify-block_group_item.patch
+ patches.kernel.org/4.4.171-027-btrfs-tree-checker-Detect-invalid-and-empty-e.patch
+ patches.kernel.org/4.4.171-028-btrfs-validate-type-when-reading-a-chunk.patch
+ patches.kernel.org/4.4.171-029-btrfs-Check-that-each-block-group-has-corresp.patch
+ patches.kernel.org/4.4.171-030-btrfs-Verify-that-every-chunk-has-correspondi.patch
+ patches.kernel.org/4.4.171-031-btrfs-tree-checker-Check-level-for-leaves-and.patch
+ patches.kernel.org/4.4.171-032-btrfs-tree-checker-Fix-misleading-group-syste.patch
+ patches.kernel.org/4.4.171-033-CIFS-Do-not-hide-EINTR-after-sending-network-.patch
+ patches.kernel.org/4.4.171-034-cifs-Fix-potential-OOB-access-of-lock-element.patch
+ patches.kernel.org/4.4.171-035-usb-cdc-acm-send-ZLP-for-Telit-3G-Intel-based.patch
+ patches.kernel.org/4.4.171-036-USB-storage-don-t-insert-sane-sense-for-SPC3-.patch
+ patches.kernel.org/4.4.171-037-USB-storage-add-quirk-for-SMI-SM3350.patch
+ patches.kernel.org/4.4.171-038-USB-Add-USB_QUIRK_DELAY_CTRL_MSG-quirk-for-Co.patch
+ patches.kernel.org/4.4.171-039-slab-alien-caches-must-not-be-initialized-if-.patch
+ patches.kernel.org/4.4.171-040-PCI-altera-Fix-altera_pcie_link_is_up.patch
+ patches.kernel.org/4.4.171-041-PCI-altera-Reorder-read-write-functions.patch
+ patches.kernel.org/4.4.171-042-PCI-altera-Check-link-status-before-retrain-l.patch
+ patches.kernel.org/4.4.171-043-PCI-altera-Poll-for-link-up-status-after-retr.patch
+ patches.kernel.org/4.4.171-044-PCI-altera-Poll-for-link-training-status-afte.patch
+ patches.kernel.org/4.4.171-045-PCI-altera-Rework-config-accessors-for-use-wi.patch
+ patches.kernel.org/4.4.171-046-PCI-altera-Move-retrain-from-fixup-to-altera_.patch
+ patches.kernel.org/4.4.171-047-ACPI-power-Skip-duplicate-power-resource-refe.patch
+ patches.kernel.org/4.4.171-048-i2c-dev-prevent-adapter-retries-and-timeout-b.patch
+ patches.kernel.org/4.4.171-049-crypto-cts-fix-crash-on-short-inputs.patch
+ patches.kernel.org/4.4.171-050-ext4-fix-a-potential-fiemap-page-fault-deadlo.patch
+ patches.kernel.org/4.4.171-051-sunrpc-use-after-free-in-svc_process_common.patch
+ patches.kernel.org/4.4.171-052-Linux-4.4.171.patch
########################################################
# Build fixes that apply to the vanilla kernel too.
@@ -7228,12 +7280,10 @@
patches.drivers/ext4-provide-ext4_issue_zeroout.patch
patches.drivers/ext4-implement-allocation-of-pre-zeroed-blocks.patch
patches.drivers/ext4-use-pre-zeroed-blocks-for-dax-page-faults.patch
- patches.suse/btrfs-0045-cleanup-stop-casting-for-extent_map-lookup-eve.patch
patches.suse/btrfs-0047-clean-up-an-error-code-in-btrfs_init_space_inf.patch
patches.suse/btrfs-0048-fix-output-of-compression-message-in-btrfs_par.patch
patches.suse/btrfs-0049-fix-typo-in-log-message-when-starting-a-balanc.patch
patches.suse/btrfs-0050-Enhance-super-validation-check.patch
- patches.suse/btrfs-0051-Enhance-chunk-validation-check.patch
patches.drivers/ALSA-timer-Introduce-disconnect-op-to-snd_timer_inst
patches.drivers/0021-crypto-qat-remove-to-call-get_sram_bar_id-for-qat_c3.patch
patches.drivers/0022-crypto-qat-fix-timeout-issues.patch
@@ -12246,7 +12296,6 @@
patches.suse/btrfs-0324-end-transaction-if-we-abort-when-creating-uuid.patch
patches.suse/btrfs-0325-clear-uptodate-flags-of-pages-in-sys_array-eb.patch
patches.suse/btrfs-0326-add-more-validation-checks-for-superblock.patch
- patches.suse/btrfs-0327-add-validadtion-checks-for-chunk-loading.patch
patches.suse/btrfs-0328-advertise-which-crc32c-implementation-is-being.patch
patches.drivers/0001-drivers-of-Fix-of_pci.h-header-guard.patch
patches.drivers/0032-i2c-octeon-Missing-AAK-flag-in-case-of-I2C_M_RECV_LE.patch
@@ -13905,7 +13954,6 @@
patches.drivers/0166-block-remove-BLK_DEV_DAX-config-option.patch
patches.arch/00-jump_label-remove-bug-h-atomic-h-dependencies-for-have_jump_label.patch
patches.suse/btrfs-0419-add-missing-bytes_readonly-attribute-file-in-s.patch
- patches.suse/btrfs-0420-check-inconsistence-between-chunk-and-block-gr.patch
patches.suse/btrfs-0421-error-out-if-generic_bin_search-get-invalid-ar.patch
patches.suse/btrfs-0422-fix-double-free-of-fs-root.patch
patches.suse/btrfs-0423-fix-read_node_slot-to-return-errors.patch
@@ -14280,9 +14328,6 @@
patches.suse/btrfs-0479-fix-fsfreeze-hang-caused-by-delayed-iputs-deal.patch
patches.suse/btrfs-0480-clarify-do_chunk_alloc-s-return-value.patch
patches.suse/btrfs-0481-do-not-background-blkdev_put.patch
- patches.suse/btrfs-0482-fix-em-leak-in-find_first_block_group.patch
- patches.suse/btrfs-0484-check-btree-node-s-nritems.patch
- patches.suse/btrfs-0485-detect-corruption-when-non-root-leaf-has-zero-.patch
patches.suse/btrfs-0486-fix-lockdep-warning-on-deadlock-against-an-ino.patch
patches.drivers/ALSA-hda-realtek-fix-headset-mic-detection-for-MSI-M
patches.drivers/IB-mlx4-Make-function-use_tunnel_data-return-void.patch
@@ -15914,11 +15959,8 @@
patches.suse/btrfs-0506-add-a-flags-field-to-btrfs_fs_info.patch
patches.suse/btrfs-0507-kill-the-start-argument-to-read_extent_buffer_.patch
patches.suse/btrfs-0508-kill-BUG_ON-s-in-btrfs_mark_extent_written.patch
- patches.suse/btrfs-0509-memset-to-avoid-stale-content-in-btree-node-bl.patch
patches.suse/btrfs-0510-remove-BUG_ON-in-start_transaction.patch
patches.suse/btrfs-0511-add-error-handling-for-extent-buffer-in-print-.patch
- patches.suse/btrfs-0512-improve-check_node-to-avoid-reading-corrupted-.patch
- patches.suse/btrfs-0513-kill-BUG_ON-in-run_delayed_tree_ref.patch
patches.suse/btrfs-0514-clean-the-old-superblocks-before-freeing-the-d.patch
patches.suse/btrfs-0515-unsplit-printed-strings.patch
patches.suse/btrfs-0516-convert-printk-KERN_-to-use-pr_-calls.patch
@@ -15927,7 +15969,6 @@
patches.suse/btrfs-0519-btrfs_debug-should-consume-fs_info-when-DEBUG-.patch
patches.suse/btrfs-0520-fix-a-possible-umount-deadlock.patch
patches.suse/btrfs-0521-parent_start-initialization-cleanup.patch
- patches.suse/btrfs-0522-memset-to-avoid-stale-content-in-btree-leaf.patch
patches.suse/btrfs-0523-fix-btrfs_no_printk-stub-helper.patch
patches.suse/btrfs-0524-remove-unnecessary-btrfs_mark_buffer_dirty-in-.patch
patches.drivers/0178-nvdimm-reduce-duplicated-wpq-flushes.patch
@@ -18004,8 +18045,6 @@
patches.fixes/0001-btrfs-improve-delayed-refs-iterations.patch
patches.suse/btrfs-0649-don-t-WARN-in-btrfs_transaction_abort-for-IO-e.patch
patches.suse/btrfs-0650-fix-relocation-incorrectly-dropping-data-refer.patch
- patches.suse/btrfs-0653-fix-BUG_ON-in-btrfs_mark_buffer_dirty.patch
- patches.suse/btrfs-0654-fix-emptiness-check-for-dirtied-extent-buffers.patch
patches.suse/SES5-0186-libceph-ceph_x_encrypt_buflen-takes-in_len.patch
patches.suse/SES5-0187-libceph-old_key-in-process_one_ticket-is-redundant.patch
patches.suse/SES5-0188-libceph-introduce-ceph_x_encrypt_offset.patch
@@ -22073,7 +22112,6 @@
patches.drivers/0012-bcache-increase-the-number-of-open-buckets.patch
patches.drivers/0013-bcache-silence-static-checker-warning.patch
patches.drivers/0014-bcache-Update-continue_at-documentation.patch
- patches.suse/btrfs-struct-funcs-constify-readers
patches.suse/btrfs-constify-tracepoint-arguments
patches.suse/btrfs-backref-constify-some-arguments
patches.suse/btrfs-backref-add-unode_aux_to_inode_list-helper
@@ -22321,12 +22359,6 @@
patches.fixes/0086-xfs-handle-zero-entries-case-in-xfs_iext_rebalance_l.patch
patches.suse/btrfs-copy-fsid-to-super_block-s_uuid.patch
patches.suse/btrfs-change-how-we-decide-to-commit-transactions-du.patch
- patches.suse/0001-btrfs-Refactor-check_leaf-function-for-later-expansi.patch
- patches.suse/0002-btrfs-Check-if-item-pointer-overlaps-with-the-item-i.patch
- patches.suse/0003-btrfs-Add-sanity-check-for-EXTENT_DATA-when-reading-.patch
- patches.suse/0004-btrfs-Add-checker-for-EXTENT_CSUM.patch
- patches.suse/0005-btrfs-Move-leaf-and-node-validation-checker-to-tree-.patch
- patches.suse/0006-btrfs-tree-checker-Enhance-btrfs_check_node-output.patch
patches.suse/0007-btrfs-tree-checker-Enhance-output-for-btrfs_check_le.patch
patches.suse/0008-btrfs-tree-checker-Enhance-output-for-check_csum_ite.patch
patches.suse/0009-btrfs-tree-checker-Enhance-output-for-check_extent_d.patch
@@ -22571,7 +22603,6 @@
patches.arch/powerpc-bigmem-27-64s-slice-Use-addr-limit-when-computing-slic.patch
patches.drivers/timekeeping-Eliminate-the-stale-declaration-of-ktime.patch
patches.drivers/net-thunderx-Fix-TCP-UDP-checksum-offload-for-IPv6-p.patch
- patches.suse/0011-btrfs-tree-checker-Fix-false-panic-for-sanity-test.patch
patches.fixes/fs-hugetlbfs-inode-c-change-put_page-unlock_page-order-in-hugetlbfs_fallocate.patch
patches.suse/s390-disassembler-correct-disassembly-lines-alignmen.patch
patches.arch/s390-revert-elf_et_dyn_base-base-changes
@@ -22707,8 +22738,6 @@
patches.fixes/0001-CIFS-use-tcon_ipc-instead-of-use_ipc-parameter-of-SM.patch
patches.fixes/0001-CIFS-dump-IPC-tcon-in-debug-proc-file.patch
patches.suse/btrfs-fix-memory-barriers-usage-with-device-stats-counters.patch
- patches.suse/0012-btrfs-tree-checker-Add-checker-for-dir-item.patch
- patches.suse/0013-btrfs-tree-checker-use-zu-format-string-for-size_t.patch
patches.arch/0001-x86-platform-uv-update-uv_mmrs-h-to-prepare-for-uv4a-fixes
patches.arch/0002-x86-platform-uv-fix-uv4a-support-on-new-intel-processors
patches.arch/0003-x86-platform-uv-add-references-to-access-fixed-uv4a-hub-mmrs
@@ -23713,10 +23742,6 @@
patches.arch/s390-mm-correct-allocate_pgste-proc_handler-callback
patches.arch/s390-sles12sp3-20-01-etoken-facility.patch
patches.arch/s390-kdump-fix-elfcorehdr-size-calculation
- patches.suse/0015-btrfs-tree-checker-Verify-block_group_item.patch
- patches.suse/0016-btrfs-tree-checker-Detect-invalid-and-empty-essentia.patch
- patches.suse/0017-btrfs-Check-that-each-block-group-has-corresponding-.patch
- patches.suse/0018-btrfs-Verify-that-every-chunk-has-corresponding-bloc.patch
patches.suse/0019-btrfs-Introduce-mount-time-chunk-dev-extent-mapping-.patch
patches.fixes/smb3-fill-in-statfs-fsid-and-correct-namelen.patch
patches.suse/xfs-fix-a-null-pointer-dereference-in-xfs_bmap_exten.patch
@@ -24045,6 +24070,7 @@
patches.fixes/0001-fbdev-fbmem-behave-better-with-small-rotated-display.patch
patches.fixes/0001-fbdev-fbcon-Fix-unregister-crash-when-more-than-one-.patch
patches.fixes/0001-drm-fb-helper-Ignore-the-value-of-fb_var_screeninfo..patch
+ patches.fixes/0001-omap2fb-Fix-stack-memory-disclosure.patch
########################################################
# end of sorted patches
@@ -24673,7 +24699,6 @@
patches.fixes/nfs-direct-write-fix.patch
patches.kabi/0008-pnfs-set-NFS_IOHDR_REDO-in-pnfs_read_resend_pnfs.patch
patches.kabi/0001-NFS-Ensure-we-commit-after-writeback-is-complete.kabi
- patches.fixes/sunrpc-use-after-free-in-svc_process_common.patch
patches.kabi/sunrpc-use-after-free-in-svc_process_common.patch
########################################################