Skip to content

Commit efc4105

Browse files
Kemeng ShiMiklos Szeredi
authored andcommitted
fuse: remove unneeded lock which protecting update of congestion_threshold
Commit 670d21c ("fuse: remove reliance on bdi congestion") change how congestion_threshold is used and lock in fuse_conn_congestion_threshold_write is not needed anymore. 1. Access to supe_block is removed along with removing of bdi congestion. Then down_read(&fc->killsb) which protecting access to super_block is no needed. 2. Compare num_background and congestion_threshold without holding bg_lock. Then there is no need to hold bg_lock to update congestion_threshold. Signed-off-by: Kemeng Shi <shikemeng@huaweicloud.com> Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
1 parent 738adad commit efc4105

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

fs/fuse/control.c

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -174,11 +174,7 @@ static ssize_t fuse_conn_congestion_threshold_write(struct file *file,
174174
if (!fc)
175175
goto out;
176176

177-
down_read(&fc->killsb);
178-
spin_lock(&fc->bg_lock);
179-
fc->congestion_threshold = val;
180-
spin_unlock(&fc->bg_lock);
181-
up_read(&fc->killsb);
177+
WRITE_ONCE(fc->congestion_threshold, val);
182178
fuse_conn_put(fc);
183179
out:
184180
return ret;

0 commit comments

Comments
 (0)