Skip to contentSkip to conversation

ocfs2_prep_new_orphaned_file should return ret

PATCH New xiaowei.hu at oracle.com 5 participants 8 messages May 22, 2013 – May 29, 2013 OCFS2

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ocfs2_prep_new_orphaned_file should return ret

From: "Xiaowei.Hu" <[email protected]>

---
 fs/ocfs2/namei.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/ocfs2/namei.c +1 -1
index 50c93a8..422cbe0 100644
@@ -2216,7 +2216,7 @@ out:
 
 	brelse(orphan_dir_bh);
 
-	return 0;
+	return ret;
 }
 
 int ocfs2_create_inode_in_orphan(struct inode *dir,
Signature · 1 line
1.7.11.7
#1 lore raw

PATCH 1/1 ocfs2_prep_new_orphaned_file should return ret

if return 0, what's wrong with this?

Quoted 19 lines · xiaowei.hu at oracle.com

From: "Xiaowei.Hu"<[email protected]>

---
  fs/ocfs2/namei.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
fs/ocfs2/namei.c +1 -1
index 50c93a8..422cbe0 100644
@@ -2216,7 +2216,7 @@ out:
 
  	brelse(orphan_dir_bh);
 
-	return 0;
+	return ret;
  }
 
  int ocfs2_create_inode_in_orphan(struct inode *dir,
author
#2 lore raw

PATCH 1/1 ocfs2_prep_new_orphaned_file should return ret

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.

Quoted 23 lines · shencanquan

if return 0, what's wrong with this?

Quoted 19 lines · xiaowei.hu at oracle.com

From: "Xiaowei.Hu"<[email protected]>

---
  fs/ocfs2/namei.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
fs/ocfs2/namei.c +1 -1
index 50c93a8..422cbe0 100644
@@ -2216,7 +2216,7 @@ out:
 
      brelse(orphan_dir_bh);
 
-    return 0;
+    return ret;
  }
 
  int ocfs2_create_inode_in_orphan(struct inode *dir,
#3 lore raw

PATCH 1/1 ocfs2_prep_new_orphaned_file should return ret

Quoted 5 lines · xiaowei.hu

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 .

Quoted 28 lines · shencanquan
Quoted 23 lines

if return 0, what's wrong with this?

Quoted 19 lines · xiaowei.hu at oracle.com

From: "Xiaowei.Hu"<[email protected]>

---
  fs/ocfs2/namei.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
fs/ocfs2/namei.c +1 -1
index 50c93a8..422cbe0 100644
@@ -2216,7 +2216,7 @@ out:
 
      brelse(orphan_dir_bh);
 
-    return 0;
+    return ret;
  }
 
  int ocfs2_create_inode_in_orphan(struct inode *dir,
#4 lore raw

PATCH 1/1 ocfs2_prep_new_orphaned_file should return ret

Quoted 39 lines · shencanquan
Quoted 5 lines · xiaowei.hu

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 .

Quoted 18 lines · shencanquan
Quoted 16 lines

if return 0, what's wrong with this?

Quoted 14 lines · xiaowei.hu at oracle.com

From: "Xiaowei.Hu"<[email protected]>

---
  fs/ocfs2/namei.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
fs/ocfs2/namei.c +0 -0
index 50c93a8..422cbe0 100644
@@ -2216,7 +2216,7 @@ out:
 
      brelse(orphan_dir_bh);
 
Quoted 10 lines
Quoted 7 lines

fs/ocfs2/namei.c out: · line 2222

Quoted 5 lines
fs/ocfs2/namei.c +1 -1
-    return 0;
+    return ret;
  }
 
  int ocfs2_create_inode_in_orphan(struct inode *dir,
Quoted 5 lines

_______________________________________________
Ocfs2-devel mailing list
Ocfs2-devel at oss.oracle.com
https://oss.oracle.com/mailman/listinfo/ocfs2-devel

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://oss.oracle.com/pipermail/ocfs2-devel/attachments/20130522/be709a6f/attachment.html

#5 lore raw

PATCH 1/1 ocfs2_prep_new_orphaned_file should return ret

Cc to AKPM for include.

Quoted 50 lines · Sunil Mushran
Acked-by Sunil Mushran <sunil.mushran at gmail.com <mailto:[email protected]>>

On Tue, May 21, 2013 at 7:44 PM, shencanquan <shencanquan at huawei.com <mailto:[email protected]>> 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 at huawei.com <mailto:[email protected]>>
    >
    > 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 at oracle.com <mailto:[email protected]> wrote:
    >>> From: "Xiaowei.Hu"<xiaowei.hu at oracle.com <mailto:[email protected]>>
    >>>
    >>> ---
    >>>   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 at oss.oracle.com <mailto:[email protected]>
    https://oss.oracle.com/mailman/listinfo/ocfs2-devel
Signature · 4 lines
Oracle <http://www.oracle.com>
Joe Jin | Software Development Senior Manager | +8610.6106.5624
ORACLE | Linux and Virtualization
No. 24 Zhongguancun Software Park, Haidian District | 100193 Beijing 
#6 lore raw

PATCH 1/1 ocfs2_prep_new_orphaned_file should return ret

In reply to xiaowei.hu at oracle.com
Quoted 11 lines · On Wed, 22 May 2013 09:43:16 +0800 xiaowei.hu at oracle.com wrote:

From: "Xiaowei.Hu" <[email protected]>

---
 fs/ocfs2/namei.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/ocfs2/namei.c +0 -0
index 50c93a8..422cbe0 100644

fs/ocfs2/namei.c out: · line 2222

Quoted 8 lines
fs/ocfs2/namei.c +1 -1
@@ -2216,7 +2216,7 @@ out:
 
 	brelse(orphan_dir_bh);
 
-	return 0;
+	return ret;
 }
 
 int ocfs2_create_inode_in_orphan(struct inode *dir,

The patch is missing your signed-off-by. I added it - please confirm this is OK.

I also pulled together a changelog based on the discussion. Please do provide good changelogs.

From: "Xiaowei.Hu" <[email protected]>
Subject: ocfs2: ocfs2_prep_new_orphaned_file() should return ret

If an error occurs, for example an EIO in __ocfs2_prepare_orphan_dir, ocfs2_prep_new_orphaned_file will release the inode_ac, then when the caller of ocfs2_prep_new_orphaned_file gets a 0 return, it will refer to a NULL ocfs2_alloc_context struct in the following functions. A kernel panic happens.

---

 fs/ocfs2/namei.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/ocfs2/namei.c renamed from fs/ocfs2/namei.c~ocfs2-ocfs2_prep_new_orphaned_file-should-return-ret +1 -1
diff -puN fs/ocfs2/namei.c~ocfs2-ocfs2_prep_new_orphaned_file-should-return-ret 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,

_

author
#7 lore raw

PATCH 1/1 ocfs2_prep_new_orphaned_file should return ret

Quoted 16 lines · Andrew Morton
Quoted 14 lines · On Wed, 22 May 2013 09:43:16 +0800 xiaowei.hu at oracle.com wrote:

From: "Xiaowei.Hu" <[email protected]>

---
  fs/ocfs2/namei.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
fs/ocfs2/namei.c +0 -0
index 50c93a8..422cbe0 100644
@@ -2216,7 +2216,7 @@ out:
 
  	brelse(orphan_dir_bh);
 
Quoted 7 lines

fs/ocfs2/namei.c out: · line 2222

Quoted 5 lines
fs/ocfs2/namei.c +1 -1
-	return 0;
+	return ret;
  }
 
  int ocfs2_create_inode_in_orphan(struct inode *dir,

The patch is missing your signed-off-by. I added it - please confirm this is OK.

It is ok, sorry for missing that, thanks for adding it.

Quoted 3 lines

I also pulled together a changelog based on the discussion. Please do provide good changelogs.

The change log looks great!

Quoted 37 lines

From: "Xiaowei.Hu" <[email protected]>
Subject: ocfs2: ocfs2_prep_new_orphaned_file() should return ret

If an error occurs, for example an EIO in __ocfs2_prepare_orphan_dir, ocfs2_prep_new_orphaned_file will release the inode_ac, then when the caller of ocfs2_prep_new_orphaned_file gets a 0 return, it will refer to a NULL ocfs2_alloc_context struct in the following functions. A kernel panic happens.

---

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

diff -puN fs/ocfs2/namei.c~ocfs2-ocfs2_prep_new_orphaned_file-should-return-ret fs/ocfs2/namei.c

fs/ocfs2/namei.c renamed from fs/ocfs2/namei.c~ocfs2-ocfs2_prep_new_orphaned_file-should-return-ret +1 -1
@@ -2216,7 +2216,7 @@ out:
 
  	brelse(orphan_dir_bh);
 
-	return 0;
+	return ret;
  }
 
  int ocfs2_create_inode_in_orphan(struct inode *dir,

_