From: Kirill Tkhai Date: Mon, 27 Aug 2018 15:29:29 +0000 (+0300) Subject: fuse: use READ_ONCE on congestion_threshold and max_background X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=2b149bb378bc34545549d2e8c35f2bbdf1debc92;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git fuse: use READ_ONCE on congestion_threshold and max_background [ Upstream commit 2a23f2b8adbe4bd584f936f7ac17a99750eed9d7 ] 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 Signed-off-by: Miklos Szeredi Signed-off-by: Sasha Levin --- diff --git a/fs/fuse/control.c b/fs/fuse/control.c index 5be0339dcceb..42bed87dd5ea 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);