Skip to content

Commit

Permalink
fuse: use READ_ONCE on congestion_threshold and max_background
Browse files Browse the repository at this point in the history
Since they are of unsigned int type, it's allowed to read them
unlocked during reporting to userspace. Let's underline this fact
with READ_ONCE() macroses.

Signed-off-by: Kirill Tkhai <ktkhai@virtuozzo.com>
Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
  • Loading branch information
Kirill Tkhai authored and Miklos Szeredi committed Sep 28, 2018
1 parent e287179 commit 2a23f2b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions fs/fuse/control.c
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ static ssize_t fuse_conn_max_background_read(struct file *file,
if (!fc)
return 0;

val = fc->max_background;
val = READ_ONCE(fc->max_background);
fuse_conn_put(fc);

return fuse_conn_limit_read(file, buf, len, ppos, val);
Expand Down Expand Up @@ -144,7 +144,7 @@ static ssize_t fuse_conn_congestion_threshold_read(struct file *file,
if (!fc)
return 0;

val = fc->congestion_threshold;
val = READ_ONCE(fc->congestion_threshold);
fuse_conn_put(fc);

return fuse_conn_limit_read(file, buf, len, ppos, val);
Expand Down

0 comments on commit 2a23f2b

Please sign in to comment.