diff options
author | Kirill Tkhai <ktkhai@virtuozzo.com> | 2018-08-27 11:29:29 -0400 |
---|---|---|
committer | Miklos Szeredi <mszeredi@redhat.com> | 2018-09-28 10:43:22 -0400 |
commit | 2a23f2b8adbe4bd584f936f7ac17a99750eed9d7 (patch) | |
tree | 12ec2c21599c7d8dfc37d13c8bfb40589d9c2d55 | |
parent | e287179afe2190faa7b97915cb89215dde5e044b (diff) |
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>
-rw-r--r-- | fs/fuse/control.c | 4 |
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, | |||
107 | if (!fc) | 107 | if (!fc) |
108 | return 0; | 108 | return 0; |
109 | 109 | ||
110 | val = fc->max_background; | 110 | val = READ_ONCE(fc->max_background); |
111 | fuse_conn_put(fc); | 111 | fuse_conn_put(fc); |
112 | 112 | ||
113 | return fuse_conn_limit_read(file, buf, len, ppos, val); | 113 | 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, | |||
144 | if (!fc) | 144 | if (!fc) |
145 | return 0; | 145 | return 0; |
146 | 146 | ||
147 | val = fc->congestion_threshold; | 147 | val = READ_ONCE(fc->congestion_threshold); |
148 | fuse_conn_put(fc); | 148 | fuse_conn_put(fc); |
149 | 149 | ||
150 | return fuse_conn_limit_read(file, buf, len, ppos, val); | 150 | return fuse_conn_limit_read(file, buf, len, ppos, val); |