From: Greg Kroah-Hartman Date: Sun, 3 Apr 2022 12:44:50 +0000 (+0200) Subject: 5.4-stable patches X-Git-Tag: v5.17.2~127 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=d2ee4a435f5f1d4c391337737b1d4d283f210393;p=thirdparty%2Fkernel%2Fstable-queue.git 5.4-stable patches added patches: gfs2-make-sure-fitrim-minlen-is-rounded-up-to-fs-block-size.patch net-hns3-fix-software-vlan-talbe-of-vlan-0-inconsistent-with-hardware.patch rtc-check-if-__rtc_read_time-was-successful.patch --- diff --git a/queue-5.4/gfs2-make-sure-fitrim-minlen-is-rounded-up-to-fs-block-size.patch b/queue-5.4/gfs2-make-sure-fitrim-minlen-is-rounded-up-to-fs-block-size.patch new file mode 100644 index 00000000000..1c6e18764c2 --- /dev/null +++ b/queue-5.4/gfs2-make-sure-fitrim-minlen-is-rounded-up-to-fs-block-size.patch @@ -0,0 +1,42 @@ +From 27ca8273fda398638ca994a207323a85b6d81190 Mon Sep 17 00:00:00 2001 +From: Andrew Price +Date: Tue, 22 Mar 2022 19:05:51 +0000 +Subject: gfs2: Make sure FITRIM minlen is rounded up to fs block size + +From: Andrew Price + +commit 27ca8273fda398638ca994a207323a85b6d81190 upstream. + +Per fstrim(8) we must round up the minlen argument to the fs block size. +The current calculation doesn't take into account devices that have a +discard granularity and requested minlen less than 1 fs block, so the +value can get shifted away to zero in the translation to fs blocks. + +The zero minlen passed to gfs2_rgrp_send_discards() then allows +sb_issue_discard() to be called with nr_sects == 0 which returns -EINVAL +and results in gfs2_rgrp_send_discards() returning -EIO. + +Make sure minlen is never < 1 fs block by taking the max of the +requested minlen and the fs block size before comparing to the device's +discard granularity and shifting to fs blocks. + +Fixes: 076f0faa764ab ("GFS2: Fix FITRIM argument handling") +Signed-off-by: Andrew Price +Signed-off-by: Andreas Gruenbacher +Signed-off-by: Greg Kroah-Hartman +--- + fs/gfs2/rgrp.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +--- a/fs/gfs2/rgrp.c ++++ b/fs/gfs2/rgrp.c +@@ -1429,7 +1429,8 @@ int gfs2_fitrim(struct file *filp, void + + start = r.start >> bs_shift; + end = start + (r.len >> bs_shift); +- minlen = max_t(u64, r.minlen, ++ minlen = max_t(u64, r.minlen, sdp->sd_sb.sb_bsize); ++ minlen = max_t(u64, minlen, + q->limits.discard_granularity) >> bs_shift; + + if (end <= start || minlen > sdp->sd_max_rg_data) diff --git a/queue-5.4/net-hns3-fix-software-vlan-talbe-of-vlan-0-inconsistent-with-hardware.patch b/queue-5.4/net-hns3-fix-software-vlan-talbe-of-vlan-0-inconsistent-with-hardware.patch new file mode 100644 index 00000000000..48705a4e710 --- /dev/null +++ b/queue-5.4/net-hns3-fix-software-vlan-talbe-of-vlan-0-inconsistent-with-hardware.patch @@ -0,0 +1,38 @@ +From 7ed258f12ec5ce855f15cdfb5710361dc82fe899 Mon Sep 17 00:00:00 2001 +From: Guangbin Huang +Date: Wed, 30 Mar 2022 21:45:06 +0800 +Subject: net: hns3: fix software vlan talbe of vlan 0 inconsistent with hardware + +From: Guangbin Huang + +commit 7ed258f12ec5ce855f15cdfb5710361dc82fe899 upstream. + +When user delete vlan 0, as driver will not delete vlan 0 for hardware in +function hclge_set_vlan_filter_hw(), so vlan 0 in software vlan talbe should +not be deleted. + +Fixes: fe4144d47eef ("net: hns3: sync VLAN filter entries when kill VLAN ID failed") +Signed-off-by: Guangbin Huang +Signed-off-by: Paolo Abeni +Signed-off-by: Greg Kroah-Hartman +--- + drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +--- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c ++++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c +@@ -8344,11 +8344,11 @@ int hclge_set_vlan_filter(struct hnae3_h + } + + if (!ret) { +- if (is_kill) +- hclge_rm_vport_vlan_table(vport, vlan_id, false); +- else ++ if (!is_kill) + hclge_add_vport_vlan_table(vport, vlan_id, + writen_to_tbl); ++ else if (is_kill && vlan_id != 0) ++ hclge_rm_vport_vlan_table(vport, vlan_id, false); + } else if (is_kill) { + /* when remove hw vlan filter failed, record the vlan id, + * and try to remove it from hw later, to be consistence diff --git a/queue-5.4/rtc-check-if-__rtc_read_time-was-successful.patch b/queue-5.4/rtc-check-if-__rtc_read_time-was-successful.patch new file mode 100644 index 00000000000..0c8eaea5602 --- /dev/null +++ b/queue-5.4/rtc-check-if-__rtc_read_time-was-successful.patch @@ -0,0 +1,54 @@ +From 915593a7a663b2ad08b895a5f3ba8b19d89d4ebf Mon Sep 17 00:00:00 2001 +From: Tom Rix +Date: Sat, 26 Mar 2022 12:42:36 -0700 +Subject: rtc: check if __rtc_read_time was successful + +From: Tom Rix + +commit 915593a7a663b2ad08b895a5f3ba8b19d89d4ebf upstream. + +Clang static analysis reports this issue +interface.c:810:8: warning: Passed-by-value struct + argument contains uninitialized data + now = rtc_tm_to_ktime(tm); + ^~~~~~~~~~~~~~~~~~~ + +tm is set by a successful call to __rtc_read_time() +but its return status is not checked. Check if +it was successful before setting the enabled flag. +Move the decl of err to function scope. + +Fixes: 2b2f5ff00f63 ("rtc: interface: ignore expired timers when enqueuing new timers") +Signed-off-by: Tom Rix +Signed-off-by: Alexandre Belloni +Link: https://lore.kernel.org/r/20220326194236.2916310-1-trix@redhat.com +Signed-off-by: Greg Kroah-Hartman +--- + drivers/rtc/interface.c | 7 +++++-- + 1 file changed, 5 insertions(+), 2 deletions(-) + +--- a/drivers/rtc/interface.c ++++ b/drivers/rtc/interface.c +@@ -793,9 +793,13 @@ static int rtc_timer_enqueue(struct rtc_ + struct timerqueue_node *next = timerqueue_getnext(&rtc->timerqueue); + struct rtc_time tm; + ktime_t now; ++ int err; ++ ++ err = __rtc_read_time(rtc, &tm); ++ if (err) ++ return err; + + timer->enabled = 1; +- __rtc_read_time(rtc, &tm); + now = rtc_tm_to_ktime(tm); + + /* Skip over expired timers */ +@@ -809,7 +813,6 @@ static int rtc_timer_enqueue(struct rtc_ + trace_rtc_timer_enqueue(timer); + if (!next || ktime_before(timer->node.expires, next->expires)) { + struct rtc_wkalrm alarm; +- int err; + + alarm.time = rtc_ktime_to_tm(timer->node.expires); + alarm.enabled = 1; diff --git a/queue-5.4/series b/queue-5.4/series index d08c5546710..18d5b1a4890 100644 --- a/queue-5.4/series +++ b/queue-5.4/series @@ -341,3 +341,6 @@ xarray-fix-xas_create_range-when-multi-order-entry-present.patch can-mcba_usb-mcba_usb_start_xmit-fix-double-dev_kfree_skb-in-error-path.patch can-mcba_usb-properly-check-endpoint-type.patch xarray-update-the-lru-list-in-xas_split.patch +rtc-check-if-__rtc_read_time-was-successful.patch +gfs2-make-sure-fitrim-minlen-is-rounded-up-to-fs-block-size.patch +net-hns3-fix-software-vlan-talbe-of-vlan-0-inconsistent-with-hardware.patch