From: Sasha Levin Date: Mon, 23 May 2022 13:29:44 +0000 (-0400) Subject: Fixes for 5.4 X-Git-Tag: v4.9.316~15 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=60dcc5db4c9f5158b4d132f4f8de77b43334b57e;p=thirdparty%2Fkernel%2Fstable-queue.git Fixes for 5.4 Signed-off-by: Sasha Levin --- diff --git a/queue-5.4/afs-fix-afs_getattr-to-refetch-file-status-if-callba.patch b/queue-5.4/afs-fix-afs_getattr-to-refetch-file-status-if-callba.patch new file mode 100644 index 00000000000..56950153378 --- /dev/null +++ b/queue-5.4/afs-fix-afs_getattr-to-refetch-file-status-if-callba.patch @@ -0,0 +1,78 @@ +From bd7e52e5d9e5f29af0090c5f0d258364e12033bf Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Sat, 21 May 2022 08:18:28 +0100 +Subject: afs: Fix afs_getattr() to refetch file status if callback break + occurred + +From: David Howells + +[ Upstream commit 2aeb8c86d49967552394d5e723f87454cb53f501 ] + +If a callback break occurs (change notification), afs_getattr() needs to +issue an FS.FetchStatus RPC operation to update the status of the file +being examined by the stat-family of system calls. + +Fix afs_getattr() to do this if AFS_VNODE_CB_PROMISED has been cleared +on a vnode by a callback break. Skip this if AT_STATX_DONT_SYNC is set. + +This can be tested by appending to a file on one AFS client and then +using "stat -L" to examine its length on a machine running kafs. This +can also be watched through tracing on the kafs machine. The callback +break is seen: + + kworker/1:1-46 [001] ..... 978.910812: afs_cb_call: c=0000005f YFSCB.CallBack + kworker/1:1-46 [001] ...1. 978.910829: afs_cb_break: 100058:23b4c:242d2c2 b=2 s=1 break-cb + kworker/1:1-46 [001] ..... 978.911062: afs_call_done: c=0000005f ret=0 ab=0 [0000000082994ead] + +And then the stat command generated no traffic if unpatched, but with +this change a call to fetch the status can be observed: + + stat-4471 [000] ..... 986.744122: afs_make_fs_call: c=000000ab 100058:023b4c:242d2c2 YFS.FetchStatus + stat-4471 [000] ..... 986.745578: afs_call_done: c=000000ab ret=0 ab=0 [0000000087fc8c84] + +Fixes: 08e0e7c82eea ("[AF_RXRPC]: Make the in-kernel AFS filesystem use AF_RXRPC.") +Reported-by: Markus Suvanto +Signed-off-by: David Howells +cc: Marc Dionne +cc: linux-afs@lists.infradead.org +Tested-by: Markus Suvanto +Tested-by: kafs-testing+fedora34_64checkkafs-build-496@auristor.com +Link: https://bugzilla.kernel.org/show_bug.cgi?id=216010 +Link: https://lore.kernel.org/r/165308359800.162686.14122417881564420962.stgit@warthog.procyon.org.uk/ # v1 +Signed-off-by: Linus Torvalds +Signed-off-by: Sasha Levin +--- + fs/afs/inode.c | 14 +++++++++++++- + 1 file changed, 13 insertions(+), 1 deletion(-) + +diff --git a/fs/afs/inode.c b/fs/afs/inode.c +index 4f58b28a1edd..90eac3ec01cb 100644 +--- a/fs/afs/inode.c ++++ b/fs/afs/inode.c +@@ -734,10 +734,22 @@ int afs_getattr(const struct path *path, struct kstat *stat, + { + struct inode *inode = d_inode(path->dentry); + struct afs_vnode *vnode = AFS_FS_I(inode); +- int seq = 0; ++ struct key *key; ++ int ret, seq = 0; + + _enter("{ ino=%lu v=%u }", inode->i_ino, inode->i_generation); + ++ if (!(query_flags & AT_STATX_DONT_SYNC) && ++ !test_bit(AFS_VNODE_CB_PROMISED, &vnode->flags)) { ++ key = afs_request_key(vnode->volume->cell); ++ if (IS_ERR(key)) ++ return PTR_ERR(key); ++ ret = afs_validate(vnode, key); ++ key_put(key); ++ if (ret < 0) ++ return ret; ++ } ++ + do { + read_seqbegin_or_lock(&vnode->cb_lock, &seq); + generic_fillattr(inode, stat); +-- +2.35.1 + diff --git a/queue-5.4/i2c-mt7621-fix-missing-clk_disable_unprepare-on-erro.patch b/queue-5.4/i2c-mt7621-fix-missing-clk_disable_unprepare-on-erro.patch new file mode 100644 index 00000000000..4c052607eb2 --- /dev/null +++ b/queue-5.4/i2c-mt7621-fix-missing-clk_disable_unprepare-on-erro.patch @@ -0,0 +1,56 @@ +From 0e349c1d292e053bec63f266cb7c1df5e5cd26f0 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Sat, 14 May 2022 10:31:47 +0800 +Subject: i2c: mt7621: fix missing clk_disable_unprepare() on error in + mtk_i2c_probe() + +From: Yang Yingliang + +[ Upstream commit a2537c98a8a3b57002e54a262d180b9490bc7190 ] + +Fix the missing clk_disable_unprepare() before return +from mtk_i2c_probe() in the error handling case. + +Fixes: d04913ec5f89 ("i2c: mt7621: Add MediaTek MT7621/7628/7688 I2C driver") +Signed-off-by: Yang Yingliang +Reviewed-by: Stefan Roese +Signed-off-by: Wolfram Sang +Signed-off-by: Sasha Levin +--- + drivers/i2c/busses/i2c-mt7621.c | 10 ++++++++-- + 1 file changed, 8 insertions(+), 2 deletions(-) + +diff --git a/drivers/i2c/busses/i2c-mt7621.c b/drivers/i2c/busses/i2c-mt7621.c +index 62df8379bc89..65e72101b393 100644 +--- a/drivers/i2c/busses/i2c-mt7621.c ++++ b/drivers/i2c/busses/i2c-mt7621.c +@@ -304,7 +304,8 @@ static int mtk_i2c_probe(struct platform_device *pdev) + + if (i2c->bus_freq == 0) { + dev_warn(i2c->dev, "clock-frequency 0 not supported\n"); +- return -EINVAL; ++ ret = -EINVAL; ++ goto err_disable_clk; + } + + adap = &i2c->adap; +@@ -322,10 +323,15 @@ static int mtk_i2c_probe(struct platform_device *pdev) + + ret = i2c_add_adapter(adap); + if (ret < 0) +- return ret; ++ goto err_disable_clk; + + dev_info(&pdev->dev, "clock %u kHz\n", i2c->bus_freq / 1000); + ++ return 0; ++ ++err_disable_clk: ++ clk_disable_unprepare(i2c->clk); ++ + return ret; + } + +-- +2.35.1 + diff --git a/queue-5.4/series b/queue-5.4/series index 02445fe5445..a2e164cf607 100644 --- a/queue-5.4/series +++ b/queue-5.4/series @@ -57,3 +57,5 @@ ethernet-tulip-fix-missing-pci_disable_device-on-err.patch net-stmmac-fix-missing-pci_disable_device-on-error-i.patch net-atlantic-verify-hw_head_-lies-within-tx-buffer-r.patch input-ili210x-fix-reset-timing.patch +i2c-mt7621-fix-missing-clk_disable_unprepare-on-erro.patch +afs-fix-afs_getattr-to-refetch-file-status-if-callba.patch