[PATCH 1/1] quota: remove unnecessary oom message

Subsystems: diskquota, filesystems (vfs and infrastructure), the rest

STALE1884d

3 messages, 2 authors, 2021-06-18 · open the first message on its own page

[PATCH 1/1] quota: remove unnecessary oom message

From: Zhen Lei <hidden>
Date: 2021-06-17 09:16:41

Fixes scripts/checkpatch.pl warning:
WARNING: Possible unnecessary 'out of memory' message

Remove it can help us save a bit of memory.

Signed-off-by: Zhen Lei <redacted>
---
 fs/quota/quota_tree.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)
diff --git a/fs/quota/quota_tree.c b/fs/quota/quota_tree.c
index c5562c871c8b..b097d02bad94 100644
--- a/fs/quota/quota_tree.c
+++ b/fs/quota/quota_tree.c
@@ -49,11 +49,7 @@ static int qtree_dqstr_in_blk(struct qtree_mem_dqinfo *info)
 
 static char *getdqbuf(size_t size)
 {
-	char *buf = kmalloc(size, GFP_NOFS);
-	if (!buf)
-		printk(KERN_WARNING
-		       "VFS: Not enough memory for quota buffers.\n");
-	return buf;
+	return kmalloc(size, GFP_NOFS);
 }
 
 static ssize_t read_blk(struct qtree_mem_dqinfo *info, uint blk, char *buf)
-- 
2.25.1

Re: [PATCH 1/1] quota: remove unnecessary oom message

From: Jan Kara <jack@suse.cz>
Date: 2021-06-17 15:01:19

On Thu 17-06-21 17:16:27, Zhen Lei wrote:
Fixes scripts/checkpatch.pl warning:
WARNING: Possible unnecessary 'out of memory' message

Remove it can help us save a bit of memory.

Signed-off-by: Zhen Lei <redacted>
I agree the message is pointless. But when doing this, I guess we can just
get rid of getdqbuf() altogether and instead call kmalloc() directly in all
the places.

								Honza
quoted hunk
diff --git a/fs/quota/quota_tree.c b/fs/quota/quota_tree.c
index c5562c871c8b..b097d02bad94 100644
--- a/fs/quota/quota_tree.c
+++ b/fs/quota/quota_tree.c
@@ -49,11 +49,7 @@ static int qtree_dqstr_in_blk(struct qtree_mem_dqinfo *info)
 
 static char *getdqbuf(size_t size)
 {
-	char *buf = kmalloc(size, GFP_NOFS);
-	if (!buf)
-		printk(KERN_WARNING
-		       "VFS: Not enough memory for quota buffers.\n");
-	return buf;
+	return kmalloc(size, GFP_NOFS);
 }
 
 static ssize_t read_blk(struct qtree_mem_dqinfo *info, uint blk, char *buf)
-- 
2.25.1
-- 
Jan Kara [off-list ref]
SUSE Labs, CR

Re: [PATCH 1/1] quota: remove unnecessary oom message

From: Leizhen (ThunderTown) <hidden>
Date: 2021-06-18 01:20:40


On 2021/6/17 23:01, Jan Kara wrote:
On Thu 17-06-21 17:16:27, Zhen Lei wrote:
quoted
Fixes scripts/checkpatch.pl warning:
WARNING: Possible unnecessary 'out of memory' message

Remove it can help us save a bit of memory.

Signed-off-by: Zhen Lei <redacted>
I agree the message is pointless. But when doing this, I guess we can just
get rid of getdqbuf() altogether and instead call kmalloc() directly in all
the places.
OK, I will get rid of it in v2.
								Honza
quoted
diff --git a/fs/quota/quota_tree.c b/fs/quota/quota_tree.c
index c5562c871c8b..b097d02bad94 100644
--- a/fs/quota/quota_tree.c
+++ b/fs/quota/quota_tree.c
@@ -49,11 +49,7 @@ static int qtree_dqstr_in_blk(struct qtree_mem_dqinfo *info)
 
 static char *getdqbuf(size_t size)
 {
-	char *buf = kmalloc(size, GFP_NOFS);
-	if (!buf)
-		printk(KERN_WARNING
-		       "VFS: Not enough memory for quota buffers.\n");
-	return buf;
+	return kmalloc(size, GFP_NOFS);
 }
 
 static ssize_t read_blk(struct qtree_mem_dqinfo *info, uint blk, char *buf)
-- 
2.25.1

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help