summaryrefslogtreecommitdiffstats
path: root/fs/fuse
diff options
context:
space:
mode:
authorTejun Heo <tj@kernel.org>2018-02-02 09:54:14 -0800
committerMiklos Szeredi <mszeredi@redhat.com>2018-05-31 12:26:10 +0200
commit8a301eb16d99983a4961f884690ec97b92e7dcfe (patch)
treed012a1a21be4c9c5b5248e5dcda88d4ba50125cc /fs/fuse
parent4ad769f3c346ec3d458e255548dec26ca5284cf6 (diff)
downloadop-kernel-dev-8a301eb16d99983a4961f884690ec97b92e7dcfe.zip
op-kernel-dev-8a301eb16d99983a4961f884690ec97b92e7dcfe.tar.gz
fuse: fix congested state leak on aborted connections
If a connection gets aborted while congested, FUSE can leave nr_wb_congested[] stuck until reboot causing wait_iff_congested() to wait spuriously which can lead to severe performance degradation. The leak is caused by gating congestion state clearing with fc->connected test in request_end(). This was added way back in 2009 by 26c3679101db ("fuse: destroy bdi on umount"). While the commit description doesn't explain why the test was added, it most likely was to avoid dereferencing bdi after it got destroyed. Since then, bdi lifetime rules have changed many times and now we're always guaranteed to have access to the bdi while the superblock is alive (fc->sb). Drop fc->connected conditional to avoid leaking congestion states. Signed-off-by: Tejun Heo <tj@kernel.org> Reported-by: Joshua Miller <joshmiller@fb.com> Cc: Johannes Weiner <hannes@cmpxchg.org> Cc: stable@vger.kernel.org # v2.6.29+ Acked-by: Jan Kara <jack@suse.cz> Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
Diffstat (limited to 'fs/fuse')
-rw-r--r--fs/fuse/dev.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/fs/fuse/dev.c b/fs/fuse/dev.c
index 686631f..e03ca14 100644
--- a/fs/fuse/dev.c
+++ b/fs/fuse/dev.c
@@ -385,8 +385,7 @@ static void request_end(struct fuse_conn *fc, struct fuse_req *req)
if (!fc->blocked && waitqueue_active(&fc->blocked_waitq))
wake_up(&fc->blocked_waitq);
- if (fc->num_background == fc->congestion_threshold &&
- fc->connected && fc->sb) {
+ if (fc->num_background == fc->congestion_threshold && fc->sb) {
clear_bdi_congested(fc->sb->s_bdi, BLK_RW_SYNC);
clear_bdi_congested(fc->sb->s_bdi, BLK_RW_ASYNC);
}
OpenPOWER on IntegriCloud