hfsplus: incorrect return value
Subsystems (2)
PATCH 1/1 hfsplus: incorrect return value
In case of memory allocation error, the return should be -ENOMEM, instead of -ENOSPC.
--- fs/hfsplus/dir.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
fs/hfsplus/dir.c +2 -2
@@ -434,7 +434,7 @@ static int hfsplus_symlink(struct inode *dir, struct dentry *dentry, {struct hfsplus_sb_info *sbi =HFSPLUS_SB (dir->i_sb);struct inode *inode; -int res = -ENOSPC ; +int res = -ENOMEM ;mutex_lock (&sbi->vh_mutex); inode =hfsplus_new_inode (dir->i_sb,S_IFLNK |S_IRWXUGO );
@@ -476,7 +476,7 @@ static int hfsplus_mknod(struct inode *dir, struct dentry *dentry, {struct hfsplus_sb_info *sbi =HFSPLUS_SB (dir->i_sb);struct inode *inode; -int res = -ENOSPC ; +int res = -ENOMEM ;mutex_lock (&sbi->vh_mutex); inode =hfsplus_new_inode (dir->i_sb, mode);
Signature · 1 line
2.1.0
CC-ing Andrew Morton.
Quoted 37 lines · Chengyu Song
In case of memory allocation error, the return should be
-ENOMEM, instead of-ENOSPC.Signed-off-by Chengyu Song <[email protected]>--- fs/hfsplus/dir.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)fs/hfsplus/dir.c +2
-3@@ -434,7 +434,7 @@ static int hfsplus_symlink(struct inode *dir, struct dentry *dentry, {struct hfsplus_sb_info *sbi =HFSPLUS_SB (dir->i_sb);struct inode *inode; -int res = -ENOSPC ; +int res = -ENOMEM ;mutex_lock (&sbi->vh_mutex); inode =hfsplus_new_inode (dir->i_sb,S_IFLNK |S_IRWXUGO );@@ -476,7 +476,7 @@ static int hfsplus_mknod(struct inode *dir, struct dentry *dentry, {struct hfsplus_sb_info *sbi =HFSPLUS_SB (dir->i_sb);struct inode *inode; -int res = -ENOSPC ; +int res = -ENOMEM ;mutex_lock (&sbi->vh_mutex); inode =hfsplus_new_inode (dir->i_sb, mode); --2.1.0
--
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
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.