All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: David Rientjes <rientjes@google.com>
Cc: Oleg Nesterov <oleg@redhat.com>,
	KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>,
	Mel Gorman <mgorman@suse.de>, Rik van Riel <riel@redhat.com>,
	Andi Kleen <andi@firstfloor.org>,
	linux-kernel@vger.kernel.org,
	Rusty Russell <rusty@rustcorp.com.au>
Subject: Re: [PATCH] mm: mempolicy: turn vma_set_policy() into vma_dup_policy()
Date: Thu, 11 Jul 2013 15:33:13 -0700	[thread overview]
Message-ID: <20130711153313.7e37a9095eacb1153ade516c@linux-foundation.org> (raw)
In-Reply-To: <alpine.DEB.2.02.1307111524400.2458@chino.kir.corp.google.com>

On Thu, 11 Jul 2013 15:27:46 -0700 (PDT) David Rientjes <rientjes@google.com> wrote:

> On Thu, 11 Jul 2013, Andrew Morton wrote:
> 
> > On Thu, 11 Jul 2013 15:13:03 -0700 (PDT) David Rientjes <rientjes@google.com> wrote:
> > 
> > > > +int vma_dup_policy(struct vm_area_struct *src, struct vm_area_struct *dst)
> > > > +{
> > > > +	struct mempolicy *pol = mpol_dup(vma_policy(src));
> > > > +
> > > > +	if (IS_ERR(pol))
> > > > +		return PTR_ERR(pol);
> > > 
> > > PTR_ERR() returns long, so vma_dup_policy() needs to return long.
> > 
> > hm, really?  vma_dup_policy() returns an errno and errnos have type "int".
> > 
> > Arguably it is PTR_ERR() which returns the wrong type...
> > 
> 
> PTR_ERR() may not imply IS_ERR(),

Well why not.  Are we saying that code can legitimately convert the
PTR_ERR() return value back into a pointer?  If so that sounds nuts.

> which I believe Rusty is trying to fix 
> with his series that fixes up abuses of PTR_ERR().

Well I hope all of this will be completely documented in err.h. 
Otherwise the abuses will simply continue.

  reply	other threads:[~2013-07-11 22:33 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-10 17:02 [PATCH] mm: mempolicy: turn vma_set_policy() into vma_dup_policy() Oleg Nesterov
2013-07-11 22:13 ` David Rientjes
2013-07-11 22:20   ` Andrew Morton
2013-07-11 22:27     ` David Rientjes
2013-07-11 22:33       ` Andrew Morton [this message]
2013-07-11 22:54         ` David Rientjes
2013-07-12 15:32   ` Oleg Nesterov

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=20130711153313.7e37a9095eacb1153ade516c@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=andi@firstfloor.org \
    --cc=kosaki.motohiro@jp.fujitsu.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mgorman@suse.de \
    --cc=oleg@redhat.com \
    --cc=riel@redhat.com \
    --cc=rientjes@google.com \
    --cc=rusty@rustcorp.com.au \
    /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.