diff mbox

ocfs2_prep_new_orphaned_file should return ret

Message ID 1369186996-7127-1-git-send-email-xiaowei.hu@oracle.com (mailing list archive)
State New, archived
Headers show

Commit Message

xiaowei Hu May 22, 2013, 1:43 a.m. UTC
From: "Xiaowei.Hu" <xiaowei.hu@oracle.com>

---
 fs/ocfs2/namei.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Shen Canquan May 22, 2013, 2:31 a.m. UTC | #1
if return 0,  what's wrong with this?
On 2013/5/22 9:43, xiaowei.hu@oracle.com wrote:
> From: "Xiaowei.Hu"<xiaowei.hu@oracle.com>
>
> ---
>   fs/ocfs2/namei.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/fs/ocfs2/namei.c b/fs/ocfs2/namei.c
> index 50c93a8..422cbe0 100644
> --- a/fs/ocfs2/namei.c
> +++ b/fs/ocfs2/namei.c
> @@ -2216,7 +2216,7 @@ out:
>
>   	brelse(orphan_dir_bh);
>
> -	return 0;
> +	return ret;
>   }
>
>   int ocfs2_create_inode_in_orphan(struct inode *dir,
xiaowei Hu May 22, 2013, 2:38 a.m. UTC | #2
if there is error happen in , for example EIO in 
__ocfs2_prepare_orphan_dir, ocfs2_prep_new_orphaned_file will release 
the inode_ac, the the caller of ocfs2_prep_new_orphaned_file get a 0 
return, it will refer to a NULL ocfs2_alloc_context struct in the 
following functions.Kernel panic happens.

On 05/22/2013 10:31 AM, shencanquan wrote:
> if return 0,  what's wrong with this?
> On 2013/5/22 9:43, xiaowei.hu@oracle.com wrote:
>> From: "Xiaowei.Hu"<xiaowei.hu@oracle.com>
>>
>> ---
>>   fs/ocfs2/namei.c | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/fs/ocfs2/namei.c b/fs/ocfs2/namei.c
>> index 50c93a8..422cbe0 100644
>> --- a/fs/ocfs2/namei.c
>> +++ b/fs/ocfs2/namei.c
>> @@ -2216,7 +2216,7 @@ out:
>>
>>       brelse(orphan_dir_bh);
>>
>> -    return 0;
>> +    return ret;
>>   }
>>
>>   int ocfs2_create_inode_in_orphan(struct inode *dir,
>
>
Shen Canquan May 22, 2013, 2:44 a.m. UTC | #3
On 2013/5/22 10:38, xiaowei.hu wrote:
> if there is error happen in , for example EIO in 
> __ocfs2_prepare_orphan_dir, ocfs2_prep_new_orphaned_file will release 
> the inode_ac, the the caller of ocfs2_prep_new_orphaned_file get a 0 
> return, it will refer to a NULL ocfs2_alloc_context struct in the 
> following functions.Kernel panic happens.
Hmm, I see, this patch looks good .
Reviewed-by: shencanquan <shencanquan@huawei.com>
>
> On 05/22/2013 10:31 AM, shencanquan wrote:
>> if return 0,  what's wrong with this?
>> On 2013/5/22 9:43, xiaowei.hu@oracle.com wrote:
>>> From: "Xiaowei.Hu"<xiaowei.hu@oracle.com>
>>>
>>> ---
>>>   fs/ocfs2/namei.c | 2 +-
>>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>>
>>> diff --git a/fs/ocfs2/namei.c b/fs/ocfs2/namei.c
>>> index 50c93a8..422cbe0 100644
>>> --- a/fs/ocfs2/namei.c
>>> +++ b/fs/ocfs2/namei.c
>>> @@ -2216,7 +2216,7 @@ out:
>>>
>>>       brelse(orphan_dir_bh);
>>>
>>> -    return 0;
>>> +    return ret;
>>>   }
>>>
>>>   int ocfs2_create_inode_in_orphan(struct inode *dir,
>>
>>
>
>
>
Sunil Mushran May 22, 2013, 10:50 p.m. UTC | #4
Acked-by: Sunil Mushran <sunil.mushran@gmail.com>


On Tue, May 21, 2013 at 7:44 PM, shencanquan <shencanquan@huawei.com> wrote:

> On 2013/5/22 10:38, xiaowei.hu wrote:
> > if there is error happen in , for example EIO in
> > __ocfs2_prepare_orphan_dir, ocfs2_prep_new_orphaned_file will release
> > the inode_ac, the the caller of ocfs2_prep_new_orphaned_file get a 0
> > return, it will refer to a NULL ocfs2_alloc_context struct in the
> > following functions.Kernel panic happens.
> Hmm, I see, this patch looks good .
> Reviewed-by: shencanquan <shencanquan@huawei.com>
> >
> > On 05/22/2013 10:31 AM, shencanquan wrote:
> >> if return 0,  what's wrong with this?
> >> On 2013/5/22 9:43, xiaowei.hu@oracle.com wrote:
> >>> From: "Xiaowei.Hu"<xiaowei.hu@oracle.com>
> >>>
> >>> ---
> >>>   fs/ocfs2/namei.c | 2 +-
> >>>   1 file changed, 1 insertion(+), 1 deletion(-)
> >>>
> >>> diff --git a/fs/ocfs2/namei.c b/fs/ocfs2/namei.c
> >>> index 50c93a8..422cbe0 100644
> >>> --- a/fs/ocfs2/namei.c
> >>> +++ b/fs/ocfs2/namei.c
> >>> @@ -2216,7 +2216,7 @@ out:
> >>>
> >>>       brelse(orphan_dir_bh);
> >>>
> >>> -    return 0;
> >>> +    return ret;
> >>>   }
> >>>
> >>>   int ocfs2_create_inode_in_orphan(struct inode *dir,
> >>
> >>
> >
> >
> >
>
>
>
> _______________________________________________
> Ocfs2-devel mailing list
> Ocfs2-devel@oss.oracle.com
> https://oss.oracle.com/mailman/listinfo/ocfs2-devel
>
Joe Jin May 27, 2013, 5:28 a.m. UTC | #5
Cc to AKPM for include.

On 05/23/13 06:50, Sunil Mushran wrote:
> Acked-by: Sunil Mushran <sunil.mushran@gmail.com <mailto:sunil.mushran@gmail.com>>
> 
> 
> On Tue, May 21, 2013 at 7:44 PM, shencanquan <shencanquan@huawei.com <mailto:shencanquan@huawei.com>> wrote:
> 
>     On 2013/5/22 10:38, xiaowei.hu <http://xiaowei.hu> wrote:
>     > if there is error happen in , for example EIO in
>     > __ocfs2_prepare_orphan_dir, ocfs2_prep_new_orphaned_file will release
>     > the inode_ac, the the caller of ocfs2_prep_new_orphaned_file get a 0
>     > return, it will refer to a NULL ocfs2_alloc_context struct in the
>     > following functions.Kernel panic happens.
>     Hmm, I see, this patch looks good .
>     Reviewed-by: shencanquan <shencanquan@huawei.com <mailto:shencanquan@huawei.com>>
>     >
>     > On 05/22/2013 10:31 AM, shencanquan wrote:
>     >> if return 0,  what's wrong with this?
>     >> On 2013/5/22 9:43, xiaowei.hu@oracle.com <mailto:xiaowei.hu@oracle.com> wrote:
>     >>> From: "Xiaowei.Hu"<xiaowei.hu@oracle.com <mailto:xiaowei.hu@oracle.com>>
>     >>>
>     >>> ---
>     >>>   fs/ocfs2/namei.c | 2 +-
>     >>>   1 file changed, 1 insertion(+), 1 deletion(-)
>     >>>
>     >>> diff --git a/fs/ocfs2/namei.c b/fs/ocfs2/namei.c
>     >>> index 50c93a8..422cbe0 100644
>     >>> --- a/fs/ocfs2/namei.c
>     >>> +++ b/fs/ocfs2/namei.c
>     >>> @@ -2216,7 +2216,7 @@ out:
>     >>>
>     >>>       brelse(orphan_dir_bh);
>     >>>
>     >>> -    return 0;
>     >>> +    return ret;
>     >>>   }
>     >>>
>     >>>   int ocfs2_create_inode_in_orphan(struct inode *dir,
>     >>
>     >>
>     >
>     >
>     >
> 
> 
> 
>     _______________________________________________
>     Ocfs2-devel mailing list
>     Ocfs2-devel@oss.oracle.com <mailto:Ocfs2-devel@oss.oracle.com>
>     https://oss.oracle.com/mailman/listinfo/ocfs2-devel
> 
>
diff mbox

Patch

diff --git a/fs/ocfs2/namei.c b/fs/ocfs2/namei.c
index 50c93a8..422cbe0 100644
--- a/fs/ocfs2/namei.c
+++ b/fs/ocfs2/namei.c
@@ -2216,7 +2216,7 @@  out:
 
 	brelse(orphan_dir_bh);
 
-	return 0;
+	return ret;
 }
 
 int ocfs2_create_inode_in_orphan(struct inode *dir,