linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 1/2] mm: kmemleak: change error at _write when kmemleak is disabled
@ 2019-06-12 15:52 André Almeida
  2019-06-12 15:52 ` [PATCH v2 2/2] docs: kmemleak: add more documentation details André Almeida
  2019-06-13 12:22 ` [PATCH v2 1/2] mm: kmemleak: change error at _write when kmemleak is disabled Catalin Marinas
  0 siblings, 2 replies; 4+ messages in thread
From: André Almeida @ 2019-06-12 15:52 UTC (permalink / raw)
  To: linux-mm; +Cc: linux-kernel, catalin.marinas, kernel, akpm, André Almeida

According to POSIX, EBUSY means that the "device or resource is busy",
and this can lead to people thinking that the file
`/sys/kernel/debug/kmemleak/` is somehow locked or being used by other
process. Change this error code to a more appropriate one.

Signed-off-by: André Almeida <andrealmeid@collabora.com>
---
Hello,

This time I've added the mailing list, not only the maintainers.

Changes in v2:
- Remove pr_error.
- Replace EINVAL for EPERM, since the command isn't invalid, in fact, the
user don't have the permission to trigger commands when kmemleak is
disabled.
- Reword the commit message to be clearer the rationale behind the
patch.

 mm/kmemleak.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mm/kmemleak.c b/mm/kmemleak.c
index 9dd581d11565..848333a591fa 100644
--- a/mm/kmemleak.c
+++ b/mm/kmemleak.c
@@ -1866,7 +1866,7 @@ static ssize_t kmemleak_write(struct file *file, const char __user *user_buf,
 	}
 
 	if (!kmemleak_enabled) {
-		ret = -EBUSY;
+		ret = -EPERM;
 		goto out;
 	}
 
-- 
2.22.0


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2019-06-13 12:23 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-06-12 15:52 [PATCH v2 1/2] mm: kmemleak: change error at _write when kmemleak is disabled André Almeida
2019-06-12 15:52 ` [PATCH v2 2/2] docs: kmemleak: add more documentation details André Almeida
2019-06-13 12:23   ` Catalin Marinas
2019-06-13 12:22 ` [PATCH v2 1/2] mm: kmemleak: change error at _write when kmemleak is disabled Catalin Marinas

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).