summaryrefslogtreecommitdiffstats
path: root/fs/fuse/control.c
diff options
context:
space:
mode:
authorKirill Tkhai2018-08-27 17:29:29 +0200
committerMiklos Szeredi2018-09-28 16:43:22 +0200
commit2a23f2b8adbe4bd584f936f7ac17a99750eed9d7 (patch)
tree12ec2c21599c7d8dfc37d13c8bfb40589d9c2d55 /fs/fuse/control.c
parentfuse: use list_first_entry() in flush_bg_queue() (diff)
downloadkernel-qcow2-linux-2a23f2b8adbe4bd584f936f7ac17a99750eed9d7.tar.gz
kernel-qcow2-linux-2a23f2b8adbe4bd584f936f7ac17a99750eed9d7.tar.xz
kernel-qcow2-linux-2a23f2b8adbe4bd584f936f7ac17a99750eed9d7.zip
fuse: use READ_ONCE on congestion_threshold and max_background
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>
Diffstat (limited to 'fs/fuse/control.c')
-rw-r--r--fs/fuse/control.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/fuse/control.c b/fs/fuse/control.c
index 0b694655d988..acc35819aae6 100644
--- a/fs/fuse/control.c
+++ b/fs/fuse/control.c
@@ -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);
@@ -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);