5.8.3-rc1 review
Subsystems (6)
Greg Kroah-Hartman
maintainerPATCH 122/232 RDMA/ipoib: Fix ABBA deadlock with ipoib_reap_ah()
In reply to Greg Kroah-HartmanFrom: Jason Gunthorpe <[email protected]>
[ Upstream commit 65936bf25f90fe440bb2d11624c7d10fab266639 ]
ipoib_mcast_carrier_on_task() insanely open codes a rtnl_lock() such that the only time flush_workqueue() can be called is if it also clears IPOIB_FLAG_OPER_UP.
Thus the flush inside ipoib_flush_ah() will deadlock if it gets unlucky enough, and lockdep doesn't help us to find it early:
CPU0 CPU1 CPU2
__ipoib_ib_dev_flush()
down_read(vlan_rwsem)
ipoib_vlan_add()
rtnl_trylock()
down_write(vlan_rwsem)
ipoib_mcast_carrier_on_task()
while (!rtnl_trylock())
msleep(20);
ipoib_flush_ah()
flush_workqueue(priv->wq)Clean up the ah_reaper related functions and lifecycle to make sense:
- Start/Stop of the reaper should only be done in open/stop NDOs, not in any other places
- cancel and flush of the reaper should only happen in the stop NDO. cancel is only functional when combined with IPOIB_STOP_REAPER.
- Non-stop places were flushing the AH's just need to flush out dead AH's synchronously and ignore the background task completely. It is fully locked and harmless to leave running.
Which ultimately fixes the ABBA deadlock by removing the unnecessary flush_workqueue() from the problematic place under the vlan_rwsem.
--- drivers/infiniband/ulp/ipoib/ipoib_ib.c | 65 ++++++++++------------- drivers/infiniband/ulp/ipoib/ipoib_main.c | 2 + 2 files changed, 31 insertions(+), 36 deletions(-)
drivers/infiniband/ulp/ipoib/ipoib_ib.c +29 -36
@@ -670,13 +670,12 @@ int ipoib_send(struct net_device *dev, struct sk_buff *skb,return rc; } -static void __ipoib_reap_ah (struct net_device *dev) +static void ipoib_reap_dead_ahs (struct ipoib_dev_priv *priv) { -struct ipoib_dev_priv *priv =ipoib_priv (dev);struct ipoib_ah *ah, *tah;unsigned long flags; -netif_tx_lock_bh (dev); +netif_tx_lock_bh (priv->dev);spin_lock_irqsave (&priv->lock, flags);list_for_each_entry_safe (ah, tah, &priv->dead_ahs, list)
@@ -687,37 +686,37 @@ static void __ipoib_reap_ah(struct net_device *dev) }spin_unlock_irqrestore (&priv->lock, flags); -netif_tx_unlock_bh (dev); +netif_tx_unlock_bh (priv->dev); }void ipoib_reap_ah (struct work_struct *work) {struct ipoib_dev_priv *priv = container_of(work, struct ipoib_dev_priv, ah_reap_task.work); -struct net_device *dev = priv->dev; -__ipoib_reap_ah (dev); +ipoib_reap_dead_ahs (priv);if (!test_bit (IPOIB_STOP_REAPER , &priv->flags))queue_delayed_work (priv->wq, &priv->ah_reap_task,round_jiffies_relative (HZ )); } -static void ipoib_flush_ah (struct net_device *dev) +static void ipoib_start_ah_reaper (struct ipoib_dev_priv *priv) { -struct ipoib_dev_priv *priv =ipoib_priv (dev); - -cancel_delayed_work (&priv->ah_reap_task); -flush_workqueue (priv->wq); -ipoib_reap_ah (&priv->ah_reap_task.work); +clear_bit (IPOIB_STOP_REAPER , &priv->flags); +queue_delayed_work (priv->wq, &priv->ah_reap_task, +round_jiffies_relative (HZ )); } -static void ipoib_stop_ah (struct net_device *dev) +static void ipoib_stop_ah_reaper (struct ipoib_dev_priv *priv) { -struct ipoib_dev_priv *priv =ipoib_priv (dev); -set_bit (IPOIB_STOP_REAPER , &priv->flags); -ipoib_flush_ah (dev); +cancel_delayed_work (&priv->ah_reap_task); +/* +* After ipoib_stop_ah_reaper() we always go through +* ipoib_reap_dead_ahs() which ensures the work is really stopped and +* does a final flush out of the dead_ah's list +*/ }static int recvs_pending (struct net_device *dev)
@@ -846,16 +845,6 @@ int ipoib_ib_dev_stop_default(struct net_device *dev)return 0 ; } -void ipoib_ib_dev_stop (struct net_device *dev) -{ -struct ipoib_dev_priv *priv =ipoib_priv (dev); - - priv->rn_ops->ndo_stop (dev); - -clear_bit (IPOIB_FLAG_INITIALIZED , &priv->flags); -ipoib_flush_ah (dev); -} -int ipoib_ib_dev_open_default (struct net_device *dev) {struct ipoib_dev_priv *priv =ipoib_priv (dev);
@@ -899,10 +888,7 @@ int ipoib_ib_dev_open(struct net_device *dev)return -1 ; } -clear_bit (IPOIB_STOP_REAPER , &priv->flags); -queue_delayed_work (priv->wq, &priv->ah_reap_task, -round_jiffies_relative (HZ )); - +ipoib_start_ah_reaper (priv);if (priv->rn_ops->ndo_open (dev)) {pr_warn ("%s: Failed to open dev\n" , dev->name); goto dev_stop;
@@ -913,13 +899,20 @@ int ipoib_ib_dev_open(struct net_device *dev)return 0 ; dev_stop: -set_bit (IPOIB_STOP_REAPER , &priv->flags); -cancel_delayed_work (&priv->ah_reap_task); -set_bit (IPOIB_FLAG_INITIALIZED , &priv->flags); -ipoib_ib_dev_stop (dev); +ipoib_stop_ah_reaper (priv);return -1 ; } +void ipoib_ib_dev_stop (struct net_device *dev) +{ +struct ipoib_dev_priv *priv =ipoib_priv (dev); + + priv->rn_ops->ndo_stop (dev); + +clear_bit (IPOIB_FLAG_INITIALIZED , &priv->flags); +ipoib_stop_ah_reaper (priv); +} +void ipoib_pkey_dev_check_presence (struct net_device *dev) {struct ipoib_dev_priv *priv =ipoib_priv (dev);
@@ -1230,7 +1223,7 @@ static void __ipoib_ib_dev_flush(struct ipoib_dev_priv *priv,ipoib_mcast_dev_flush (dev);if (oper_up)set_bit (IPOIB_FLAG_OPER_UP , &priv->flags); -ipoib_flush_ah (dev); +ipoib_reap_dead_ahs (priv); }if (level >=IPOIB_FLUSH_NORMAL )
@@ -1305,7 +1298,7 @@ void ipoib_ib_dev_cleanup(struct net_device *dev)* the neighbor garbage collection is stopped and reaped. * That should all be done now, so make a final ah flush. */ -ipoib_stop_ah (dev); +ipoib_reap_dead_ahs (priv);clear_bit (IPOIB_PKEY_ASSIGNED , &priv->flags);
drivers/infiniband/ulp/ipoib/ipoib_main.c +2 -0
@@ -1976,6 +1976,8 @@ static void ipoib_ndo_uninit(struct net_device *dev)/* no more works over the priv->wq */ if (priv->wq) { +/* See ipoib_mcast_carrier_on_task() */ +WARN_ON (test_bit (IPOIB_FLAG_OPER_UP , &priv->flags));flush_workqueue (priv->wq);destroy_workqueue (priv->wq); priv->wq =NULL ;
Signature · 1 line
2.25.1
Greg Kroah-Hartman
maintainerPATCH 98/232 dm ebs: Fix incorrect checking for REQ_OP_FLUSH
In reply to Greg Kroah-HartmanFrom: John Dorminy <[email protected]>
commit 4cb6f22612511ff2aba4c33fb0f281cae7c23772 upstream.
REQ_OP_FLUSH was being treated as a flag, but the operation part of bio->bi_opf must be treated as a whole. Change to accessing the operation part via bio_op(bio) and checking for equality.
--- drivers/md/dm-ebs-target.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/md/dm-ebs-target.c +1 -1
@@ -363,7 +363,7 @@ static int ebs_map(struct dm_target *ti,bio_set_dev (bio, ec->dev->bdev); bio->bi_iter.bi_sector = ec->start +dm_target_offset (ti, bio->bi_iter.bi_sector); -if (unlikely (bio->bi_opf &REQ_OP_FLUSH )) +if (unlikely (bio_op (bio) ==REQ_OP_FLUSH ))return DM_MAPIO_REMAPPED ;/* * Only queue for bufio processing in case of partial or overlapping buffers
Greg Kroah-Hartman
maintainerPATCH 151/232 clk: actions: Fix h_clk for Actions S500 SoC
In reply to Greg Kroah-HartmanFrom: Cristian Ciocaltea <[email protected]>
[ Upstream commit f47ee279d25fb0e010cae5d6e758e39b40eb6378 ]
The h_clk clock in the Actions Semi S500 SoC clock driver has an invalid parent. Replace with the correct one.
--- drivers/clk/actions/owl-s500.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/clk/actions/owl-s500.c +1 -1
@@ -183,7 +183,7 @@ static OWL_GATE(timer_clk, "timer_clk", "hosc", CMU_DEVCLKEN1, 27, 0, 0); static OWL_GATE(hdmi_clk, "hdmi_clk", "hosc", CMU_DEVCLKEN1, 3, 0, 0);/* divider clocks */ -static OWL_DIVIDER(h_clk, "h_clk", "ahbprevdiv_clk", CMU_BUSCLK1, 12, 2, NULL, 0, 0); +static OWL_DIVIDER(h_clk, "h_clk", "ahbprediv_clk", CMU_BUSCLK1, 12, 2, NULL, 0, 0); static OWL_DIVIDER(rmii_ref_clk, "rmii_ref_clk", "ethernet_pll_clk", CMU_ETHERNETPLL, 1, 1, rmii_ref_div_table, 0, 0);/* factor clocks */
Signature · 1 line
2.25.1
Greg Kroah-Hartman
maintainerPATCH 99/232 dm: dont call report zones for more than the user requested
In reply to Greg Kroah-HartmanFrom: Johannes Thumshirn <[email protected]>
commit a9cb9f4148ef6bb8fabbdaa85c42b2171fbd5a0d upstream.
Don't call report zones for more zones than the user actually requested, otherwise this can lead to out-of-bounds accesses in the callback functions.
Such a situation can happen if the target's ->report_zones() callback function returns 0 because we've reached the end of the target and then restart the report zones on the second target.
We're again calling into ->report_zones() and ultimately into the user supplied callback function but when we're not subtracting the number of zones already processed this may lead to out-of-bounds accesses in the user callbacks.
--- drivers/md/dm.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/md/dm.c +2 -1
@@ -504,7 +504,8 @@ static int dm_blk_report_zones(struct ge } args.tgt = tgt; - ret = tgt->type->report_zones (tgt, &args, nr_zones); + ret = tgt->type->report_zones (tgt, &args, + nr_zones - args.zone_idx);if (ret <0 ) goto out; } while (args.zone_idx < nr_zones &&
Greg Kroah-Hartman
maintainerPATCH 124/232 media: staging: rkisp1: remove macro RKISP1_DIR_SINK_SRC
In reply to Greg Kroah-HartmanFrom: Dafna Hirschfeld <[email protected]>
[ Upstream commit b861d139a36a4593498932bfec957bdcc7d98eb3 ]
The macro RKISP1_DIR_SINK_SRC is a mask of two flags.
The macro hides the fact that it's a mask and the code
is actually more clear if we replace it the with bitwise-or explicitly.
--- drivers/staging/media/rkisp1/rkisp1-isp.c | 25 +++++++++++------------ 1 file changed, 12 insertions(+), 13 deletions(-)
drivers/staging/media/rkisp1/rkisp1-isp.c +12 -13
@@ -25,7 +25,6 @@#define RKISP1_DIR_SRC BIT(0)#define RKISP1_DIR_SINK BIT(1) -#define RKISP1_DIR_SINK_SRC (RKISP1_DIR_SINK | RKISP1_DIR_SRC)/* * NOTE: MIPI controller and input MUX are also configured in this file.
@@ -69,84 +68,84 @@ static const struct rkisp1_isp_mbus_info rkisp1_isp_formats[] = { .mipi_dt = RKISP1_CIF_CSI2_DT_RAW10, .bayer_pat = RKISP1_RAW_RGGB, .bus_width = 10, - .direction = RKISP1_DIR_SINK_SRC, + .direction = RKISP1_DIR_SINK | RKISP1_DIR_SRC, }, { .mbus_code = MEDIA_BUS_FMT_SBGGR10_1X10, .pixel_enc = V4L2_PIXEL_ENC_BAYER, .mipi_dt = RKISP1_CIF_CSI2_DT_RAW10, .bayer_pat = RKISP1_RAW_BGGR, .bus_width = 10, - .direction = RKISP1_DIR_SINK_SRC, + .direction = RKISP1_DIR_SINK | RKISP1_DIR_SRC, }, { .mbus_code = MEDIA_BUS_FMT_SGBRG10_1X10, .pixel_enc = V4L2_PIXEL_ENC_BAYER, .mipi_dt = RKISP1_CIF_CSI2_DT_RAW10, .bayer_pat = RKISP1_RAW_GBRG, .bus_width = 10, - .direction = RKISP1_DIR_SINK_SRC, + .direction = RKISP1_DIR_SINK | RKISP1_DIR_SRC, }, { .mbus_code = MEDIA_BUS_FMT_SGRBG10_1X10, .pixel_enc = V4L2_PIXEL_ENC_BAYER, .mipi_dt = RKISP1_CIF_CSI2_DT_RAW10, .bayer_pat = RKISP1_RAW_GRBG, .bus_width = 10, - .direction = RKISP1_DIR_SINK_SRC, + .direction = RKISP1_DIR_SINK | RKISP1_DIR_SRC, }, { .mbus_code = MEDIA_BUS_FMT_SRGGB12_1X12, .pixel_enc = V4L2_PIXEL_ENC_BAYER, .mipi_dt = RKISP1_CIF_CSI2_DT_RAW12, .bayer_pat = RKISP1_RAW_RGGB, .bus_width = 12, - .direction = RKISP1_DIR_SINK_SRC, + .direction = RKISP1_DIR_SINK | RKISP1_DIR_SRC, }, { .mbus_code = MEDIA_BUS_FMT_SBGGR12_1X12, .pixel_enc = V4L2_PIXEL_ENC_BAYER, .mipi_dt = RKISP1_CIF_CSI2_DT_RAW12, .bayer_pat = RKISP1_RAW_BGGR, .bus_width = 12, - .direction = RKISP1_DIR_SINK_SRC, + .direction = RKISP1_DIR_SINK | RKISP1_DIR_SRC, }, { .mbus_code = MEDIA_BUS_FMT_SGBRG12_1X12, .pixel_enc = V4L2_PIXEL_ENC_BAYER, .mipi_dt = RKISP1_CIF_CSI2_DT_RAW12, .bayer_pat = RKISP1_RAW_GBRG, .bus_width = 12, - .direction = RKISP1_DIR_SINK_SRC, + .direction = RKISP1_DIR_SINK | RKISP1_DIR_SRC, }, { .mbus_code = MEDIA_BUS_FMT_SGRBG12_1X12, .pixel_enc = V4L2_PIXEL_ENC_BAYER, .mipi_dt = RKISP1_CIF_CSI2_DT_RAW12, .bayer_pat = RKISP1_RAW_GRBG, .bus_width = 12, - .direction = RKISP1_DIR_SINK_SRC, + .direction = RKISP1_DIR_SINK | RKISP1_DIR_SRC, }, { .mbus_code = MEDIA_BUS_FMT_SRGGB8_1X8, .pixel_enc = V4L2_PIXEL_ENC_BAYER, .mipi_dt = RKISP1_CIF_CSI2_DT_RAW8, .bayer_pat = RKISP1_RAW_RGGB, .bus_width = 8, - .direction = RKISP1_DIR_SINK_SRC, + .direction = RKISP1_DIR_SINK | RKISP1_DIR_SRC, }, { .mbus_code = MEDIA_BUS_FMT_SBGGR8_1X8, .pixel_enc = V4L2_PIXEL_ENC_BAYER, .mipi_dt = RKISP1_CIF_CSI2_DT_RAW8, .bayer_pat = RKISP1_RAW_BGGR, .bus_width = 8, - .direction = RKISP1_DIR_SINK_SRC, + .direction = RKISP1_DIR_SINK | RKISP1_DIR_SRC, }, { .mbus_code = MEDIA_BUS_FMT_SGBRG8_1X8, .pixel_enc = V4L2_PIXEL_ENC_BAYER, .mipi_dt = RKISP1_CIF_CSI2_DT_RAW8, .bayer_pat = RKISP1_RAW_GBRG, .bus_width = 8, - .direction = RKISP1_DIR_SINK_SRC, + .direction = RKISP1_DIR_SINK | RKISP1_DIR_SRC, }, { .mbus_code = MEDIA_BUS_FMT_SGRBG8_1X8, .pixel_enc = V4L2_PIXEL_ENC_BAYER, .mipi_dt = RKISP1_CIF_CSI2_DT_RAW8, .bayer_pat = RKISP1_RAW_GRBG, .bus_width = 8, - .direction = RKISP1_DIR_SINK_SRC, + .direction = RKISP1_DIR_SINK | RKISP1_DIR_SRC, }, { .mbus_code = MEDIA_BUS_FMT_YUYV8_1X16, .pixel_enc = V4L2_PIXEL_ENC_YUV,
Signature · 1 line
2.25.1
Greg Kroah-Hartman
maintainerPATCH 133/232 selftests/bpf: test_progs use another shell exit on non-actions
In reply to Greg Kroah-HartmanFrom: Jesper Dangaard Brouer <[email protected]>
[ Upstream commit 3220fb667842a9725cbb71656f406eadb03c094b ]
This is a follow up adjustment to commit 6c92bd5cd465 ("selftests/bpf:Test_progs indicate to shell on non-actions"), that returns shell exit indication EXIT_FAILURE (value 1) when user selects a non-existing test.
The problem with using EXIT_FAILURE is that a shell script cannot tell the difference between a non-existing test and the test failing.
This patch uses value 2 as shell exit indication. (Aside note unrecognized option parameters use value 64).
--- tools/testing/selftests/bpf/test_progs.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
tools/testing/selftests/bpf/test_progs.c +3 -1
@@ -12,6 +12,8 @@#include <string.h> #include <execinfo.h> /* backtrace */ +#define EXIT_NO_TEST 2 +/* defined in test_progs.h */ struct test_env env = {};
@@ -707,7 +709,7 @@ int main(int argc, char **argv)close (env.saved_netns_fd);if (env.succ_cnt + env.fail_cnt + env.skip_cnt ==0 ) -return EXIT_FAILURE ; +return EXIT_NO_TEST ;return env.fail_cnt ?EXIT_FAILURE :EXIT_SUCCESS ; }
Signature · 1 line
2.25.1
Greg Kroah-Hartman
maintainerPATCH 141/232 RDMA/counter: Allow manually bind QPs with different pids to same counter
In reply to Greg Kroah-HartmanFrom: Mark Zhang <[email protected]>
[ Upstream commit cbeb7d896c0f296451ffa7b67e7706786b8364c8 ]
In manual mode allow bind user QPs with different pids to same counter, since this is allowed in auto mode.
Bind kernel QPs and user QPs to the same counter are not allowed.
--- drivers/infiniband/core/counters.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/infiniband/core/counters.c +1 -1
@@ -483,7 +483,7 @@ int rdma_counter_bind_qpn(struct ib_device *dev, u8 port, goto err; } -if (counter->res.task != qp->res.task) { +if (rdma_is_kernel_res (&counter->res) !=rdma_is_kernel_res (&qp->res)) { ret = -EINVAL ; goto err_task; }
Signature · 1 line
2.25.1
Greg Kroah-Hartman
maintainerPATCH 142/232 mmc: renesas_sdhi_internal_dmac: clean up the code for dma complete
In reply to Greg Kroah-HartmanFrom: Yoshihiro Shimoda <[email protected]>
[ Upstream commit 2b26e34e9af3fa24fa1266e9ea2d66a1f7d62dc0 ]
To add end() operation in the future, clean the code of renesas_sdhi_internal_dmac_complete_tasklet_fn(). No behavior change.
--- drivers/mmc/host/renesas_sdhi_internal_dmac.c | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-)
drivers/mmc/host/renesas_sdhi_internal_dmac.c +13 -5
@@ -229,15 +229,12 @@ static void renesas_sdhi_internal_dmac_issue_tasklet_fn(unsigned long arg) DTRAN_CTRL_DM_START); } -static void renesas_sdhi_internal_dmac_complete_tasklet_fn (unsigned long arg) +static bool renesas_sdhi_internal_dmac_complete (struct tmio_mmc_host *host) { -struct tmio_mmc_host *host = (struct tmio_mmc_host *)arg;enum dma_data_direction dir; -spin_lock_irq (&host->lock); -if (!host->data) - goto out; +return false;if (host->data->flags &MMC_DATA_READ ) dir =DMA_FROM_DEVICE ;
@@ -250,6 +247,17 @@ static void renesas_sdhi_internal_dmac_complete_tasklet_fn(unsigned long arg)if (dir ==DMA_FROM_DEVICE )clear_bit (SDHI_INTERNAL_DMAC_RX_IN_USE , &global_flags); +return true; +} + +static void renesas_sdhi_internal_dmac_complete_tasklet_fn (unsigned long arg) +{ +struct tmio_mmc_host *host = (struct tmio_mmc_host *)arg; + +spin_lock_irq (&host->lock); +if (!renesas_sdhi_internal_dmac_complete (host)) + goto out; +tmio_mmc_do_data_irq (host); out:spin_unlock_irq (&host->lock);
Signature · 1 line
2.25.1
Greg Kroah-Hartman
maintainerPATCH 145/232 crypto: caam - Remove broken arc4 support
In reply to Greg Kroah-HartmanFrom: Herbert Xu <[email protected]>
[ Upstream commit eeedb618378f8a09779546a3eeac16b000447d62 ]
The arc4 algorithm requires storing state in the request context in order to allow more than one encrypt/decrypt operation. As this driver does not seem to do that, it means that using it for more than one operation is broken.
--- drivers/crypto/caam/caamalg.c | 29 ----------------------------- drivers/crypto/caam/compat.h | 1 - 2 files changed, 30 deletions(-)
drivers/crypto/caam/caamalg.c +0 -29
@@ -810,12 +810,6 @@ static int ctr_skcipher_setkey(struct crypto_skcipher *skcipher,return skcipher_setkey (skcipher, key, keylen, ctx1_iv_off); } -static int arc4_skcipher_setkey (struct crypto_skcipher *skcipher, -const u8 *key,unsigned int keylen) -{ -return skcipher_setkey (skcipher, key, keylen,0 ); -} -static int des_skcipher_setkey (struct crypto_skcipher *skcipher,const u8 *key,unsigned int keylen) {
@@ -1967,21 +1961,6 @@ static struct caam_skcipher_alg driver_algs[] = { }, .caam.class1_alg_type = OP_ALG_ALGSEL_3DES | OP_ALG_AAI_ECB, }, - { - .skcipher = { - .base = { - .cra_name = "ecb(arc4)", - .cra_driver_name = "ecb-arc4-caam", - .cra_blocksize = ARC4_BLOCK_SIZE, - }, - .setkey = arc4_skcipher_setkey, - .encrypt = skcipher_encrypt, - .decrypt = skcipher_decrypt, - .min_keysize = ARC4_MIN_KEY_SIZE, - .max_keysize = ARC4_MAX_KEY_SIZE, - }, - .caam.class1_alg_type = OP_ALG_ALGSEL_ARC4 | OP_ALG_AAI_ECB, - }, }; static struct caam_aead_alg driver_aeads[] = {
@@ -3457,7 +3436,6 @@ int caam_algapi_init(struct device *ctrldev)struct caam_drv_private *priv =dev_get_drvdata (ctrldev);int i =0 , err =0 ;u32 aes_vid, aes_inst, des_inst, md_vid, md_inst, ccha_inst, ptha_inst; -u32 arc4_inst;unsigned int md_limit =SHA512_DIGEST_SIZE ;bool registered = false, gcm_support;
@@ -3477,8 +3455,6 @@ int caam_algapi_init(struct device *ctrldev)CHA_ID_LS_DES_SHIFT ; aes_inst = cha_inst &CHA_ID_LS_AES_MASK ; md_inst = (cha_inst &CHA_ID_LS_MD_MASK ) >>CHA_ID_LS_MD_SHIFT ; - arc4_inst = (cha_inst &CHA_ID_LS_ARC4_MASK ) >> -CHA_ID_LS_ARC4_SHIFT ; ccha_inst =0 ; ptha_inst =0 ;
@@ -3499,7 +3475,6 @@ int caam_algapi_init(struct device *ctrldev) md_inst = mdha &CHA_VER_NUM_MASK ; ccha_inst =rd_reg32 (&priv->ctrl->vreg.ccha) &CHA_VER_NUM_MASK ; ptha_inst =rd_reg32 (&priv->ctrl->vreg.ptha) &CHA_VER_NUM_MASK ; - arc4_inst =rd_reg32 (&priv->ctrl->vreg.afha) &CHA_VER_NUM_MASK ; gcm_support = aesa &CHA_VER_MISC_AES_GCM ; }
@@ -3522,10 +3497,6 @@ int caam_algapi_init(struct device *ctrldev)if (!aes_inst && (alg_sel ==OP_ALG_ALGSEL_AES ))continue ; -/* Skip ARC4 algorithms if not supported by device */ -if (!arc4_inst && alg_sel ==OP_ALG_ALGSEL_ARC4 ) -continue ; -/* * Check support for AES modes not available * on LP devices.
drivers/crypto/caam/compat.h +0 -1
@@ -43,7 +43,6 @@#include <crypto/akcipher.h> #include <crypto/scatterwalk.h> #include <crypto/skcipher.h> -#include <crypto/arc4.h> #include <crypto/internal/skcipher.h> #include <crypto/internal/hash.h> #include <crypto/internal/rsa.h>
Signature · 1 line
2.25.1
Greg Kroah-Hartman
maintainerPATCH 149/232 ima: Fail rule parsing when appraise_flag=blacklist is unsupportable
In reply to Greg Kroah-HartmanFrom: Tyler Hicks <[email protected]>
[ Upstream commit 5f3e92657bbfb63ad3109433d843c89996114b03 ]
Verifying that a file hash is not blacklisted is currently only supported for files with appended signatures (modsig). In the future, this might change.
For now, the "appraise_flag" option is only appropriate for appraise actions and its "blacklist" value is only appropriate when CONFIG_IMA_APPRAISE_MODSIG is enabled and "appraise_flag=blacklist" is only appropriate when "appraise_type=imasig|modsig" is also present. Make this clear at policy load so that IMA policy authors don't assume that other uses of "appraise_flag=blacklist" are supported.
--- security/integrity/ima/ima_policy.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-)
security/integrity/ima/ima_policy.c +14 -1
@@ -1035,6 +1035,11 @@ static bool ima_validate_rule(struct ima_rule_entry *entry)return false; } +/* Ensure that combinations of flags are compatible with each other */ +if (entry->flags &IMA_CHECK_BLACKLIST && + !(entry->flags &IMA_MODSIG_ALLOWED )) +return false; +return true; }
@@ -1371,9 +1376,17 @@ static int ima_parse_rule(char *rule, struct ima_rule_entry *entry) result = -EINVAL ;break ;case Opt_appraise_flag: +if (entry->action !=APPRAISE ) { + result = -EINVAL ; +break ; + } +ima_log_string (ab,"appraise_flag" , args[0 ].from); -if (strstr (args[0 ].from,"blacklist" )) +if (IS_ENABLED (CONFIG_IMA_APPRAISE_MODSIG ) && +strstr (args[0 ].from,"blacklist" )) entry->flags |=IMA_CHECK_BLACKLIST ; +else + result = -EINVAL ;break ;case Opt_permit_directio: entry->flags |=IMA_PERMIT_DIRECTIO ;
Signature · 1 line
2.25.1
Greg Kroah-Hartman
maintainerPATCH 90/232 tracing/hwlat: Honor the tracing_cpumask
In reply to Greg Kroah-HartmanFrom: Kevin Hao <[email protected]>
commit 96b4833b6827a62c295b149213c68b559514c929 upstream.
In calculation of the cpu mask for the hwlat kernel thread, the wrong cpu mask is used instead of the tracing_cpumask, this causes the tracing/tracing_cpumask useless for hwlat tracer. Fixes it.
--- kernel/trace/trace_hwlat.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
kernel/trace/trace_hwlat.c +3 -2
@@ -283,6 +283,7 @@ static bool disable_migrate;static void move_to_next_cpu (void ) {struct cpumask *current_mask = &save_cpumask; +struct trace_array *tr = hwlat_trace;int next_cpu;if (disable_migrate)
@@ -296,7 +297,7 @@ static void move_to_next_cpu(void) goto disable;get_online_cpus (); -cpumask_and (current_mask, cpu_online_mask, tracing_buffer_mask); +cpumask_and (current_mask, cpu_online_mask, tr->tracing_cpumask); next_cpu =cpumask_next (smp_processor_id (), current_mask);put_online_cpus ();
@@ -373,7 +374,7 @@ static int start_kthread(struct trace_ar/* Just pick the first CPU on first iteration */ current_mask = &save_cpumask;get_online_cpus (); -cpumask_and (current_mask, cpu_online_mask, tracing_buffer_mask); +cpumask_and (current_mask, cpu_online_mask, tr->tracing_cpumask);put_online_cpus (); next_cpu =cpumask_first (current_mask);
Greg Kroah-Hartman
maintainerPATCH 126/232 media: staging: rkisp1: rsz: set default format if the given format is not RKISP1_ISP_SD_SRC
In reply to Greg Kroah-HartmanFrom: Dafna Hirschfeld <[email protected]>
[ Upstream commit 206003b18bb264521607440752814ccff59f91f3 ]
When setting the sink format of the 'rkisp1_resizer' the format should be supported by 'rkisp1_isp' on the video source pad. This patch checks this condition and sets the format to default if the condition is false.
--- drivers/staging/media/rkisp1/rkisp1-common.h | 3 +++ drivers/staging/media/rkisp1/rkisp1-isp.c | 3 --- drivers/staging/media/rkisp1/rkisp1-resizer.c | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-)
drivers/staging/media/rkisp1/rkisp1-common.h +3 -0
@@ -22,6 +22,9 @@#include "rkisp1-regs.h" #include "uapi/rkisp1-config.h" +#define RKISP1_ISP_SD_SRC BIT(0) +#define RKISP1_ISP_SD_SINK BIT(1) +#define RKISP1_ISP_MAX_WIDTH 4032#define RKISP1_ISP_MAX_HEIGHT 3024#define RKISP1_ISP_MIN_WIDTH 32
drivers/staging/media/rkisp1/rkisp1-isp.c +0 -3
@@ -23,9 +23,6 @@#define RKISP1_ISP_DEV_NAME RKISP1_DRIVER_NAME "_isp" -#define RKISP1_ISP_SD_SRC BIT(0) -#define RKISP1_ISP_SD_SINK BIT(1) -/* * NOTE: MIPI controller and input MUX are also configured in this file. * This is because ISP Subdev describes not only ISP submodule (input size,
drivers/staging/media/rkisp1/rkisp1-resizer.c +1 -1
@@ -542,7 +542,7 @@ static void rkisp1_rsz_set_sink_fmt(struct rkisp1_resizer *rsz, which); sink_fmt->code = format->code; mbus_info =rkisp1_isp_mbus_info_get (sink_fmt->code); -if (!mbus_info) { +if (!mbus_info || !(mbus_info->direction &RKISP1_ISP_SD_SRC )) { sink_fmt->code =RKISP1_DEF_FMT ; mbus_info =rkisp1_isp_mbus_info_get (sink_fmt->code); }
Signature · 1 line
2.25.1
Greg Kroah-Hartman
maintainerPATCH 93/232 watchdog: f71808e_wdt: remove use of wrong watchdog_info option
In reply to Greg Kroah-HartmanFrom: Ahmad Fatoum <[email protected]>
commit 802141462d844f2e6a4d63a12260d79b7afc4c34 upstream.
The flags that should be or-ed into the watchdog_info.options by drivers all start with WDIOF_, e.g. WDIOF_SETTIMEOUT, which indicates that the driver's watchdog_ops has a usable set_timeout.
WDIOC_SETTIMEOUT was used instead, which expands to 0xc0045706, which equals:
WDIOF_FANFAULT | WDIOF_EXTERN1 | WDIOF_PRETIMEOUT | WDIOF_ALARMONLY | WDIOF_MAGICCLOSE | 0xc0045000
These were so far indicated to userspace on WDIOC_GETSUPPORT. As the driver has not yet been migrated to the new watchdog kernel API, the constant can just be dropped without substitute.
--- drivers/watchdog/f71808e_wdt.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/watchdog/f71808e_wdt.c +1 -2
@@ -690,8 +690,7 @@ static int __init watchdog_init(int sioa* into the module have been registered yet. */ watchdog.sioaddr = sioaddr; - watchdog.ident.options =WDIOC_SETTIMEOUT - |WDIOF_MAGICCLOSE + watchdog.ident.options =WDIOF_MAGICCLOSE |WDIOF_KEEPALIVEPING |WDIOF_CARDRESET ;
Greg Kroah-Hartman
maintainerPATCH 104/232 perf intel-pt: Fix FUP packet state
In reply to Greg Kroah-HartmanFrom: Adrian Hunter <[email protected]>
commit 401136bb084fd021acd9f8c51b52fe0a25e326b2 upstream.
While walking code towards a FUP ip, the packet state is INTEL_PT_STATE_FUP or INTEL_PT_STATE_FUP_NO_TIP. That was mishandled resulting in the state becoming INTEL_PT_STATE_IN_SYNC prematurely. The result was an occasional lost EXSTOP event.
--- tools/perf/util/intel-pt-decoder/intel-pt-decoder.c | 21 ++++++-------------- 1 file changed, 7 insertions(+), 14 deletions(-)
tools/perf/util/intel-pt-decoder/intel-pt-decoder.c +7 -14
@@ -1164,6 +1164,7 @@ static int intel_pt_walk_fup(struct intereturn 0 ;if (err == -EAGAIN ||intel_pt_fup_with_nlip (decoder, &intel_pt_insn, ip, err)) { + decoder->pkt_state =INTEL_PT_STATE_IN_SYNC ;if (intel_pt_fup_event (decoder))return 0 ;return -EAGAIN ;
@@ -1942,17 +1943,13 @@ next: }if (decoder->set_fup_mwait) no_tip = true; +if (no_tip) + decoder->pkt_state =INTEL_PT_STATE_FUP_NO_TIP ; +else + decoder->pkt_state =INTEL_PT_STATE_FUP ; err =intel_pt_walk_fup (decoder); -if (err != -EAGAIN ) { -if (err) -return err; -if (no_tip) - decoder->pkt_state = -INTEL_PT_STATE_FUP_NO_TIP ; -else - decoder->pkt_state =INTEL_PT_STATE_FUP ; -return 0 ; - } +if (err != -EAGAIN ) +return err;if (no_tip) { no_tip = false;break ;
@@ -2599,15 +2596,11 @@ const struct intel_pt_state *intel_pt_de err =intel_pt_walk_tip (decoder);break ;case INTEL_PT_STATE_FUP : - decoder->pkt_state =INTEL_PT_STATE_IN_SYNC ; err =intel_pt_walk_fup (decoder);if (err == -EAGAIN ) err =intel_pt_walk_fup_tip (decoder); -else if (!err) - decoder->pkt_state =INTEL_PT_STATE_FUP ;break ;case INTEL_PT_STATE_FUP_NO_TIP : - decoder->pkt_state =INTEL_PT_STATE_IN_SYNC ; err =intel_pt_walk_fup (decoder);if (err == -EAGAIN ) err =intel_pt_walk_trace (decoder);
Greg Kroah-Hartman
maintainerPATCH 146/232 gpu: ipu-v3: image-convert: Combine rotate/no-rotate irq handlers
In reply to Greg Kroah-HartmanFrom: Steve Longerbeam <[email protected]>
[ Upstream commit 0f6245f42ce9b7e4d20f2cda8d5f12b55a44d7d1 ]
Combine the rotate_irq() and norotate_irq() handlers into a single eof_irq() handler.
--- drivers/gpu/ipu-v3/ipu-image-convert.c | 58 +++++++++----------------- 1 file changed, 20 insertions(+), 38 deletions(-)
drivers/gpu/ipu-v3/ipu-image-convert.c +20 -38
@@ -1709,9 +1709,10 @@ static irqreturn_t do_irq(struct ipu_image_convert_run *run)return IRQ_WAKE_THREAD ; } -static irqreturn_t norotate_irq (int irq,void *data) +static irqreturn_t eof_irq (int irq,void *data) {struct ipu_image_convert_chan *chan = data; +struct ipu_image_convert_priv *priv = chan->priv;struct ipu_image_convert_ctx *ctx;struct ipu_image_convert_run *run;unsigned long flags;
@@ -1728,45 +1729,26 @@ static irqreturn_t norotate_irq(int irq, void *data) ctx = run->ctx; -if (ipu_rot_mode_is_irt (ctx->rot_mode)) { -/* this is a rotation operation, just ignore */ -spin_unlock_irqrestore (&chan->irqlock, flags); -return IRQ_HANDLED ; - } - - ret =do_irq (run); -out: -spin_unlock_irqrestore (&chan->irqlock, flags); -return ret; -} - -static irqreturn_t rotate_irq (int irq,void *data) -{ -struct ipu_image_convert_chan *chan = data; -struct ipu_image_convert_priv *priv = chan->priv; -struct ipu_image_convert_ctx *ctx; -struct ipu_image_convert_run *run; -unsigned long flags; -irqreturn_t ret; - -spin_lock_irqsave (&chan->irqlock, flags); - -/* get current run and its context */ - run = chan->current_run; -if (!run) { +if (irq == chan->out_eof_irq) { +if (ipu_rot_mode_is_irt (ctx->rot_mode)) { +/* this is a rotation op, just ignore */ + ret =IRQ_HANDLED ; + goto out; + } + }else if (irq == chan->rot_out_eof_irq) { +if (!ipu_rot_mode_is_irt (ctx->rot_mode)) { +/* this was NOT a rotation op, shouldn't happen */ +dev_err (priv->ipu->dev, +"Unexpected rotation interrupt\n" ); + ret =IRQ_HANDLED ; + goto out; + } + }else { +dev_err (priv->ipu->dev,"Received unknown irq %d\n" , irq); ret =IRQ_NONE ; goto out; } - ctx = run->ctx; - -if (!ipu_rot_mode_is_irt (ctx->rot_mode)) { -/* this was NOT a rotation operation, shouldn't happen */ -dev_err (priv->ipu->dev,"Unexpected rotation interrupt\n" ); -spin_unlock_irqrestore (&chan->irqlock, flags); -return IRQ_HANDLED ; - } - ret =do_irq (run); out:spin_unlock_irqrestore (&chan->irqlock, flags);
@@ -1859,7 +1841,7 @@ static int get_ipu_resources(struct ipu_image_convert_chan *chan) chan->out_chan, IPU_IRQ_EOF); - ret =request_threaded_irq (chan->out_eof_irq, norotate_irq, do_bh, + ret =request_threaded_irq (chan->out_eof_irq, eof_irq, do_bh,0 ,"ipu-ic" , chan);if (ret <0 ) { dev_err(priv->ipu->dev, "could not acquire irq %d\n",
@@ -1872,7 +1854,7 @@ static int get_ipu_resources(struct ipu_image_convert_chan *chan) chan->rotation_out_chan, IPU_IRQ_EOF); - ret =request_threaded_irq (chan->rot_out_eof_irq, rotate_irq, do_bh, + ret =request_threaded_irq (chan->rot_out_eof_irq, eof_irq, do_bh,0 ,"ipu-ic" , chan);if (ret <0 ) { dev_err(priv->ipu->dev, "could not acquire irq %d\n",
Signature · 1 line
2.25.1
Greg Kroah-Hartman
maintainerPATCH 140/232 RDMA/counter: Only bind user QPs in auto mode
In reply to Greg Kroah-HartmanFrom: Mark Zhang <[email protected]>
[ Upstream commit c9f557421e505f75da4234a6af8eff46bc08614b ]
In auto mode only bind user QPs to a dynamic counter, since this feature is mainly used for system statistic and diagnostic purpose, while there's no need to counter kernel QPs so far.
--- drivers/infiniband/core/counters.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/infiniband/core/counters.c +1 -1
@@ -288,7 +288,7 @@ int rdma_counter_bind_qp_auto(struct ib_qp *qp, u8 port)struct rdma_counter *counter;int ret; -if (!qp->res.valid) +if (!qp->res.valid ||rdma_is_kernel_res (&qp->res))return 0 ;if (!rdma_is_port_valid (dev, port))
Signature · 1 line
2.25.1
Greg Kroah-Hartman
maintainerPATCH 136/232 USB: serial: ftdi_sio: clean up receive processing
In reply to Greg Kroah-HartmanFrom: Johan Hovold <[email protected]>
[ Upstream commit ce054039ba5e47b75a3be02a00274e52b06a6456 ]
Clean up receive processing by dropping the character pointer and keeping the length argument unchanged throughout the function.
Also make it more apparent that sysrq processing can consume a characters by adding an explicit continue.
--- drivers/usb/serial/ftdi_sio.c | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-)
drivers/usb/serial/ftdi_sio.c +9 -10
@@ -2483,7 +2483,6 @@ static int ftdi_process_packet(struct usb_serial_port *port, struct ftdi_private *priv, unsigned char *buf, int len) { unsigned char status; -unsigned char *ch;int i;char flag;
@@ -2526,8 +2525,7 @@ static int ftdi_process_packet(struct usb_serial_port *port,else priv->transmit_empty =0 ; - len -=2 ; -if (!len) +if (len ==2 )return 0 ;/* status only */ /*
@@ -2556,19 +2554,20 @@ static int ftdi_process_packet(struct usb_serial_port *port, } } - port->icount.rx += len; - ch = buf +2 ; + port->icount.rx += len -2 ;if (port->port.console && port->sysrq) { -for (i =0 ; i < len; i++, ch++) { -if (!usb_serial_handle_sysrq_char (port, *ch)) -tty_insert_flip_char (&port->port, *ch, flag); +for (i =2 ; i < len; i++) { +if (usb_serial_handle_sysrq_char (port, buf[i])) +continue ; +tty_insert_flip_char (&port->port, buf[i], flag); } }else { -tty_insert_flip_string_fixed_flag (&port->port, ch, flag, len); +tty_insert_flip_string_fixed_flag (&port->port, buf +2 , flag, + len -2 ); } -return len; +return len -2 ; }static void ftdi_process_read_urb (struct urb *urb)
Signature · 1 line
2.25.1
Greg Kroah-Hartman
maintainerPATCH 135/232 USB: serial: ftdi_sio: make process-packet buffer unsigned
In reply to Greg Kroah-HartmanFrom: Johan Hovold <[email protected]>
[ Upstream commit ab4cc4ef6724ea588e835fc1e764c4b4407a70b7 ]
Use an unsigned type for the process-packet buffer argument and give it a more apt name.
--- drivers/usb/serial/ftdi_sio.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-)
drivers/usb/serial/ftdi_sio.c +11 -11
@@ -2480,12 +2480,12 @@ static int ftdi_prepare_write_buffer(struct usb_serial_port *port,#define FTDI_RS_ERR_MASK (FTDI_RS_BI | FTDI_RS_PE | FTDI_RS_FE | FTDI_RS_OE)static int ftdi_process_packet (struct usb_serial_port *port, -struct ftdi_private *priv,char *packet,int len) +struct ftdi_private *priv,unsigned char *buf,int len) { +unsigned char status; +unsigned char *ch;int i; -char status;char flag; -char *ch;if (len <2 ) {dev_dbg (&port->dev,"malformed packet\n" );
@@ -2495,7 +2495,7 @@ static int ftdi_process_packet(struct usb_serial_port *port,/* Compare new line status to the old one, signal if different/ N.B. packet may be processed more than once, but differences are only processed once. */ - status = packet[0 ] &FTDI_STATUS_B0_MASK ; + status = buf[0 ] &FTDI_STATUS_B0_MASK ;if (status != priv->prev_status) {char diff_status = status ^ priv->prev_status;
@@ -2521,7 +2521,7 @@ static int ftdi_process_packet(struct usb_serial_port *port, }/* save if the transmitter is empty or not */ -if (packet[1 ] &FTDI_RS_TEMT ) +if (buf[1 ] &FTDI_RS_TEMT ) priv->transmit_empty =1 ;else priv->transmit_empty =0 ;
@@ -2535,29 +2535,29 @@ static int ftdi_process_packet(struct usb_serial_port *port,* data payload to avoid over-reporting. */ flag =TTY_NORMAL ; -if (packet[1 ] &FTDI_RS_ERR_MASK ) { +if (buf[1 ] &FTDI_RS_ERR_MASK ) {/* Break takes precedence over parity, which takes precedence * over framing errors */ -if (packet[1 ] &FTDI_RS_BI ) { +if (buf[1 ] &FTDI_RS_BI ) { flag =TTY_BREAK ; port->icount.brk++;usb_serial_handle_break (port); - }else if (packet[1 ] &FTDI_RS_PE ) { + }else if (buf[1 ] &FTDI_RS_PE ) { flag =TTY_PARITY ; port->icount.parity++; - }else if (packet[1 ] &FTDI_RS_FE ) { + }else if (buf[1 ] &FTDI_RS_FE ) { flag =TTY_FRAME ; port->icount.frame++; }/* Overrun is special, not associated with a char */ -if (packet[1 ] &FTDI_RS_OE ) { +if (buf[1 ] &FTDI_RS_OE ) { port->icount.overrun++;tty_insert_flip_char (&port->port,0 ,TTY_OVERRUN ); } } port->icount.rx += len; - ch = packet +2 ; + ch = buf +2 ;if (port->port.console && port->sysrq) {for (i =0 ; i < len; i++, ch++) {
Signature · 1 line
2.25.1
Greg Kroah-Hartman
maintainerPATCH 97/232 pseries: Fix 64 bit logical memory block panic
In reply to Greg Kroah-HartmanFrom: Anton Blanchard <[email protected]>
commit 89c140bbaeee7a55ed0360a88f294ead2b95201b upstream.
Booting with a 4GB LMB size causes us to panic:
qemu-system-ppc64: OS terminated: OS panic:
Memory block size not suitable: 0x0
Fix pseries_memory_block_size() to handle 64 bit LMBs.
--- arch/powerpc/platforms/pseries/hotplug-memory.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/powerpc/platforms/pseries/hotplug-memory.c +1 -1
@@ -27,7 +27,7 @@ static bool rtas_hp_event;unsigned long pseries_memory_block_size (void ) {struct device_node *np; -unsigned int memblock_size =MIN_MEMORY_BLOCK_SIZE ; +u64 memblock_size =MIN_MEMORY_BLOCK_SIZE ;struct resource r; np =of_find_node_by_path ("/ibm,dynamic-reconfiguration-memory" );
Greg Kroah-Hartman
maintainerPATCH 116/232 octeontx2-af: change (struct qmem)->entry_sz from u8 to u16
In reply to Greg Kroah-HartmanFrom: Eric Dumazet <[email protected]>
[ Upstream commit 393415203f5c916b5907e0a7c89f4c2c5a9c5505 ]
We need to increase TSO_HEADER_SIZE from 128 to 256.
Since otx2_sq_init() calls qmem_alloc() with TSO_HEADER_SIZE, we need to change (struct qmem)->entry_sz to avoid truncation to 0.
--- drivers/net/ethernet/marvell/octeontx2/af/common.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/marvell/octeontx2/af/common.h +1 -1
@@ -43,7 +43,7 @@ struct qmem {void *base;dma_addr_t iova;int alloc_sz; -u8 entry_sz; +u16 entry_sz;u8 align;u32 qsize; };
Signature · 1 line
2.25.1
Greg Kroah-Hartman
maintainerPATCH 115/232 mfd: arizona: Ensure 32k clock is put on driver unbind and error
In reply to Greg Kroah-HartmanFrom: Charles Keepax <[email protected]>
[ Upstream commit ddff6c45b21d0437ce0c85f8ac35d7b5480513d7 ]
Whilst it doesn't matter if the internal 32k clock register settings are cleaned up on exit, as the part will be turned off losing any settings, hence the driver hasn't historially bothered. The external clock should however be cleaned up, as it could cause clocks to be left on, and will at best generate a warning on unbind.
Add clean up on both the probe error path and unbind for the 32k clock.
--- drivers/mfd/arizona-core.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+)
drivers/mfd/arizona-core.c +18 -0
@@ -1426,6 +1426,15 @@ int arizona_dev_init(struct arizona *arizona)arizona_irq_exit (arizona); err_pm:pm_runtime_disable (arizona->dev); + +switch (arizona->pdata.clk32k_src) { +case ARIZONA_32KZ_MCLK1 : +case ARIZONA_32KZ_MCLK2 : +arizona_clk32k_disable (arizona); +break ; +default : +break ; + } err_reset:arizona_enable_reset (arizona);regulator_disable (arizona->dcvdd);
@@ -1448,6 +1457,15 @@ int arizona_dev_exit(struct arizona *arizona)regulator_disable (arizona->dcvdd);regulator_put (arizona->dcvdd); +switch (arizona->pdata.clk32k_src) { +case ARIZONA_32KZ_MCLK1 : +case ARIZONA_32KZ_MCLK2 : +arizona_clk32k_disable (arizona); +break ; +default : +break ; + } +mfd_remove_devices (arizona->dev);arizona_free_irq (arizona,ARIZONA_IRQ_UNDERCLOCKED , arizona);arizona_free_irq (arizona,ARIZONA_IRQ_OVERCLOCKED , arizona);
Signature · 1 line
2.25.1
Greg Kroah-Hartman
maintainerPATCH 112/232 drm/imx: imx-ldb: Disable both channels for split mode in enc->disable()
In reply to Greg Kroah-HartmanFrom: Liu Ying <[email protected]>
commit 3b2a999582c467d1883716b37ffcc00178a13713 upstream.
Both of the two LVDS channels should be disabled for split mode in the encoder's ->disable() callback, because they are enabled in the encoder's ->enable() callback.
--- drivers/gpu/drm/imx/imx-ldb.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-)
drivers/gpu/drm/imx/imx-ldb.c +4 -3
@@ -304,18 +304,19 @@ static void imx_ldb_encoder_disable(stru {struct imx_ldb_channel *imx_ldb_ch =enc_to_imx_ldb_ch (encoder);struct imx_ldb *ldb = imx_ldb_ch->ldb; +int dual = ldb->ldb_ctrl &LDB_SPLIT_MODE_EN ;int mux, ret;drm_panel_disable (imx_ldb_ch->panel); -if (imx_ldb_ch == &ldb->channel[0 ]) +if (imx_ldb_ch == &ldb->channel[0 ] || dual) ldb->ldb_ctrl &= ~LDB_CH0_MODE_EN_MASK ; -else if (imx_ldb_ch == &ldb->channel[1 ]) +if (imx_ldb_ch == &ldb->channel[1 ] || dual) ldb->ldb_ctrl &= ~LDB_CH1_MODE_EN_MASK ;regmap_write (ldb->regmap,IOMUXC_GPR2 , ldb->ldb_ctrl); -if (ldb->ldb_ctrl &LDB_SPLIT_MODE_EN ) { +if (dual) {clk_disable_unprepare (ldb->clk[0 ]);clk_disable_unprepare (ldb->clk[1 ]); }
Greg Kroah-Hartman
maintainerPATCH 113/232 drm/ingenic: Fix incorrect assumption about plane->index
In reply to Greg Kroah-HartmanFrom: Paul Cercueil <[email protected]>
commit ca43f274e03f91c533643299ae4984965ce03205 upstream.
plane->index is NOT the index of the color plane in a YUV frame. Actually, a YUV frame is represented by a single drm_plane, even though it contains three Y, U, V planes.
v2-v3: No change
--- drivers/gpu/drm/ingenic/ingenic-drm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/ingenic/ingenic-drm.c +1 -1
@@ -386,7 +386,7 @@ static void ingenic_drm_plane_atomic_upd addr =drm_fb_cma_get_gem_addr (state->fb, state,0 ); width = state->src_w >>16 ; height = state->src_h >>16 ; - cpp = state->fb->format->cpp[plane->index]; + cpp = state->fb->format->cpp[0 ]; priv->dma_hwdesc->addr = addr; priv->dma_hwdesc->cmd = width * height * cpp /4 ;
Greg Kroah-Hartman
maintainerPATCH 102/232 perf probe: Fix wrong variable warning when the probe point is not found
In reply to Greg Kroah-HartmanFrom: Masami Hiramatsu <[email protected]>
commit 11fd3eb874e73ee8069bcfd54e3c16fa7ce56fe6 upstream.
Fix a wrong "variable not found" warning when the probe point is not found in the debuginfo.
Since the debuginfo__find_probes() can return 0 even if it does not find given probe point in the debuginfo, fill_empty_trace_arg() can be called with tf.ntevs == 0 and it can emit a wrong warning. To fix this, reject ntevs == 0 in fill_empty_trace_arg().
E.g. without this patch;
# perf probe -x /lib64/libc-2.30.so -a "memcpy arg1=%di"
Failed to find the location of the '%di' variable at this address.
Perhaps it has been optimized out.
Use -V with the --range option to show '%di' location range.
Added new events:
probe_libc:memcpy (on memcpy in /usr/lib64/libc-2.30.so with arg1=%di)
probe_libc:memcpy (on memcpy in /usr/lib64/libc-2.30.so with arg1=%di)You can now use it in all perf tools, such as:
perf record -e probe_libc:memcpy -aR sleep 1
With this;
# perf probe -x /lib64/libc-2.30.so -a "memcpy arg1=%di"
Added new events:
probe_libc:memcpy (on memcpy in /usr/lib64/libc-2.30.so with arg1=%di)
probe_libc:memcpy (on memcpy in /usr/lib64/libc-2.30.so with arg1=%di)You can now use it in all perf tools, such as:
perf record -e probe_libc:memcpy -aR sleep 1
--- tools/perf/util/probe-finder.c | 3 +++ 1 file changed, 3 insertions(+)
tools/perf/util/probe-finder.c +3 -0
@@ -1408,6 +1408,9 @@ static int fill_empty_trace_arg(struct pchar *type;int i, j, ret; +if (!ntevs) +return -ENOENT ; +for (i =0 ; i < pev->nargs; i++) { type =NULL ;for (j =0 ; j < ntevs; j++) {
Greg Kroah-Hartman
maintainerPATCH 103/232 perf probe: Fix memory leakage when the probe point is not found
In reply to Greg Kroah-HartmanFrom: Masami Hiramatsu <[email protected]>
commit 12d572e785b15bc764e956caaa8a4c846fd15694 upstream.
Fix the memory leakage in debuginfo__find_trace_events() when the probe point is not found in the debuginfo. If there is no probe point found in the debuginfo, debuginfo__find_probes() will NOT return -ENOENT, but 0.
Thus the caller of debuginfo__find_probes() must check the tf.ntevs and release the allocated memory for the array of struct probe_trace_event.
The current code releases the memory only if the debuginfo__find_probes() hits an error but not checks tf.ntevs. In the result, the memory allocated on *tevs are not released if tf.ntevs == 0.
This fixes the memory leakage by checking tf.ntevs == 0 in addition to ret < 0.
--- tools/perf/util/probe-finder.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tools/perf/util/probe-finder.c +1 -1
@@ -1467,7 +1467,7 @@ int debuginfo__find_trace_events(structif (ret >=0 && tf.pf.skip_empty_arg) ret =fill_empty_trace_arg (pev, tf.tevs, tf.ntevs); -if (ret <0 ) { +if (ret <0 || tf.ntevs ==0 ) {for (i =0 ; i < tf.ntevs; i++)clear_probe_trace_event (&tf.tevs[i]);zfree (tevs);
Greg Kroah-Hartman
maintainerPATCH 92/232 watchdog: f71808e_wdt: indicate WDIOF_CARDRESET support in watchdog_info.options
In reply to Greg Kroah-HartmanFrom: Ahmad Fatoum <[email protected]>
commit e871e93fb08a619dfc015974a05768ed6880fd82 upstream.
The driver supports populating bootstatus with WDIOF_CARDRESET, but so far userspace couldn't portably determine whether absence of this flag meant no watchdog reset or no driver support. Or-in the bit to fix this.
--- drivers/watchdog/f71808e_wdt.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/watchdog/f71808e_wdt.c +2 -1
@@ -692,7 +692,8 @@ static int __init watchdog_init(int sioa watchdog.sioaddr = sioaddr; watchdog.ident.options =WDIOC_SETTIMEOUT |WDIOF_MAGICCLOSE - |WDIOF_KEEPALIVEPING ; + |WDIOF_KEEPALIVEPING + |WDIOF_CARDRESET ; snprintf(watchdog.ident.identity, sizeof(watchdog.ident.identity), "%s watchdog",
Greg Kroah-Hartman
maintainerPATCH 59/232 irqchip/loongson-liointc: Fix misuse of gc->mask_cache
In reply to Greg Kroah-HartmanFrom: Huacai Chen <[email protected]>
commit c9c73a05413ea4a465cae1cb3593b01b190a233f upstream.
In gc->mask_cache bits, 1 means enabled and 0 means disabled, but in the loongson-liointc driver mask_cache is misused by reverting its meaning. This patch fix the bug and update the comments as well.
--- drivers/irqchip/irq-loongson-liointc.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
drivers/irqchip/irq-loongson-liointc.c +5 -5
@@ -60,7 +60,7 @@ static void liointc_chained_handle_irq(sif (!pending) {/* Always blame LPC IRQ if we have that bug */ if (handler->priv->has_lpc_irq_errata && - (handler->parent_int_map & ~gc->mask_cache & + (handler->parent_int_map & gc->mask_cache &BIT (LIOINTC_ERRATA_IRQ ))) pending =BIT (LIOINTC_ERRATA_IRQ );else
@@ -132,11 +132,11 @@ static void liointc_resume(struct irq_chirq_gc_lock_irqsave (gc, flags);/* Disable all at first */ writel (0xffffffff , gc->reg_base +LIOINTC_REG_INTC_DISABLE ); -/* Revert map cache */ +/* Restore map cache */ for (i =0 ; i <LIOINTC_CHIP_IRQ ; i++)writeb (priv->map_cache[i], gc->reg_base + i); -/* Revert mask cache */ -writel (~gc->mask_cache, gc->reg_base +LIOINTC_REG_INTC_ENABLE ); +/* Restore mask cache */ +writel (gc->mask_cache, gc->reg_base +LIOINTC_REG_INTC_ENABLE );irq_gc_unlock_irqrestore (gc, flags); }
@@ -244,7 +244,7 @@ int __init liointc_of_init(struct device ct->chip.irq_mask_ack = irq_gc_mask_disable_reg; ct->chip.irq_set_type = liointc_set_type; - gc->mask_cache =0xffffffff ; + gc->mask_cache =0 ; priv->gc = gc;for (i =0 ; i <LIOINTC_NUM_PARENT ; i++) {
Greg Kroah-Hartman
maintainerPATCH 64/232 md/raid5: Fix Force reconstruct-write io stuck in degraded raid5
In reply to Greg Kroah-HartmanFrom: ChangSyun Peng <[email protected]>
commit a1c6ae3d9f3dd6aa5981a332a6f700cf1c25edef upstream.
In degraded raid5, we need to read parity to do reconstruct-write when data disks fail. However, we can not read parity from handle_stripe_dirtying() in force reconstruct-write mode.
Reproducible Steps:
1. Create degraded raid5
mdadm -C /dev/md2 --assume-clean -l5 -n3 /dev/sda2 /dev/sdb2 missing
2. Set rmw_level to 0
echo 0 > /sys/block/md2/md/rmw_level
3. IO to raid5
Now some io may be stuck in raid5. We can use handle_stripe_fill() to read the parity in this situation.
--- drivers/md/raid5.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/md/raid5.c +2 -1
@@ -3607,6 +3607,7 @@ static int need_this_block(struct stripe* is missing/faulty, then we need to read everything we can. */ if (sh->raid_conf->level !=6 && + sh->raid_conf->rmw_level !=PARITY_DISABLE_RMW && sh->sector < sh->raid_conf->mddev->recovery_cp)/* reconstruct-write isn't being forced */ return 0 ;
@@ -4842,7 +4843,7 @@ static void handle_stripe(struct stripe_* or to load a block that is being partially written. */ if (s.to_read || s.non_overwrite - || (conf->level ==6 && s.to_write && s.failed) + || (s.to_write && s.failed) || (s.syncing && (s.uptodate + s.compute < disks)) || s.replacing || s.expanding)
Greg Kroah-Hartman
maintainerPATCH 63/232 selftests/seccomp: Set NNP for TSYNC ESRCH flag test
In reply to Greg Kroah-HartmanFrom: Kees Cook <[email protected]>
commit e4d05028a07f505a08802a6d1b11674c149df2b3 upstream.
The TSYNC ESRCH flag test will fail for regular users because NNP was not set yet. Add NNP setting.
--- tools/testing/selftests/seccomp/seccomp_bpf.c | 5 +++++ 1 file changed, 5 insertions(+)
tools/testing/selftests/seccomp/seccomp_bpf.c +5 -0
@@ -3258,6 +3258,11 @@ TEST(user_notification_with_tsync)int ret;unsigned int flags; + ret =prctl (PR_SET_NO_NEW_PRIVS ,1 ,0 ,0 ,0 ); + ASSERT_EQ(0, ret) { +TH_LOG ("Kernel does not support PR_SET_NO_NEW_PRIVS!" ); + } +/* these were exclusive */ flags =SECCOMP_FILTER_FLAG_NEW_LISTENER |SECCOMP_FILTER_FLAG_TSYNC ;
Greg Kroah-Hartman
maintainerPATCH 143/232 rtw88: pci: disable aspm for platform inter-op with module parameter
In reply to Greg Kroah-HartmanFrom: Yan-Hsuan Chuang <[email protected]>
[ Upstream commit 68aa716b7dd36f55e080da9e27bc594346334c41 ]
Some platforms cannot read the DBI register successfully for the ASPM settings. After the read failed, the bus could be unstable, and the device just became unavailable [1]. For those platforms, the ASPM should be disabled. But as the ASPM can help the driver to save the power consumption in power save mode, the ASPM is still needed. So, add a module parameter for them to disable it, then the device can still work, while others can benefit from the less power consumption that brings by ASPM enabled.
[1] https://bugzilla.kernel.org/show_bug.cgi?id=206411
[2] Note that my lenovo T430 is the same.
--- drivers/net/wireless/realtek/rtw88/pci.c | 9 +++++++++ 1 file changed, 9 insertions(+)
drivers/net/wireless/realtek/rtw88/pci.c +9 -0
@@ -14,8 +14,11 @@#include "debug.h" static bool rtw_disable_msi; +static bool rtw_pci_disable_aspm;module_param_named (disable_msi, rtw_disable_msi, bool,0644 ); +module_param_named (disable_aspm, rtw_pci_disable_aspm, bool,0644 );MODULE_PARM_DESC (disable_msi,"Set Y to disable MSI interrupt support" ); +MODULE_PARM_DESC (disable_aspm,"Set Y to disable PCI ASPM support" );static u32 rtw_pci_tx_queue_idx_addr[] = { [RTW_TX_QUEUE_BK ] =RTK_PCI_TXBD_IDX_BKQ ,
@@ -1200,6 +1203,9 @@ static void rtw_pci_clkreq_set(struct rtw_dev *rtwdev, bool enable)u8 value;int ret; +if (rtw_pci_disable_aspm) +return ; + ret =rtw_dbi_read8 (rtwdev,RTK_PCIE_LINK_CFG , &value);if (ret) {rtw_err (rtwdev,"failed to read CLKREQ_L1, ret=%d" , ret);
@@ -1219,6 +1225,9 @@ static void rtw_pci_aspm_set(struct rtw_dev *rtwdev, bool enable)u8 value;int ret; +if (rtw_pci_disable_aspm) +return ; + ret =rtw_dbi_read8 (rtwdev,RTK_PCIE_LINK_CFG , &value);if (ret) {rtw_err (rtwdev,"failed to read ASPM, ret=%d" , ret);
Signature · 1 line
2.25.1
Greg Kroah-Hartman
maintainerPATCH 137/232 USB: serial: ftdi_sio: fix break and sysrq handling
In reply to Greg Kroah-HartmanFrom: Johan Hovold <[email protected]>
[ Upstream commit 733fff67941dad64b8a630450b8372b1873edc41 ]
Only the last NUL in a packet should be flagged as a break character, for example, to avoid dropping unrelated characters when IGNBRK is set.
Also make sysrq work by consuming the break character instead of having it immediately cancel the sysrq request, and by not processing it prematurely to avoid triggering a sysrq based on an unrelated character received in the same packet (which was received *before* the break).
Note that the break flag can be left set also for a packet received immediately following a break and that and an ending NUL in such a packet will continue to be reported as a break as there's no good way to tell it apart from an actual break.
Tested on FT232R and FT232H.
--- drivers/usb/serial/ftdi_sio.c | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-)
drivers/usb/serial/ftdi_sio.c +17 -7
@@ -2483,6 +2483,7 @@ static int ftdi_process_packet(struct usb_serial_port *port, struct ftdi_private *priv, unsigned char *buf, int len) { unsigned char status; +bool brkint = false;int i;char flag;
@@ -2534,13 +2535,17 @@ static int ftdi_process_packet(struct usb_serial_port *port,*/ flag =TTY_NORMAL ;if (buf[1 ] &FTDI_RS_ERR_MASK ) { -/* Break takes precedence over parity, which takes precedence -* over framing errors */ -if (buf[1 ] &FTDI_RS_BI ) { - flag =TTY_BREAK ; +/* +* Break takes precedence over parity, which takes precedence +* over framing errors. Note that break is only associated +* with the last character in the buffer and only when it's a +* NUL. +*/ +if (buf[1 ] &FTDI_RS_BI && buf[len -1 ] =='\0' ) { port->icount.brk++; -usb_serial_handle_break (port); - }else if (buf[1 ] &FTDI_RS_PE ) { + brkint = true; + } +if (buf[1 ] &FTDI_RS_PE ) { flag =TTY_PARITY ; port->icount.parity++; }else if (buf[1 ] &FTDI_RS_FE ) {
@@ -2556,8 +2561,13 @@ static int ftdi_process_packet(struct usb_serial_port *port, port->icount.rx += len -2 ; -if (port->port.console && port->sysrq) { +if (brkint || (port->port.console && port->sysrq)) {for (i =2 ; i < len; i++) { +if (brkint && i == len -1 ) { +if (usb_serial_handle_break (port)) +return len -3 ; + flag =TTY_BREAK ; + }if (usb_serial_handle_sysrq_char (port, buf[i]))continue ;tty_insert_flip_char (&port->port, buf[i], flag);
Signature · 1 line
2.25.1
Greg Kroah-Hartman
maintainerPATCH 139/232 devres: keep both device name and resource name in pretty name
In reply to Greg Kroah-HartmanFrom: Vladimir Oltean <[email protected]>
[ Upstream commit 35bd8c07db2ce8fd2834ef866240613a4ef982e7 ]
Sometimes debugging a device is easiest using devmem on its register map, and that can be seen with /proc/iomem. But some device drivers have many memory regions. Take for example a networking switch. Its memory map used to look like this in /proc/iomem:
1fc000000-1fc3fffff : pcie@1f0000000
1fc000000-1fc3fffff : 0000:00:00.5
1fc010000-1fc01ffff : sys
1fc030000-1fc03ffff : rew
1fc060000-1fc0603ff : s2
1fc070000-1fc0701ff : devcpu_gcb
1fc080000-1fc0800ff : qs
1fc090000-1fc0900cb : ptp
1fc100000-1fc10ffff : port0
1fc110000-1fc11ffff : port1
1fc120000-1fc12ffff : port2
1fc130000-1fc13ffff : port3
1fc140000-1fc14ffff : port4
1fc150000-1fc15ffff : port5
1fc200000-1fc21ffff : qsys
1fc280000-1fc28ffff : anaBut after the patch in Fixes: was applied, the information is now presented in a much more opaque way:
1fc000000-1fc3fffff : pcie@1f0000000
1fc000000-1fc3fffff : 0000:00:00.5
1fc010000-1fc01ffff : 0000:00:00.5
1fc030000-1fc03ffff : 0000:00:00.5
1fc060000-1fc0603ff : 0000:00:00.5
1fc070000-1fc0701ff : 0000:00:00.5
1fc080000-1fc0800ff : 0000:00:00.5
1fc090000-1fc0900cb : 0000:00:00.5
1fc100000-1fc10ffff : 0000:00:00.5
1fc110000-1fc11ffff : 0000:00:00.5
1fc120000-1fc12ffff : 0000:00:00.5
1fc130000-1fc13ffff : 0000:00:00.5
1fc140000-1fc14ffff : 0000:00:00.5
1fc150000-1fc15ffff : 0000:00:00.5
1fc200000-1fc21ffff : 0000:00:00.5
1fc280000-1fc28ffff : 0000:00:00.5That patch made a fair comment that /proc/iomem might be confusing when it shows resources without an associated device, but we can do better than just hide the resource name altogether. Namely, we can print the device name _and_ the resource name. Like this:
1fc000000-1fc3fffff : pcie@1f0000000
1fc000000-1fc3fffff : 0000:00:00.5
1fc010000-1fc01ffff : 0000:00:00.5 sys
1fc030000-1fc03ffff : 0000:00:00.5 rew
1fc060000-1fc0603ff : 0000:00:00.5 s2
1fc070000-1fc0701ff : 0000:00:00.5 devcpu_gcb
1fc080000-1fc0800ff : 0000:00:00.5 qs
1fc090000-1fc0900cb : 0000:00:00.5 ptp
1fc100000-1fc10ffff : 0000:00:00.5 port0
1fc110000-1fc11ffff : 0000:00:00.5 port1
1fc120000-1fc12ffff : 0000:00:00.5 port2
1fc130000-1fc13ffff : 0000:00:00.5 port3
1fc140000-1fc14ffff : 0000:00:00.5 port4
1fc150000-1fc15ffff : 0000:00:00.5 port5
1fc200000-1fc21ffff : 0000:00:00.5 qsys
1fc280000-1fc28ffff : 0000:00:00.5 ana--- lib/devres.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-)
lib/devres.c +10 -1
@@ -119,6 +119,7 @@ __devm_ioremap_resource(struct device *dev, const struct resource *res, {resource_size_t size;void __iomem *dest_ptr; +char *pretty_name;BUG_ON (!dev);
@@ -129,7 +130,15 @@ __devm_ioremap_resource(struct device *dev, const struct resource *res, size =resource_size (res); -if (!devm_request_mem_region (dev, res->start, size,dev_name (dev))) { +if (res->name) + pretty_name =devm_kasprintf (dev,GFP_KERNEL ,"%s %s" , +dev_name (dev), res->name); +else + pretty_name =devm_kstrdup (dev,dev_name (dev),GFP_KERNEL ); +if (!pretty_name) +return IOMEM_ERR_PTR (-ENOMEM ); + +if (!devm_request_mem_region (dev, res->start, size, pretty_name)) {dev_err (dev,"can't request region for resource %pR\n" , res);return IOMEM_ERR_PTR (-EBUSY ); }
Signature · 1 line
2.25.1
Greg Kroah-Hartman
maintainerPATCH 144/232 rtc: pl031: fix set_alarm by adding back call to alarm_irq_enable
In reply to Greg Kroah-HartmanFrom: Sudeep Holla <[email protected]>
[ Upstream commit 4df2ef85f0efe44505f511ca5e4455585f53a2da ]
Commit c8ff5841a90b ("rtc: pl031: switch to rtc_time64_to_tm/rtc_tm_to_time64") seemed to have accidentally removed the call to pl031_alarm_irq_enable from pl031_set_alarm while switching to 64-bit apis.
Let us add back the same to get the set alarm functionality back.
--- drivers/rtc/rtc-pl031.c | 1 + 1 file changed, 1 insertion(+)
drivers/rtc/rtc-pl031.c +1 -0
@@ -275,6 +275,7 @@ static int pl031_set_alarm(struct device *dev, struct rtc_wkalrm *alarm)struct pl031_local *ldata =dev_get_drvdata (dev);writel (rtc_tm_to_time64 (&alarm->time), ldata->base +RTC_MR ); +pl031_alarm_irq_enable (dev, alarm->enabled);return 0 ; }
Signature · 1 line
2.25.1
Greg Kroah-Hartman
maintainerPATCH 95/232 ceph: set sec_context xattr on symlink creation
In reply to Greg Kroah-HartmanFrom: Jeff Layton <[email protected]>
commit b748fc7a8763a5b3f8149f12c45711cd73ef8176 upstream.
Symlink inodes should have the security context set in their xattrs on creation. We already set the context on creation, but we don't attach the pagelist. The effect is that symlink inodes don't get an SELinux context set on them at creation, so they end up unlabeled instead of inheriting the proper context. Make it do so.
--- fs/ceph/dir.c | 4 ++++ 1 file changed, 4 insertions(+)
fs/ceph/dir.c +4 -0
@@ -930,6 +930,10 @@ static int ceph_symlink(struct inode *di req->r_num_caps =2 ; req->r_dentry_drop =CEPH_CAP_FILE_SHARED |CEPH_CAP_AUTH_EXCL ; req->r_dentry_unless =CEPH_CAP_FILE_EXCL ; +if (as_ctx.pagelist) { + req->r_pagelist = as_ctx.pagelist; + as_ctx.pagelist =NULL ; + } err =ceph_mdsc_do_request (mdsc, dir, req);if (!err && !req->r_reply_info.head->is_dentry) err =ceph_handle_notrace_create (dir, dentry);
Greg Kroah-Hartman
maintainerPATCH 91/232 tracing: Use trace_sched_process_free() instead of exit() for pid tracing
In reply to Greg Kroah-HartmanFrom: Steven Rostedt (VMware) <[email protected]>
commit afcab636657421f7ebfa0783a91f90256bba0091 upstream.
On exit, if a process is preempted after the trace_sched_process_exit() tracepoint but before the process is done exiting, then when it gets scheduled in, the function tracers will not filter it properly against the function tracing pid filters.
That is because the function tracing pid filters hooks to the sched_process_exit() tracepoint to remove the exiting task's pid from the filter list. Because the filtering happens at the sched_switch tracepoint, when the exiting task schedules back in to finish up the exit, it will no longer be in the function pid filtering tables.
This was noticeable in the notrace self tests on a preemptable kernel, as the tests would fail as it exits and preempted after being taken off the notrace filter table and on scheduling back in it would not be in the notrace list, and then the ending of the exit function would trace. The test detected this and would fail.
--- kernel/trace/ftrace.c | 4 ++-- kernel/trace/trace_events.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-)
kernel/trace/ftrace.c +2 -2
@@ -6969,12 +6969,12 @@ void ftrace_pid_follow_fork(struct traceif (enable) {register_trace_sched_process_fork (ftrace_pid_follow_sched_process_fork, tr); -register_trace_sched_process_exit (ftrace_pid_follow_sched_process_exit, +register_trace_sched_process_free (ftrace_pid_follow_sched_process_exit, tr); }else {unregister_trace_sched_process_fork (ftrace_pid_follow_sched_process_fork, tr); -unregister_trace_sched_process_exit (ftrace_pid_follow_sched_process_exit, +unregister_trace_sched_process_free (ftrace_pid_follow_sched_process_exit, tr); } }
kernel/trace/trace_events.c +2 -2
@@ -538,12 +538,12 @@ void trace_event_follow_fork(struct tracif (enable) {register_trace_prio_sched_process_fork (event_filter_pid_sched_process_fork, tr,INT_MIN ); -register_trace_prio_sched_process_exit (event_filter_pid_sched_process_exit, +register_trace_prio_sched_process_free (event_filter_pid_sched_process_exit, tr,INT_MAX ); }else {unregister_trace_sched_process_fork (event_filter_pid_sched_process_fork, tr); -unregister_trace_sched_process_exit (event_filter_pid_sched_process_exit, +unregister_trace_sched_process_free (event_filter_pid_sched_process_exit, tr); } }
Greg Kroah-Hartman
maintainerPATCH 100/232 module: Correctly truncate sysfs sections output
In reply to Greg Kroah-HartmanFrom: Kees Cook <[email protected]>
commit 11990a5bd7e558e9203c1070fc52fb6f0488e75b upstream.
The only-root-readable /sys/module/$module/sections/$section files did not truncate their output to the available buffer size. While most paths into the kernfs read handlers end up using PAGE_SIZE buffers, it's possible to get there through other paths (e.g. splice, sendfile). Actually limit the output to the "count" passed into the read function, and report it back correctly. *sigh*
--- kernel/module.c | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-)
kernel/module.c +19 -3
@@ -1520,18 +1520,34 @@ struct module_sect_attrs {struct module_sect_attr attrs[]; }; +#define MODULE_SECT_READ_SIZE (3 /* "0x", "\n" */ + (BITS_PER_LONG / 4))static ssize_t module_sect_read (struct file *file,struct kobject *kobj,struct bin_attribute *battr,char *buf,loff_t pos,size_t count) {struct module_sect_attr *sattr = container_of(battr, struct module_sect_attr, battr); +char bounce[MODULE_SECT_READ_SIZE +1 ]; +size_t wrote;if (pos !=0 )return -EINVAL ; -return sprintf (buf,"0x%px\n" , -kallsyms_show_value (file->f_cred) ? (void *)sattr->address :NULL ); +/* +* Since we're a binary read handler, we must account for the +* trailing NUL byte that sprintf will write: if "buf" is +* too small to hold the NUL, or the NUL is exactly the last +* byte, the read will look like it got truncated by one byte. +* Since there is no way to ask sprintf nicely to not write +* the NUL, we have to use a bounce buffer. +*/ + wrote =scnprintf (bounce,sizeof (bounce),"0x%px\n" , +kallsyms_show_value (file->f_cred) + ? (void *)sattr->address :NULL ); + count =min (count, wrote); +memcpy (buf, bounce, count); + +return count; }static void free_sect_attrs (struct module_sect_attrs *sect_attrs)
@@ -1580,7 +1596,7 @@ static void add_sect_attrs(struct module goto out; sect_attrs->nsections++; sattr->battr.read = module_sect_read; - sattr->battr.size =3 /* "0x", "\n" */ + (BITS_PER_LONG /4 ); + sattr->battr.size =MODULE_SECT_READ_SIZE ; sattr->battr.attr.mode =0400 ; *(gattr++) = &(sattr++)->battr; }
Greg Kroah-Hartman
maintainerRe: [PATCH 5.8 164/232] PCI: hv: Fix a timing issue which causes kdump to fail occasionally
In reply to Sasha LevinQuoted 33 lines · Sasha Levin
Quoted 32 lines · Michael Kelley
From: Greg Kroah-Hartman <[email protected]> Sent: Thursday, August 20, 2020 2:20 AM
Quoted 30 lines
From: Wei Hu <[email protected]>
[ Upstream commit
d6af2ed29c7c1c311b96dac989dcb991e90ee195]Kdump could fail sometime on Hyper-V guest because the retry in
hv_pci_enter_d0()releases child device structures inhv_pci_bus_exit().Although there is a second asynchronous device relations message sending from the host, if this message arrives to the guest after
hv_send_resource_allocated()is called, the retry would fail.Fix the problem by moving retry to
hv_pci_probe()and start the retry fromhv_pci_query_relations()call. This will cause a device relations message to arrive to the guest synchronously; the guest would then be able to rebuild the child device structures before callinghv_send_resource_allocated().Link:
https://lore.kernel.org/linux-hyperv/[email protected]/Fixes c81992e7f4aa ("PCI: hv: Retry PCI bus D0 entry on invalid device state")Signed-off-by Wei Hu <[email protected]>[[email protected]: fixed a comment and commit log]Signed-off-by Lorenzo Pieralisi <[email protected]>Reviewed-by Michael Kelley <[email protected]>Signed-off-by Sasha Levin <[email protected]>--- drivers/pci/controller/pci-hyperv.c | 71 +++++++++++++++-------------- 1 file changed, 37 insertions(+), 34 deletions(-)
Quoted 4 lines
Quoted 2 lines
This patch came through three days ago, and I indicated then that we don't want it backported to 5.8 and earlier.
Uh, I re-added it by mistake, sorry.
Ok, let me go drop it...
Greg Kroah-Hartman
maintainerRe: [PATCH 5.8 164/232] PCI: hv: Fix a timing issue which causes kdump to fail occasionally
Quoted 34 lines · Greg Kroah-Hartman
Quoted 33 lines · Sasha Levin
Quoted 32 lines · Michael Kelley
From: Greg Kroah-Hartman <[email protected]> Sent: Thursday, August 20, 2020 2:20 AM
Quoted 30 lines
From: Wei Hu <[email protected]>
[ Upstream commit
d6af2ed29c7c1c311b96dac989dcb991e90ee195]Kdump could fail sometime on Hyper-V guest because the retry in
hv_pci_enter_d0()releases child device structures inhv_pci_bus_exit().Although there is a second asynchronous device relations message sending from the host, if this message arrives to the guest after
hv_send_resource_allocated()is called, the retry would fail.Fix the problem by moving retry to
hv_pci_probe()and start the retry fromhv_pci_query_relations()call. This will cause a device relations message to arrive to the guest synchronously; the guest would then be able to rebuild the child device structures before callinghv_send_resource_allocated().Link:
https://lore.kernel.org/linux-hyperv/[email protected]/Fixes c81992e7f4aa ("PCI: hv: Retry PCI bus D0 entry on invalid device state")Signed-off-by Wei Hu <[email protected]>[[email protected]: fixed a comment and commit log]Signed-off-by Lorenzo Pieralisi <[email protected]>Reviewed-by Michael Kelley <[email protected]>Signed-off-by Sasha Levin <[email protected]>--- drivers/pci/controller/pci-hyperv.c | 71 +++++++++++++++-------------- 1 file changed, 37 insertions(+), 34 deletions(-)
Quoted 6 lines
Quoted 4 lines
Quoted 2 lines
This patch came through three days ago, and I indicated then that we don't want it backported to 5.8 and earlier.
Uh, I re-added it by mistake, sorry.
Ok, let me go drop it...
Oops, you already did :)
Greg Kroah-Hartman
maintainerPATCH 88/232 ftrace: Setup correct FTRACE_FL_REGS flags for module
In reply to Greg Kroah-HartmanFrom: Chengming Zhou <[email protected]>
commit 8a224ffb3f52b0027f6b7279854c71a31c48fc97 upstream.
When module loaded and enabled, we will use __ftrace_replace_code for module if any ftrace_ops referenced it found. But we will get wrong ftrace_addr for module rec in ftrace_get_addr_new, because rec->flags has not been setup correctly. It can cause the callback function of a ftrace_ops has FTRACE_OPS_FL_SAVE_REGS to be called with pt_regs set to NULL.
So setup correct FTRACE_FL_REGS flags for rec when we call referenced_filters to find ftrace_ops references it.
--- kernel/trace/ftrace.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-)
kernel/trace/ftrace.c +7 -4
@@ -6187,8 +6187,11 @@ static int referenced_filters(struct dynint cnt =0 ;for (ops = ftrace_ops_list; ops != &ftrace_list_end; ops = ops->next) { -if (ops_references_rec (ops, rec)) - cnt++; +if (ops_references_rec (ops, rec)) { + cnt++; +if (ops->flags &FTRACE_OPS_FL_SAVE_REGS ) + rec->flags |=FTRACE_FL_REGS ; + } }return cnt;
@@ -6367,8 +6370,8 @@ void ftrace_module_enable(struct moduleif (ftrace_start_up) cnt +=referenced_filters (rec); -/* This clears FTRACE_FL_DISABLED */ - rec->flags = cnt; + rec->flags &= ~FTRACE_FL_DISABLED ; + rec->flags += cnt;if (ftrace_start_up && cnt) {int failed =__ftrace_replace_code (rec,1 );
Greg Kroah-Hartman
maintainerPATCH 89/232 kprobes: Fix NULL pointer dereference at kprobe_ftrace_handler
In reply to Greg Kroah-HartmanFrom: Muchun Song <[email protected]>
commit 0cb2f1372baa60af8456388a574af6133edd7d80 upstream.
We found a case of kernel panic on our server. The stack trace is as follows(omit some irrelevant information):
BUG: kernel NULL pointer dereference, address: 0000000000000080 RIP: 0010:kprobe_ftrace_handler+0x5e/0xe0 RSP: 0018:ffffb512c6550998 EFLAGS: 00010282 RAX: 0000000000000000 RBX: ffff8e9d16eea018 RCX: 0000000000000000 RDX: ffffffffbe1179c0 RSI: ffffffffc0535564 RDI: ffffffffc0534ec0 RBP: ffffffffc0534ec1 R08: ffff8e9d1bbb0f00 R09: 0000000000000004 R10: 0000000000000000 R11: 0000000000000000 R12: 0000000000000000 R13: ffff8e9d1f797060 R14: 000000000000bacc R15: ffff8e9ce13eca00 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 0000000000000080 CR3: 00000008453d0005 CR4: 00000000003606e0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Call Trace: <IRQ> ftrace_ops_assist_func+0x56/0xe0 ftrace_call+0x5/0x34 tcpa_statistic_send+0x5/0x130 [ttcp_engine]
The tcpa_statistic_send is the function being kprobed. After analysis, the root cause is that the fourth parameter regs of kprobe_ftrace_handler is NULL. Why regs is NULL? We use the crash tool to analyze the kdump.
crash> dis tcpa_statistic_send -r
<tcpa_statistic_send>: callq 0xffffffffbd8018c0 <ftrace_caller>
The tcpa_statistic_send calls ftrace_caller instead of ftrace_regs_caller. So it is reasonable that the fourth parameter regs of kprobe_ftrace_handler is NULL. In theory, we should call the ftrace_regs_caller instead of the ftrace_caller. After in-depth analysis, we found a reproducible path.
Writing a simple kernel module which starts a periodic timer. The timer's handler is named 'kprobe_test_timer_handler'. The module name is kprobe_test.ko.
1) insmod kprobe_test.ko
2) bpftrace -e 'kretprobe:kprobe_test_timer_handler {}'
3) echo 0 > /proc/sys/kernel/ftrace_enabled
4) rmmod kprobe_test
5) stop step 2) kprobe
6) insmod kprobe_test.ko
7) bpftrace -e 'kretprobe:kprobe_test_timer_handler {}'
We mark the kprobe as GONE but not disarm the kprobe in the step 4). The step 5) also do not disarm the kprobe when unregister kprobe. So we do not remove the ip from the filter. In this case, when the module loads again in the step 6), we will replace the code to ftrace_caller via the ftrace_module_enable(). When we register kprobe again, we will not replace ftrace_caller to ftrace_regs_caller because the ftrace is disabled in the step 3). So the step 7) will trigger kernel panic. Fix this problem by disarming the kprobe when the module is going away.
--- kernel/kprobes.c | 7 +++++++ 1 file changed, 7 insertions(+)
kernel/kprobes.c +7 -0
@@ -2113,6 +2113,13 @@ static void kill_kprobe(struct kprobe *p* the original probed function (which will be freed soon) any more. */ arch_remove_kprobe (p); + +/* +* The module is going away. We should disarm the kprobe which +* is using ftrace. +*/ +if (kprobe_ftrace (p)) +disarm_kprobe_ftrace (p); }/* Disable one kprobe */
Greg Kroah-Hartman
maintainerPATCH 62/232 net/compat: Add missing sock updates for SCM_RIGHTS
In reply to Greg Kroah-HartmanFrom: Kees Cook <[email protected]>
commit d9539752d23283db4692384a634034f451261e29 upstream.
Add missed sock updates to compat path via a new helper, which will be used more in coming patches. (The net/core/scm.c code is left as-is here to assist with -stable backports for the compat path.)
--- include/net/sock.h | 4 ++++ net/compat.c | 1 + net/core/sock.c | 21 +++++++++++++++++++++ 3 files changed, 26 insertions(+)
include/net/sock.h +4 -0
@@ -891,6 +891,8 @@ static inline int sk_memalloc_socks(void {return static_branch_unlikely (&memalloc_socks_key); } + +void __receive_sock (struct file *file);#else static inline int sk_memalloc_socks (void )
@@ -898,6 +900,8 @@ static inline int sk_memalloc_socks(void return 0; } +static inline void __receive_sock (struct file *file) +{ }#endif static inline gfp_t sk_gfp_mask (const struct sock *sk,gfp_t gfp_mask)
net/compat.c +1 -0
@@ -309,6 +309,7 @@ void scm_detach_fds_compat(struct msghdrbreak ; }/* Bump the usage count and install the file. */ +__receive_sock (fp[i]);fd_install (new_fd,get_file (fp[i])); }
net/core/sock.c +21 -0
@@ -2842,6 +2842,27 @@ int sock_no_mmap(struct file *file, stru }EXPORT_SYMBOL (sock_no_mmap); +/* +* When a file is received (via SCM_RIGHTS, etc), we must bump the +* various sock-based usage counts. +*/ +void __receive_sock (struct file *file) +{ +struct socket *sock; +int error; + +/* +* The resulting value of "error" is ignored here since we only +* need to take action when the file is a socket and testing +* "sock" for NULL is sufficient. +*/ + sock =sock_from_file (file, &error); +if (sock) { +sock_update_netprioidx (&sock->sk->sk_cgrp_data); +sock_update_classid (&sock->sk->sk_cgrp_data); + } +} +ssize_t sock_no_sendpage (struct socket *sock,struct page *page,int offset,size_t size,int flags) {ssize_t res;
Greg Kroah-Hartman
maintainerPATCH 87/232 mm/memory_hotplug: fix unpaired mem_hotplug_begin/done
In reply to Greg Kroah-HartmanFrom: Jia He <[email protected]>
commit b4223a510e2ab1bf0f971d50af7c1431014b25ad upstream.
When check_memblock_offlined_cb() returns failed rc(e.g. the memblock is online at that time), mem_hotplug_begin/done is unpaired in such case.
Therefore a warning:
Call Trace: percpu_up_write+0x33/0x40 try_remove_memory+0x66/0x120 ? _cond_resched+0x19/0x30 remove_memory+0x2b/0x40 dev_dax_kmem_remove+0x36/0x72 [kmem] device_release_driver_internal+0xf0/0x1c0 device_release_driver+0x12/0x20 bus_remove_device+0xe1/0x150 device_del+0x17b/0x3e0 unregister_dev_dax+0x29/0x60 devm_action_release+0x15/0x20 release_nodes+0x19a/0x1e0 devres_release_all+0x3f/0x50 device_release_driver_internal+0x100/0x1c0 driver_detach+0x4c/0x8f bus_remove_driver+0x5c/0xd0 driver_unregister+0x31/0x50 dax_pmem_exit+0x10/0xfe0 [dax_pmem]
--- mm/memory_hotplug.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)
mm/memory_hotplug.c +2 -3
@@ -1742,7 +1742,7 @@ static int __ref try_remove_memory(int n*/ rc =walk_memory_blocks (start, size,NULL , check_memblock_offlined_cb);if (rc) - goto done; +return rc;/* remove memmap entry */ firmware_map_remove (start, start + size,"System RAM" );
@@ -1766,9 +1766,8 @@ static int __ref try_remove_memory(int ntry_offline_node (nid); -done:mem_hotplug_done (); -return rc; +return 0 ; }/**
Greg Kroah-Hartman
maintainerPATCH 86/232 cma: dont quit at first error when activating reserved areas
In reply to Greg Kroah-HartmanFrom: Mike Kravetz <[email protected]>
commit 3a5139f1c5bb76d69756fb8f13fffa173e261153 upstream.
The routine cma_init_reserved_areas is designed to activate all reserved cma areas. It quits when it first encounters an error. This can leave some areas in a state where they are reserved but not activated. There is no feedback to code which performed the reservation. Attempting to allocate memory from areas in such a state will result in a BUG.
Modify cma_init_reserved_areas to always attempt to activate all areas. The called routine, cma_activate_area is responsible for leaving the area in a valid state. No one is making active use of returned error codes, so change the routine to void.
How to reproduce: This example uses kernelcore, hugetlb and cma as an easy way to reproduce. However, this is a more general cma issue.
Two node x86 VM 16GB total, 8GB per node
Kernel command line parameters, kernelcore=4G hugetlb_cma=8G Related boot time messages,
hugetlb_cma: reserve 8192 MiB, up to 4096 MiB per node
cma: Reserved 4096 MiB at 0x0000000100000000
hugetlb_cma: reserved 4096 MiB on node 0
cma: Reserved 4096 MiB at 0x0000000300000000
hugetlb_cma: reserved 4096 MiB on node 1
cma: CMA area hugetlb could not be activated
# echo 8 > /sys/kernel/mm/hugepages/hugepages-1048576kB/nr_hugepages
BUG: kernel NULL pointer dereference, address: 0000000000000000
#PF: supervisor read access in kernel mode
#PF: error_code(0x0000) - not-present page
PGD 0 P4D 0
Oops: 0000 [#1] SMP PTI
...
Call Trace:
bitmap_find_next_zero_area_off+0x51/0x90
cma_alloc+0x1a5/0x310
alloc_fresh_huge_page+0x78/0x1a0
alloc_pool_huge_page+0x6f/0xf0
set_max_huge_pages+0x10c/0x250
nr_hugepages_store_common+0x92/0x120
? __kmalloc+0x171/0x270
kernfs_fop_write+0xc1/0x1a0
vfs_write+0xc7/0x1f0
ksys_write+0x5f/0xe0
do_syscall_64+0x4d/0x90
entry_SYSCALL_64_after_hwframe+0x44/0xa9--- mm/cma.c | 23 +++++++++-------------- 1 file changed, 9 insertions(+), 14 deletions(-)
mm/cma.c +9 -14
@@ -93,17 +93,15 @@ static void cma_clear_bitmap(struct cmamutex_unlock (&cma->lock); } -static int __init cma_activate_area (struct cma *cma) +static void __init cma_activate_area (struct cma *cma) {unsigned long base_pfn = cma->base_pfn, pfn = base_pfn;unsigned i = cma->count >> pageblock_order;struct zone *zone; cma->bitmap =bitmap_zalloc (cma_bitmap_maxno (cma),GFP_KERNEL ); -if (!cma->bitmap) { - cma->count =0 ; -return -ENOMEM ; - } +if (!cma->bitmap) + goto out_error;WARN_ON_ONCE (!pfn_valid (pfn)); zone =page_zone (pfn_to_page (pfn));
@@ -133,25 +131,22 @@ static int __init cma_activate_area(struspin_lock_init (&cma->mem_head_lock);#endif -return 0 ; +return ; not_in_zone: -pr_err ("CMA area %s could not be activated\n" , cma->name);bitmap_free (cma->bitmap); +out_error: cma->count =0 ; -return -EINVAL ; +pr_err ("CMA area %s could not be activated\n" , cma->name); +return ; }static int __init cma_init_reserved_areas (void ) {int i; -for (i =0 ; i < cma_area_count; i++) { -int ret =cma_activate_area (&cma_areas[i]); - -if (ret) -return ret; - } +for (i =0 ; i < cma_area_count; i++) +cma_activate_area (&cma_areas[i]);return 0 ; }
Greg Kroah-Hartman
maintainerPATCH 85/232 mm/page_counter.c: fix protection usage propagation
In reply to Greg Kroah-HartmanFrom: Michal Koutný <[email protected]>
commit a6f23d14ec7d7d02220ad8bb2774be3322b9aeec upstream.
When workload runs in cgroups that aren't directly below root cgroup and their parent specifies reclaim protection, it may end up ineffective.
The reason is that propagate_protected_usage() is not called in all hierarchy up. All the protected usage is incorrectly accumulated in the workload's parent. This means that siblings_low_usage is overestimated and effective protection underestimated. Even though it is transitional phenomenon (uncharge path does correct propagation and fixes the wrong children_low_usage), it can undermine the intended protection unexpectedly.
We have noticed this problem while seeing a swap out in a descendant of a protected memcg (intermediate node) while the parent was conveniently under its protection limit and the memory pressure was external to that hierarchy. Michal has pinpointed this down to the wrong siblings_low_usage which led to the unwanted reclaim.
The fix is simply updating children_low_usage in respective ancestors also in the charging path.
--- mm/page_counter.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
mm/page_counter.c +3 -3
@@ -72,7 +72,7 @@ void page_counter_charge(struct page_coulong new; new =atomic_long_add_return (nr_pages, &c->usage); -propagate_protected_usage (counter, new); +propagate_protected_usage (c, new);/* * This is indeed racy, but we can live with some * inaccuracy in the watermark.
@@ -116,7 +116,7 @@ bool page_counter_try_charge(struct page new =atomic_long_add_return (nr_pages, &c->usage);if (new > c->max) {atomic_long_sub (nr_pages, &c->usage); -propagate_protected_usage (counter, new); +propagate_protected_usage (c, new);/* * This is racy, but we can live with some * inaccuracy in the failcnt.
@@ -125,7 +125,7 @@ bool page_counter_try_charge(struct page *fail = c; goto failed; } -propagate_protected_usage (counter, new); +propagate_protected_usage (c, new);/* * Just like with failcnt, we can live with some * inaccuracy in the watermark.
Greg Kroah-Hartman
maintainerPATCH 83/232 mm: fix kthread_use_mm() vs TLB invalidate
In reply to Greg Kroah-HartmanFrom: Peter Zijlstra <[email protected]>
commit 38cf307c1f2011d413750c5acb725456f47d9172 upstream.
For SMP systems using IPI based TLB invalidation, looking at current->active_mm is entirely reasonable. This then presents the following race condition:
CPU0 CPU1
flush_tlb_mm(mm) use_mm(mm)
<send-IPI> tsk->active_mm = mm; <IPI> if (tsk->active_mm == mm) // flush TLBs </IPI> switch_mm(old_mm,mm,tsk);
Where it is possible the IPI flushed the TLBs for @old_mm, not @mm, because the IPI lands before we actually switched.
Avoid this by disabling IRQs across changing ->active_mm and switch_mm().
Of the (SMP) architectures that have IPI based TLB invalidate:
Alpha - checks active_mm ARC - ASID specific IA64 - checks active_mm MIPS - ASID specific flush OpenRISC - shoots down world PARISC - shoots down world SH - ASID specific SPARC - ASID specific x86 - N/A xtensa - checks active_mm
So at the very least Alpha, IA64 and Xtensa are suspect.
On top of this, for scheduler consistency we need at least preemption disabled across changing tsk->mm and doing switch_mm(), which is currently provided by task_lock(), but that's not sufficient for PREEMPT_RT.
[[email protected]: add comment]
--- kernel/kthread.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)
kernel/kthread.c +6 -1
@@ -1239,13 +1239,16 @@ void kthread_use_mm(struct mm_struct *mmWARN_ON_ONCE (tsk->mm);task_lock (tsk); +/* Hold off tlb flush IPIs while switching mm's */ +local_irq_disable (); active_mm = tsk->active_mm;if (active_mm != mm) {mmgrab (mm); tsk->active_mm = mm; } tsk->mm = mm; -switch_mm (active_mm, mm, tsk); +switch_mm_irqs_off (active_mm, mm, tsk); +local_irq_enable ();task_unlock (tsk);#ifdef finish_arch_post_lock_switchfinish_arch_post_lock_switch ();
@@ -1274,9 +1277,11 @@ void kthread_unuse_mm(struct mm_struct *task_lock (tsk);sync_mm_rss (mm); +local_irq_disable (); tsk->mm =NULL ;/* active_mm is still 'mm' */ enter_lazy_tlb (mm, tsk); +local_irq_enable ();task_unlock (tsk); }EXPORT_SYMBOL_GPL (kthread_unuse_mm);
Greg Kroah-Hartman
maintainerPATCH 82/232 mm/shuffle: dont move pages between zones and dont read garbage memmaps
In reply to Greg Kroah-HartmanFrom: David Hildenbrand <[email protected]>
commit 4a93025cbe4a0b19d1a25a2d763a3d2018bad0d9 upstream.
Especially with memory hotplug, we can have offline sections (with a garbage memmap) and overlapping zones. We have to make sure to only touch initialized memmaps (online sections managed by the buddy) and that the zone matches, to not move pages between zones.
To test if this can actually happen, I added a simple
BUG_ON(page_zone(page_i) != page_zone(page_j));
right before the swap. When hotplugging a 256M DIMM to a 4G x86-64 VM and onlining the first memory block "online_movable" and the second memory block "online_kernel", it will trigger the BUG, as both zones (NORMAL and MOVABLE) overlap.
This might result in all kinds of weird situations (e.g., double allocations, list corruptions, unmovable allocations ending up in the movable zone).
--- mm/shuffle.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-)
mm/shuffle.c +9 -9
@@ -58,25 +58,25 @@ module_param_call(shuffle, shuffle_store* For two pages to be swapped in the shuffle, they must be free (on a * 'free_area' lru), have the same order, and have the same migratetype. */ -static struct page *__meminit shuffle_valid_page (unsigned long pfn,int order) +static struct page *__meminit shuffle_valid_page (struct zone *zone, +unsigned long pfn,int order) { -struct page *page; +struct page *page =pfn_to_online_page (pfn);/* * Given we're dealing with randomly selected pfns in a zone we * need to ask questions like... */ -/* ...is the pfn even in the memmap? */ -if (!pfn_valid_within (pfn)) +/* ... is the page managed by the buddy? */ +if (!page)return NULL ; -/* ...is the pfn in a present section or a hole? */ -if (!pfn_in_present_section (pfn)) +/* ... is the page assigned to the same zone? */ +if (page_zone (page) != zone)return NULL ;/* ...is the page free and currently on a free_area list? */ - page =pfn_to_page (pfn);if (!PageBuddy (page))return NULL ;
@@ -123,7 +123,7 @@ void __meminit __shuffle_zone(struct zon* page_j randomly selected in the span @zone_start_pfn to * @spanned_pages. */ - page_i =shuffle_valid_page (i, order); + page_i =shuffle_valid_page (z, i, order);if (!page_i)continue ;
@@ -137,7 +137,7 @@ void __meminit __shuffle_zone(struct zon j = z->zone_start_pfn +ALIGN_DOWN (get_random_long () % z->spanned_pages, order_pages); - page_j =shuffle_valid_page (j, order); + page_j =shuffle_valid_page (z, j, order);if (page_j && page_j != page_i)break ; }
Greg Kroah-Hartman
maintainerPATCH 84/232 ocfs2: change slot number type s16 to u16
In reply to Greg Kroah-HartmanFrom: Junxiao Bi <[email protected]>
commit 38d51b2dd171ad973afc1f5faab825ed05a2d5e9 upstream.
Dan Carpenter reported the following static checker warning.
fs/ocfs2/super.c:1269 ocfs2_parse_options() warn: '(-1)' 65535 can't fit into 32767 'mopt->slot' fs/ocfs2/suballoc.c:859 ocfs2_init_inode_steal_slot() warn: '(-1)' 65535 can't fit into 32767 'osb->s_inode_steal_slot' fs/ocfs2/suballoc.c:867 ocfs2_init_meta_steal_slot() warn: '(-1)' 65535 can't fit into 32767 'osb->s_meta_steal_slot'
That's because OCFS2_INVALID_SLOT is (u16)-1. Slot number in ocfs2 can be never negative, so change s16 to u16.
--- fs/ocfs2/ocfs2.h | 4 ++-- fs/ocfs2/suballoc.c | 4 ++-- fs/ocfs2/super.c | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-)
fs/ocfs2/ocfs2.h +2 -2
@@ -327,8 +327,8 @@ struct ocfs2_superspinlock_t osb_lock;u32 s_next_generation;unsigned long osb_flags; -s16 s_inode_steal_slot; -s16 s_meta_steal_slot; +u16 s_inode_steal_slot; +u16 s_meta_steal_slot;atomic_t s_num_inodes_stolen;atomic_t s_num_meta_stolen;
fs/ocfs2/suballoc.c +2 -2
@@ -879,9 +879,9 @@ static void __ocfs2_set_steal_slot(struc {spin_lock (&osb->osb_lock);if (type ==INODE_ALLOC_SYSTEM_INODE ) - osb->s_inode_steal_slot = slot; + osb->s_inode_steal_slot = (u16 )slot;else if (type ==EXTENT_ALLOC_SYSTEM_INODE ) - osb->s_meta_steal_slot = slot; + osb->s_meta_steal_slot = (u16 )slot;spin_unlock (&osb->osb_lock); }
fs/ocfs2/super.c +2 -2
@@ -78,7 +78,7 @@ struct mount_optionsunsigned long commit_interval;unsigned long mount_opt;unsigned int atime_quantum; -signed short slot; +unsigned short slot;int localalloc_opt;unsigned int resv_level;int dir_resv_level;
@@ -1349,7 +1349,7 @@ static int ocfs2_parse_options(struct su goto bail; }if (option) - mopt->slot = (s16 )option; + mopt->slot = (u16 )option;break ;case Opt_commit:if (match_int (&args[0 ], &option)) {
Greg Kroah-Hartman
maintainerPATCH 81/232 hugetlbfs: remove call to huge_pte_alloc without i_mmap_rwsem
In reply to Greg Kroah-HartmanFrom: Mike Kravetz <[email protected]>
commit 34ae204f18519f0920bd50a644abd6fefc8dbfcf upstream.
Commit c0d0381ade79 ("hugetlbfs: use i_mmap_rwsem for more pmd sharing synchronization") requires callers of huge_pte_alloc to hold i_mmap_rwsem in at least read mode. This is because the explicit locking in huge_pmd_share (called by huge_pte_alloc) was removed. When restructuring the code, the call to huge_pte_alloc in the else block at the beginning of hugetlb_fault was missed.
Unfortunately, that else clause is exercised when there is no page table entry. This will likely lead to a call to huge_pmd_share. If huge_pmd_share thinks pmd sharing is possible, it will traverse the mapping tree (i_mmap) without holding i_mmap_rwsem. If someone else is modifying the tree, bad things such as addressing exceptions or worse could happen.
Simply remove the else clause. It should have been removed previously. The code following the else will call huge_pte_alloc with the appropriate locking.
To prevent this type of issue in the future, add routines to assert that i_mmap_rwsem is held, and call these routines in huge pmd sharing routines.
--- include/linux/fs.h | 10 ++++++++++ include/linux/hugetlb.h | 8 +++++--- mm/hugetlb.c | 15 +++++++-------- mm/rmap.c | 2 +- 4 files changed, 23 insertions(+), 12 deletions(-)
include/linux/fs.h +10 -0
@@ -549,6 +549,16 @@ static inline void i_mmap_unlock_read(stup_read (&mapping->i_mmap_rwsem); } +static inline void i_mmap_assert_locked (struct address_space *mapping) +{ +lockdep_assert_held (&mapping->i_mmap_rwsem); +} + +static inline void i_mmap_assert_write_locked (struct address_space *mapping) +{ +lockdep_assert_held_write (&mapping->i_mmap_rwsem); +} +/* * Might pages of this file be mapped into userspace? */
include/linux/hugetlb.h +5 -3
@@ -164,7 +164,8 @@ pte_t *huge_pte_alloc(struct mm_struct * unsigned long addr, unsigned long sz);pte_t *huge_pte_offset (struct mm_struct *mm,unsigned long addr,unsigned long sz); -int huge_pmd_unshare (struct mm_struct *mm,unsigned long *addr,pte_t *ptep); +int huge_pmd_unshare (struct mm_struct *mm,struct vm_area_struct *vma, +unsigned long *addr,pte_t *ptep);void adjust_range_if_pmd_sharing_possible (struct vm_area_struct *vma,unsigned long *start,unsigned long *end); struct page *follow_huge_addr(struct mm_struct *mm, unsigned long address,
@@ -203,8 +204,9 @@ static inline struct address_space *hugereturn NULL ; } -static inline int huge_pmd_unshare (struct mm_struct *mm,unsigned long *addr, -pte_t *ptep) +static inline int huge_pmd_unshare (struct mm_struct *mm, +struct vm_area_struct *vma, +unsigned long *addr,pte_t *ptep) {return 0 ; }
mm/hugetlb.c +7 -8
@@ -3952,7 +3952,7 @@ void __unmap_hugepage_range(struct mmu_gcontinue ; ptl =huge_pte_lock (h, mm, ptep); -if (huge_pmd_unshare (mm, &address, ptep)) { +if (huge_pmd_unshare (mm, vma, &address, ptep)) {spin_unlock (ptl);/* * We just unmapped a page of PMDs by clearing a PUD.
@@ -4539,10 +4539,6 @@ vm_fault_t hugetlb_fault(struct mm_struc }else if (unlikely (is_hugetlb_entry_hwpoisoned (entry)))return VM_FAULT_HWPOISON_LARGE |VM_FAULT_SET_HINDEX (hstate_index (h)); - }else { - ptep =huge_pte_alloc (mm, haddr,huge_page_size (h)); -if (!ptep) -return VM_FAULT_OOM ; }/*
@@ -5019,7 +5015,7 @@ unsigned long hugetlb_change_protection(if (!ptep)continue ; ptl =huge_pte_lock (h, mm, ptep); -if (huge_pmd_unshare (mm, &address, ptep)) { +if (huge_pmd_unshare (mm, vma, &address, ptep)) { pages++;spin_unlock (ptl); shared_pmd = true;
@@ -5400,12 +5396,14 @@ out:* returns: 1 successfully unmapped a shared pte page * 0 the underlying pte page is not shared, or it is the last user */ -int huge_pmd_unshare (struct mm_struct *mm,unsigned long *addr,pte_t *ptep) +int huge_pmd_unshare (struct mm_struct *mm,struct vm_area_struct *vma, +unsigned long *addr,pte_t *ptep) {pgd_t *pgd =pgd_offset (mm, *addr);p4d_t *p4d =p4d_offset (pgd, *addr);pud_t *pud =pud_offset (p4d, *addr); +i_mmap_assert_write_locked (vma->vm_file->f_mapping);BUG_ON (page_count (virt_to_page (ptep)) ==0 );if (page_count (virt_to_page (ptep)) ==1 )return 0 ;
@@ -5423,7 +5421,8 @@ pte_t *huge_pmd_share(struct mm_struct *return NULL ; } -int huge_pmd_unshare (struct mm_struct *mm,unsigned long *addr,pte_t *ptep) +int huge_pmd_unshare (struct mm_struct *mm,struct vm_area_struct *vma, +unsigned long *addr,pte_t *ptep) {return 0 ; }
mm/rmap.c +1 -1
@@ -1469,7 +1469,7 @@ static bool try_to_unmap_one(struct page* do this outside rmap routines. */ VM_BUG_ON (!(flags &TTU_RMAP_LOCKED )); -if (huge_pmd_unshare (mm, &address, pvmw.pte)) { +if (huge_pmd_unshare (mm, vma, &address, pvmw.pte)) {/* * huge_pmd_unshare unmapped an entire PMD * page. There is no way of knowing exactly
Greg Kroah-Hartman
maintainerPATCH 80/232 khugepaged: retract_page_tables() remember to test exit
In reply to Greg Kroah-HartmanFrom: Hugh Dickins <[email protected]>
commit 18e77600f7a1ed69f8ce46c9e11cad0985712dfa upstream.
Only once have I seen this scenario (and forgot even to notice what forced the eventual crash): a sequence of "BUG: Bad page map" alerts from vm_normal_page(), from zap_pte_range() servicing exit_mmap(); pmd:00000000, pte values corresponding to data in physical page 0.
The pte mappings being zapped in this case were supposed to be from a huge page of ext4 text (but could as well have been shmem): my belief is that it was racing with collapse_file()'s retract_page_tables(), found *pmd pointing to a page table, locked it, but *pmd had become 0 by the time start_pte was decided.
In most cases, that possibility is excluded by holding mmap lock; but exit_mmap() proceeds without mmap lock. Most of what's run by khugepaged checks khugepaged_test_exit() after acquiring mmap lock:khugepaged_collapse_pte_mapped_thps() and hugepage_vma_revalidate() do so, for example. But retract_page_tables() did not: fix that.
The fix is for retract_page_tables() to check khugepaged_test_exit(), after acquiring mmap lock, before doing anything to the page table. Getting the mmap lock serializes with __mmput(), which briefly takes and drops it in __khugepaged_exit(); then the khugepaged_test_exit() check on mm_users makes sure we don't touch the page table once exit_mmap() might reach it, since exit_mmap() will be proceeding without mmap lock, not expecting anyone to be racing with it.
--- mm/khugepaged.c | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-)
mm/khugepaged.c +14 -10
@@ -1532,6 +1532,7 @@ out:static void retract_page_tables (struct address_space *mapping,pgoff_t pgoff) {struct vm_area_struct *vma; +struct mm_struct *mm;unsigned long addr;pmd_t *pmd, _pmd;
@@ -1560,7 +1561,8 @@ static void retract_page_tables(struct acontinue ;if (vma->vm_end < addr +HPAGE_PMD_SIZE )continue ; - pmd =mm_find_pmd (vma->vm_mm, addr); + mm = vma->vm_mm; + pmd =mm_find_pmd (mm, addr);if (!pmd)continue ;/*
@@ -1570,17 +1572,19 @@ static void retract_page_tables(struct a* mmap_lock while holding page lock. Fault path does it in * reverse order. Trylock is a way to avoid deadlock. */ -if (mmap_write_trylock (vma->vm_mm)) { -spinlock_t *ptl =pmd_lock (vma->vm_mm, pmd); -/* assume page table is clear */ - _pmd =pmdp_collapse_flush (vma, addr, pmd); -spin_unlock (ptl); -mmap_write_unlock (vma->vm_mm); -mm_dec_nr_ptes (vma->vm_mm); -pte_free (vma->vm_mm,pmd_pgtable (_pmd)); +if (mmap_write_trylock (mm)) { +if (!khugepaged_test_exit (mm)) { +spinlock_t *ptl =pmd_lock (mm, pmd); +/* assume page table is clear */ + _pmd =pmdp_collapse_flush (vma, addr, pmd); +spin_unlock (ptl); +mm_dec_nr_ptes (mm); +pte_free (mm,pmd_pgtable (_pmd)); + } +mmap_write_unlock (mm); }else {/* Try again later */ -khugepaged_add_pte_mapped_thp (vma->vm_mm, addr); +khugepaged_add_pte_mapped_thp (mm, addr); } }i_mmap_unlock_write (mapping);
Greg Kroah-Hartman
maintainerPATCH 75/232 MIPS: SGI-IP27: always enable NUMA in Kconfig
In reply to Greg Kroah-HartmanFrom: Mike Rapoport <[email protected]>
commit 6c86a3029ce3b44597526909f2e39a77a497f640 upstream.
When a configuration has NUMA disabled and SGI_IP27 enabled, the build fails:
CC kernel/bounds.s
CC arch/mips/kernel/asm-offsets.s
In file included from arch/mips/include/asm/topology.h:11,
from include/linux/topology.h:36,
from include/linux/gfp.h:9,
from include/linux/slab.h:15,
from include/linux/crypto.h:19,
from include/crypto/hash.h:11,
from include/linux/uio.h:10,
from include/linux/socket.h:8,
from include/linux/compat.h:15,
from arch/mips/kernel/asm-offsets.c:12:include/linux/topology.h: In function 'numa_node_id':arch/mips/include/asm/mach-ip27/topology.h:16:27: error: implicit declaration of function 'cputonasid'; did you mean 'cpu_vpe_id'? [-Werror=implicit-function-declaration]
#define cpu_to_node(cpu) (cputonasid(cpu))
^~~~~~~~~~
include/linux/topology.h:119:9: note: in expansion of macro 'cpu_to_node'
return cpu_to_node(raw_smp_processor_id());
^~~~~~~~~~~
include/linux/topology.h: In function 'cpu_cpu_mask':
arch/mips/include/asm/mach-ip27/topology.h:19:7: error: implicit declaration of function 'hub_data' [-Werror=implicit-function-declaration]
&hub_data(node)->h_cpus)
^~~~~~~~
include/linux/topology.h:210:9: note: in expansion of macro 'cpumask_of_node'
return cpumask_of_node(cpu_to_node(cpu));
^~~~~~~~~~~~~~~
arch/mips/include/asm/mach-ip27/topology.h:19:21: error: invalid type argument of '->' (have 'int')
&hub_data(node)->h_cpus)
^~
include/linux/topology.h:210:9: note: in expansion of macro 'cpumask_of_node'
return cpumask_of_node(cpu_to_node(cpu));
^~~~~~~~~~~~~~~Before switch from discontigmem to sparsemem, there always was CONFIG_NEED_MULTIPLE_NODES=y because it was selected by DISCONTIGMEM. Without DISCONTIGMEM it is possible to have SPARSEMEM without NUMA for SGI_IP27 and as many things there rely on custom node definition, the build breaks.
As Thomas noted "... there are right now too many places in IP27 code, which assumes NUMA enabled", the simplest solution would be to always enable NUMA for SGI-IP27 builds.
--- arch/mips/Kconfig | 1 + 1 file changed, 1 insertion(+)
arch/mips/Kconfig +1 -0
@@ -678,6 +678,7 @@ config SGI_IP27 select SYS_SUPPORTS_NUMA select SYS_SUPPORTS_SMP select MIPS_L1_CACHE_SHIFT_7 + select NUMA help This are the SGI Origin 200, Origin 2000 and Onyx 2 Graphics workstations. To compile a Linux kernel that runs on these, say Y
Greg Kroah-Hartman
maintainerPATCH 79/232 khugepaged: collapse_pte_mapped_thp() protect the pmd lock
In reply to Greg Kroah-HartmanFrom: Hugh Dickins <[email protected]>
commit 119a5fc16105b2b9383a6e2a7800b2ef861b2975 upstream.
When retract_page_tables() removes a page table to make way for a huge pmd, it holds huge page lock, i_mmap_lock_write, mmap_write_trylock and pmd lock; but when collapse_pte_mapped_thp() does the same (to handle the case when the original mmap_write_trylock had failed), only mmap_write_trylock and pmd lock are held.
That's not enough. One machine has twice crashed under load, with "BUG:
spinlock bad magic" and GPF on 6b6b6b6b6b6b6b6b. Examining the second crash, page_vma_mapped_walk_done()'s spin_unlock of pvmw->ptl (serving page_referenced() on a file THP, that had found a page table at *pmd) discovers that the page table page and its lock have already been freed by the time it comes to unlock.
Follow the example of retract_page_tables(), but we only need one of huge page lock or i_mmap_lock_write to secure against this: because it's the narrower lock, and because it simplifies collapse_pte_mapped_thp() to know the hpage earlier, choose to rely on huge page lock here.
--- mm/khugepaged.c | 44 +++++++++++++++++++------------------------- 1 file changed, 19 insertions(+), 25 deletions(-)
mm/khugepaged.c +19 -25
@@ -1412,7 +1412,7 @@ void collapse_pte_mapped_thp(struct mm_s {unsigned long haddr = addr &HPAGE_PMD_MASK ;struct vm_area_struct *vma =find_vma (mm, haddr); -struct page *hpage =NULL ; +struct page *hpage;pte_t *start_pte, *pte;pmd_t *pmd, _pmd;spinlock_t *ptl;
@@ -1432,9 +1432,17 @@ void collapse_pte_mapped_thp(struct mm_sif (!hugepage_vma_check (vma, vma->vm_flags |VM_HUGEPAGE ))return ; + hpage =find_lock_page (vma->vm_file->f_mapping, +linear_page_index (vma, haddr)); +if (!hpage) +return ; + +if (!PageHead (hpage)) + goto drop_hpage; + pmd =mm_find_pmd (mm, haddr);if (!pmd) -return ; + goto drop_hpage; start_pte =pte_offset_map_lock (mm, pmd, haddr, &ptl);
@@ -1453,30 +1461,11 @@ void collapse_pte_mapped_thp(struct mm_s page =vm_normal_page (vma, addr, *pte); -if (!page || !PageCompound (page)) - goto abort; - -if (!hpage) { - hpage =compound_head (page); -/* -* The mapping of the THP should not change. -* -* Note that uprobe, debugger, or MAP_PRIVATE may -* change the page table, but the new page will -* not pass PageCompound() check. -*/ -if (WARN_ON (hpage->mapping != vma->vm_file->f_mapping)) - goto abort; - } -/* -* Confirm the page maps to the correct subpage. -* -* Note that uprobe, debugger, or MAP_PRIVATE may change -* the page table, but the new page will not pass -* PageCompound() check. +* Note that uprobe, debugger, or MAP_PRIVATE may change the +* page table, but the new page will not be a subpage of hpage. */ -if (WARN_ON (hpage + i != page)) +if (hpage + i != page) goto abort; count++; }
@@ -1495,7 +1484,7 @@ void collapse_pte_mapped_thp(struct mm_spte_unmap_unlock (start_pte, ptl);/* step 3: set proper refcount and mm_counters. */ -if (hpage) { +if (count) {page_ref_sub (hpage, count);add_mm_counter (vma->vm_mm,mm_counter_file (hpage), -count); }
@@ -1506,10 +1495,15 @@ void collapse_pte_mapped_thp(struct mm_sspin_unlock (ptl);mm_dec_nr_ptes (mm);pte_free (mm,pmd_pgtable (_pmd)); + +drop_hpage: +unlock_page (hpage); +put_page (hpage);return ; abort:pte_unmap_unlock (start_pte, ptl); + goto drop_hpage; }static int khugepaged_collapse_pte_mapped_thps (struct mm_slot *mm_slot)
Greg Kroah-Hartman
maintainerPATCH 14/232 btrfs: free anon block device right after subvolume deletion
In reply to Greg Kroah-HartmanFrom: Qu Wenruo <[email protected]>
commit 082b6c970f02fefd278c7833880cda29691a5f34 upstream.
[BUG]
When a lot of subvolumes are created, there is a user report about transaction aborted caused by slow anonymous block device reclaim:
BTRFS: Transaction aborted (error -24)
WARNING: CPU: 17 PID: 17041 at fs/btrfs/transaction.c:1576 create_pending_snapshot+0xbc4/0xd10 [btrfs] RIP: 0010:create_pending_snapshot+0xbc4/0xd10 [btrfs] Call Trace: create_pending_snapshots+0x82/0xa0 [btrfs] btrfs_commit_transaction+0x275/0x8c0 [btrfs] btrfs_mksubvol+0x4b9/0x500 [btrfs] btrfs_ioctl_snap_create_transid+0x174/0x180 [btrfs] btrfs_ioctl_snap_create_v2+0x11c/0x180 [btrfs] btrfs_ioctl+0x11a4/0x2da0 [btrfs] do_vfs_ioctl+0xa9/0x640 ksys_ioctl+0x67/0x90 __x64_sys_ioctl+0x1a/0x20 do_syscall_64+0x5a/0x110 entry_SYSCALL_64_after_hwframe+0x44/0xa9 ---[ end trace 33f2f83f3d5250e9 ]--- BTRFS: error (device sda1) in create_pending_snapshot:1576: errno=-24 unknown BTRFS info (device sda1): forced readonly BTRFS warning (device sda1): Skipping commit of aborted transaction. BTRFS: error (device sda1) in cleanup_transaction:1831: errno=-24 unknown
[CAUSE]
The anonymous device pool is shared and its size is 1M. It's possible to hit that limit if the subvolume deletion is not fast enough and the subvolumes to be cleaned keep the ids allocated.
[WORKAROUND]
We can't avoid the anon device pool exhaustion but we can shorten the time the id is attached to the subvolume root once the subvolume becomes invisible to the user.
--- fs/btrfs/inode.c | 2 ++ 1 file changed, 2 insertions(+)
fs/btrfs/inode.c +2 -0
@@ -4041,6 +4041,8 @@ int btrfs_delete_subvolume(struct inode } } +free_anon_bdev (dest->anon_dev); + dest->anon_dev =0 ; out_end_trans: trans->block_rsv =NULL ; trans->bytes_reserved =0 ;
Greg Kroah-Hartman
maintainerPATCH 21/232 btrfs: remove no longer needed use of log_writers for the log root tree
In reply to Greg Kroah-HartmanFrom: Filipe Manana <[email protected]>
commit a93e01682e283f6de09d6ce8f805dc52a2e942fb upstream.
When syncing the log, we used to update the log root tree without holding neither the log_mutex of the subvolume root nor the log_mutex of log root tree.
We used to have two critical sections delimited by the log_mutex of the log root tree, so in the first one we incremented the log_writers of the log root tree and on the second one we decremented it and waited for the log_writers counter to go down to zero. This was because the update of the log root tree happened between the two critical sections.
The use of two critical sections allowed a little bit more of parallelism and required the use of the log_writers counter, necessary to make sure we didn't miss any log root tree update when we have multiple tasks trying to sync the log in parallel.
However after commit 06989c799f0481 ("Btrfs: fix race updating log root item during fsync") the log root tree update was moved into a critical section delimited by the subvolume's log_mutex. Later another commit moved the log tree update from that critical section into the second critical section delimited by the log_mutex of the log root tree. Both commits addressed different bugs.
The end result is that the first critical section delimited by the log_mutex of the log root tree became pointless, since there's nothing done between it and the second critical section, we just have an unlock of the log_mutex followed by a lock operation. This means we can merge both critical sections, as the first one does almost nothing now, and we can stop using the log_writers counter of the log root tree, which was incremented in the first critical section and decremented in the second criticial section, used to make sure no one in the second critical section started writeback of the log root tree before some other task updated it.
So just remove the mutex_unlock() followed by mutex_lock() of the log root tree, as well as the use of the log_writers counter for the log root tree.
This patch is part of a series that has the following patches:
1/4 btrfs: only commit the delayed inode when doing a full fsync 2/4 btrfs: only commit delayed items at fsync if we are logging a directory 3/4 btrfs: stop incremening log_batch for the log root tree when syncing log 4/4 btrfs: remove no longer needed use of log_writers for the log root tree
After the entire patchset applied I saw about 12% decrease on max latency reported by dbench. The test was done on a qemu vm, with 8 cores, 16Gb of ram, using kvm and using a raw NVMe device directly (no intermediary fs on the host). The test was invoked like the following:
mkfs.btrfs -f /dev/sdk
mount -o ssd -o nospace_cache /dev/sdk /mnt/sdk
dbench -D /mnt/sdk -t 300 8
umount /mnt/dsk
--- fs/btrfs/ctree.h | 1 + fs/btrfs/tree-log.c | 13 ------------- 2 files changed, 1 insertion(+), 13 deletions(-)
fs/btrfs/ctree.h +1 -0
@@ -1059,6 +1059,7 @@ struct btrfs_root {wait_queue_head_t log_writer_wait;wait_queue_head_t log_commit_wait[2 ];struct list_head log_ctxs[2 ]; +/* Used only for log trees of subvolumes, not for the log root tree */ atomic_t log_writers;atomic_t log_commit[2 ];/* Used only for log trees of subvolumes, not for the log root tree */
fs/btrfs/tree-log.c +0 -13
@@ -3116,28 +3116,17 @@ int btrfs_sync_log(struct btrfs_trans_habtrfs_init_log_ctx (&root_log_ctx,NULL );mutex_lock (&log_root_tree->log_mutex); -atomic_inc (&log_root_tree->log_writers); index2 = log_root_tree->log_transid %2 ;list_add_tail (&root_log_ctx.list, &log_root_tree->log_ctxs[index2]); root_log_ctx.log_transid = log_root_tree->log_transid; -mutex_unlock (&log_root_tree->log_mutex); - -mutex_lock (&log_root_tree->log_mutex); -/* * Now we are safe to update the log_root_tree because we're under the * log_mutex, and we're a current writer so we're holding the commit * open until we drop the log_mutex. */ ret =update_log_root (trans, log, &new_root_item); - -if (atomic_dec_and_test (&log_root_tree->log_writers)) { -/* atomic_dec_and_test implies a barrier */ -cond_wake_up_nomb (&log_root_tree->log_writer_wait); - } -if (ret) {if (!list_empty (&root_log_ctx.list))list_del_init (&root_log_ctx.list);
@@ -3183,8 +3172,6 @@ int btrfs_sync_log(struct btrfs_trans_ha root_log_ctx.log_transid - 1); } -wait_for_writer (log_root_tree); -/* * now that we've moved on to the tree of log tree roots, * check the full commit flag again
Greg Kroah-Hartman
maintainerPATCH 22/232 btrfs: dont traverse into the seed devices in show_devname
In reply to Greg Kroah-HartmanFrom: Anand Jain <[email protected]>
commit 4faf55b03823e96c44dc4e364520000ed3b12fdb upstream.
->show_devname currently shows the lowest devid in the list. As the seed devices have the lowest devid in the sprouted filesystem, the userland tool such as findmnt end up seeing seed device instead of the device from the read-writable sprouted filesystem. As shown below.
mount /dev/sda /btrfs
mount: /btrfs: WARNING: device write-protected, mounted read-only.
findmnt --output SOURCE,TARGET,UUID /btrfs
SOURCE TARGET UUID
/dev/sda /btrfs 899f7027-3e46-4626-93e7-7d4c9ad19111
btrfs dev add -f /dev/sdb /btrfs
umount /btrfs
mount /dev/sdb /btrfs
findmnt --output SOURCE,TARGET,UUID /btrfs
SOURCE TARGET UUID
/dev/sda /btrfs 899f7027-3e46-4626-93e7-7d4c9ad19111
All sprouts from a single seed will show the same seed device and the same fsid. That's confusing.
This is causing problems in our prototype as there isn't any reference to the sprout file-system(s) which is being used for actual read and write.
This was added in the patch which implemented the show_devname in btrfs commit 9c5085c14798 ("Btrfs: implement ->show_devname").
I tried to look for any particular reason that we need to show the seed device, there isn't any.
So instead, do not traverse through the seed devices, just show the lowest devid in the sprouted fsid.
After the patch:
mount /dev/sda /btrfs
mount: /btrfs: WARNING: device write-protected, mounted read-only.
findmnt --output SOURCE,TARGET,UUID /btrfs
SOURCE TARGET UUID
/dev/sda /btrfs 899f7027-3e46-4626-93e7-7d4c9ad19111
btrfs dev add -f /dev/sdb /btrfs
mount -o rw,remount /dev/sdb /btrfs
findmnt --output SOURCE,TARGET,UUID /btrfs
SOURCE TARGET UUID
/dev/sdb /btrfs 595ca0e6-b82e-46b5-b9e2-c72a6928be48
mount /dev/sda /btrfs1
mount: /btrfs1: WARNING: device write-protected, mounted read-only.
btrfs dev add -f /dev/sdc /btrfs1
findmnt --output SOURCE,TARGET,UUID /btrfs1
SOURCE TARGET UUID
/dev/sdc /btrfs1 ca1dbb7a-8446-4f95-853c-a20f3f82bdbb
cat /proc/self/mounts | grep btrfs
/dev/sdb /btrfs btrfs rw,relatime,noacl,space_cache,subvolid=5,subvol=/ 0 0 /dev/sdc /btrfs1 btrfs ro,relatime,noacl,space_cache,subvolid=5,subvol=/ 0 0
--- fs/btrfs/super.c | 21 +++++++-------------- 1 file changed, 7 insertions(+), 14 deletions(-)
fs/btrfs/super.c +7 -14
@@ -2296,9 +2296,7 @@ static int btrfs_unfreeze(struct super_bstatic int btrfs_show_devname (struct seq_file *m,struct dentry *root) {struct btrfs_fs_info *fs_info =btrfs_sb (root->d_sb); -struct btrfs_fs_devices *cur_devices;struct btrfs_device *dev, *first_dev =NULL ; -struct list_head *head;/* * Lightweight locking of the devices. We should not need
@@ -2308,18 +2306,13 @@ static int btrfs_show_devname(struct seq* least until the rcu_read_unlock. */ rcu_read_lock (); - cur_devices = fs_info->fs_devices; -while (cur_devices) { - head = &cur_devices->devices; -list_for_each_entry_rcu (dev, head, dev_list) { -if (test_bit (BTRFS_DEV_STATE_MISSING , &dev->dev_state)) -continue ; -if (!dev->name) -continue ; -if (!first_dev || dev->devid < first_dev->devid) - first_dev = dev; - } - cur_devices = cur_devices->seed; +list_for_each_entry_rcu (dev, &fs_info->fs_devices->devices, dev_list) { +if (test_bit (BTRFS_DEV_STATE_MISSING , &dev->dev_state)) +continue ; +if (!dev->name) +continue ; +if (!first_dev || dev->devid < first_dev->devid) + first_dev = dev; }if (first_dev)
Greg Kroah-Hartman
maintainerPATCH 24/232 btrfs: open device without device_list_mutex
In reply to Greg Kroah-HartmanFrom: Josef Bacik <[email protected]>
commit 18c850fdc5a801bad4977b0f1723761d42267e45 upstream.
There's long existed a lockdep splat because we open our bdev's under the ->device_list_mutex at mount time, which acquires the bd_mutex. Usually this goes unnoticed, but if you do loopback devices at all suddenly the bd_mutex comes with a whole host of other dependencies, which results in the splat when you mount a btrfs file system.
======================================================
WARNING: possible circular locking dependency detected 5.8.0-0.rc3.1.fc33.x86_64+debug #1 Not tainted
------------------------------------------------------
systemd-journal/509 is trying to acquire lock:ffff970831f84db0 (&fs_info->reloc_mutex){+.+.}-{3:3}, at: btrfs_record_root_in_trans+0x44/0x70 [btrfs]
but task is already holding lock:ffff97083144d598 (sb_pagefaults){.+.+}-{0:0}, at: btrfs_page_mkwrite+0x59/0x560 [btrfs]
which lock already depends on the new lock.
the existing dependency chain (in reverse order) is:
-> #6 (sb_pagefaults){.+.+}-{0:0}:
__sb_start_write+0x13e/0x220
btrfs_page_mkwrite+0x59/0x560 [btrfs]
do_page_mkwrite+0x4f/0x130
do_wp_page+0x3b0/0x4f0
handle_mm_fault+0xf47/0x1850
do_user_addr_fault+0x1fc/0x4b0
exc_page_fault+0x88/0x300
asm_exc_page_fault+0x1e/0x30-> #5 (&mm->mmap_lock#2){++++}-{3:3}:
__might_fault+0x60/0x80
_copy_from_user+0x20/0xb0
get_sg_io_hdr+0x9a/0xb0
scsi_cmd_ioctl+0x1ea/0x2f0
cdrom_ioctl+0x3c/0x12b4
sr_block_ioctl+0xa4/0xd0
block_ioctl+0x3f/0x50
ksys_ioctl+0x82/0xc0
__x64_sys_ioctl+0x16/0x20
do_syscall_64+0x52/0xb0
entry_SYSCALL_64_after_hwframe+0x44/0xa9-> #4 (&cd->lock){+.+.}-{3:3}:
__mutex_lock+0x7b/0x820
sr_block_open+0xa2/0x180
__blkdev_get+0xdd/0x550
blkdev_get+0x38/0x150
do_dentry_open+0x16b/0x3e0
path_openat+0x3c9/0xa00
do_filp_open+0x75/0x100
do_sys_openat2+0x8a/0x140
__x64_sys_openat+0x46/0x70
do_syscall_64+0x52/0xb0
entry_SYSCALL_64_after_hwframe+0x44/0xa9-> #3 (&bdev->bd_mutex){+.+.}-{3:3}:
__mutex_lock+0x7b/0x820
__blkdev_get+0x6a/0x550
blkdev_get+0x85/0x150
blkdev_get_by_path+0x2c/0x70
btrfs_get_bdev_and_sb+0x1b/0xb0 [btrfs]
open_fs_devices+0x88/0x240 [btrfs]
btrfs_open_devices+0x92/0xa0 [btrfs]
btrfs_mount_root+0x250/0x490 [btrfs]
legacy_get_tree+0x30/0x50
vfs_get_tree+0x28/0xc0
vfs_kern_mount.part.0+0x71/0xb0
btrfs_mount+0x119/0x380 [btrfs]
legacy_get_tree+0x30/0x50
vfs_get_tree+0x28/0xc0
do_mount+0x8c6/0xca0
__x64_sys_mount+0x8e/0xd0
do_syscall_64+0x52/0xb0
entry_SYSCALL_64_after_hwframe+0x44/0xa9-> #2 (&fs_devs->device_list_mutex){+.+.}-{3:3}:
__mutex_lock+0x7b/0x820
btrfs_run_dev_stats+0x36/0x420 [btrfs]
commit_cowonly_roots+0x91/0x2d0 [btrfs]
btrfs_commit_transaction+0x4e6/0x9f0 [btrfs]
btrfs_sync_file+0x38a/0x480 [btrfs]
__x64_sys_fdatasync+0x47/0x80
do_syscall_64+0x52/0xb0
entry_SYSCALL_64_after_hwframe+0x44/0xa9-> #1 (&fs_info->tree_log_mutex){+.+.}-{3:3}:
__mutex_lock+0x7b/0x820
btrfs_commit_transaction+0x48e/0x9f0 [btrfs]
btrfs_sync_file+0x38a/0x480 [btrfs]
__x64_sys_fdatasync+0x47/0x80
do_syscall_64+0x52/0xb0
entry_SYSCALL_64_after_hwframe+0x44/0xa9-> #0 (&fs_info->reloc_mutex){+.+.}-{3:3}:
__lock_acquire+0x1241/0x20c0
lock_acquire+0xb0/0x400
__mutex_lock+0x7b/0x820
btrfs_record_root_in_trans+0x44/0x70 [btrfs]
start_transaction+0xd2/0x500 [btrfs]
btrfs_dirty_inode+0x44/0xd0 [btrfs]
file_update_time+0xc6/0x120
btrfs_page_mkwrite+0xda/0x560 [btrfs]
do_page_mkwrite+0x4f/0x130
do_wp_page+0x3b0/0x4f0
handle_mm_fault+0xf47/0x1850
do_user_addr_fault+0x1fc/0x4b0
exc_page_fault+0x88/0x300
asm_exc_page_fault+0x1e/0x30other info that might help us debug this:
Chain exists of: &fs_info->reloc_mutex --> &mm->mmap_lock#2 --> sb_pagefaults Possible unsafe locking scenario:
CPU0 CPU1
---- ----
lock(sb_pagefaults);
lock(&mm->mmap_lock#2);
lock(sb_pagefaults); lock(&fs_info->reloc_mutex);
*** DEADLOCK ***
3 locks held by systemd-journal/509:
#0: ffff97083bdec8b8 (&mm->mmap_lock#2){++++}-{3:3}, at: do_user_addr_fault+0x12e/0x4b0 #1: ffff97083144d598 (sb_pagefaults){.+.+}-{0:0}, at: btrfs_page_mkwrite+0x59/0x560 [btrfs] #2: ffff97083144d6a8 (sb_internal){.+.+}-{0:0}, at: start_transaction+0x3f8/0x500 [btrfs]
stack backtrace: CPU: 0 PID: 509 Comm: systemd-journal Not tainted 5.8.0-0.rc3.1.fc33.x86_64+debug #1 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 0.0.0 02/06/2015 Call Trace: dump_stack+0x92/0xc8 check_noncircular+0x134/0x150 __lock_acquire+0x1241/0x20c0 lock_acquire+0xb0/0x400 ? btrfs_record_root_in_trans+0x44/0x70 [btrfs] ? lock_acquire+0xb0/0x400 ? btrfs_record_root_in_trans+0x44/0x70 [btrfs] __mutex_lock+0x7b/0x820 ? btrfs_record_root_in_trans+0x44/0x70 [btrfs] ? kvm_sched_clock_read+0x14/0x30 ? sched_clock+0x5/0x10 ? sched_clock_cpu+0xc/0xb0 btrfs_record_root_in_trans+0x44/0x70 [btrfs] start_transaction+0xd2/0x500 [btrfs] btrfs_dirty_inode+0x44/0xd0 [btrfs] file_update_time+0xc6/0x120 btrfs_page_mkwrite+0xda/0x560 [btrfs] ? sched_clock+0x5/0x10 do_page_mkwrite+0x4f/0x130 do_wp_page+0x3b0/0x4f0 handle_mm_fault+0xf47/0x1850 do_user_addr_fault+0x1fc/0x4b0 exc_page_fault+0x88/0x300 ? asm_exc_page_fault+0x8/0x30 asm_exc_page_fault+0x1e/0x30 RIP: 0033:0x7fa3972fdbfe Code: Bad RIP value.
Fix this by not holding the ->device_list_mutex at this point. The device_list_mutex exists to protect us from modifying the device list while the file system is running.
However it can also be modified by doing a scan on a device. But this action is specifically protected by the uuid_mutex, which we are holding here. We cannot race with opening at this point because we have the ->s_mount lock held during the mount. Not having the ->device_list_mutex here is perfectly safe as we're not going to change the devices at this point.
--- fs/btrfs/volumes.c | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-)
fs/btrfs/volumes.c +18 -3
@@ -245,7 +245,9 @@ static int __btrfs_map_block(struct btrf* * global::fs_devs - add, remove, updates to the global list * -* does not protect: manipulation of the fs_devices::devices list! +* does not protect: manipulation of the fs_devices::devices list in general +* but in mount context it could be used to exclude list modifications by eg. +* scan ioctl * * btrfs_device::name - renames (write side), read is RCU *
@@ -258,6 +260,9 @@ static int __btrfs_map_block(struct btrf* may be used to exclude some operations from running concurrently without any * modifications to the list (see write_all_supers) * +* Is not required at mount and close times, because our device list is +* protected by the uuid_mutex at that point. +* * balance_mutex * ------------- * protects balance structures (status, state) and context accessed from
@@ -602,6 +607,11 @@ static int btrfs_free_stale_devices(consreturn ret; } +/* +* This is only used on mount, and we are protected from competing things +* messing with our fs_devices by the uuid_mutex, thus we do not need the +* fs_devices->device_list_mutex here. +*/ static int btrfs_open_one_device (struct btrfs_fs_devices *fs_devices,struct btrfs_device *device,fmode_t flags,void *holder)
@@ -1229,8 +1239,14 @@ int btrfs_open_devices(struct btrfs_fs_dint ret;lockdep_assert_held (&uuid_mutex); +/* +* The device_list_mutex cannot be taken here in case opening the +* underlying device takes further locks like bd_mutex. +* +* We also don't need the lock here as this is called during mount and +* exclusion is provided by uuid_mutex +*/ -mutex_lock (&fs_devices->device_list_mutex);if (fs_devices->opened) { fs_devices->opened++; ret =0 ;
@@ -1238,7 +1254,6 @@ int btrfs_open_devices(struct btrfs_fs_dlist_sort (NULL , &fs_devices->devices, devid_cmp); ret =open_fs_devices (fs_devices, flags, holder); } -mutex_unlock (&fs_devices->device_list_mutex);return ret; }
Greg Kroah-Hartman
maintainerPATCH 25/232 btrfs: move the chunk_mutex in btrfs_read_chunk_tree
In reply to Greg Kroah-HartmanFrom: Josef Bacik <[email protected]>
commit 01d01caf19ff7c537527d352d169c4368375c0a1 upstream.
We are currently getting this lockdep splat in btrfs/161:
======================================================
WARNING: possible circular locking dependency detected
5.8.0-rc5+ #20 Tainted: G E
------------------------------------------------------
mount/678048 is trying to acquire lock:
ffff9b769f15b6e0 (&fs_devs->device_list_mutex){+.+.}-{3:3}, at: clone_fs_devices+0x4d/0x170 [btrfs]
but task is already holding lock:
ffff9b76abdb08d0 (&fs_info->chunk_mutex){+.+.}-{3:3}, at: btrfs_read_chunk_tree+0x6a/0x800 [btrfs]
which lock already depends on the new lock.
the existing dependency chain (in reverse order) is:
-> #1 (&fs_info->chunk_mutex){+.+.}-{3:3}:
__mutex_lock+0x8b/0x8f0 btrfs_init_new_device+0x2d2/0x1240 [btrfs] btrfs_ioctl+0x1de/0x2d20 [btrfs] ksys_ioctl+0x87/0xc0 __x64_sys_ioctl+0x16/0x20 do_syscall_64+0x52/0xb0 entry_SYSCALL_64_after_hwframe+0x44/0xa9
-> #0 (&fs_devs->device_list_mutex){+.+.}-{3:3}:
__lock_acquire+0x1240/0x2460 lock_acquire+0xab/0x360 __mutex_lock+0x8b/0x8f0 clone_fs_devices+0x4d/0x170 [btrfs] btrfs_read_chunk_tree+0x330/0x800 [btrfs] open_ctree+0xb7c/0x18ce [btrfs] btrfs_mount_root.cold+0x13/0xfa [btrfs] legacy_get_tree+0x30/0x50 vfs_get_tree+0x28/0xc0 fc_mount+0xe/0x40 vfs_kern_mount.part.0+0x71/0x90 btrfs_mount+0x13b/0x3e0 [btrfs] legacy_get_tree+0x30/0x50 vfs_get_tree+0x28/0xc0 do_mount+0x7de/0xb30 __x64_sys_mount+0x8e/0xd0 do_syscall_64+0x52/0xb0 entry_SYSCALL_64_after_hwframe+0x44/0xa9
other info that might help us debug this:
Possible unsafe locking scenario:
CPU0 CPU1
---- ----
lock(&fs_info->chunk_mutex);
lock(&fs_devs->device_list_mutex);
lock(&fs_info->chunk_mutex);
lock(&fs_devs->device_list_mutex);*** DEADLOCK ***
3 locks held by mount/678048:
#0: ffff9b75ff5fb0e0 (&type->s_umount_key#63/1){+.+.}-{3:3}, at: alloc_super+0xb5/0x380 #1: ffffffffc0c2fbc8 (uuid_mutex){+.+.}-{3:3}, at: btrfs_read_chunk_tree+0x54/0x800 [btrfs] #2: ffff9b76abdb08d0 (&fs_info->chunk_mutex){+.+.}-{3:3}, at: btrfs_read_chunk_tree+0x6a/0x800 [btrfs]
stack backtrace: CPU: 2 PID: 678048 Comm: mount Tainted: G E 5.8.0-rc5+ #20 Hardware name: To Be Filled By O.E.M. To Be Filled By O.E.M./890FX Deluxe5, BIOS P1.40 05/03/2011 Call Trace: dump_stack+0x96/0xd0 check_noncircular+0x162/0x180 __lock_acquire+0x1240/0x2460 ? asm_sysvec_apic_timer_interrupt+0x12/0x20 lock_acquire+0xab/0x360 ? clone_fs_devices+0x4d/0x170 [btrfs] __mutex_lock+0x8b/0x8f0 ? clone_fs_devices+0x4d/0x170 [btrfs] ? rcu_read_lock_sched_held+0x52/0x60 ? cpumask_next+0x16/0x20 ? module_assert_mutex_or_preempt+0x14/0x40 ? __module_address+0x28/0xf0 ? clone_fs_devices+0x4d/0x170 [btrfs] ? static_obj+0x4f/0x60 ? lockdep_init_map_waits+0x43/0x200 ? clone_fs_devices+0x4d/0x170 [btrfs] clone_fs_devices+0x4d/0x170 [btrfs] btrfs_read_chunk_tree+0x330/0x800 [btrfs] open_ctree+0xb7c/0x18ce [btrfs] ? super_setup_bdi_name+0x79/0xd0 btrfs_mount_root.cold+0x13/0xfa [btrfs] ? vfs_parse_fs_string+0x84/0xb0 ? rcu_read_lock_sched_held+0x52/0x60 ? kfree+0x2b5/0x310 legacy_get_tree+0x30/0x50 vfs_get_tree+0x28/0xc0 fc_mount+0xe/0x40 vfs_kern_mount.part.0+0x71/0x90 btrfs_mount+0x13b/0x3e0 [btrfs] ? cred_has_capability+0x7c/0x120 ? rcu_read_lock_sched_held+0x52/0x60 ? legacy_get_tree+0x30/0x50 legacy_get_tree+0x30/0x50 vfs_get_tree+0x28/0xc0 do_mount+0x7de/0xb30 ? memdup_user+0x4e/0x90 __x64_sys_mount+0x8e/0xd0 do_syscall_64+0x52/0xb0 entry_SYSCALL_64_after_hwframe+0x44/0xa9
This is because btrfs_read_chunk_tree() can come upon DEV_EXTENT's and then read the device, which takes the device_list_mutex. The device_list_mutex needs to be taken before the chunk_mutex, so this is a problem. We only really need the chunk mutex around adding the chunk, so move the mutex around read_one_chunk.
An argument could be made that we don't even need the chunk_mutex here as it's during mount, and we are protected by various other locks. However we already have special rules for ->device_list_mutex, and I'd rather not have another special case for ->chunk_mutex.
--- fs/btrfs/volumes.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
fs/btrfs/volumes.c +2 -2
@@ -7064,7 +7064,6 @@ int btrfs_read_chunk_tree(struct btrfs_f* otherwise we don't need it. */ mutex_lock (&uuid_mutex); -mutex_lock (&fs_info->chunk_mutex);/* * It is possible for mount and umount to race in such a way that
@@ -7109,7 +7108,9 @@ int btrfs_read_chunk_tree(struct btrfs_f }else if (found_key.type ==BTRFS_CHUNK_ITEM_KEY ) {struct btrfs_chunk *chunk; chunk = btrfs_item_ptr(leaf, slot, struct btrfs_chunk); +mutex_lock (&fs_info->chunk_mutex); ret =read_one_chunk (&found_key, leaf, chunk); +mutex_unlock (&fs_info->chunk_mutex);if (ret) goto error; }
@@ -7139,7 +7140,6 @@ int btrfs_read_chunk_tree(struct btrfs_f } ret =0 ; error: -mutex_unlock (&fs_info->chunk_mutex);mutex_unlock (&uuid_mutex);btrfs_free_path (path);
Greg Kroah-Hartman
maintainerPATCH 39/232 btrfs: make sure SB_I_VERSION doesnt get unset by remount
In reply to Greg Kroah-HartmanFrom: Josef Bacik <[email protected]>
commit faa008899a4db21a2df99833cb4ff6fa67009a20 upstream.
There's some inconsistency around SB_I_VERSION handling with mount and remount. Since we don't really want it to be off ever just work around this by making sure we don't get the flag cleared on remount.
There's a tiny cpu cost of setting the bit, otherwise all changes to i_version also change some of the times (ctime/mtime) so the inode needs to be synced. We wouldn't save anything by disabling it.
--- fs/btrfs/super.c | 6 ++++++ 1 file changed, 6 insertions(+)
fs/btrfs/super.c +6 -0
@@ -1897,6 +1897,12 @@ static int btrfs_remount(struct super_blset_bit (BTRFS_FS_OPEN , &fs_info->flags); } out: +/* +* We need to set SB_I_VERSION here otherwise it'll get cleared by VFS, +* since the absence of the flag means it can be toggled off by remount. +*/ + *flags |=SB_I_VERSION ; +wake_up_process (fs_info->transaction_kthread);btrfs_remount_cleanup (fs_info, old_opts);return 0 ;
Greg Kroah-Hartman
maintainerPATCH 41/232 btrfs: check correct variable after allocation in btrfs_backref_iter_alloc
In reply to Greg Kroah-HartmanFrom: Boleyn Su <[email protected]>
commit c15c2ec07a26b251040943a1a9f90d3037f041e5 upstream.
The if (!ret) check will always be false and it may result in ret->path being dereferenced while it is a NULL pointer.
--- fs/btrfs/backref.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
fs/btrfs/backref.c +1 -1
@@ -2303,7 +2303,7 @@ struct btrfs_backref_iter *btrfs_backrefreturn NULL ; ret->path =btrfs_alloc_path (); -if (!ret) { +if (!ret->path) {kfree (ret);return NULL ; }
Greg Kroah-Hartman
maintainerPATCH 42/232 arm64: dts: qcom: sc7180: Drop the unused non-MSA SID
In reply to Greg Kroah-HartmanFrom: Sibi Sankar <[email protected]>
commit 08257610302159e08fd4f5d33787807374ea63c7 upstream.
Having a non-MSA (Modem Self-Authentication) SID bypassed breaks modem sandboxing i.e if a transaction were to originate from it, the hardware memory protections units (XPUs) would fail to flag them (any transaction originating from modem are historically termed as an MSA transaction). Drop the unused non-MSA modem SID on SC7180 SoCs and cheza so that SMMU continues to block them.
--- arch/arm64/boot/dts/qcom/sc7180-idp.dts | 2 +- arch/arm64/boot/dts/qcom/sdm845-cheza.dtsi | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
arch/arm64/boot/dts/qcom/sc7180-idp.dts +1 -1
@@ -312,7 +312,7 @@ &remoteproc_mpss { status = "okay"; compatible = "qcom,sc7180-mss-pil"; - iommus = <&apps_smmu 0x460 0x1>, <&apps_smmu 0x444 0x3>; + iommus = <&apps_smmu 0x461 0x0>, <&apps_smmu 0x444 0x3>; memory-region = <&mba_mem &mpss_mem>; };
arch/arm64/boot/dts/qcom/sdm845-cheza.dtsi +1 -1
@@ -634,7 +634,7 @@ ap_ts_i2c: &i2c14 { }; &mss_pil { - iommus = <&apps_smmu 0x780 0x1>, + iommus = <&apps_smmu 0x781 0x0>, <&apps_smmu 0x724 0x3>; };
Greg Kroah-Hartman
maintainerPATCH 43/232 arm64: perf: Correct the event index in sysfs
In reply to Greg Kroah-HartmanFrom: Shaokun Zhang <[email protected]>
commit 539707caa1a89ee4efc57b4e4231c20c46575ccc upstream.
When PMU event ID is equal or greater than 0x4000, it will be reduced by 0x4000 and it is not the raw number in the sysfs. Let's correct it and obtain the raw event ID.
Before this patch:
cat /sys/bus/event_source/devices/armv8_pmuv3_0/events/sample_feed event=0x001
After this patch:
cat /sys/bus/event_source/devices/armv8_pmuv3_0/events/sample_feed event=0x4001
--- arch/arm64/kernel/perf_event.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-)
arch/arm64/kernel/perf_event.c +8 -5
@@ -155,7 +155,7 @@ armv8pmu_events_sysfs_show(struct device pmu_attr = container_of(attr, struct perf_pmu_events_attr, attr); -return sprintf (page,"event=0x%03llx\n" , pmu_attr->id); +return sprintf (page,"event=0x%04llx\n" , pmu_attr->id); }#define ARMV8_EVENT_ATTR (name, config) \
@@ -244,10 +244,13 @@ armv8pmu_event_attr_is_visible(struct ko test_bit(pmu_attr->id, cpu_pmu->pmceid_bitmap))return attr->mode; - pmu_attr->id -=ARMV8_PMUV3_EXT_COMMON_EVENT_BASE ; -if (pmu_attr->id <ARMV8_PMUV3_MAX_COMMON_EVENTS && -test_bit (pmu_attr->id, cpu_pmu->pmceid_ext_bitmap)) -return attr->mode; +if (pmu_attr->id >=ARMV8_PMUV3_EXT_COMMON_EVENT_BASE ) { +u64 id = pmu_attr->id -ARMV8_PMUV3_EXT_COMMON_EVENT_BASE ; + +if (id <ARMV8_PMUV3_MAX_COMMON_EVENTS && +test_bit (id, cpu_pmu->pmceid_ext_bitmap)) +return attr->mode; + }return 0 ; }
Greg Kroah-Hartman
maintainerPATCH 45/232 iio: dac: ad5592r: fix unbalanced mutex unlocks in ad5592r_read_raw()
In reply to Greg Kroah-HartmanFrom: Alexandru Ardelean <[email protected]>
commit 65afb0932a81c1de719ceee0db0b276094b10ac8 upstream.
There are 2 exit paths where the lock isn't held, but try to unlock the mutex when exiting. In these places we should just return from the function.
A neater approach would be to cleanup the ad5592r_read_raw(), but that would make this patch more difficult to backport to stable versions.
Fixes 56ca9db862bf3: ("iio: dac: Add support for the AD5592R/AD5593R ADCs/DACs")
--- drivers/iio/dac/ad5592r-base.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/iio/dac/ad5592r-base.c +2 -2
@@ -413,7 +413,7 @@ static int ad5592r_read_raw(struct iio_ds64 tmp = *val * (3767897513LL /25LL ); *val =div_s64_rem (tmp,1000000000LL , val2); - ret =IIO_VAL_INT_PLUS_MICRO ; +return IIO_VAL_INT_PLUS_MICRO ; }else {int mult;
@@ -444,7 +444,7 @@ static int ad5592r_read_raw(struct iio_d ret =IIO_VAL_INT ;break ;default : - ret = -EINVAL ; +return -EINVAL ; } unlock:
Greg Kroah-Hartman
maintainerPATCH 49/232 cifs: Fix leak when handling lease break for cached root fid
In reply to Greg Kroah-HartmanFrom: Paul Aurich <[email protected]>
commit baf57b56d3604880ccb3956ec6c62ea894f5de99 upstream.
Handling a lease break for the cached root didn't free the smb2_lease_break_work allocation, resulting in a leak:
unreferenced object 0xffff98383a5af480 (size 128):
comm "cifsd", pid 684, jiffies 4294936606 (age 534.868s)
hex dump (first 32 bytes):
c0 ff ff ff 1f 00 00 00 88 f4 5a 3a 38 98 ff ff ..........Z:8...
88 f4 5a 3a 38 98 ff ff 80 88 d6 8a ff ff ff ff ..Z:8...........
backtrace:
[<0000000068957336>] smb2_is_valid_oplock_break+0x1fa/0x8c0
[<0000000073b70b9e>] cifs_demultiplex_thread+0x73d/0xcc0
[<00000000905fa372>] kthread+0x11c/0x150
[<0000000079378e4e>] ret_from_fork+0x22/0x30Avoid this leak by only allocating when necessary.
--- fs/cifs/smb2misc.c | 73 +++++++++++++++++++++++++++++++++++++---------------- 1 file changed, 52 insertions(+), 21 deletions(-)
fs/cifs/smb2misc.c +52 -21
@@ -508,15 +508,31 @@ cifs_ses_oplock_break(struct work_structkfree (lw); } +static void +smb2_queue_pending_open_break (struct tcon_link *tlink,__u8 *lease_key, +__le32 new_lease_state) +{ +struct smb2_lease_break_work *lw; + + lw =kmalloc (sizeof (struct smb2_lease_break_work ),GFP_KERNEL ); +if (!lw) { +cifs_put_tlink (tlink); +return ; + } + +INIT_WORK (&lw->lease_break, cifs_ses_oplock_break); + lw->tlink = tlink; + lw->lease_state = new_lease_state; +memcpy (lw->lease_key, lease_key,SMB2_LEASE_KEY_SIZE ); +queue_work (cifsiod_wq, &lw->lease_break); +} +static bool -smb2_tcon_has_lease (struct cifs_tcon *tcon,struct smb2_lease_break *rsp, -struct smb2_lease_break_work *lw) +smb2_tcon_has_lease (struct cifs_tcon *tcon,struct smb2_lease_break *rsp) { -bool found;__u8 lease_state;struct list_head *tmp;struct cifsFileInfo *cfile; -struct cifs_pending_open *open;struct cifsInodeInfo *cinode;int ack_req =le32_to_cpu (rsp->Flags &SMB2_NOTIFY_BREAK_LEASE_FLAG_ACK_REQUIRED );
@@ -546,22 +562,29 @@ smb2_tcon_has_lease(struct cifs_tcon *tc cfile->oplock_level = lease_state;cifs_queue_oplock_break (cfile); -kfree (lw);return true; } - found = false; +return false; +} + +static struct cifs_pending_open * +smb2_tcon_find_pending_open_lease (struct cifs_tcon *tcon, +struct smb2_lease_break *rsp) +{ +__u8 lease_state =le32_to_cpu (rsp->NewLeaseState); +int ack_req =le32_to_cpu (rsp->Flags & +SMB2_NOTIFY_BREAK_LEASE_FLAG_ACK_REQUIRED ); +struct cifs_pending_open *open; +struct cifs_pending_open *found =NULL ; +list_for_each_entry (open, &tcon->pending_opens, olist) {if (memcmp (open->lease_key, rsp->LeaseKey,SMB2_LEASE_KEY_SIZE ))continue ;if (!found && ack_req) { - found = true; -memcpy (lw->lease_key, open->lease_key, -SMB2_LEASE_KEY_SIZE ); - lw->tlink =cifs_get_tlink (open->tlink); -queue_work (cifsiod_wq, &lw->lease_break); + found = open; }cifs_dbg (FYI ,"found in the pending open list\n" );
@@ -582,14 +605,7 @@ smb2_is_valid_lease_break(char *buffer)struct TCP_Server_Info *server;struct cifs_ses *ses;struct cifs_tcon *tcon; -struct smb2_lease_break_work *lw; - - lw =kmalloc (sizeof (struct smb2_lease_break_work ),GFP_KERNEL ); -if (!lw) -return false; - -INIT_WORK (&lw->lease_break, cifs_ses_oplock_break); - lw->lease_state = rsp->NewLeaseState; +struct cifs_pending_open *open;cifs_dbg (FYI ,"Checking for lease break\n" );
@@ -607,11 +623,27 @@ smb2_is_valid_lease_break(char *buffer)spin_lock (&tcon->open_file_lock);cifs_stats_inc ( &tcon->stats.cifs_stats.num_oplock_brks); -if (smb2_tcon_has_lease (tcon, rsp, lw)) { +if (smb2_tcon_has_lease (tcon, rsp)) {spin_unlock (&tcon->open_file_lock);spin_unlock (&cifs_tcp_ses_lock);return true; } + open =smb2_tcon_find_pending_open_lease (tcon, + rsp); +if (open) { +__u8 lease_key[SMB2_LEASE_KEY_SIZE ]; +struct tcon_link *tlink; + + tlink =cifs_get_tlink (open->tlink); +memcpy (lease_key, open->lease_key, +SMB2_LEASE_KEY_SIZE ); +spin_unlock (&tcon->open_file_lock); +spin_unlock (&cifs_tcp_ses_lock); +smb2_queue_pending_open_break (tlink, + lease_key, + rsp->NewLeaseState); +return true; + }spin_unlock (&tcon->open_file_lock); if (tcon->crfid.is_valid &&
@@ -629,7 +661,6 @@ smb2_is_valid_lease_break(char *buffer) } }spin_unlock (&cifs_tcp_ses_lock); -kfree (lw);cifs_dbg (FYI ,"Can not process lease break - no lease matched\n" );return false; }
Greg Kroah-Hartman
maintainerPATCH 52/232 powerpc: Fix circular dependency between percpu.h and mmu.h
In reply to Greg Kroah-HartmanFrom: Michael Ellerman <[email protected]>
commit 0c83b277ada72b585e6a3e52b067669df15bcedb upstream.
Recently random.h started including percpu.h (see commit f227e3ec3b5c ("random32: update the net random state on interrupt and activity")), which broke corenet64_smp_defconfig:
In file included from /linux/arch/powerpc/include/asm/paca.h:18,
from /linux/arch/powerpc/include/asm/percpu.h:13,
from /linux/include/linux/random.h:14,
from /linux/lib/uuid.c:14:
/linux/arch/powerpc/include/asm/mmu.h:139:22: error: unknown type name 'next_tlbcam_idx'
139 | DECLARE_PER_CPU(int, next_tlbcam_idx);This is due to a circular header dependency:
asm/mmu.h includes asm/percpu.h, which includes asm/paca.h, which includes asm/mmu.h
Which means DECLARE_PER_CPU() isn't defined when mmu.h needs it.
We can fix it by moving the include of paca.h below the include of asm-generic/percpu.h.
This moves the include of paca.h out of the #ifdef __powerpc64__, but that is OK because paca.h is almost entirely inside #ifdef CONFIG_PPC64 anyway.
It also moves the include of paca.h out of the #ifdef CONFIG_SMP, which could possibly break something, but seems to have no ill effects.
--- arch/powerpc/include/asm/percpu.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
arch/powerpc/include/asm/percpu.h +2 -2
@@ -10,8 +10,6 @@#ifdef CONFIG_SMP -#include <asm/paca.h> -#define __my_cpu_offset local_paca->data_offset#endif /* CONFIG_SMP */
@@ -19,4 +17,6 @@#include <asm-generic/percpu.h> +#include <asm/paca.h> +#endif /* _ASM_POWERPC_PERCPU_H_ */
Greg Kroah-Hartman
maintainerPATCH 54/232 pinctrl: ingenic: Properly detect GPIO direction when configured for IRQ
In reply to Greg Kroah-HartmanFrom: Paul Cercueil <[email protected]>
commit 84e7a946da71f678affacea301f6d5cb4d9784e8 upstream.
The PAT1 register contains information about the IRQ type (edge/level) for input GPIOs with IRQ enabled, and the direction for non-IRQ GPIOs. So it makes sense to read it only if the GPIO has no interrupt configured, otherwise input GPIOs configured for level IRQs are misdetected as output GPIOs.
--- drivers/pinctrl/pinctrl-ingenic.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/pinctrl/pinctrl-ingenic.c +2 -1
@@ -1955,7 +1955,8 @@ static int ingenic_gpio_get_direction(stunsigned int pin = gc->base + offset;if (jzpc->info->version >=ID_JZ4760 ) { -if (ingenic_get_pin_config (jzpc, pin,JZ4760_GPIO_PAT1 )) +if (ingenic_get_pin_config (jzpc, pin,JZ4760_GPIO_INT ) || +ingenic_get_pin_config (jzpc, pin,JZ4760_GPIO_PAT1 ))return GPIO_LINE_DIRECTION_IN ;return GPIO_LINE_DIRECTION_OUT ; }
Greg Kroah-Hartman
maintainerPATCH 56/232 media: vsp1: dl: Fix NULL pointer dereference on unbind
In reply to Greg Kroah-HartmanFrom: Eugeniu Rosca <[email protected]>
commit c92d30e4b78dc331909f8c6056c2792aa14e2166 upstream.
In commit f3b98e3c4d2e16 ("media: vsp1: Provide support for extended command pools"), the vsp pointer used for referencing the VSP1 device structure from a command pool during vsp1_dl_ext_cmd_pool_destroy() was not populated.
Correctly assign the pointer to prevent the following null-pointer-dereference when removing the device:
[*] h3ulcb-kf #>
echo fea28000.vsp > /sys/bus/platform/devices/fea28000.vsp/driver/unbind
Unable to handle kernel NULL pointer dereference at virtual address 0000000000000028 Mem abort info: ESR = 0x96000006 EC = 0x25: DABT (current EL), IL = 32 bits SET = 0, FnV = 0 EA = 0, S1PTW = 0 Data abort info: ISV = 0, ISS = 0x00000006 CM = 0, WnR = 0 user pgtable: 4k pages, 48-bit VAs, pgdp=00000007318be000 [0000000000000028] pgd=00000007333a1003, pud=00000007333a6003, pmd=0000000000000000 Internal error: Oops: 96000006 [#1] PREEMPT SMP Modules linked in: CPU: 1 PID: 486 Comm: sh Not tainted 5.7.0-rc6-arm64-renesas-00118-ge644645abf47 #185 Hardware name: Renesas H3ULCB Kingfisher board based on r8a77951 (DT) pstate: 40000005 (nZcv daif -PAN -UAO) pc : vsp1_dlm_destroy+0xe4/0x11c lr : vsp1_dlm_destroy+0xc8/0x11c sp : ffff800012963b60 x29: ffff800012963b60 x28: ffff0006f83fc440 x27: 0000000000000000 x26: ffff0006f5e13e80 x25: ffff0006f5e13ed0 x24: ffff0006f5e13ed0 x23: ffff0006f5e13ed0 x22: dead000000000122 x21: ffff0006f5e3a080 x20: ffff0006f5df2938 x19: ffff0006f5df2980 x18: 0000000000000003 x17: 0000000000000000 x16: 0000000000000016 x15: 0000000000000003 x14: 00000000000393c0 x13: ffff800011a5ec18 x12: ffff800011d8d000 x11: ffff0006f83fcc68 x10: ffff800011a53d70 x9 : ffff8000111f3000 x8 : 0000000000000000 x7 : 0000000000210d00 x6 : 0000000000000000 x5 : ffff800010872e60 x4 : 0000000000000004 x3 : 0000000078068000 x2 : ffff800012781000 x1 : 0000000000002c00 x0 : 0000000000000000 Call trace: vsp1_dlm_destroy+0xe4/0x11c vsp1_wpf_destroy+0x10/0x20 vsp1_entity_destroy+0x24/0x4c vsp1_destroy_entities+0x54/0x130 vsp1_remove+0x1c/0x40 platform_drv_remove+0x28/0x50 __device_release_driver+0x178/0x220 device_driver_detach+0x44/0xc0 unbind_store+0xe0/0x104 drv_attr_store+0x20/0x30 sysfs_kf_write+0x48/0x70 kernfs_fop_write+0x148/0x230 __vfs_write+0x18/0x40 vfs_write+0xdc/0x1c4 ksys_write+0x68/0xf0 __arm64_sys_write+0x18/0x20 el0_svc_common.constprop.0+0x70/0x170 do_el0_svc+0x20/0x80 el0_sync_handler+0x134/0x1b0 el0_sync+0x140/0x180 Code: b40000c2 f9403a60 d2800084 a9400663 (f9401400) ---[ end trace 3875369841fb288a ]---
--- drivers/media/platform/vsp1/vsp1_dl.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/media/platform/vsp1/vsp1_dl.c +2 -0
@@ -431,6 +431,8 @@ vsp1_dl_cmd_pool_create(struct vsp1_deviif (!pool)return NULL ; + pool->vsp1 = vsp1; +spin_lock_init (&pool->lock);INIT_LIST_HEAD (&pool->free);
Greg Kroah-Hartman
maintainerPATCH 36/232 btrfs: inode: fix NULL pointer dereference if inode doesnt need compression
In reply to Greg Kroah-HartmanFrom: Qu Wenruo <[email protected]>
commit 1e6e238c3002ea3611465ce5f32777ddd6a40126 upstream.
[BUG]
There is a bug report of NULL pointer dereference caused in compress_file_extent():
Oops: Kernel access of bad area, sig: 11 [#1] LE PAGE_SIZE=64K MMU=Hash SMP NR_CPUS=2048 NUMA pSeries Workqueue: btrfs-delalloc btrfs_delalloc_helper [btrfs] NIP [c008000006dd4d34] compress_file_range.constprop.41+0x75c/0x8a0 [btrfs] LR [c008000006dd4d1c] compress_file_range.constprop.41+0x744/0x8a0 [btrfs] Call Trace: [c000000c69093b00] [c008000006dd4d1c] compress_file_range.constprop.41+0x744/0x8a0 [btrfs] (unreliable) [c000000c69093bd0] [c008000006dd4ebc] async_cow_start+0x44/0xa0 [btrfs] [c000000c69093c10] [c008000006e14824] normal_work_helper+0xdc/0x598 [btrfs] [c000000c69093c80] [c0000000001608c0] process_one_work+0x2c0/0x5b0 [c000000c69093d10] [c000000000160c38] worker_thread+0x88/0x660 [c000000c69093db0] [c00000000016b55c] kthread+0x1ac/0x1c0 [c000000c69093e20] [c00000000000b660] ret_from_kernel_thread+0x5c/0x7c ---[ end trace f16954aa20d822f6 ]---
[CAUSE]
For the following execution route of compress_file_range(), it's possible to hit NULL pointer dereference:
compress_file_extent()
|- pages = NULL;
|- start = async_chunk->start = 0;
|- end = async_chunk = 4095;
|- nr_pages = 1;
|- inode_need_compress() == false; <<< Possible, see later explanation
| Now, we have nr_pages = 1, pages = NULL
|- cont:
|- ret = cow_file_range_inline();
|- if (ret <= 0) {
|- for (i = 0; i < nr_pages; i++) {
|- WARN_ON(pages[i]->mapping); <<< CrashTo enter above call execution branch, we need the following race:
Thread 1 (chattr) | Thread 2 (writeback)
--------------------------+------------------------------
| btrfs_run_delalloc_range
| |- inode_need_compress = true
| |- cow_file_range_async()
btrfs_ioctl_set_flag() |
|- binode_flags |= |
BTRFS_INODE_NOCOMPRESS |
| compress_file_range()
| |- inode_need_compress = false
| |- nr_page = 1 while pages = NULL
| | Then hit the crash[FIX]
This patch will fix it by checking @pages before doing accessing it. This patch is only designed as a hot fix and easy to backport.
More elegant fix may make btrfs only check inode_need_compress() once to avoid such race, but that would be another story.
--- fs/btrfs/inode.c | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-)
fs/btrfs/inode.c +11 -5
@@ -650,12 +650,18 @@ cont: page_error_op | PAGE_END_WRITEBACK); -for (i =0 ; i < nr_pages; i++) { -WARN_ON (pages[i]->mapping); -put_page (pages[i]); +/* +* Ensure we only free the compressed pages if we have +* them allocated, as we can still reach here with +* inode_need_compress() == false. +*/ +if (pages) { +for (i =0 ; i < nr_pages; i++) { +WARN_ON (pages[i]->mapping); +put_page (pages[i]); + } +kfree (pages); } -kfree (pages); -return 0 ; } }
Greg Kroah-Hartman
maintainerPATCH 69/232 bcache: use disk_{start,end}_io_acct() to count I/O for bcache device
In reply to Greg Kroah-HartmanFrom: Coly Li <[email protected]>
commit c5be1f2c5bab1538aa29cd42e226d6b80391e3ff upstream.
This patch is a fix to patch "bcache: fix bio_{start,end}_io_acct with proper device". The previous patch uses a hack to temporarily set bi_disk to bcache device, which is mistaken too.
As Christoph suggests, this patch uses disk_{start,end}_io_acct() to count I/O for bcache device in the correct way.
--- drivers/md/bcache/request.c | 37 +++++++++---------------------------- 1 file changed, 9 insertions(+), 28 deletions(-)
drivers/md/bcache/request.c +9 -28
@@ -617,28 +617,6 @@ static void cache_lookup(struct closure/* Common code for the make_request functions */ -static inline void bch_bio_start_io_acct (struct gendisk *acct_bi_disk, -struct bio *bio, -unsigned long *start_time) -{ -struct gendisk *saved_bi_disk = bio->bi_disk; - - bio->bi_disk = acct_bi_disk; - *start_time =bio_start_io_acct (bio); - bio->bi_disk = saved_bi_disk; -} - -static inline void bch_bio_end_io_acct (struct gendisk *acct_bi_disk, -struct bio *bio, -unsigned long start_time) -{ -struct gendisk *saved_bi_disk = bio->bi_disk; - - bio->bi_disk = acct_bi_disk; -bio_end_io_acct (bio, start_time); - bio->bi_disk = saved_bi_disk; -} -static void request_endio (struct bio *bio) {struct closure *cl = bio->bi_private;
@@ -690,7 +668,9 @@ static void backing_request_endio(structstatic void bio_complete (struct search *s) {if (s->orig_bio) { -bch_bio_end_io_acct (s->d->disk, s->orig_bio, s->start_time); +/* Count on bcache device */ +disk_end_io_acct (s->d->disk,bio_op (s->orig_bio), s->start_time); +trace_bcache_request_end (s->d, s->orig_bio); s->orig_bio->bi_status = s->iop.status;bio_endio (s->orig_bio);
@@ -750,8 +730,8 @@ static inline struct search *search_allo s->recoverable =1 ; s->write =op_is_write (bio_op (bio)); s->read_dirty_data =0 ; -bch_bio_start_io_acct (d->disk, bio, &s->start_time); - +/* Count on the bcache device */ + s->start_time =disk_start_io_acct (d->disk,bio_sectors (bio),bio_op (bio)); s->iop.c = d->c; s->iop.bio =NULL ; s->iop.inode = d->id;
@@ -1102,7 +1082,8 @@ static void detached_dev_end_io(struct b bio->bi_end_io = ddip->bi_end_io; bio->bi_private = ddip->bi_private; -bch_bio_end_io_acct (ddip->d->disk, bio, ddip->start_time); +/* Count on the bcache device */ +disk_end_io_acct (ddip->d->disk,bio_op (bio), ddip->start_time);if (bio->bi_status) { struct cached_dev *dc = container_of(ddip->d,
@@ -1127,8 +1108,8 @@ static void detached_dev_do_request(stru*/ ddip =kzalloc (sizeof (struct detached_dev_io_private ),GFP_NOIO ); ddip->d = d; -bch_bio_start_io_acct (d->disk, bio, &ddip->start_time); - +/* Count on the bcache device */ + ddip->start_time =disk_start_io_acct (d->disk,bio_sectors (bio),bio_op (bio)); ddip->bi_end_io = bio->bi_end_io; ddip->bi_private = bio->bi_private; bio->bi_end_io = detached_dev_end_io;
Greg Kroah-Hartman
maintainerPATCH 70/232 mac80211: fix misplaced while instead of if
In reply to Greg Kroah-HartmanFrom: Johannes Berg <[email protected]>
commit 5981fe5b0529ba25d95f37d7faa434183ad618c5 upstream.
This never was intended to be a 'while' loop, it should've just been an 'if' instead of 'while'. Fix this.
I noticed this while applying another patch from Ben that intended to fix a busy loop at this spot.
--- net/mac80211/sta_info.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
net/mac80211/sta_info.c +1 -1
@@ -1050,7 +1050,7 @@ static void __sta_info_destroy_part2(strmight_sleep ();lockdep_assert_held (&local->sta_mtx); -while (sta->sta_state ==IEEE80211_STA_AUTHORIZED ) { +if (sta->sta_state ==IEEE80211_STA_AUTHORIZED ) { ret =sta_info_move_state (sta,IEEE80211_STA_ASSOC );WARN_ON_ONCE (ret); }
Greg Kroah-Hartman
maintainerPATCH 71/232 appletalk: Fix atalk_proc_init() return path
In reply to Greg Kroah-HartmanFrom: Vincent Duvert <[email protected]>
commit d0f6ba2ef2c1c95069509e71402e7d6d43452512 upstream.
Add a missing return statement to atalk_proc_init so it doesn't return -ENOMEM when successful. This allows the appletalk module to load properly.
--- net/appletalk/atalk_proc.c | 2 ++ 1 file changed, 2 insertions(+)
net/appletalk/atalk_proc.c +2 -0
@@ -229,6 +229,8 @@ int __init atalk_proc_init(void) sizeof(struct aarp_iter_state), NULL)) goto out; +return 0 ; + out:remove_proc_subtree ("atalk" , init_net.proc_net);return -ENOMEM ;
Greg Kroah-Hartman
maintainerPATCH 60/232 irqchip/gic-v4.1: Ensure accessing the correct RD when writing INVALLR
In reply to Greg Kroah-HartmanFrom: Zenghui Yu <[email protected]>
commit 3af9571cd585efafc2facbd8dbd407317ff898cf upstream.
The GICv4.1 spec tells us that it's CONSTRAINED UNPREDICTABLE to issue a register-based invalidation operation for a vPEID not mapped to that RD, or another RD within the same CommonLPIAff group.
To follow this rule, commit f3a059219bc7 ("irqchip/gic-v4.1: Ensure mutual exclusion between vPE affinity change and RD access") tried to address the race between the RD accesses and the vPE affinity change, but somehow forgot to take GICR_INVALLR into account. Let's take the vpe_lock before evaluating vpe->col_idx to fix it.
--- drivers/irqchip/irq-gic-v3-its.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-)
drivers/irqchip/irq-gic-v3-its.c +7 -3
@@ -4090,18 +4090,22 @@ static void its_vpe_4_1_deschedule(strucstatic void its_vpe_4_1_invall (struct its_vpe *vpe) {void __iomem *rdbase; +unsigned long flags;u64 val; +int cpu; val =GICR_INVALLR_V ; val |=FIELD_PREP (GICR_INVALLR_VPEID , vpe->vpe_id);/* Target the redistributor this vPE is currently known on */ -raw_spin_lock (&gic_data_rdist_cpu (vpe->col_idx)->rd_lock); - rdbase =per_cpu_ptr (gic_rdists->rdist, vpe->col_idx)->rd_base; + cpu =vpe_to_cpuid_lock (vpe, &flags); +raw_spin_lock (&gic_data_rdist_cpu (cpu)->rd_lock); + rdbase =per_cpu_ptr (gic_rdists->rdist, cpu)->rd_base;gic_write_lpir (val, rdbase +GICR_INVALLR );wait_for_syncr (rdbase); -raw_spin_unlock (&gic_data_rdist_cpu (vpe->col_idx)->rd_lock); +raw_spin_unlock (&gic_data_rdist_cpu (cpu)->rd_lock); +vpe_to_cpuid_unlock (vpe, flags); }static int its_vpe_4_1_set_vcpu_affinity (struct irq_data *d,void *vcpu_info)
Greg Kroah-Hartman
maintainerPATCH 74/232 MIPS: qi_lb60: Fix routing to audio amplifier
In reply to Greg Kroah-HartmanFrom: Paul Cercueil <[email protected]>
commit 0889a67a9e7a56ba39af223d536630b20b877fda upstream.
The ROUT (right channel output of audio codec) was connected to INL (left channel of audio amplifier) instead of INR (right channel of audio amplifier).
--- arch/mips/boot/dts/ingenic/qi_lb60.dts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/mips/boot/dts/ingenic/qi_lb60.dts +1 -1
@@ -69,7 +69,7 @@ "Speaker", "OUTL", "Speaker", "OUTR", "INL", "LOUT", - "INL", "ROUT"; + "INR", "ROUT"; simple-audio-card,aux-devs = <&>;
Greg Kroah-Hartman
maintainerPATCH 27/232 btrfs: add missing check for nocow and compression inode flags
In reply to Greg Kroah-HartmanFrom: David Sterba <[email protected]>
commit f37c563bab4297024c300b05c8f48430e323809d upstream.
User Forza reported on IRC that some invalid combinations of file attributes are accepted by chattr.
The NODATACOW and compression file flags/attributes are mutually exclusive, but they could be set by 'chattr +c +C' on an empty file. The nodatacow will be in effect because it's checked first in btrfs_run_delalloc_range.
Extend the flag validation to catch the following cases:
- input flags are conflicting
- old and new flags are conflicting
- initialize the local variable with inode flags after inode ls locked
Inode attributes take precedence over mount options and are an independent setting.
Nocompress would be a no-op with nodatacow, but we don't want to mix any compression-related options with nodatacow.
--- fs/btrfs/ioctl.c | 30 ++++++++++++++++++++++-------- 1 file changed, 22 insertions(+), 8 deletions(-)
fs/btrfs/ioctl.c +22 -8
@@ -164,8 +164,11 @@ static int btrfs_ioctl_getflags(struct freturn 0 ; } -/* Check if @flags are a supported and valid set of FS_*_FL flags */ -static int check_fsflags (unsigned int flags) +/* +* Check if @flags are a supported and valid set of FS_*_FL flags and that +* the old and new flags are not conflicting +*/ +static int check_fsflags (unsigned int old_flags,unsigned int flags) { if (flags & ~(FS_IMMUTABLE_FL | FS_APPEND_FL | \ FS_NOATIME_FL | FS_NODUMP_FL | \
@@ -174,9 +177,19 @@ static int check_fsflags(unsigned int fl FS_NOCOW_FL))return -EOPNOTSUPP ; +/* COMPR and NOCOMP on new/old are valid */ if ((flags &FS_NOCOMP_FL ) && (flags &FS_COMPR_FL ))return -EINVAL ; +if ((flags &FS_COMPR_FL ) && (flags &FS_NOCOW_FL )) +return -EINVAL ; + +/* NOCOW and compression options are mutually exclusive */ +if ((old_flags &FS_NOCOW_FL ) && (flags & (FS_COMPR_FL |FS_NOCOMP_FL ))) +return -EINVAL ; +if ((flags &FS_NOCOW_FL ) && (old_flags & (FS_COMPR_FL |FS_NOCOMP_FL ))) +return -EINVAL ; +return 0 ; }
@@ -190,7 +203,7 @@ static int btrfs_ioctl_setflags(struct funsigned int fsflags, old_fsflags;int ret;const char *comp =NULL ; -u32 binode_flags = binode->flags; +u32 binode_flags;if (!inode_owner_or_capable (inode))return -EPERM ;
@@ -201,22 +214,23 @@ static int btrfs_ioctl_setflags(struct fif (copy_from_user (&fsflags, arg,sizeof (fsflags)))return -EFAULT ; - ret =check_fsflags (fsflags); -if (ret) -return ret; - ret =mnt_want_write_file (file);if (ret)return ret;inode_lock (inode); - fsflags =btrfs_mask_fsflags_for_type (inode, fsflags); old_fsflags =btrfs_inode_flags_to_fsflags (binode->flags); + ret =vfs_ioc_setflags_prepare (inode, old_fsflags, fsflags);if (ret) goto out_unlock; + ret =check_fsflags (old_fsflags, fsflags); +if (ret) + goto out_unlock; + + binode_flags = binode->flags;if (fsflags &FS_SYNC_FL ) binode_flags |=BTRFS_INODE_SYNC ;else
Greg Kroah-Hartman
maintainerPATCH 33/232 btrfs: dont show full path of bind mounts in subvol=
In reply to Greg Kroah-HartmanFrom: Josef Bacik <[email protected]>
commit 3ef3959b29c4a5bd65526ab310a1a18ae533172a upstream.
Chris Murphy reported a problem where rpm ostree will bind mount a bunch of things for whatever voodoo it's doing. But when it does this /proc/mounts shows something like
/dev/sda /mnt/test btrfs rw,relatime,subvolid=256,subvol=/foo 0 0 /dev/sda /mnt/test/baz btrfs rw,relatime,subvolid=256,subvol=/foo/bar 0 0
Despite subvolid=256 being subvol=/foo. This is because we're just spitting out the dentry of the mount point, which in the case of bind mounts is the source path for the mountpoint. Instead we should spit out the path to the actual subvol. Fix this by looking up the name for the subvolid we have mounted. With this fix the same test looks like this
/dev/sda /mnt/test btrfs rw,relatime,subvolid=256,subvol=/foo 0 0 /dev/sda /mnt/test/baz btrfs rw,relatime,subvolid=256,subvol=/foo 0 0
--- fs/btrfs/super.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-)
fs/btrfs/super.c +8 -2
@@ -1312,6 +1312,7 @@ static int btrfs_show_options(struct seq {struct btrfs_fs_info *info =btrfs_sb (dentry->d_sb);const char *compress_type; +const char *subvol_name;if (btrfs_test_opt (info,DEGRADED ))seq_puts (seq,",degraded" );
@@ -1398,8 +1399,13 @@ static int btrfs_show_options(struct seqseq_puts (seq,",ref_verify" );seq_printf (seq,",subvolid=%llu" ,BTRFS_I (d_inode (dentry))->root->root_key.objectid); -seq_puts (seq,",subvol=" ); -seq_dentry (seq, dentry," \t\n\\" ); + subvol_name =btrfs_get_subvol_name_from_objectid (info, +BTRFS_I (d_inode (dentry))->root->root_key.objectid); +if (!IS_ERR (subvol_name)) { +seq_puts (seq,",subvol=" ); +seq_escape (seq, subvol_name," \t\n\\" ); +kfree (subvol_name); + }return 0 ; }
Greg Kroah-Hartman
maintainerPATCH 58/232 net: stmmac: dwmac1000: provide multicast filter fallback
In reply to Greg Kroah-HartmanFrom: Jonathan McDowell <[email protected]>
commit 592d751c1e174df5ff219946908b005eb48934b3 upstream.
If we don't have a hardware multicast filter available then instead of silently failing to listen for the requested ethernet broadcast addresses fall back to receiving all multicast packets, in a similar fashion to other drivers with no multicast filter.
--- drivers/net/ethernet/stmicro/stmmac/dwmac1000_core.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/net/ethernet/stmicro/stmmac/dwmac1000_core.c +3 -0
@@ -164,6 +164,9 @@ static void dwmac1000_set_filter(struct value =GMAC_FRAME_FILTER_PR |GMAC_FRAME_FILTER_PCF ; }else if (dev->flags &IFF_ALLMULTI ) { value =GMAC_FRAME_FILTER_PM ;/* pass all multi */ + }else if (!netdev_mc_empty (dev) && (mcbitslog2 ==0 )) { +/* Fall back to all multicast if we've no filter */ + value =GMAC_FRAME_FILTER_PM ; }else if (!netdev_mc_empty (dev)) {struct netdev_hw_addr *ha;
Greg Kroah-Hartman
maintainerPATCH 29/232 btrfs: return EROFS for BTRFS_FS_STATE_ERROR cases
In reply to Greg Kroah-HartmanFrom: Josef Bacik <[email protected]>
commit fbabd4a36faaf74c83142d0b3d950c11ec14fda1 upstream.
Eric reported seeing this message while running generic/475
BTRFS: error (device dm-3) in btrfs_sync_log:3084: errno=-117 Filesystem corrupted
Full stack trace:
BTRFS: error (device dm-0) in btrfs_commit_transaction:2323: errno=-5 IO failure (Error while writing out transaction) BTRFS info (device dm-0): forced readonly
BTRFS warning (device dm-0): Skipping commit of aborted transaction.
------------[ cut here ]------------ BTRFS: error (device dm-0) in cleanup_transaction:1894: errno=-5 IO failure BTRFS: Transaction aborted (error -117) BTRFS warning (device dm-0): direct IO failed ino 3555 rw 0,0 sector 0x1c6480 len 4096 err no 10 BTRFS warning (device dm-0): direct IO failed ino 3555 rw 0,0 sector 0x1c6488 len 4096 err no 10 BTRFS warning (device dm-0): direct IO failed ino 3555 rw 0,0 sector 0x1c6490 len 4096 err no 10 BTRFS warning (device dm-0): direct IO failed ino 3555 rw 0,0 sector 0x1c6498 len 4096 err no 10 BTRFS warning (device dm-0): direct IO failed ino 3555 rw 0,0 sector 0x1c64a0 len 4096 err no 10 BTRFS warning (device dm-0): direct IO failed ino 3555 rw 0,0 sector 0x1c64a8 len 4096 err no 10 BTRFS warning (device dm-0): direct IO failed ino 3555 rw 0,0 sector 0x1c64b0 len 4096 err no 10 BTRFS warning (device dm-0): direct IO failed ino 3555 rw 0,0 sector 0x1c64b8 len 4096 err no 10 BTRFS warning (device dm-0): direct IO failed ino 3555 rw 0,0 sector 0x1c64c0 len 4096 err no 10 BTRFS warning (device dm-0): direct IO failed ino 3572 rw 0,0 sector 0x1b85e8 len 4096 err no 10 BTRFS warning (device dm-0): direct IO failed ino 3572 rw 0,0 sector 0x1b85f0 len 4096 err no 10 WARNING: CPU: 3 PID: 23985 at fs/btrfs/tree-log.c:3084 btrfs_sync_log+0xbc8/0xd60 [btrfs] BTRFS warning (device dm-0): direct IO failed ino 3548 rw 0,0 sector 0x1d4288 len 4096 err no 10 BTRFS warning (device dm-0): direct IO failed ino 3548 rw 0,0 sector 0x1d4290 len 4096 err no 10 BTRFS warning (device dm-0): direct IO failed ino 3548 rw 0,0 sector 0x1d4298 len 4096 err no 10 BTRFS warning (device dm-0): direct IO failed ino 3548 rw 0,0 sector 0x1d42a0 len 4096 err no 10 BTRFS warning (device dm-0): direct IO failed ino 3548 rw 0,0 sector 0x1d42a8 len 4096 err no 10 BTRFS warning (device dm-0): direct IO failed ino 3548 rw 0,0 sector 0x1d42b0 len 4096 err no 10 BTRFS warning (device dm-0): direct IO failed ino 3548 rw 0,0 sector 0x1d42b8 len 4096 err no 10 BTRFS warning (device dm-0): direct IO failed ino 3548 rw 0,0 sector 0x1d42c0 len 4096 err no 10 BTRFS warning (device dm-0): direct IO failed ino 3548 rw 0,0 sector 0x1d42c8 len 4096 err no 10 BTRFS warning (device dm-0): direct IO failed ino 3548 rw 0,0 sector 0x1d42d0 len 4096 err no 10 CPU: 3 PID: 23985 Comm: fsstress Tainted: G W L 5.8.0-rc4-default+ #1181 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.12.0-59-gc9ba527-rebuilt.opensuse.org 04/01/2014 RIP: 0010:btrfs_sync_log+0xbc8/0xd60 [btrfs] RSP: 0018:ffff909a44d17bd0 EFLAGS: 00010286 RAX: 0000000000000000 RBX: 0000000000000001 RCX: 0000000000000001 RDX: ffff8f3be41cb940 RSI: ffffffffb0108d2b RDI: ffffffffb0108ff7 RBP: ffff909a44d17e70 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000037988 R12: ffff8f3bd20e4000 R13: ffff8f3bd20e4428 R14: 00000000ffffff8b R15: ffff909a44d17c70 FS: 00007f6a6ed3fb80(0000) GS:ffff8f3c3dc00000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00007f6a6ed3e000 CR3: 00000000525c0003 CR4: 0000000000160ee0 Call Trace: ? finish_wait+0x90/0x90 ? __mutex_unlock_slowpath+0x45/0x2a0 ? lock_acquire+0xa3/0x440 ? lockref_put_or_lock+0x9/0x30 ? dput+0x20/0x4a0 ? dput+0x20/0x4a0 ? do_raw_spin_unlock+0x4b/0xc0 ? _raw_spin_unlock+0x1f/0x30 btrfs_sync_file+0x335/0x490 [btrfs] do_fsync+0x38/0x70 __x64_sys_fsync+0x10/0x20 do_syscall_64+0x50/0xe0 entry_SYSCALL_64_after_hwframe+0x44/0xa9 RIP: 0033:0x7f6a6ef1b6e3 Code: Bad RIP value. RSP: 002b:00007ffd01e20038 EFLAGS: 00000246 ORIG_RAX: 000000000000004a RAX: ffffffffffffffda RBX: 000000000007a120 RCX: 00007f6a6ef1b6e3 RDX: 00007ffd01e1ffa0 RSI: 00007ffd01e1ffa0 RDI: 0000000000000003 RBP: 0000000000000003 R08: 0000000000000001 R09: 00007ffd01e2004c R10: 0000000000000000 R11: 0000000000000246 R12: 000000000000009f R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000 irq event stamp: 0 hardirqs last enabled at (0): [<0000000000000000>] 0x0 hardirqs last disabled at (0): [<ffffffffb007fe0b>] copy_process+0x67b/0x1b00 softirqs last enabled at (0): [<ffffffffb007fe0b>] copy_process+0x67b/0x1b00 softirqs last disabled at (0): [<0000000000000000>] 0x0 ---[ end trace af146e0e38433456 ]--- BTRFS: error (device dm-0) in btrfs_sync_log:3084: errno=-117 Filesystem corrupted
This ret came from btrfs_write_marked_extents(). If we get an aborted transaction via EIO before, we'll see it in btree_write_cache_pages() and return EUCLEAN, which gets printed as "Filesystem corrupted".
Except we shouldn't be returning EUCLEAN here, we need to be returning EROFS because EUCLEAN is reserved for actual corruption, not IO errors.
We are inconsistent about our handling of BTRFS_FS_STATE_ERROR elsewhere, but we want to use EROFS for this particular case. The original transaction abort has the real error code for why we ended up with an aborted transaction, all subsequent actions just need to return EROFS because they may not have a trans handle and have no idea about the original cause of the abort.
After patch "btrfs: don't WARN if we abort a transaction with EROFS" the stacktrace will not be dumped either.
--- fs/btrfs/extent_io.c | 2 +- fs/btrfs/scrub.c | 2 +- fs/btrfs/transaction.c | 5 ++++- 3 files changed, 6 insertions(+), 3 deletions(-)
fs/btrfs/extent_io.c +1 -1
@@ -4127,7 +4127,7 @@ retry:if (!test_bit (BTRFS_FS_STATE_ERROR , &fs_info->fs_state)) { ret =flush_write_bio (&epd); }else { - ret = -EUCLEAN ; + ret = -EROFS ;end_write_bio (&epd, ret); }return ret;
fs/btrfs/scrub.c +1 -1
@@ -3758,7 +3758,7 @@ static noinline_for_stack int scrub_supestruct btrfs_fs_info *fs_info = sctx->fs_info;if (test_bit (BTRFS_FS_STATE_ERROR , &fs_info->fs_state)) -return -EIO ; +return -EROFS ;/* Seed devices of a new filesystem has their own generation. */ if (scrub_dev->fs_devices != fs_info->fs_devices)
fs/btrfs/transaction.c +4 -1
@@ -937,7 +937,10 @@ static int __btrfs_end_transaction(strucif (TRANS_ABORTED (trans) ||test_bit (BTRFS_FS_STATE_ERROR , &info->fs_state)) {wake_up_process (info->transaction_kthread); - err = -EIO ; +if (TRANS_ABORTED (trans)) + err = trans->aborted; +else + err = -EROFS ; }kmem_cache_free (btrfs_trans_handle_cachep, trans);
Greg Kroah-Hartman
maintainerQuoted 26 lines · Jon Hunter
Quoted 9 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 5.8.3 release. There are 232 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Sat, 22 Aug 2020 09:15:09 +0000. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
Quoted 8 lines
https://www.kernel.org/pub/linux/kernel/v5.x/stable-review/patch-5.8.3-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-5.8.y
and the diffstat can be found below.thanks,
greg k-h
All tests passing for Tegra ...
Test results for stable-v5.8:
11 builds: 11 pass, 0 fail 26 boots: 26 pass, 0 fail 60 tests: 60 pass, 0 fail
Quoted 5 lines
Linux version: 5.8.3-rc1-g201fff807310
Boards tested: tegra124-jetson-tk1, tegra186-p2771-0000,tegra194-p2972-0000, tegra20-ventana, tegra210-p2371-2180, tegra210-p3450-0000, tegra30-cardhu-a04
Thanks for testing all of these and letting me know.
greg k-h
Greg Kroah-Hartman
maintainerPATCH 72/232 driver core: Avoid binding drivers to dead devices
In reply to Greg Kroah-HartmanFrom: Lukas Wunner <[email protected]>
commit 654888327e9f655a9d55ad477a9583e90e8c9b5c upstream.
Commit 3451a495ef24 ("driver core: Establish order of operations for device_add and device_del via bitflag") sought to prevent asynchronous driver binding to a device which is being removed. It added a per-device "dead" flag which is checked in the following code paths:
* asynchronous binding in __driver_attach_async_helper()
* synchronous binding in device_driver_attach()
* asynchronous binding in __device_attach_async_helper()
It did *not* check the flag upon:
* synchronous binding in __device_attach()
However __device_attach() may also be called asynchronously from:
deferred_probe_work_func()
bus_probe_device()
device_initial_probe()
__device_attach()So if the commit's intention was to check the "dead" flag in all asynchronous code paths, then a check is also necessary in __device_attach(). Add the missing check.
--- drivers/base/dd.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/base/dd.c +3 -1
@@ -844,7 +844,9 @@ static int __device_attach(struct deviceint ret =0 ;device_lock (dev); -if (dev->driver) { +if (dev->p->dead) { + goto out_unlock; + }else if (dev->driver) {if (device_is_bound (dev)) { ret =1 ; goto out_unlock;
Greg Kroah-Hartman
maintainerPATCH 35/232 btrfs: only search for left_info if there is no right_info in try_merge_free_space
In reply to Greg Kroah-HartmanFrom: Josef Bacik <[email protected]>
commit bf53d4687b8f3f6b752f091eb85f62369a515dfd upstream.
In try_to_merge_free_space we attempt to find entries to the left and right of the entry we are adding to see if they can be merged. We search for an entry past our current info (saved into right_info), and then if right_info exists and it has a rb_prev() we save the rb_prev() into left_info.
However there's a slight problem in the case that we have a right_info, but no entry previous to that entry. At that point we will search for an entry just before the info we're attempting to insert. This will simply find right_info again, and assign it to left_info, making them both the same pointer.
Now if right_info _can_ be merged with the range we're inserting, we'll add it to the info and free right_info. However further down we'll access left_info, which was right_info, and thus get a use-after-free.
Fix this by only searching for the left entry if we don't find a right entry at all.
The CVE referenced had a specially crafted file system that could trigger this use-after-free. However with the tree checker improvements we no longer trigger the conditions for the UAF. But the original conditions still apply, hence this fix.
Reference: CVE-2019-19448
--- fs/btrfs/free-space-cache.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
fs/btrfs/free-space-cache.c +2 -2
@@ -2281,7 +2281,7 @@ out:static bool try_merge_free_space (struct btrfs_free_space_ctl *ctl,struct btrfs_free_space *info,bool update_stat) { -struct btrfs_free_space *left_info; +struct btrfs_free_space *left_info =NULL ;struct btrfs_free_space *right_info;bool merged = false;u64 offset = info->offset;
@@ -2297,7 +2297,7 @@ static bool try_merge_free_space(structif (right_info &&rb_prev (&right_info->offset_index)) left_info =rb_entry (rb_prev (&right_info->offset_index), struct btrfs_free_space, offset_index); -else +else if (!right_info) left_info =tree_search_offset (ctl, offset -1 ,0 ,0 );/* See try_merge_free_space() comment. */
Greg Kroah-Hartman
maintainerPATCH 57/232 net: ethernet: stmmac: Disable hardware multicast filter
In reply to Greg Kroah-HartmanFrom: Jonathan McDowell <[email protected]>
commit df43dd526e6609769ae513a81443c7aa727c8ca3 upstream.
The IPQ806x does not appear to have a functional multicast ethernet address filter. This was observed as a failure to correctly receive IPv6 packets on a LAN to the all stations address. Checking the vendor driver shows that it does not attempt to enable the multicast filter and instead falls back to receiving all multicast packets, internally setting ALLMULTI.
Use the new fallback support in the dwmac1000 driver to correctly achieve the same with the mainline IPQ806x driver. Confirmed to fix IPv6 functionality on an RB3011 router.
--- drivers/net/ethernet/stmicro/stmmac/dwmac-ipq806x.c | 1 + 1 file changed, 1 insertion(+)
drivers/net/ethernet/stmicro/stmmac/dwmac-ipq806x.c +1 -0
@@ -351,6 +351,7 @@ static int ipq806x_gmac_probe(struct pla plat_dat->has_gmac = true; plat_dat->bsp_priv = gmac; plat_dat->fix_mac_speed = ipq806x_gmac_fix_mac_speed; + plat_dat->multicast_filter_bins =0 ; err =stmmac_dvr_probe (&pdev->dev, plat_dat, &stmmac_res);if (err)
Greg Kroah-Hartman
maintainerPATCH 30/232 btrfs: sysfs: use NOFS for device creation
In reply to Greg Kroah-HartmanFrom: Josef Bacik <[email protected]>
commit a47bd78d0c44621efb98b525d04d60dc4d1a79b0 upstream.
Dave hit this splat during testing btrfs/078:
======================================================
WARNING: possible circular locking dependency detected
5.8.0-rc6-default+ #1191 Not tainted
------------------------------------------------------
kswapd0/75 is trying to acquire lock:
ffffa040e9d04ff8 (&delayed_node->mutex){+.+.}-{3:3}, at: __btrfs_release_delayed_node.part.0+0x3f/0x310 [btrfs]
but task is already holding lock:
ffffffff8b0c8040 (fs_reclaim){+.+.}-{0:0}, at: __fs_reclaim_acquire+0x5/0x30
which lock already depends on the new lock.
the existing dependency chain (in reverse order) is:
-> #2 (fs_reclaim){+.+.}-{0:0}:
__lock_acquire+0x56f/0xaa0 lock_acquire+0xa3/0x440 fs_reclaim_acquire.part.0+0x25/0x30 __kmalloc_track_caller+0x49/0x330 kstrdup+0x2e/0x60 __kernfs_new_node.constprop.0+0x44/0x250 kernfs_new_node+0x25/0x50 kernfs_create_link+0x34/0xa0 sysfs_do_create_link_sd+0x5e/0xd0 btrfs_sysfs_add_devices_dir+0x65/0x100 [btrfs] btrfs_init_new_device+0x44c/0x12b0 [btrfs] btrfs_ioctl+0xc3c/0x25c0 [btrfs] ksys_ioctl+0x68/0xa0 __x64_sys_ioctl+0x16/0x20 do_syscall_64+0x50/0xe0 entry_SYSCALL_64_after_hwframe+0x44/0xa9
-> #1 (&fs_info->chunk_mutex){+.+.}-{3:3}:
__lock_acquire+0x56f/0xaa0 lock_acquire+0xa3/0x440 __mutex_lock+0xa0/0xaf0 btrfs_chunk_alloc+0x137/0x3e0 [btrfs] find_free_extent+0xb44/0xfb0 [btrfs] btrfs_reserve_extent+0x9b/0x180 [btrfs] btrfs_alloc_tree_block+0xc1/0x350 [btrfs] alloc_tree_block_no_bg_flush+0x4a/0x60 [btrfs] __btrfs_cow_block+0x143/0x7a0 [btrfs] btrfs_cow_block+0x15f/0x310 [btrfs] push_leaf_right+0x150/0x240 [btrfs] split_leaf+0x3cd/0x6d0 [btrfs] btrfs_search_slot+0xd14/0xf70 [btrfs] btrfs_insert_empty_items+0x64/0xc0 [btrfs] __btrfs_commit_inode_delayed_items+0xb2/0x840 [btrfs] btrfs_async_run_delayed_root+0x10e/0x1d0 [btrfs] btrfs_work_helper+0x2f9/0x650 [btrfs] process_one_work+0x22c/0x600 worker_thread+0x50/0x3b0 kthread+0x137/0x150 ret_from_fork+0x1f/0x30
-> #0 (&delayed_node->mutex){+.+.}-{3:3}:
check_prev_add+0x98/0xa20 validate_chain+0xa8c/0x2a00 __lock_acquire+0x56f/0xaa0 lock_acquire+0xa3/0x440 __mutex_lock+0xa0/0xaf0 __btrfs_release_delayed_node.part.0+0x3f/0x310 [btrfs] btrfs_evict_inode+0x3bf/0x560 [btrfs] evict+0xd6/0x1c0 dispose_list+0x48/0x70 prune_icache_sb+0x54/0x80 super_cache_scan+0x121/0x1a0 do_shrink_slab+0x175/0x420 shrink_slab+0xb1/0x2e0 shrink_node+0x192/0x600 balance_pgdat+0x31f/0x750 kswapd+0x206/0x510 kthread+0x137/0x150 ret_from_fork+0x1f/0x30
other info that might help us debug this:
Chain exists of:
&delayed_node->mutex --> &fs_info->chunk_mutex --> fs_reclaim
Possible unsafe locking scenario: CPU0 CPU1
---- ----
lock(fs_reclaim);
lock(&fs_info->chunk_mutex);
lock(fs_reclaim);
lock(&delayed_node->mutex);*** DEADLOCK ***
3 locks held by kswapd0/75:
#0: ffffffff8b0c8040 (fs_reclaim){+.+.}-{0:0}, at: __fs_reclaim_acquire+0x5/0x30 #1: ffffffff8b0b50b8 (shrinker_rwsem){++++}-{3:3}, at: shrink_slab+0x54/0x2e0 #2: ffffa040e057c0e8 (&type->s_umount_key#26){++++}-{3:3}, at: trylock_super+0x16/0x50
stack backtrace: CPU: 2 PID: 75 Comm: kswapd0 Not tainted 5.8.0-rc6-default+ #1191 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.12.0-59-gc9ba527-rebuilt.opensuse.org 04/01/2014 Call Trace: dump_stack+0x78/0xa0 check_noncircular+0x16f/0x190 check_prev_add+0x98/0xa20 validate_chain+0xa8c/0x2a00 __lock_acquire+0x56f/0xaa0 lock_acquire+0xa3/0x440 ? __btrfs_release_delayed_node.part.0+0x3f/0x310 [btrfs] __mutex_lock+0xa0/0xaf0 ? __btrfs_release_delayed_node.part.0+0x3f/0x310 [btrfs] ? __lock_acquire+0x56f/0xaa0 ? __btrfs_release_delayed_node.part.0+0x3f/0x310 [btrfs] ? lock_acquire+0xa3/0x440 ? btrfs_evict_inode+0x138/0x560 [btrfs] ? btrfs_evict_inode+0x2fe/0x560 [btrfs] ? __btrfs_release_delayed_node.part.0+0x3f/0x310 [btrfs] __btrfs_release_delayed_node.part.0+0x3f/0x310 [btrfs] btrfs_evict_inode+0x3bf/0x560 [btrfs] evict+0xd6/0x1c0 dispose_list+0x48/0x70 prune_icache_sb+0x54/0x80 super_cache_scan+0x121/0x1a0 do_shrink_slab+0x175/0x420 shrink_slab+0xb1/0x2e0 shrink_node+0x192/0x600 balance_pgdat+0x31f/0x750 kswapd+0x206/0x510 ? _raw_spin_unlock_irqrestore+0x3e/0x50 ? finish_wait+0x90/0x90 ? balance_pgdat+0x750/0x750 kthread+0x137/0x150 ? kthread_stop+0x2a0/0x2a0 ret_from_fork+0x1f/0x30
This is because we're holding the chunk_mutex while adding this device and adding its sysfs entries. We actually hold different locks in different places when calling this function, the dev_replace semaphore for instance in dev replace, so instead of moving this call around simply wrap it's operations in NOFS.
--- fs/btrfs/sysfs.c | 3 +++ 1 file changed, 3 insertions(+)
fs/btrfs/sysfs.c +3 -0
@@ -1273,7 +1273,9 @@ int btrfs_sysfs_add_devices_dir(struct b {int error =0 ;struct btrfs_device *dev; +unsigned int nofs_flag; + nofs_flag =memalloc_nofs_save ();list_for_each_entry (dev, &fs_devices->devices, dev_list) {if (one_device && one_device != dev)
@@ -1301,6 +1303,7 @@ int btrfs_sysfs_add_devices_dir(struct bbreak ; } } +memalloc_nofs_restore (nofs_flag);return error; }
Greg Kroah-Hartman
maintainerPATCH 46/232 iio: imu: st_lsm6dsx: reset hw ts after resume
In reply to Greg Kroah-HartmanFrom: Lorenzo Bianconi <[email protected]>
commit a1bab9396c2d98c601ce81c27567159dfbc10c19 upstream.
Reset hw time samples generator after system resume in order to avoid disalignment between system and device time reference since FIFO batching and time samples generator are disabled during suspend.
--- drivers/iio/imu/st_lsm6dsx/st_lsm6dsx.h | 3 +-- drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_buffer.c | 23 +++++++++++++++-------- drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_core.c | 2 +- 3 files changed, 17 insertions(+), 11 deletions(-)
drivers/iio/imu/st_lsm6dsx/st_lsm6dsx.h +1 -2
@@ -436,8 +436,7 @@ int st_lsm6dsx_update_watermark(struct s u16 watermark);int st_lsm6dsx_update_fifo (struct st_lsm6dsx_sensor *sensor,bool enable);int st_lsm6dsx_flush_fifo (struct st_lsm6dsx_hw *hw); -int st_lsm6dsx_set_fifo_mode (struct st_lsm6dsx_hw *hw, -enum st_lsm6dsx_fifo_mode fifo_mode); +int st_lsm6dsx_resume_fifo (struct st_lsm6dsx_hw *hw);int st_lsm6dsx_read_fifo (struct st_lsm6dsx_hw *hw);int st_lsm6dsx_read_tagged_fifo (struct st_lsm6dsx_hw *hw);int st_lsm6dsx_check_odr (struct st_lsm6dsx_sensor *sensor,u32 odr,u8 *val);
drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_buffer.c +15 -8
@@ -184,8 +184,8 @@ static int st_lsm6dsx_update_decimators(return err; } -int st_lsm6dsx_set_fifo_mode (struct st_lsm6dsx_hw *hw, -enum st_lsm6dsx_fifo_mode fifo_mode) +static int st_lsm6dsx_set_fifo_mode (struct st_lsm6dsx_hw *hw, +enum st_lsm6dsx_fifo_mode fifo_mode) {unsigned int data;
@@ -302,6 +302,18 @@ static int st_lsm6dsx_reset_hw_ts(structreturn 0 ; } +int st_lsm6dsx_resume_fifo (struct st_lsm6dsx_hw *hw) +{ +int err; + +/* reset hw ts counter */ + err =st_lsm6dsx_reset_hw_ts (hw); +if (err <0 ) +return err; + +return st_lsm6dsx_set_fifo_mode (hw,ST_LSM6DSX_FIFO_CONT ); +} +/* * Set max bulk read to ST_LSM6DSX_MAX_WORD_LEN/ST_LSM6DSX_MAX_TAGGED_WORD_LEN * in order to avoid a kmalloc for each bus access
@@ -675,12 +687,7 @@ int st_lsm6dsx_update_fifo(struct st_lsm goto out;if (fifo_mask) { -/* reset hw ts counter */ - err =st_lsm6dsx_reset_hw_ts (hw); -if (err <0 ) - goto out; - - err =st_lsm6dsx_set_fifo_mode (hw,ST_LSM6DSX_FIFO_CONT ); + err =st_lsm6dsx_resume_fifo (hw);if (err <0 ) goto out; }
drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_core.c +1 -1
@@ -2458,7 +2458,7 @@ static int __maybe_unused st_lsm6dsx_res }if (hw->fifo_mask) - err =st_lsm6dsx_set_fifo_mode (hw,ST_LSM6DSX_FIFO_CONT ); + err =st_lsm6dsx_resume_fifo (hw);return err; }
Greg Kroah-Hartman
maintainerPATCH 44/232 dt-bindings: iio: io-channel-mux: Fix compatible string in example code
In reply to Greg Kroah-HartmanFrom: Christian Eggers <[email protected]>
commit add48ba425192c6e04ce70549129cacd01e2a09e upstream.
The correct compatible string is "gpio-mux" (see bindings/mux/gpio-mux.txt).
--- Documentation/devicetree/bindings/iio/multiplexer/io-channel-mux.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Documentation/devicetree/bindings/iio/multiplexer/io-channel-mux.txt +1 -1
@@ -21,7 +21,7 @@ controller state. The mux controller sta Example: mux: mux-controller { - compatible = "mux-gpio"; + compatible = "gpio-mux"; #mux-control-cells = <0>; mux-gpios = <&pioA 0 GPIO_ACTIVE_HIGH>,
Greg Kroah-Hartman
maintainerPATCH 17/232 btrfs: ref-verify: fix memory leak in add_block_entry
In reply to Greg Kroah-HartmanFrom: Tom Rix <[email protected]>
commit d60ba8de1164e1b42e296ff270c622a070ef8fe7 upstream.
clang static analysis flags this error
fs/btrfs/ref-verify.c:290:3: warning: Potential leak of memory pointed to by 're' [unix.Malloc]
kfree(be);
^~~~~The problem is in this block of code:
if (root_objectid) {
struct root_entry *exist_re;
exist_re = insert_root_entry(&exist->roots, re);
if (exist_re)
kfree(re);
}There is no 'else' block freeing when root_objectid is 0. Add the missing kfree to the else branch.
--- fs/btrfs/ref-verify.c | 2 ++ 1 file changed, 2 insertions(+)
fs/btrfs/ref-verify.c +2 -0
@@ -286,6 +286,8 @@ static struct block_entry *add_block_ent exist_re =insert_root_entry (&exist->roots, re);if (exist_re)kfree (re); + }else { +kfree (re); }kfree (be);return exist;
Greg Kroah-Hartman
maintainerPATCH 23/232 btrfs: pass checksum type via BTRFS_IOC_FS_INFO ioctl
In reply to Greg Kroah-HartmanFrom: Johannes Thumshirn <[email protected]>
commit 137c541821a83debb63b3fa8abdd1cbc41bdf3a1 upstream.
With the recent addition of filesystem checksum types other than CRC32c, it is not anymore hard-coded which checksum type a btrfs filesystem uses.
Up to now there is no good way to read the filesystem checksum, apart from reading the filesystem UUID and then query sysfs for the checksum type.
Add a new csum_type and csum_size fields to the BTRFS_IOC_FS_INFO ioctl command which usually is used to query filesystem features. Also add a flags member indicating that the kernel responded with a set csum_type and csum_size field.
For compatibility reasons, only return the csum_type and csum_size if the BTRFS_FS_INFO_FLAG_CSUM_INFO flag was passed to the kernel. Also clear any unknown flags so we don't pass false positives to user-space newer than the kernel.
To simplify further additions to the ioctl, also switch the padding to a u8 array. Pahole was used to verify the result of this switch:
The csum members are added before flags, which might look odd, but this is to keep the alignment requirements and not to introduce holes in the structure.
$ pahole -C btrfs_ioctl_fs_info_args fs/btrfs/btrfs.ko
struct btrfs_ioctl_fs_info_args {
__u64 max_id; /* 0 8 */
__u64 num_devices; /* 8 8 */
__u8 fsid[16]; /* 16 16 */
__u32 nodesize; /* 32 4 */
__u32 sectorsize; /* 36 4 */
__u32 clone_alignment; /* 40 4 */
__u16 csum_type; /* 44 2 */
__u16 csum_size; /* 46 2 */
__u64 flags; /* 48 8 */
__u8 reserved[968]; /* 56 968 *//* size: 1024, cachelines: 16, members: 10 */
};
--- fs/btrfs/ioctl.c | 16 +++++++++++++--- include/uapi/linux/btrfs.h | 14 ++++++++++++-- 2 files changed, 25 insertions(+), 5 deletions(-)
fs/btrfs/ioctl.c +13 -3
@@ -3217,11 +3217,15 @@ static long btrfs_ioctl_fs_info(struct bstruct btrfs_ioctl_fs_info_args *fi_args;struct btrfs_device *device;struct btrfs_fs_devices *fs_devices = fs_info->fs_devices; +u64 flags_in;int ret =0 ; - fi_args =kzalloc (sizeof (*fi_args),GFP_KERNEL ); -if (!fi_args) -return -ENOMEM ; + fi_args =memdup_user (arg,sizeof (*fi_args)); +if (IS_ERR (fi_args)) +return PTR_ERR (fi_args); + + flags_in = fi_args->flags; +memset (fi_args,0 ,sizeof (*fi_args));rcu_read_lock (); fi_args->num_devices = fs_devices->num_devices;
@@ -3237,6 +3241,12 @@ static long btrfs_ioctl_fs_info(struct b fi_args->sectorsize = fs_info->sectorsize; fi_args->clone_alignment = fs_info->sectorsize; +if (flags_in &BTRFS_FS_INFO_FLAG_CSUM_INFO ) { + fi_args->csum_type =btrfs_super_csum_type (fs_info->super_copy); + fi_args->csum_size =btrfs_super_csum_size (fs_info->super_copy); + fi_args->flags |=BTRFS_FS_INFO_FLAG_CSUM_INFO ; + } +if (copy_to_user (arg, fi_args,sizeof (*fi_args))) ret = -EFAULT ;
include/uapi/linux/btrfs.h +12 -2
@@ -243,6 +243,13 @@ struct btrfs_ioctl_dev_info_args {__u8 path[BTRFS_DEVICE_PATH_NAME_MAX ];/* out */ }; +/* +* Retrieve information about the filesystem +*/ + +/* Request information about checksum type and size */ +#define BTRFS_FS_INFO_FLAG_CSUM_INFO (1 << 0) +struct btrfs_ioctl_fs_info_args {__u64 max_id;/* out */ __u64 num_devices;/* out */
@@ -250,8 +257,11 @@ struct btrfs_ioctl_fs_info_args {__u32 nodesize;/* out */ __u32 sectorsize;/* out */ __u32 clone_alignment;/* out */ -__u32 reserved32; -__u64 reserved[122 ];/* pad to 1k */ +/* See BTRFS_FS_INFO_FLAG_* */ +__u16 csum_type;/* out */ +__u16 csum_size;/* out */ +__u64 flags;/* in/out */ +__u8 reserved[968 ];/* pad to 1k */ };/*
Greg Kroah-Hartman
maintainerPATCH 18/232 btrfs: only commit the delayed inode when doing a full fsync
In reply to Greg Kroah-HartmanFrom: Filipe Manana <[email protected]>
commit 8c8648dd1f6d62aeb912deeb788b6ac33cb782e7 upstream.
Commit 2c2c452b0cafdc ("Btrfs: fix fsync when extend references are added to an inode") forced a commit of the delayed inode when logging an inode in order to ensure we would end up logging the inode item during a full fsync. By committing the delayed inode, we updated the inode item in the fs/subvolume tree and then later when copying items from leafs modified in the current transaction into the log tree (with copy_inode_items_to_log()) we ended up copying the inode item from the fs/subvolume tree into the log tree. Logging an up to date version of the inode item is required to make sure at log replay time we get the link count fixup triggered among other things (replay xattr deletes, etc). The test case generic/040 from fstests exercises the bug which that commit fixed.
However for a fast fsync we don't need to commit the delayed inode because we always log an up to date version of the inode item based on the struct btrfs_inode we have in-memory. We started doing this for fast fsyncs since commit e4545de5b035c7 ("Btrfs: fix fsync data loss after append write").
So just stop committing the delayed inode if we are doing a fast fsync, we are only wasting time and adding contention on fs/subvolume tree.
This patch is part of a series that has the following patches:
1/4 btrfs: only commit the delayed inode when doing a full fsync 2/4 btrfs: only commit delayed items at fsync if we are logging a directory 3/4 btrfs: stop incremening log_batch for the log root tree when syncing log 4/4 btrfs: remove no longer needed use of log_writers for the log root tree
After the entire patchset applied I saw about 12% decrease on max latency reported by dbench. The test was done on a qemu vm, with 8 cores, 16Gb of ram, using kvm and using a raw NVMe device directly (no intermediary fs on the host). The test was invoked like the following:
mkfs.btrfs -f /dev/sdk
mount -o ssd -o nospace_cache /dev/sdk /mnt/sdk
dbench -D /mnt/sdk -t 300 8
umount /mnt/dsk
--- fs/btrfs/tree-log.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-)
fs/btrfs/tree-log.c +7 -5
@@ -5130,7 +5130,7 @@ static int btrfs_log_inode(struct btrfs_struct btrfs_key max_key;struct btrfs_root *log = root->log_root;int err =0 ; -int ret; +int ret =0 ;bool fast_search = false;u64 ino =btrfs_ino (inode);struct extent_map_tree *em_tree = &inode->extent_tree;
@@ -5167,14 +5167,16 @@ static int btrfs_log_inode(struct btrfs_/* * Only run delayed items if we are a dir or a new file. -* Otherwise commit the delayed inode only, which is needed in -* order for the log replay code to mark inodes for link count -* fixup (create temporary BTRFS_TREE_LOG_FIXUP_OBJECTID items). +* Otherwise commit the delayed inode only if the full sync flag is set, +* as we want to make sure an up to date version is in the subvolume +* tree so copy_inode_items_to_log() / copy_items() can find it and copy +* it to the log tree. For a non full sync, we always log the inode item +* based on the in-memory struct btrfs_inode which is always up to date. */ if (S_ISDIR (inode->vfs_inode.i_mode) || inode->generation > fs_info->last_trans_committed) ret =btrfs_commit_inode_delayed_items (trans, inode); -else +else if (test_bit (BTRFS_INODE_NEEDS_FULL_SYNC , &inode->runtime_flags)) ret =btrfs_commit_inode_delayed_inode (inode);if (ret) {
Greg Kroah-Hartman
maintainerPATCH 15/232 btrfs: dont allocate anonymous block device for user invisible roots
In reply to Greg Kroah-HartmanFrom: Qu Wenruo <[email protected]>
commit 851fd730a743e072badaf67caf39883e32439431 upstream.
[BUG]
When a lot of subvolumes are created, there is a user report about transaction aborted:
BTRFS: Transaction aborted (error -24)
WARNING: CPU: 17 PID: 17041 at fs/btrfs/transaction.c:1576 create_pending_snapshot+0xbc4/0xd10 [btrfs] RIP: 0010:create_pending_snapshot+0xbc4/0xd10 [btrfs] Call Trace: create_pending_snapshots+0x82/0xa0 [btrfs] btrfs_commit_transaction+0x275/0x8c0 [btrfs] btrfs_mksubvol+0x4b9/0x500 [btrfs] btrfs_ioctl_snap_create_transid+0x174/0x180 [btrfs] btrfs_ioctl_snap_create_v2+0x11c/0x180 [btrfs] btrfs_ioctl+0x11a4/0x2da0 [btrfs] do_vfs_ioctl+0xa9/0x640 ksys_ioctl+0x67/0x90 __x64_sys_ioctl+0x1a/0x20 do_syscall_64+0x5a/0x110 entry_SYSCALL_64_after_hwframe+0x44/0xa9 ---[ end trace 33f2f83f3d5250e9 ]--- BTRFS: error (device sda1) in create_pending_snapshot:1576: errno=-24 unknown BTRFS info (device sda1): forced readonly BTRFS warning (device sda1): Skipping commit of aborted transaction. BTRFS: error (device sda1) in cleanup_transaction:1831: errno=-24 unknown
[CAUSE]
The error is EMFILE (Too many files open) and comes from the anonymous block device allocation. The ids are in a shared pool of size 1<<20.
The ids are assigned to live subvolumes, ie. the root structure exists in memory (eg. after creation or after the root appears in some path). The pool could be exhausted if the numbers are not reclaimed fast enough, after subvolume deletion or if other system component uses the anon block devices.
[WORKAROUND]
Since it's not possible to completely solve the problem, we can only minimize the time the id is allocated to a subvolume root.
Firstly, we can reduce the use of anon_dev by trees that are not subvolume roots, like data reloc tree.
This patch will do extra check on root objectid, to skip roots that don't need anon_dev. Currently it's only data reloc tree and orphan roots.
--- fs/btrfs/disk-io.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-)
fs/btrfs/disk-io.c +10 -3
@@ -1428,9 +1428,16 @@ static int btrfs_init_fs_root(struct btrspin_lock_init (&root->ino_cache_lock);init_waitqueue_head (&root->ino_cache_wait); - ret =get_anon_bdev (&root->anon_dev); -if (ret) - goto fail; +/* +* Don't assign anonymous block device to roots that are not exposed to +* userspace, the id pool is limited to 1M +*/ +if (is_fstree (root->root_key.objectid) && +btrfs_root_refs (&root->root_item) >0 ) { + ret =get_anon_bdev (&root->anon_dev); +if (ret) + goto fail; + }mutex_lock (&root->objectid_mutex); ret = btrfs_find_highest_objectid(root,
Greg Kroah-Hartman
maintainerPATCH 11/232 PCI: qcom: Define some PARF params needed for ipq8064 SoC
In reply to Greg Kroah-HartmanFrom: Ansuel Smith <[email protected]>
commit 5149901e9e6deca487c01cc434a3ac4125c7b00b upstream.
Set some specific value for Tx De-Emphasis, Tx Swing and Rx equalization needed on some ipq8064 based device (Netgear R7800 for example). Without this the system locks on kernel load.
--- drivers/pci/controller/dwc/pcie-qcom.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+)
drivers/pci/controller/dwc/pcie-qcom.c +24 -0
@@ -77,6 +77,18 @@#define DBI_RO_WR_EN 1#define PERST_DELAY_US 1000 +/* PARF registers */ +#define PCIE20_PARF_PCS_DEEMPH 0x34 +#define PCS_DEEMPH_TX_DEEMPH_GEN1 (x) ((x) << 16) +#define PCS_DEEMPH_TX_DEEMPH_GEN2_3_5DB (x) ((x) << 8) +#define PCS_DEEMPH_TX_DEEMPH_GEN2_6DB (x) ((x) << 0) + +#define PCIE20_PARF_PCS_SWING 0x38 +#define PCS_SWING_TX_SWING_FULL (x) ((x) << 8) +#define PCS_SWING_TX_SWING_LOW (x) ((x) << 0) + +#define PCIE20_PARF_CONFIG_BITS 0x50 +#define PHY_RX0_EQ (x) ((x) << 24)#define PCIE20_v3_PARF_SLV_ADDR_SPACE_SIZE 0x358#define SLV_ADDR_SPACE_SZ 0x10000000
@@ -286,6 +298,7 @@ static int qcom_pcie_init_2_1_0(struct qstruct qcom_pcie_resources_2_1_0 *res = &pcie->res.v2_1_0;struct dw_pcie *pci = pcie->pci;struct device *dev = pci->dev; +struct device_node *node = dev->of_node;u32 val;int ret;
@@ -330,6 +343,17 @@ static int qcom_pcie_init_2_1_0(struct q val &= ~BIT (0 );writel (val, pcie->parf +PCIE20_PARF_PHY_CTRL ); +if (of_device_is_compatible (node,"qcom,pcie-ipq8064" )) { +writel (PCS_DEEMPH_TX_DEEMPH_GEN1 (24 ) | +PCS_DEEMPH_TX_DEEMPH_GEN2_3_5DB (24 ) | +PCS_DEEMPH_TX_DEEMPH_GEN2_6DB (34 ), + pcie->parf +PCIE20_PARF_PCS_DEEMPH ); +writel (PCS_SWING_TX_SWING_FULL (120 ) | +PCS_SWING_TX_SWING_LOW (120 ), + pcie->parf +PCIE20_PARF_PCS_SWING ); +writel (PHY_RX0_EQ (4 ), pcie->parf +PCIE20_PARF_CONFIG_BITS ); + } +/* enable external reference clock */ val =readl (pcie->parf +PCIE20_PARF_PHY_REFCLK ); val |=BIT (16 );
Greg Kroah-Hartman
maintainerPATCH 34/232 btrfs: fix messages after changing compression level by remount
In reply to Greg Kroah-HartmanFrom: David Sterba <[email protected]>
commit 27942c9971cc405c60432eca9395e514a2ae9f5e upstream.
Reported by Forza on IRC that remounting with compression options does not reflect the change in level, or at least it does not appear to do so according to the messages:
mount -o compress=zstd:1 /dev/sda /mnt
mount -o remount,compress=zstd:15 /mnt
does not print the change to the level to syslog:
[ 41.366060] BTRFS info (device vda): use zstd compression, level 1 [ 41.368254] BTRFS info (device vda): disk space caching is enabled [ 41.390429] BTRFS info (device vda): disk space caching is enabled
What really happens is that the message is lost but the level is actualy changed.
There's another weird output, if compression is reset to 'no':
[ 45.413776] BTRFS info (device vda): use no compression, level 4
To fix that, save the previous compression level and print the message in that case too and use separate message for 'no' compression.
--- fs/btrfs/super.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-)
fs/btrfs/super.c +9 -5
@@ -449,6 +449,7 @@ int btrfs_parse_options(struct btrfs_fs_char *compress_type;bool compress_force = false;enum btrfs_compression_type saved_compress_type; +int saved_compress_level;bool saved_compress_force;int no_compress =0 ;
@@ -531,6 +532,7 @@ int btrfs_parse_options(struct btrfs_fs_ info->compress_type : BTRFS_COMPRESS_NONE; saved_compress_force =btrfs_test_opt (info,FORCE_COMPRESS ); + saved_compress_level = info->compress_level;if (token == Opt_compress || token == Opt_compress_force ||strncmp (args[0 ].from,"zlib" ,4 ) ==0 ) {
@@ -575,6 +577,8 @@ int btrfs_parse_options(struct btrfs_fs_ no_compress =0 ; }else if (strncmp (args[0 ].from,"no" ,2 ) ==0 ) { compress_type ="no" ; + info->compress_level =0 ; + info->compress_type =0 ;btrfs_clear_opt (info->mount_opt,COMPRESS );btrfs_clear_opt (info->mount_opt,FORCE_COMPRESS ); compress_force = false;
@@ -595,11 +599,11 @@ int btrfs_parse_options(struct btrfs_fs_*/ btrfs_clear_opt (info->mount_opt,FORCE_COMPRESS ); } -if ((btrfs_test_opt (info,COMPRESS ) && - (info->compress_type != saved_compress_type || - compress_force != saved_compress_force)) || - (!btrfs_test_opt (info,COMPRESS ) && - no_compress ==1 )) { +if (no_compress ==1 ) { +btrfs_info (info,"use no compression" ); + }else if ((info->compress_type != saved_compress_type) || + (compress_force != saved_compress_force) || + (info->compress_level != saved_compress_level)) {btrfs_info (info,"%s %s compression, level %d" , (compress_force) ?"force" :"use" , compress_type, info->compress_level);
Greg Kroah-Hartman
maintainerPATCH 38/232 btrfs: trim: fix underflow in trim length to prevent access beyond device boundary
In reply to Greg Kroah-HartmanFrom: Qu Wenruo <[email protected]>
commit c57dd1f2f6a7cd1bb61802344f59ccdc5278c983 upstream.
[BUG]
The following script can lead to tons of beyond device boundary access:
mkfs.btrfs -f $dev -b 10G
mount $dev $mnt
trimfs $mnt
btrfs filesystem resize 1:-1G $mnt
trimfs $mnt
[CAUSE]
Since commit 929be17a9b49 ("btrfs: Switch btrfs_trim_free_extents to find_first_clear_extent_bit"), we try to avoid trimming ranges that's already trimmed.
So we check device->alloc_state by finding the first range which doesn't have CHUNK_TRIMMED and CHUNK_ALLOCATED not set.
But if we shrunk the device, that bits are not cleared, thus we could easily got a range starts beyond the shrunk device size.
This results the returned @start and @end are all beyond device size, then we call "end = min(end, device->total_bytes -1);" making @end smaller than device size.
Then finally we goes "len = end - start + 1", totally underflow the result, and lead to the beyond-device-boundary access.
[FIX]
This patch will fix the problem in two ways:
- Clear CHUNK_TRIMMED | CHUNK_ALLOCATED bits when shrinking device This is the root fix
- Add extra safety check when trimming free device extents We check and warn if the returned range is already beyond current device.
--- fs/btrfs/extent-io-tree.h | 2 ++ fs/btrfs/extent-tree.c | 14 ++++++++++++++ fs/btrfs/volumes.c | 4 ++++ 3 files changed, 20 insertions(+)
fs/btrfs/extent-io-tree.h +2 -0
@@ -34,6 +34,8 @@ struct io_failure_record;*/ #define CHUNK_ALLOCATED EXTENT_DIRTY#define CHUNK_TRIMMED EXTENT_DEFRAG +#define CHUNK_STATE_MASK (CHUNK_ALLOCATED | \ + CHUNK_TRIMMED)enum {IO_TREE_FS_PINNED_EXTENTS ,
fs/btrfs/extent-tree.c +14 -0
@@ -33,6 +33,7 @@#include "delalloc-space.h" #include "block-group.h" #include "discard.h" +#include "rcu-string.h" #undef SCRAMBLE_DELAYED_REFS
@@ -5668,6 +5669,19 @@ static int btrfs_trim_free_extents(struc &start, &end, CHUNK_TRIMMED | CHUNK_ALLOCATED); +/* Check if there are any CHUNK_* bits left */ +if (start > device->total_bytes) { +WARN_ON (IS_ENABLED (CONFIG_BTRFS_DEBUG )); +btrfs_warn_in_rcu (fs_info, +"ignoring attempt to trim beyond device size: offset %llu length %llu device %s device size %llu" , + start, end - start +1 , +rcu_str_deref (device->name), + device->total_bytes); +mutex_unlock (&fs_info->chunk_mutex); + ret =0 ; +break ; + } +/* Ensure we skip the reserved area in the first 1M */ start =max_t (u64, start,SZ_1M );
fs/btrfs/volumes.c +4 -0
@@ -4720,6 +4720,10 @@ again: }mutex_lock (&fs_info->chunk_mutex); +/* Clear all state bits beyond the shrunk device size */ +clear_extent_bits (&device->alloc_state, new_size, (u64)-1 , +CHUNK_STATE_MASK ); +btrfs_device_set_disk_total_bytes (device, new_size);if (list_empty (&device->post_commit_list)) list_add_tail(&device->post_commit_list,
Greg Kroah-Hartman
maintainerPATCH 40/232 btrfs: fix return value mixup in btrfs_get_extent
In reply to Greg Kroah-HartmanFrom: Pavel Machek <[email protected]>
commit 881a3a11c2b858fe9b69ef79ac5ee9978a266dc9 upstream.
btrfs_get_extent() sets variable ret, but out: error path expect error to be in variable err so the error code is lost.
--- fs/btrfs/inode.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
fs/btrfs/inode.c +1 -1
@@ -6633,7 +6633,7 @@ struct extent_map *btrfs_get_extent(stru extent_type == BTRFS_FILE_EXTENT_PREALLOC) {/* Only regular file could have regular/prealloc extent */ if (!S_ISREG (inode->vfs_inode.i_mode)) { - ret = -EUCLEAN ; + err = -EUCLEAN ;btrfs_crit (fs_info,"regular/prealloc extent found for non-regular inode %llu" ,btrfs_ino (inode));
Greg Kroah-Hartman
maintainerPATCH 73/232 MIPS: CPU#0 is not hotpluggable
In reply to Greg Kroah-HartmanFrom: Huacai Chen <[email protected]>
commit 9cce844abf07b683cff5f0273977d5f8d0af94c7 upstream.
Now CPU#0 is not hotpluggable on MIPS, so prevent to create /sys/devices /system/cpu/cpu0/online which confuses some user-space tools.
--- arch/mips/kernel/topology.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/mips/kernel/topology.c +1 -1
@@ -20,7 +20,7 @@ static int __init topology_init(void)for_each_present_cpu (i) {struct cpu *c = &per_cpu (cpu_devices, i); - c->hotpluggable =1 ; + c->hotpluggable = !!i; ret =register_cpu (c, i);if (ret) printk(KERN_WARNING "topology_init: register_cpu %d "
Quoted 15 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 5.8.3 release. There are 232 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Sat, 22 Aug 2020 09:15:09 +0000. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
https://www.kernel.org/pub/linux/kernel/v5.x/stable-review/patch-5.8.3-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-5.8.y
and the diffstat can be found below.
Quoted 6 lines
thanks,
greg k-h
Herbert Xu <[email protected]>
crypto:af_alg- Fix regression on empty requests
Results from Linaro?s test farm.
Regressions detected.
ltp-crypto-tests:
* af_alg02
ltp-cve-tests:
* cve-2017-17805
af_alg02.c:52: BROK: Timed out while reading from request socket. We are running the LTP 20200515 tag released test suite.
https://github.com/linux-test-project/ltp/blob/master/testcases/kernel/crypto/af_alg02.c
Summary
------------------------------------------------------------------------
kernel: 5.8.3-rc1
git repo: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git
git branch: linux-5.8.y
git commit: 201fff807310ce10485bcff294d47be95f3769eb
git describe: v5.8.2-233-g201fff807310
Test details: https://qa-reports.linaro.org/lkft/linux-stable-rc-5.8-oe/build/v5.8.2-233-g201fff807310
Regressions (compared to build v5.8.2)
------------------------------------------------------------------------
x15:
ltp-crypto-tests:
* af_alg02
ltp-cve-tests:
* cve-2017-17805
Signature · 2 lines
Linaro LKFT https://lkft.linaro.org
Quoted 49 lines · Naresh Kamboju
Quoted 15 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 5.8.3 release. There are 232 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Sat, 22 Aug 2020 09:15:09 +0000. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
https://www.kernel.org/pub/linux/kernel/v5.x/stable-review/patch-5.8.3-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-5.8.y
and the diffstat can be found below.Quoted 6 lines
thanks,
greg k-h
Herbert Xu <[email protected]>
crypto:af_alg- Fix regression on empty requestsResults from Linaro’s test farm.
Regressions detected.ltp-crypto-tests:
*af_alg02
ltp-cve-tests:
* cve-2017-17805af_alg02.c:52: BROK: Timed out while reading from request socket. We are running the LTP 20200515 tag released test suite.
https://github.com/linux-test-project/ltp/blob/master/testcases/kernel/crypto/af_alg02.cSummary
------------------------------------------------------------------------kernel: 5.8.3-rc1
git repo: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git
git branch: linux-5.8.y
git commit:201fff807310ce10485bcff294d47be95f3769eb
git describe: v5.8.2-233-g201fff807310
Test details: https://qa-reports.linaro.org/lkft/linux-stable-rc-5.8-oe/build/v5.8.2-233-g201fff807310Regressions (compared to build v5.8.2)
------------------------------------------------------------------------
Quoted 7 lines
x15:
ltp-crypto-tests:
*af_alg02ltp-cve-tests:
* cve-2017-17805
Looks like this test is still "broken" because it assumes behavior that isn't clearly specified, as previously discussed at
https://lkml.kernel.org/r/[email protected].
I sent out LTP patches to fix it:
https://lkml.kernel.org/linux-crypto/[email protected]/T/#u
- Eric
Quoted 8 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 5.8.3 release. There are 232 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Sat, 22 Aug 2020 09:15:09 +0000. Anything received after that time might be too late.
Build results:
total: 154 pass: 154 fail: 0 Qemu test results: total: 430 pass: 430 fail: 0
Guenter
Quoted 9 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 5.8.3 release. There are 232 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Sat, 22 Aug 2020 09:15:09 +0000. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
Quoted 9 lines
https://www.kernel.org/pub/linux/kernel/v5.x/stable-review/patch-5.8.3-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-5.8.y
and the diffstat can be found below.thanks,
greg k-h
Compiled and booted on my test system. No dmesg regressions.
thanks,
-- Shuah
Hi all,
Quoted 58 lines · Naresh Kamboju
Quoted 49 lines
Quoted 14 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 5.8.3 release. There are 232 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Sat, 22 Aug 2020 09:15:09 +0000. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
https://www.kernel.org/pub/linux/kernel/v5.x/stable-review/patch-5.8.3-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-5.8.y
and the diffstat can be found below.Quoted 6 lines
thanks,
greg k-h
Herbert Xu <[email protected]>
crypto:af_alg- Fix regression on empty requestsResults from Linaro’s test farm.
Regressions detected.ltp-crypto-tests:
*af_alg02
ltp-cve-tests:
* cve-2017-17805af_alg02.c:52: BROK: Timed out while reading from request socket. We are running the LTP 20200515 tag released test suite.
https://github.com/linux-test-project/ltp/blob/master/testcases/kernel/crypto/af_alg02.cSummary
------------------------------------------------------------------------kernel: 5.8.3-rc1
git repo: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git
git branch: linux-5.8.y
git commit:201fff807310ce10485bcff294d47be95f3769eb
git describe: v5.8.2-233-g201fff807310
Test details: https://qa-reports.linaro.org/lkft/linux-stable-rc-5.8-oe/build/v5.8.2-233-g201fff807310Regressions (compared to build v5.8.2)
------------------------------------------------------------------------Quoted 6 lines
x15:
ltp-crypto-tests:
*af_alg02ltp-cve-tests:
* cve-2017-17805
Quoted 6 lines
Looks like this test is still "broken" because it assumes behavior that isn't clearly specified, as previously discussed at
https://lkml.kernel.org/r/[email protected].I sent out LTP patches to fix it:
https://lkml.kernel.org/linux-crypto/[email protected]/T/#u
FYI fix for LTP merged.
Kind regards,
Petr
Quoted 1 line
- Eric
Greg Kroah-Hartman
maintainerQuoted 15 lines · Shuah Khan
Quoted 14 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 5.8.3 release. There are 232 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Sat, 22 Aug 2020 09:15:09 +0000. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
https://www.kernel.org/pub/linux/kernel/v5.x/stable-review/patch-5.8.3-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-5.8.y
and the diffstat can be found below.
Quoted 8 lines
Quoted 4 lines
thanks,
greg k-h
Compiled and booted on my test system. No dmesg regressions.
Tested-by Shuah Khan <[email protected]>
Thanks for testing all of these and letting me know.
greg k-h
Greg Kroah-Hartman
maintainerQuoted 10 lines · Guenter Roeck
Quoted 8 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 5.8.3 release. There are 232 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Sat, 22 Aug 2020 09:15:09 +0000. Anything received after that time might be too late.
Quoted 6 lines
Build results:
total: 154 pass: 154 fail: 0 Qemu test results: total: 430 pass: 430 fail: 0Tested-by Guenter Roeck <[email protected]>
Thanks for testing all of these and letting me know.
greg k-h
Greg Kroah-Hartman
maintainerQuoted 27 lines · Naresh Kamboju
Quoted 15 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 5.8.3 release. There are 232 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Sat, 22 Aug 2020 09:15:09 +0000. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
https://www.kernel.org/pub/linux/kernel/v5.x/stable-review/patch-5.8.3-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-5.8.y
and the diffstat can be found below.Quoted 6 lines
thanks,
greg k-h
Herbert Xu <[email protected]>
crypto:af_alg- Fix regression on empty requestsResults from Linaro’s test farm.
Regressions detected.
Quoted 8 lines
ltp-crypto-tests:
*af_alg02
ltp-cve-tests:
* cve-2017-17805af_alg02.c:52: BROK: Timed out while reading from request socket. We are running the LTP 20200515 tag released test suite.
https://github.com/linux-test-project/ltp/blob/master/testcases/kernel/crypto/af_alg02.c
Looks like the crypto tests are now fixed :)
Anyway, thanks for testing all of these and letting me know.
greg k-h
Quoted 34 lines · Greg Kroah-Hartman
Quoted 32 lines · Naresh Kamboju
Quoted 15 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 5.8.3 release. There are 232 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Sat, 22 Aug 2020 09:15:09 +0000. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
https://www.kernel.org/pub/linux/kernel/v5.x/stable-review/patch-5.8.3-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-5.8.y
and the diffstat can be found below.Quoted 6 lines
thanks,
greg k-h
Herbert Xu <[email protected]>
crypto:af_alg- Fix regression on empty requestsResults from Linaro?s test farm.
Regressions detected.ltp-crypto-tests:
*af_alg02
ltp-cve-tests:
* cve-2017-17805
Quoted 7 lines
Quoted 3 lines
af_alg02.c:52: BROK: Timed out while reading from request socket. We are running the LTP 20200515 tag released test suite.
https://github.com/linux-test-project/ltp/blob/master/testcases/kernel/crypto/af_alg02.cLooks like the crypto tests are now fixed :)
Anyway, thanks for testing all of these and letting me know.
Apart from the reported LTP crypto test case problem all other results look good to me.
Results from Linaro?s test farm.
No regressions on arm64, arm, x86_64, and i386.
Summary
------------------------------------------------------------------------
kernel: 5.8.3
git repo: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git
git branch: linux-5.8.y
git commit: a1101e94767e2d5da5bcbee12573d96a1c8be5bb
git describe: v5.8.3
Test details: https://qa-reports.linaro.org/lkft/linux-stable-rc-5.8-oe/build/v5.8.3
No regressions (compared to build v5.8.2)
No fixes (compared to build v5.8.2)
Ran 30256 total tests in the following environments and test suites.
Environments
--------------
- dragonboard-410c
- hi6220-hikey
- i386
- juno-r2
- juno-r2-compat
- juno-r2-kasan
- nxp-ls2088
- qemu_arm
- qemu_arm64
- qemu_i386
- qemu_x86_64
- x15
- x86
- x86-kasan
Test Suites
-----------
* build
* linux-log-parser
* ltp-commands-tests
* ltp-containers-tests
* ltp-dio-tests
* ltp-fs-tests
* ltp-io-tests
* ltp-math-tests
* ltp-tracing-tests
* ltp-cve-tests
* ltp-fcntl-locktests-tests
* ltp-filecaps-tests
* ltp-fs_bind-tests
* ltp-fs_perms_simple-tests
* ltp-fsx-tests
* ltp-nptl-tests
* ltp-pty-tests
* ltp-securebits-tests
* ltp-syscalls-tests
* v4l2-compliance
* libhugetlbfs
* ltp-cap_bounds-tests
* ltp-controllers-tests
* ltp-cpuhotplug-tests
* ltp-crypto-tests
* ltp-hugetlb-tests
* ltp-ipc-tests
* ltp-mm-tests
* ltp-open-posix-tests
* ltp-sched-tests
* network-basic-tests
* igt-gpu-tools
Signature · 2 lines
Linaro LKFT https://lkft.linaro.org
Re: [PATCH 5.8 137/232] USB: serial: ftdi_sio: fix break and sysrq handling
In reply to Greg Kroah-HartmanQuoted 7 lines · Greg Kroah-Hartman
Quoted 3 lines · Johan Hovold
This was never intended for stable as it is not a critical fix and has never worked properly in the first place. Please drop this one and the preparatory clean ups from all stable trees.
Ok, but the "fix this thing" and the "Fixes:" tag really did imply this was actually fixing something :)
Sure and it is indeed a fix, just not for a regression or something critical (oops, etc), and therefore the stable-cc tag was omitted.
Quoted 1 line
I'll drop it from everywhere, thanks.
Looks like you never dropped the preparatory clean ups. Should be ok.
Johan
Greg Kroah-Hartman
maintainerRe: [PATCH 5.8 137/232] USB: serial: ftdi_sio: fix break and sysrq handling
Quoted 9 lines · Johan Hovold
Quoted 7 lines · Greg Kroah-Hartman
Quoted 3 lines · Johan Hovold
This was never intended for stable as it is not a critical fix and has never worked properly in the first place. Please drop this one and the preparatory clean ups from all stable trees.
Ok, but the "fix this thing" and the "Fixes:" tag really did imply this was actually fixing something :)
Quoted 6 lines
Sure and it is indeed a fix, just not for a regression or something critical (oops, etc), and therefore the stable-cc tag was omitted.
Quoted 1 line
I'll drop it from everywhere, thanks.
Looks like you never dropped the preparatory clean ups. Should be ok.
Ah, sorry about that, shouldn't be a problem :)
Re: [PATCH 5.8 130/232] sched/uclamp: Protect uclamp fast path code with static key
In reply to Greg Kroah-HartmanQuoted 71 lines · Greg Kroah-Hartman
From: Qais Yousef <[email protected]>
[ Upstream commit
46609ce227039fd192e0ecc7d940bed587fd2c78]There is a report that when uclamp is enabled, a netperf UDP test regresses compared to a kernel compiled without uclamp.
https://lore.kernel.org/lkml/[email protected]/
While investigating the root cause, there were no sign that the uclamp code is doing anything particularly expensive but could suffer from bad cache behavior under certain circumstances that are yet to be understood.
https://lore.kernel.org/lkml/20200616110824.dgkkbyapn3io6wik@e107158-lin/
To reduce the pressure on the fast path anyway, add a static key that is by default will skip executing uclamp logic in the enqueue/dequeue_task() fast path until it's needed.
As soon as the user start using util clamp by:
1. Changing uclamp value of a task with
sched_setattr()
2. Modifying the default sysctl_sched_util_clamp_{min, max}
3. Modifying the default cpu.uclamp.{min, max} value in cgroupWe flip the static key now that the user has opted to use util clamp. Effectively re-introducing uclamp logic in the enqueue/dequeue_task() fast path. It stays on from that point forward until the next reboot.
This should help minimize the effect of util clamp on workloads that don't need it but still allow distros to ship their kernels with uclamp compiled in by default.
SCHED_WARN_ON()inuclamp_rq_dec_id()was removed since now we can end up with unbalanced call touclamp_rq_dec_id()if we flip the key while a task is running in the rq. Since we know it is harmless we just quietly return if we attempt auclamp_rq_dec_id()when rq->uclamp[].bucket[].tasks is 0.In schedutil, we introduce a new
uclamp_is_enabled()helper which takes the static key into account to ensure RT boosting behavior is retained.The following results demonstrates how this helps on 2 Sockets Xeon E5 2x10-Cores system.
nouclamp uclamp uclamp-static-key Hmean send-64 162.43 ( 0.00%) 157.84 * -2.82%* 163.39 * 0.59%* Hmean send-128 324.71 ( 0.00%) 314.78 * -3.06%* 326.18 * 0.45%* Hmean send-256 641.55 ( 0.00%) 628.67 * -2.01%* 648.12 * 1.02%* Hmean send-1024 2525.28 ( 0.00%) 2448.26 * -3.05%* 2543.73 * 0.73%* Hmean send-2048 4836.14 ( 0.00%) 4712.08 * -2.57%* 4867.69 * 0.65%* Hmean send-3312 7540.83 ( 0.00%) 7425.45 * -1.53%* 7621.06 * 1.06%* Hmean send-4096 9124.53 ( 0.00%) 8948.82 * -1.93%* 9276.25 * 1.66%* Hmean send-8192 15589.67 ( 0.00%) 15486.35 * -0.66%* 15819.98 * 1.48%* Hmean send-16384 26386.47 ( 0.00%) 25752.25 * -2.40%* 26773.74 * 1.47%*The perf diff between nouclamp and uclamp-static-key when uclamp is disabled in the fast path:
8.73% -1.55% [kernel.kallsyms] [k] try_to_wake_up 0.07% +0.04% [kernel.kallsyms] [k] deactivate_task 0.13% -0.02% [kernel.kallsyms] [k] activate_taskThe diff between nouclamp and uclamp-static-key when uclamp is enabled in the fast path:
8.73% -0.72% [kernel.kallsyms] [k] try_to_wake_up 0.13% +0.39% [kernel.kallsyms] [k] activate_task 0.07% +0.38% [kernel.kallsyms] [k] deactivate_task
Quoted 8 lines
Fixes 69842cba9ace ("sched/uclamp: Add CPU's clamp buckets refcounting")Reported-by Mel Gorman <[email protected]>Signed-off-by Qais Yousef <[email protected]>Signed-off-by Peter Zijlstra (Intel) <[email protected]>Tested-by Lukasz Luba <[email protected]>Signed-off-by Sasha Levin <[email protected]>---
Greg/Peter/Mel
Should this go to 5.4 too? Not saying it should, but I don't know if distros could care about potential performance hit that this patch addresses.
Thanks
--
Qais Yousef
Greg Kroah-Hartman
maintainerRe: [PATCH 5.8 130/232] sched/uclamp: Protect uclamp fast path code with static key
Quoted 81 lines · Qais Yousef
Quoted 71 lines · Greg Kroah-Hartman
From: Qais Yousef <[email protected]>
[ Upstream commit
46609ce227039fd192e0ecc7d940bed587fd2c78]There is a report that when uclamp is enabled, a netperf UDP test regresses compared to a kernel compiled without uclamp.
https://lore.kernel.org/lkml/[email protected]/
While investigating the root cause, there were no sign that the uclamp code is doing anything particularly expensive but could suffer from bad cache behavior under certain circumstances that are yet to be understood.
https://lore.kernel.org/lkml/20200616110824.dgkkbyapn3io6wik@e107158-lin/
To reduce the pressure on the fast path anyway, add a static key that is by default will skip executing uclamp logic in the enqueue/dequeue_task() fast path until it's needed.
As soon as the user start using util clamp by:
1. Changing uclamp value of a task with
sched_setattr()
2. Modifying the default sysctl_sched_util_clamp_{min, max}
3. Modifying the default cpu.uclamp.{min, max} value in cgroupWe flip the static key now that the user has opted to use util clamp. Effectively re-introducing uclamp logic in the enqueue/dequeue_task() fast path. It stays on from that point forward until the next reboot.
This should help minimize the effect of util clamp on workloads that don't need it but still allow distros to ship their kernels with uclamp compiled in by default.
SCHED_WARN_ON()inuclamp_rq_dec_id()was removed since now we can end up with unbalanced call touclamp_rq_dec_id()if we flip the key while a task is running in the rq. Since we know it is harmless we just quietly return if we attempt auclamp_rq_dec_id()when rq->uclamp[].bucket[].tasks is 0.In schedutil, we introduce a new
uclamp_is_enabled()helper which takes the static key into account to ensure RT boosting behavior is retained.The following results demonstrates how this helps on 2 Sockets Xeon E5 2x10-Cores system.
nouclamp uclamp uclamp-static-key Hmean send-64 162.43 ( 0.00%) 157.84 * -2.82%* 163.39 * 0.59%* Hmean send-128 324.71 ( 0.00%) 314.78 * -3.06%* 326.18 * 0.45%* Hmean send-256 641.55 ( 0.00%) 628.67 * -2.01%* 648.12 * 1.02%* Hmean send-1024 2525.28 ( 0.00%) 2448.26 * -3.05%* 2543.73 * 0.73%* Hmean send-2048 4836.14 ( 0.00%) 4712.08 * -2.57%* 4867.69 * 0.65%* Hmean send-3312 7540.83 ( 0.00%) 7425.45 * -1.53%* 7621.06 * 1.06%* Hmean send-4096 9124.53 ( 0.00%) 8948.82 * -1.93%* 9276.25 * 1.66%* Hmean send-8192 15589.67 ( 0.00%) 15486.35 * -0.66%* 15819.98 * 1.48%* Hmean send-16384 26386.47 ( 0.00%) 25752.25 * -2.40%* 26773.74 * 1.47%*The perf diff between nouclamp and uclamp-static-key when uclamp is disabled in the fast path:
8.73% -1.55% [kernel.kallsyms] [k] try_to_wake_up 0.07% +0.04% [kernel.kallsyms] [k] deactivate_task 0.13% -0.02% [kernel.kallsyms] [k] activate_taskThe diff between nouclamp and uclamp-static-key when uclamp is enabled in the fast path:
8.73% -0.72% [kernel.kallsyms] [k] try_to_wake_up 0.13% +0.39% [kernel.kallsyms] [k] activate_task 0.07% +0.38% [kernel.kallsyms] [k] deactivate_taskQuoted 8 lines
Fixes 69842cba9ace ("sched/uclamp: Add CPU's clamp buckets refcounting")Reported-by Mel Gorman <[email protected]>Signed-off-by Qais Yousef <[email protected]>Signed-off-by Peter Zijlstra (Intel) <[email protected]>Tested-by Lukasz Luba <[email protected]>Signed-off-by Sasha Levin <[email protected]>---
Quoted 4 lines
Greg/Peter/Mel
Should this go to 5.4 too? Not saying it should, but I don't know if distros could care about potential performance hit that this patch addresses.
If you want to provide a backported version of this to 5.4.y, that you have tested that works properly, I will be glad to queue it up.
thanks,
greg k-h
Re: [PATCH 5.8 130/232] sched/uclamp: Protect uclamp fast path code with static key
Quoted 82 lines · Greg Kroah-Hartman
Quoted 81 lines · Qais Yousef
Quoted 79 lines · Greg Kroah-Hartman
From: Qais Yousef <[email protected]>
[ Upstream commit
46609ce227039fd192e0ecc7d940bed587fd2c78]There is a report that when uclamp is enabled, a netperf UDP test regresses compared to a kernel compiled without uclamp.
https://lore.kernel.org/lkml/[email protected]/
While investigating the root cause, there were no sign that the uclamp code is doing anything particularly expensive but could suffer from bad cache behavior under certain circumstances that are yet to be understood.
https://lore.kernel.org/lkml/20200616110824.dgkkbyapn3io6wik@e107158-lin/
To reduce the pressure on the fast path anyway, add a static key that is by default will skip executing uclamp logic in the enqueue/dequeue_task() fast path until it's needed.
As soon as the user start using util clamp by:
1. Changing uclamp value of a task with
sched_setattr()
2. Modifying the default sysctl_sched_util_clamp_{min, max}
3. Modifying the default cpu.uclamp.{min, max} value in cgroupWe flip the static key now that the user has opted to use util clamp. Effectively re-introducing uclamp logic in the enqueue/dequeue_task() fast path. It stays on from that point forward until the next reboot.
This should help minimize the effect of util clamp on workloads that don't need it but still allow distros to ship their kernels with uclamp compiled in by default.
SCHED_WARN_ON()inuclamp_rq_dec_id()was removed since now we can end up with unbalanced call touclamp_rq_dec_id()if we flip the key while a task is running in the rq. Since we know it is harmless we just quietly return if we attempt auclamp_rq_dec_id()when rq->uclamp[].bucket[].tasks is 0.In schedutil, we introduce a new
uclamp_is_enabled()helper which takes the static key into account to ensure RT boosting behavior is retained.The following results demonstrates how this helps on 2 Sockets Xeon E5 2x10-Cores system.
nouclamp uclamp uclamp-static-key Hmean send-64 162.43 ( 0.00%) 157.84 * -2.82%* 163.39 * 0.59%* Hmean send-128 324.71 ( 0.00%) 314.78 * -3.06%* 326.18 * 0.45%* Hmean send-256 641.55 ( 0.00%) 628.67 * -2.01%* 648.12 * 1.02%* Hmean send-1024 2525.28 ( 0.00%) 2448.26 * -3.05%* 2543.73 * 0.73%* Hmean send-2048 4836.14 ( 0.00%) 4712.08 * -2.57%* 4867.69 * 0.65%* Hmean send-3312 7540.83 ( 0.00%) 7425.45 * -1.53%* 7621.06 * 1.06%* Hmean send-4096 9124.53 ( 0.00%) 8948.82 * -1.93%* 9276.25 * 1.66%* Hmean send-8192 15589.67 ( 0.00%) 15486.35 * -0.66%* 15819.98 * 1.48%* Hmean send-16384 26386.47 ( 0.00%) 25752.25 * -2.40%* 26773.74 * 1.47%*The perf diff between nouclamp and uclamp-static-key when uclamp is disabled in the fast path:
8.73% -1.55% [kernel.kallsyms] [k] try_to_wake_up 0.07% +0.04% [kernel.kallsyms] [k] deactivate_task 0.13% -0.02% [kernel.kallsyms] [k] activate_taskThe diff between nouclamp and uclamp-static-key when uclamp is enabled in the fast path:
8.73% -0.72% [kernel.kallsyms] [k] try_to_wake_up 0.13% +0.39% [kernel.kallsyms] [k] activate_task 0.07% +0.38% [kernel.kallsyms] [k] deactivate_taskFixes 69842cba9ace ("sched/uclamp: Add CPU's clamp buckets refcounting")Reported-by Mel Gorman <[email protected]>Signed-off-by Qais Yousef <[email protected]>Signed-off-by Peter Zijlstra (Intel) <[email protected]>Tested-by Lukasz Luba <[email protected]>Signed-off-by Sasha Levin <[email protected]>---
Quoted 7 lines
Quoted 4 lines
Greg/Peter/Mel
Should this go to 5.4 too? Not saying it should, but I don't know if distros could care about potential performance hit that this patch addresses.
If you want to provide a backported version of this to 5.4.y, that you have tested that works properly, I will be glad to queue it up.
The conflict was simple enough to resolve. I'll test them tomorrow and post 2 patches.
Thanks!
--
Qais Yousef