Skip to contentSkip to conversation

proc-dont-use-read_once-write_once-for-proc-fail-nth.patch removed from -mm tree

merged [email protected] 1 participant 1 message Feb 7, 2018

lore
Share & tools
lore

[email protected]

author tree notice Applied
#0 lore raw

The patch titled
Subject: proc: don't use READ_ONCE/WRITE_ONCE for /proc/*/fail-nth
has been removed from the -mm tree. Its filename was
proc-dont-use-read_once-write_once-for-proc-fail-nth.patch

This patch was dropped because it was merged into mainline or a subsystem tree

------------------------------------------------------
From: Alexey Dobriyan <[email protected]>
Subject: proc: don't use READ_ONCE/WRITE_ONCE for /proc/*/fail-nth

READ_ONCE and WRITE_ONCE are useless when there is only one read/write is being made.

---

 fs/proc/base.c |    5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
fs/proc/base.c renamed from fs/proc/base.c~proc-dont-use-read_once-write_once-for-proc-fail-nth +2 -3
diff -puN fs/proc/base.c~proc-dont-use-read_once-write_once-for-proc-fail-nth fs/proc/base.c
@@ -1370,7 +1370,7 @@ static ssize_t proc_fail_nth_write(struc
 	task = get_proc_task(file_inode(file));
 	if (!task)
 		return -ESRCH;
-	WRITE_ONCE(task->fail_nth, n);
+	task->fail_nth = n;
 	put_task_struct(task);
 
 	return count;
@@ -1386,8 +1386,7 @@ static ssize_t proc_fail_nth_read(struct
 	task = get_proc_task(file_inode(file));
 	if (!task)
 		return -ESRCH;
-	len = snprintf(numbuf, sizeof(numbuf), "%u\n",
-			READ_ONCE(task->fail_nth));
+	len = snprintf(numbuf, sizeof(numbuf), "%u\n", task->fail_nth);
 	len = simple_read_from_buffer(buf, count, ppos, numbuf, len);
 	put_task_struct(task);
 

_

Patches currently in -mm which might be from [email protected] are

seq_file-delete-small-value-optimization.patch