hfs: incorrect return values
Subsystems (2)
PATCH 1/1 hfs: incorrect return values
In case of memory allocation error, the return should be -ENOMEM, instead of -ENOSPC.
Signed-off-by Chengyu Song <[email protected]>
--- fs/hfs/dir.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
fs/hfs/dir.c +2 -2
@@ -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) {
Signature · 1 line
2.1.0
Viacheslav Dubeyko
maintainerQuoted 3 lines · Chengyu Song
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.