* [PATCH 1/1] hfs: incorrect return values
@ 2015-03-25 0:37 Chengyu Song
2015-03-25 16:54 ` Viacheslav Dubeyko
0 siblings, 1 reply; 2+ messages in thread
From: Chengyu Song @ 2015-03-25 0:37 UTC (permalink / raw)
To: linux-fsdevel, linux-kernel; +Cc: taesoo, changwoo, sanidhya, blee, csong84
In case of memory allocation error, the return should be -ENOMEM,
instead of -ENOSPC.
Signed-off-by: Chengyu Song <csong84@gatech.edu>
---
fs/hfs/dir.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/fs/hfs/dir.c b/fs/hfs/dir.c
index 1455668..36d1a6a 100644
--- a/fs/hfs/dir.c
+++ b/fs/hfs/dir.c
@@ -197,7 +197,7 @@ static int hfs_create(struct inode *dir, struct dentry *dentry, umode_t mode,
inode = hfs_new_inode(dir, &dentry->d_name, mode);
if (!inode)
- return -ENOSPC;
+ return -ENOMEM;
res = hfs_cat_create(inode->i_ino, dir, &dentry->d_name, inode);
if (res) {
@@ -226,7 +226,7 @@ static int hfs_mkdir(struct inode *dir, struct dentry *dentry, umode_t mode)
inode = hfs_new_inode(dir, &dentry->d_name, S_IFDIR | mode);
if (!inode)
- return -ENOSPC;
+ return -ENOMEM;
res = hfs_cat_create(inode->i_ino, dir, &dentry->d_name, inode);
if (res) {
--
2.1.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH 1/1] hfs: incorrect return values
2015-03-25 0:37 [PATCH 1/1] hfs: incorrect return values Chengyu Song
@ 2015-03-25 16:54 ` Viacheslav Dubeyko
0 siblings, 0 replies; 2+ messages in thread
From: Viacheslav Dubeyko @ 2015-03-25 16:54 UTC (permalink / raw)
To: Chengyu Song
Cc: linux-fsdevel, linux-kernel, taesoo, changwoo, sanidhya, blee
On Tue, 2015-03-24 at 20:37 -0400, Chengyu Song wrote:
> In case of memory allocation error, the return should be -ENOMEM,
> instead of -ENOSPC.
>
To be honest, I am not fully sure that such fix makes sense. Of course,
it is possible to exchange -ENOSPC on -ENOMEM. But principally it is not
critical to use as -ENOSPC as -ENOMEM in such situation, from my point
of view.
Anyway, it is possible to change error code here.
Thanks,
Vyacheslav Dubeyko.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2015-03-25 16:54 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-03-25 0:37 [PATCH 1/1] hfs: incorrect return values Chengyu Song
2015-03-25 16:54 ` Viacheslav Dubeyko
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.