Linux ocfs2 filesystem development
 help / color / mirror / Atom feed
* [Ocfs2-devel] [PATCH 2/2] ocfs2: Fix d_splice_alias() return code checking
       [not found] <1413715184-30196-1-git-send-email-richard@nod.at>
@ 2014-10-19 10:39 ` Richard Weinberger
  2014-10-20 23:12   ` Andrew Morton
  0 siblings, 1 reply; 3+ messages in thread
From: Richard Weinberger @ 2014-10-19 10:39 UTC (permalink / raw)
  To: linux-fsdevel
  Cc: linux-kernel, Richard Weinberger, Mark Fasheh, Joel Becker,
	ocfs2-devel

d_splice_alias() can return a valid dentry, NULL or an ERR_PTR.
Currently the code checks not for ERR_PTR and my oops in
ocfs2_dentry_attach_lock().
Fix this by using IS_ERR_OR_NULL().

Cc: Mark Fasheh <mfasheh@suse.com>
Cc: Joel Becker <jlbec@evilplan.org>
Cc: ocfs2-devel at oss.oracle.com
Signed-off-by: Richard Weinberger <richard@nod.at>
---
 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 8add6f1..b931e04 100644
--- a/fs/ocfs2/namei.c
+++ b/fs/ocfs2/namei.c
@@ -158,7 +158,7 @@ bail_add:
 		 * NOTE: This dentry already has ->d_op set from
 		 * ocfs2_get_parent() and ocfs2_get_dentry()
 		 */
-		if (ret)
+		if (!IS_ERR_OR_NULL(ret))
 			dentry = ret;
 
 		status = ocfs2_dentry_attach_lock(dentry, inode,
-- 
2.1.0

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [Ocfs2-devel] [PATCH 2/2] ocfs2: Fix d_splice_alias() return code checking
  2014-10-19 10:39 ` [Ocfs2-devel] [PATCH 2/2] ocfs2: Fix d_splice_alias() return code checking Richard Weinberger
@ 2014-10-20 23:12   ` Andrew Morton
  2014-10-22 20:33     ` Richard Weinberger
  0 siblings, 1 reply; 3+ messages in thread
From: Andrew Morton @ 2014-10-20 23:12 UTC (permalink / raw)
  To: Richard Weinberger; +Cc: linux-fsdevel, ocfs2-devel, linux-kernel, Mark Fasheh

On Sun, 19 Oct 2014 12:39:44 +0200 Richard Weinberger <richard@nod.at> wrote:

> d_splice_alias() can return a valid dentry, NULL or an ERR_PTR.
> Currently the code checks not for ERR_PTR and my oops in
> ocfs2_dentry_attach_lock().

It's unclear what the second sentence is trying to tell us.  The patch
fixes an oops?  If so, a copy of the trace would be useful, as would an
explanation of why it occurred.  If not, I'm all confused.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Ocfs2-devel] [PATCH 2/2] ocfs2: Fix d_splice_alias() return code checking
  2014-10-20 23:12   ` Andrew Morton
@ 2014-10-22 20:33     ` Richard Weinberger
  0 siblings, 0 replies; 3+ messages in thread
From: Richard Weinberger @ 2014-10-22 20:33 UTC (permalink / raw)
  To: Andrew Morton; +Cc: linux-fsdevel, ocfs2-devel, linux-kernel, Mark Fasheh

Am 21.10.2014 um 01:12 schrieb Andrew Morton:
> On Sun, 19 Oct 2014 12:39:44 +0200 Richard Weinberger <richard@nod.at> wrote:
> 
>> d_splice_alias() can return a valid dentry, NULL or an ERR_PTR.
>> Currently the code checks not for ERR_PTR and my oops in
>> ocfs2_dentry_attach_lock().
> 
> It's unclear what the second sentence is trying to tell us.  The patch
> fixes an oops?  If so, a copy of the trace would be useful, as would an
> explanation of why it occurred.  If not, I'm all confused.

ocfs2_dentry_attach_lock() derefs the dentry pointer.
If d_splice_alias() returns ERR_PTR(-EIO) it will oops.

Thanks,
//richard

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-10-22 20:33 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <1413715184-30196-1-git-send-email-richard@nod.at>
2014-10-19 10:39 ` [Ocfs2-devel] [PATCH 2/2] ocfs2: Fix d_splice_alias() return code checking Richard Weinberger
2014-10-20 23:12   ` Andrew Morton
2014-10-22 20:33     ` Richard Weinberger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox