* [PATCH 1/1] hfsplus: incorrect return value
@ 2015-03-25 0:44 Chengyu Song
2015-03-25 15:34 ` Sergei Antonov
2015-03-25 16:54 ` Viacheslav Dubeyko
0 siblings, 2 replies; 3+ messages in thread
From: Chengyu Song @ 2015-03-25 0:44 UTC (permalink / raw)
To: viro, 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/hfsplus/dir.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/fs/hfsplus/dir.c b/fs/hfsplus/dir.c
index f0235c1..3074609 100644
--- a/fs/hfsplus/dir.c
+++ b/fs/hfsplus/dir.c
@@ -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
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH 1/1] hfsplus: incorrect return value
2015-03-25 0:44 [PATCH 1/1] hfsplus: incorrect return value Chengyu Song
@ 2015-03-25 15:34 ` Sergei Antonov
2015-03-25 16:54 ` Viacheslav Dubeyko
1 sibling, 0 replies; 3+ messages in thread
From: Sergei Antonov @ 2015-03-25 15:34 UTC (permalink / raw)
To: Chengyu Song
Cc: Al Viro, linux-fsdevel, linux-kernel, taesoo, changwoo, sanidhya,
blee, Andrew Morton
Reviewed-by: Sergei Antonov <saproj@gmail.com>
CC-ing Andrew Morton.
On 25 March 2015 at 01:44, Chengyu Song <csong84@gatech.edu> wrote:
> In case of memory allocation error, the return should be -ENOMEM,
> instead of -ENOSPC.
>
> Signed-off-by: Chengyu Song <csong84@gatech.edu>
> ---
> fs/hfsplus/dir.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/fs/hfsplus/dir.c b/fs/hfsplus/dir.c
> index f0235c1..3074609 100644
> --- a/fs/hfsplus/dir.c
> +++ b/fs/hfsplus/dir.c
> @@ -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 majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH 1/1] hfsplus: incorrect return value
2015-03-25 0:44 [PATCH 1/1] hfsplus: incorrect return value Chengyu Song
2015-03-25 15:34 ` Sergei Antonov
@ 2015-03-25 16:54 ` Viacheslav Dubeyko
1 sibling, 0 replies; 3+ messages in thread
From: Viacheslav Dubeyko @ 2015-03-25 16:54 UTC (permalink / raw)
To: Chengyu Song
Cc: viro, linux-fsdevel, linux-kernel, taesoo, changwoo, sanidhya, blee
On Tue, 2015-03-24 at 20:44 -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] 3+ messages in thread
end of thread, other threads:[~2015-03-25 16:54 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-03-25 0:44 [PATCH 1/1] hfsplus: incorrect return value Chengyu Song
2015-03-25 15:34 ` Sergei Antonov
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.