All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: ocfs2-devel@oss.oracle.com
Subject: [Ocfs2-devel] [PATCH] ocfs2_prep_new_orphaned_file should return ret
Date: Tue, 28 May 2013 15:35:23 -0700	[thread overview]
Message-ID: <20130528153523.f8d9d1a3aca72f857d72e185@linux-foundation.org> (raw)
In-Reply-To: <1369186996-7127-1-git-send-email-xiaowei.hu@oracle.com>

On Wed, 22 May 2013 09:43:16 +0800 xiaowei.hu at 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,

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" <xiaowei.hu@oracle.com>
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.

Signed-off-by: "Xiaowei.Hu" <xiaowei.hu@oracle.com>
Reviewed-by: shencanquan <shencanquan@huawei.com>
Acked-by: Sunil Mushran <sunil.mushran@gmail.com>
Cc: Joe Jin <joe.jin@oracle.com>
Cc: Mark Fasheh <mfasheh@suse.com>
Cc: Joel Becker <jlbec@evilplan.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 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
--- a/fs/ocfs2/namei.c~ocfs2-ocfs2_prep_new_orphaned_file-should-return-ret
+++ a/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,
_

  parent reply	other threads:[~2013-05-28 22:35 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-22  1:43 [Ocfs2-devel] [PATCH] ocfs2_prep_new_orphaned_file should return ret xiaowei.hu at oracle.com
2013-05-22  2:31 ` shencanquan
2013-05-22  2:38   ` xiaowei.hu
2013-05-22  2:44     ` shencanquan
2013-05-22 22:50       ` Sunil Mushran
2013-05-27  5:28         ` Joe Jin
2013-05-28 22:35 ` Andrew Morton [this message]
2013-05-29  1:06   ` xiaowei.hu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20130528153523.f8d9d1a3aca72f857d72e185@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=ocfs2-devel@oss.oracle.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.